-
Notifications
You must be signed in to change notification settings - Fork 0
Add multi-scheme authentication support #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
moutonjeremy
wants to merge
26
commits into
main
Choose a base branch
from
chore-auth
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
ff21c1a
feat: Add mock authentication services and corresponding tests
moutonjeremy 6d5aaea
feat: Implement authentication validators for Basic Auth, API Key, an…
moutonjeremy 98b1518
feat: Enhance validateAuthorization to support multiple security sche…
moutonjeremy 794ab63
feat: Implement authentication methods for Basic Auth, API Key, and A…
moutonjeremy d567d64
feat: Implement SmartAuthMiddleware and MultiSchemeAuthMiddleware for…
moutonjeremy 65db835
feat: Update parseInput to pass configuration to validateAuthorization
moutonjeremy 413d589
feat: Enhance error handling with AuthError and ScopeError types; val…
moutonjeremy bf3fd26
fix: Update authentication tests to expect 401 status code instead of…
moutonjeremy 07fa2ab
fix: Enhance error handling in validateAuthorization to return AuthEr…
moutonjeremy 32ee533
fix: Improve authentication error handling in MultiSchemeAuthMiddlewa…
moutonjeremy 62516ab
fix: Enhance error handling in Method to differentiate between authen…
moutonjeremy 65e64aa
fix: Update validateResourceAccess to return AuthError with appropria…
moutonjeremy 9e2ec67
test: Add unit test for parseAWSSigV4Header to handle missing SignedH…
moutonjeremy de157fd
fix: Enhance AWS SigV4 header validation to check for missing SignedH…
moutonjeremy 58009f6
fix: Improve error handling in MultiSchemeAuthMiddleware to return se…
moutonjeremy 0ef0d49
feat: Add MockBearerAndAPIKeyAuthService and tests for AND-semantics …
moutonjeremy 9612f01
fix: Update error handling in authentication validation functions to …
moutonjeremy dde8e82
fix: Propagate typed errors in validateAuthorization without re-wrapping
moutonjeremy 6e7385c
fix: Improve error handling in authentication middlewares to return a…
moutonjeremy 34ead02
fix: Enhance validateAuthorization to short-circuit on server configu…
moutonjeremy 8a07212
fix: Short-circuit on server configuration errors in MultiSchemeAuthM…
moutonjeremy 3dcaa86
fix: Add error label for authorization failure in MultiSchemeAuthMidd…
moutonjeremy 9799cd9
test: Add tests for unsupported API Key location and per-route securi…
moutonjeremy 23b31a4
fix: Return AuthError for unsupported API Key location in validateAPIKey
moutonjeremy a61f2a0
fix: Implement per-route security requirements fallback in parseInput
moutonjeremy 5853c84
fix: Add specific error label for authorization failure in classifyAu…
moutonjeremy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the backward-compatibility branch (
len(config.SecuritySchemes)==0), any error fromvalidateBearerTokenis wrapped intoAuthError{StatusCode:401,...}. This discards typed errors coming fromauthService.ValidateToken(e.g., an*AuthErrorwith a 5xx status for an internal failure), which can cause internal errors to be reported as 401. Consider preserving*AuthError(and its status code) whenValidateTokenreturns one, and only default to 401 for untyped errors.