-
Notifications
You must be signed in to change notification settings - Fork 3.5k
OAuth metadata implementation #1862
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
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
370ebca
initial oauth metadata implementation
mattdholloway 0a1b701
add nolint for GetEffectiveHostAndScheme
mattdholloway afda19b
remove CAPI reference
mattdholloway 97859a1
remove nonsensical example URL
mattdholloway f8f109c
anonymize
mattdholloway 9f308b3
add oauth tests
mattdholloway 9b5c2fb
Merge branch 'http-stack-2' into oauth-handler-implementation
mattdholloway 50227bf
replace custom protected resource metadata handler with our own
mattdholloway a3135d9
remove unused header
mattdholloway 1ce01df
Update pkg/http/oauth/oauth.go
mattdholloway 4fc6c3a
pass oauth config to mcp handler for token extraction
mattdholloway b0bddbf
chore: retrigger ci
mattdholloway 6c5102a
align types with base branch
mattdholloway 3daa5c3
update more types
mattdholloway e3c565a
initial oauth metadata implementation
mattdholloway f768eda
add nolint for GetEffectiveHostAndScheme
mattdholloway 68e1f50
remove CAPI reference
mattdholloway 67b821c
remove nonsensical example URL
mattdholloway 7c90050
anonymize
mattdholloway 78f1a82
add oauth tests
mattdholloway e2699c8
replace custom protected resource metadata handler with our own
mattdholloway 9c21eed
Update pkg/http/oauth/oauth.go
mattdholloway 49191a9
chore: retrigger ci
mattdholloway 03a5082
update more types
mattdholloway 37c32c5
Merge branch 'oauth-handler-implementation' of https://github.com/git…
mattdholloway 97092a0
remove CAPI specific header
mattdholloway cfea762
restore mcp path specific logic
mattdholloway 840b41e
implement better resource path handling for OAuth server
mattdholloway 203ebb3
return auth handler to lib version
mattdholloway 3990325
rename to base-path flag
mattdholloway 7abbc53
switch to chi group
mattdholloway 4d0bdbc
make viper commands http only
mattdholloway 5ef1fde
Default to http, but check for TLS in GetEffectiveHostAndScheme
omgitsads 2b5be7a
Merge branch 'http-stack-2' into oauth-handler-implementation
omgitsads 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
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
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.
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.
The new function
sendAuthChallengeand the modifiedExtractUserTokenmiddleware function lack test coverage. The oauth package has comprehensive tests, but the middleware changes that use this package are not tested. This is inconsistent with the codebase's testing practices, as the oauth package itself has 11 test functions covering various scenarios.Consider adding tests for:
sendAuthChallengefunction to verify the WWW-Authenticate header formatExtractUserTokenmiddleware with missing authorization headers to ensure proper 401 responses with OAuth metadata URLs