Split AuthMiddleware into OptionalHandler and RequiredHandler variants.
OptionalHandler: preserves current silent fail-through semantics (no header → pass through; bad header/invalid JWT → log + pass through with no user)
RequiredHandler: returns 401 + WWW-Authenticate: Bearer on missing/invalid token per RFC 6750
Use strings.EqualFold for case-insensitive Bearer prefix matching (RFC 6750)
Use strings.HasPrefix (idiomatic Go)
Sanitize Trace log: log auth_header_len + scheme_word instead of raw auth_header (Q-064)
Narrow dependency: middleware accepts tokenValidator interface (just ValidateJWT) instead of full user.AuthService
Legacy .Middleware method preserved as deprecated alias to OptionalHandler for backwards compatibility
The /greet endpoint continues to use optional auth via the deprecated alias. No behavioral change for existing endpoints.
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe [email protected]
Split AuthMiddleware into OptionalHandler and RequiredHandler variants.
- OptionalHandler: preserves current silent fail-through semantics (no header → pass through; bad header/invalid JWT → log + pass through with no user)
- RequiredHandler: returns 401 + WWW-Authenticate: Bearer on missing/invalid token per RFC 6750
- Use strings.EqualFold for case-insensitive Bearer prefix matching (RFC 6750)
- Use strings.HasPrefix (idiomatic Go)
- Sanitize Trace log: log auth_header_len + scheme_word instead of raw auth_header (Q-064)
- Narrow dependency: middleware accepts tokenValidator interface (just ValidateJWT) instead of full user.AuthService
- Legacy .Middleware method preserved as deprecated alias to OptionalHandler for backwards compatibility
The /greet endpoint continues to use optional auth via the deprecated alias. No behavioral change for existing endpoints.
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Split AuthMiddleware into OptionalHandler and RequiredHandler variants.
The /greet endpoint continues to use optional auth via the deprecated alias. No behavioral change for existing endpoints.
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe [email protected]
LGTM - All changes match the spec. Build, vet, and tests pass.