RockteMQ-AI commented on issue #2892:
URL: 
https://github.com/apache/rocketmq-dashboard/issues/2892#issuecomment-5500432289

   **Issue Evaluation**
   
   Category: `bug` | Status: **Confirmed**
   
   This is a valid performance and correctness issue. 
`AuthInterceptor.preHandle` calling both `isAuthenticated()` and 
`getAuthenticatedUser()` results in duplicate session resolution since 
`isAuthenticated` delegates to `getAuthenticatedUser`.
   
   **Root Cause:** Redundant session lookup — the interceptor resolves the same 
bearer token twice per request.
   **Impact:** Every protected endpoint incurs 2x session/user reads. 
Additionally, a session revocation between the two lookups can produce an 
inconsistent auth decision (first call authenticates, second call finds no 
user).
   **Severity:** Medium — performance overhead on every request + potential 
inconsistency edge case.
   
   **Suggested fix:** Resolve the authenticated user once in the interceptor, 
reject if empty, and use that single snapshot for both the auth check and 
request context.
   
   An automated fix proposal can be generated. Reply `/approve` to proceed with 
PR generation.
   
   ---
   *Automated evaluation by github-manager*


-- 
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