Skip to content

feat: log the auth method on JWT rejection - #1252

Merged
mentels merged 1 commit into
mainfrom
chore/jwt-reject-log-method
Oct 28, 2026
Merged

mentels merged 1 commit into
mainfrom
chore/jwt-reject-log-method

Conversation

@mentels

@mentels mentels commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The check_auth: rejected ... warning now ends with the verifier that rejected the token, e.g. (hmac) or (jwks), so shared-secret and JWKS (AWS STS) failures can be told apart in the logs.
  • The method tag on the [:supavisor, :jwt_auth, :rejected] metric is unchanged.

Test plan

  • jwt_test.exs asserts the suffix for an HMAC rejection and a JWKS rejection.
  • JWT and web test suites pass.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 28, 2026 11:25
@mentels
mentels requested a review from a team as a code owner October 28, 2026 11:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the change distinguishing HMAC and JWKS rejection warnings.

No open issues 🎉

What changed in this PR

Adds the rejecting verifier to JWT rejection warnings, making HMAC and JWKS failures distinguishable in logs without changing the telemetry method tag.

Changes:

  • Appends the authentication method, such as (hmac) or (jwks), to rejection warnings.
  • Adds assertions for both method suffixes in existing rejection tests.
File Description
test/​supavisor/​jwt_test.exs Asserts HMAC and JWKS method suffixes in rejection logs.
lib/​supavisor/​jwt.ex Includes the authentication method in rejection warnings.

Review effort: Balanced

@mentels
mentels enabled auto-merge (squash) October 28, 2026 11:48
@mentels
mentels merged commit defc12b into main Oct 28, 2026
21 of 23 checks passed
@mentels
mentels deleted the chore/jwt-reject-log-method branch October 28, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants