rundood5 commented on issue #11470:
URL: https://github.com/apache/rocketmq/issues/11470#issuecomment-7123937801

   I read through the interceptor while tracing the admin auth path, and the 
report matches the current
   code. On develop the relevant lines are:
   
   - 
`proxy/src/main/java/org/apache/rocketmq/proxy/grpc/admin/ProxyAdminAuthInterceptor.java:192`
 —
     `ResourceAction resourceAction = METHOD_PERMISSIONS.get(method);`
   - `:196` — `if (resourceAction != null && authzEnabled) { ... }`
   - `:265` — the same lookup, exposed for tests
   
   So an RPC whose method name is absent from `METHOD_PERMISSIONS` skips the 
authorization branch and
   reaches `next.startCall(...)` with authentication only, which contradicts 
the fail-closed mode the
   class documents.
   
   Two questions before settling on a fix:
   
   1. Is the map meant to be exhaustive by construction, or does "no entry" 
mean "no authorization
      required"? The answer decides whether unmapped methods should be 
rejected, or whether the map
      should be extended with an explicit entry.
   2. If fail-closed is the intent, a test that cross-checks the served `Admin` 
method descriptors
      against `METHOD_PERMISSIONS` would catch a future RPC being added without 
a mapping. That looks
      cheap to add next to the existing interceptor tests and protects against 
exactly the drift
      described here.
   
   Happy to help with that test if the direction is acceptable.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to