Conversation
|
Claude finished @kickster97's task —— View job OAuth2 Support PR Code ReviewReviewing this PR for bugs, security vulnerabilities, performance issues, missing error handling, and Crystal anti-patterns. Todo List
Issues Found🚨 Critical Security Vulnerability
🛡️ Security Issues
🐛 Potential Bugs @token_updated.send nilIf multiple token updates happen rapidly, the channel send could block or messages could be lost, potentially leaving the expiration fiber in an inconsistent state.
📈 Performance Issues
🔧 Crystal Anti-patterns rescue ex : ExceptionCatching generic
|
94d5705 to
66eac18
Compare
|
For sure should implement our own JWT parser, it's not many lines of code: https://claude.ai/artifacts/82992d3e-5e0d-4e0e-8205-bb29f7a0dce1 |
|
Is the the |
Yes sounds good, Could override the methods that need |
spuun
left a comment
There was a problem hiding this comment.
Rename User to BasicUser and introduce an abstract base class User. Rename TempUser to OAuthUser and let it inherit thew new abstract User.
Remove all TempUser handling code in UserStore
2e7a1f7 to
ffed68a
Compare
fd08404 to
4a52ebf
Compare
spuun
left a comment
There was a problem hiding this comment.
Good job!
I've got some questions and suggestions.
ec3da2b to
cd61438
Compare
Co-authored-by: Carl Hörberg <carl@84codes.com>
Co-authored-by: Carl Hörberg <carl@84codes.com>
Co-authored-by: Carl Hörberg <carl@84codes.com>
Co-authored-by: Carl Hörberg <carl@84codes.com>
### WHAT is this pull request doing? Adds additional checks on the token, checking aud, kty and more fields Split OauthAuthenticator and TokenVerifier into different classes and refactor signatures for easier testing Add testing to the new JWTTokenVerifier Each commit can be cherry picked into target branch unless we want all changes.
1bac0d1 to
9ad4c98
Compare
9ad4c98 to
89f3515
Compare
4e3ee8a to
df27b8f
Compare
|
closing here to get a cleaner PR to wrok with in #1632 :) |
WHAT is this pull request doing?
Add OAuth2/OpenID Connect authentication to LavinMQ. Clients can now authenticate using JWT tokens (RS256) as the password field. The authenticator validates tokens against the OAuth provider's JWKS endpoint, checks issuer/audience/expiration, and maps scopes to LavinMQ permissions. Supports token refresh via UpdateSecret frame without reconnecting. JWKS public keys are cached with configurable TTL.
Refactors the user system into an abstract User base class with LocalUser (password-based) and OAuthUser (token-based with expiration tracking) implementations. Authentication chain tries local auth first, then OAuth.
fixes #857
HOW can this pull request be tested?
specs to come once we are satisfied with the general logic and structure