fix: return 401 instead of 500 for invalid bearer tokens (IS-5805)#8
Open
mykyta-batalov wants to merge 1 commit intomasterfrom
Open
fix: return 401 instead of 500 for invalid bearer tokens (IS-5805)#8mykyta-batalov wants to merge 1 commit intomasterfrom
mykyta-batalov wants to merge 1 commit intomasterfrom
Conversation
When a bearer token is present but invalid/expired/empty, the plugin was falling through to make_oidc() which returned a generic 500. Now short-circuits with 401 after failed JWT verify or introspection when a bearer token is detected, preventing the fallthrough. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No issues found
About Unblocked
Unblocked has been set up to automatically review your team's pull requests to identify genuine bugs and issues.
📖 Documentation — Learn more in our docs.
💬 Ask questions — Mention @unblocked to request a review or summary, or ask follow-up questions about your code.
👍 Give feedback — React to comments with 👍 or 👎 to help us improve.
⚙️ Customize — Adjust settings in your preferences.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
verify_bearer_jwt()→introspect()→make_oidc(), whereresty.openidc.authenticate()failed with a non-standard error string, triggering the catch-all 500 athandler.lua:106has_bearer_access_token()make_oidc()Branch restructuring
v2branch to preserve the v2.0.x work (23 commits)mastertov1.4.0-7(current production) so this fix targets the deployed versionv1.4.0-8Test plan
Authorization: Bearer) → should return 401Jira: IS-5805
🤖 Generated with Claude Code