Loading
Skip IAM disabled log for non-IAM tokens
What does this MR do and why?
Authn::Tokens::IamOauthToken.from_jwt logged IAM JWT authentication attempt when disabled for every token it received. This included regular tokens without the gliamat- prefix. When IAM is disabled, the auth log filled up with messages for requests that never used IAM.
This MR checks the gliamat- prefix first. The disabled message is now logged only when an actual IAM token arrives while IAM is disabled.
References
N/A
Screenshots or screen recordings
Not applicable. This is a backend logging change with no UI.
How to set up and validate locally
- Make sure IAM auth is disabled.
- Make an API request with a regular personal access token.
- Check
log/auth_json.log. It should not containIAM JWT authentication attempt when disabled. - Run the spec:
bin/rspec spec/lib/authn/tokens/iam_oauth_token_spec.rb
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.