-
Notifications
You must be signed in to change notification settings - Fork 1.5k
refactor(coderd/oauth2provider): extract OAuth2 client authentication helpers #29206
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
BobbyHo
wants to merge
156
commits into
main
Choose a base branch
from
coder-sec-348-authenticate-client
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.
+158
−33
Open
Changes from all commits
Commits
Show all changes
156 commits
Select commit
Hold shift + click to select a range
a672066
feat(coderd/rbac): compare scopes by permission coverage
BobbyHo 4315706
Merge branch 'main' into plat479-1-rbac-scope-coverage
BobbyHo 787c461
docs(coderd/rbac): shorten the ScopesCover doc comment
BobbyHo 2d39e04
Merge branch 'main' into plat479-1-rbac-scope-coverage
BobbyHo 2f6c44e
fix(coderd/rbac): guard allowed-side org and user permissions
BobbyHo bd40270
refactor(coderd/rbac): drop the unreachable negative skip in coverage
BobbyHo 3139c54
test(coderd/rbac): pin the scope coverage table's weak assertions
BobbyHo 9276bb8
refactor(coderd/rbac): make the coverage guards reachable from tests
BobbyHo 865eb9a
refactor(coderd/rbac): share the alias table and name the canonical c…
BobbyHo 26a6bed
docs(coderd/rbac): document the expansion invariant where it can be b…
BobbyHo 7cca7b3
Merge branch 'main' into plat479-1-rbac-scope-coverage
BobbyHo 1678a77
test(coderd/rbac): pin the coverage guards at one strength
BobbyHo aba3c6c
fix(coderd/rbac): name the scope once in expansion errors
BobbyHo 9a08105
docs(coderd/rbac): correct the external scope list contract
BobbyHo 2fcce8b
docs(coderd/rbac): trim the restated coverage invariant
BobbyHo a775a48
docs(coderd/rbac): correct the negative permission cross-reference
BobbyHo e0c0d4a
docs(coderd/rbac): name every category IsExternalScope admits
BobbyHo 189740d
test(coderd/rbac): pin the alias list invariants on the alias table
BobbyHo 7d08e49
Merge branch 'main' into plat479-1-rbac-scope-coverage
BobbyHo ca4dc52
feat(coderd/oauth2provider): negotiate and persist authorization scope
BobbyHo f402e1a
feat(site): state the negotiated scope on the OAuth2 consent page
BobbyHo 28ef5ba
fix(coderd/oauth2provider): return invalid_scope to the client's call…
BobbyHo 62950d3
test(coderd/rbac): close two mutation gaps in scope coverage tests
BobbyHo 554a703
Merge branch 'main' into plat479-2-negotiate-scope
BobbyHo 09bc1b4
refactor(coderd/oauth2provider): rename validateRequestedScope to neg…
BobbyHo 6fe6c71
test(coderd/oauth2provider): bind the wire-level scope reasons to the…
BobbyHo e296dda
refactor(coderd): log undecidable oauth2 scope coverage instead of re…
BobbyHo 2760db5
fix(coderd/oauth2provider): name the stored allowlist when none of it…
BobbyHo 5b2ca57
refactor(coderd/oauth2provider): reword the oauth2 scope rejection re…
BobbyHo 90a6f83
docs: correct what the oauth2 authorize scope parameter promises
BobbyHo 77654a1
test(coderd/oauth2provider): fold the no-allowlist guarantee into one…
BobbyHo dfdd33f
Merge branch 'plat479-2-negotiate-scope' into plat479-3-report-negoti…
BobbyHo ba8a123
Merge branch 'main' into plat479-2-negotiate-scope
BobbyHo bc40908
test(coderd): close the consent-page and state-echo test gaps
BobbyHo cb7df2e
fix(site/static): left-align the consent permission list
BobbyHo 41e9f40
fix(coderd/oauth2provider): validate the callback scheme before any r…
BobbyHo a56cdac
fix(coderd/oauth2provider): replace callback query params instead of …
BobbyHo 009962c
feat: say that the consent permission names are technical
BobbyHo f983335
fix: state unrestricted OAuth2 consent in its own field
BobbyHo 81bbfb0
docs: trim OAuth2 scope negotiation comments
BobbyHo b7f88f0
Merge branch 'plat479-2-negotiate-scope' into plat479-3-report-negoti…
BobbyHo 2a2e006
Merge branch 'main' into plat479-2-negotiate-scope
BobbyHo a11d42c
test(coderd/oauth2provider): pin the consent list semantics and the s…
BobbyHo eb37c2f
test(coderd/oauth2provider): cover the error redirect in the query-pa…
BobbyHo a5e3f94
fix(coderd/oauth2provider): answer 500 and log on an unusable callbac…
BobbyHo 60cbe59
fix: refuse to render a consent page for a grant with no permissions
BobbyHo fdc9532
docs: document invalid_scope rejections on the authorize endpoint
BobbyHo e63ff3a
docs(coderd): trim the scope test comments
BobbyHo a9ade4a
Merge branch 'plat479-2-negotiate-scope' into plat479-3-report-negoti…
BobbyHo 5589bf6
docs: trim the consent page and error redirect comments
BobbyHo 24b4f46
docs(coderd): drop the godoc-style comments from the scope tests
BobbyHo b92b7f9
docs(coderd/oauth2provider): trim the authorize.go comments
BobbyHo e4cc41d
Merge branch 'plat479-2-negotiate-scope' into plat479-3-report-negoti…
BobbyHo 20caa9c
docs(coderd): trim the scope reporting test comments
BobbyHo c7d3d53
docs(site): trim the consent page scope comments
BobbyHo 98545a6
feat(coderd): mint OAuth2 tokens with the negotiated scope
BobbyHo 641e45e
test(coderd/oauth2provider): cover the negotiated scope end to end
BobbyHo 1a30a9c
feat(coderd/oauth2provider): report the granted scope in token responses
BobbyHo 8b46823
refactor(coderd/oauth2provider): clarify the unmintable scope sentinel
BobbyHo da5b590
test(coderd/oauth2provider): derive the exchange query from authorize…
BobbyHo fc6eb77
docs: scope the OAuth2 refresh limitation to narrowing
BobbyHo 589b8b8
docs(coderd): trim the negotiated scope comments
BobbyHo 78fbab1
Merge branch 'main' into plat479-2-negotiate-scope
BobbyHo f675cf1
fix(site/static): make the whole consent page reachable by scrolling
BobbyHo 6b5f01d
Merge branch 'plat479-3-report-negotiated-scope' into plat480-1-apply…
BobbyHo 90821d8
docs: say the negotiated scope now bounds the issued token
BobbyHo 72b8cb5
docs: annotate the token endpoint with the response it returns
BobbyHo b6f74c3
feat: re-check the app allowlist at OAuth2 code redemption
BobbyHo 9f3193e
docs(coderd/oauth2provider): trim the allowlist re-check comments
BobbyHo 9e98cef
fix(coderd): make OAuth2 code redemption single-use under concurrency
BobbyHo 48cb5a4
feat: let an OAuth2 refresh narrow the granted scope
BobbyHo ceb3997
Update coderd/oauth2provider/authorize.go
BobbyHo 2cd9b60
Update coderd/oauth2provider/authorize.go
BobbyHo d160bda
docs(coderd/oauth2provider): trim the errNoGrantableScope comment
BobbyHo b60eee6
refactor(coderd/oauth2provider): canonicalize scopes before the catal…
BobbyHo 4732d1f
refactor(coderd/oauth2provider): canonicalize the allowlist in one pass
BobbyHo 03df6a9
test(coderd/rbac): pin the field sets scope coverage reads
BobbyHo a2d2856
docs(coderd/rbac): trim the TestCoverageModelFields comment
BobbyHo d83636b
Merge branch 'plat479-2-negotiate-scope' into plat479-3-report-negoti…
BobbyHo 037e744
Merge remote-tracking branch 'origin/main' into plat479-3-report-nego…
BobbyHo cd35b94
Merge branch 'plat479-3-report-negotiated-scope' into plat480-1-apply…
BobbyHo 508d09e
Merge branch 'plat480-1-apply-negotiated-scope' into plat480-2-stale-…
BobbyHo fc40ac3
Merge branch 'plat480-2-stale-scope-recheck' into plat480-3-single-us…
BobbyHo 0e2bf76
Merge branch 'plat480-3-single-use-code' into plat481-1-narrow-refres…
BobbyHo 433e449
docs(coderd/oauth2provider): trim scope negotiation comments
BobbyHo 5dffb74
Merge branch 'plat479-3-report-negotiated-scope' into plat480-1-apply…
BobbyHo 6aa7510
docs(coderd/oauth2provider): trim scope negotiation comments
BobbyHo a1eae58
Merge branch 'plat480-1-apply-negotiated-scope' into plat480-2-stale-…
BobbyHo e1ea400
docs(coderd/oauth2provider): trim scope negotiation comments
BobbyHo 52567a4
Merge branch 'plat480-2-stale-scope-recheck' into plat480-3-single-us…
BobbyHo 8efc783
docs(coderd/oauth2provider): trim the single-use code comment
BobbyHo 124d652
Merge branch 'plat480-3-single-use-code' into plat481-1-narrow-refres…
BobbyHo 5b08b81
docs(coderd/oauth2provider): trim refresh scope comments
BobbyHo 35ce008
Merge branch 'main' into plat479-3-report-negotiated-scope
BobbyHo 48d9c7f
fix(coderd/oauth2provider): return server_error for undecidable scope…
BobbyHo c8a3754
Merge branch 'plat479-3-report-negotiated-scope' into plat480-1-apply…
BobbyHo 339aa34
Merge branch 'plat480-1-apply-negotiated-scope' into plat480-2-stale-…
BobbyHo 6b29b13
Merge branch 'main' into plat480-1-apply-negotiated-scope
BobbyHo 976335d
fix: answer invalid_grant for an unmintable stored scope
BobbyHo 5ebc706
Merge branch 'plat480-1-apply-negotiated-scope' into plat480-2-stale-…
BobbyHo 4a31118
Merge remote-tracking branch 'origin/main' into plat480-2-stale-scope…
BobbyHo cf7ddb7
Merge branch 'plat480-2-stale-scope-recheck' into plat480-3-single-us…
BobbyHo 7a251f1
Merge branch 'plat480-3-single-use-code' into plat481-1-narrow-refres…
BobbyHo c54ccdb
fix(coderd): address the allowlist re-check review
BobbyHo d5c8a1c
docs(coderd): simplify the scope check comments
BobbyHo bb574d0
Merge branch 'plat480-2-stale-scope-recheck' into plat480-3-single-us…
BobbyHo 40fda97
Merge branch 'plat480-3-single-use-code' into plat481-1-narrow-refres…
BobbyHo 886ec18
refactor(coderd/oauth2provider): rename the coverage wrapper
BobbyHo d9d032d
test(coderd): cover replay and post-redemption state for single-use c…
BobbyHo 8acedcd
Merge remote-tracking branch 'origin/main' into plat480-3-single-use-…
BobbyHo 361f669
Merge branch 'plat480-3-single-use-code' into plat481-1-narrow-refres…
BobbyHo 85030f8
docs(coderd/oauth2provider): correct the canonicalization cross-refer…
BobbyHo ec80733
test(coderd/oauth2provider): assert the winner's token survives a ref…
BobbyHo 98e6191
refactor(coderd): fold the duplicated app code delete into one query
BobbyHo 15cc66f
docs(coderd): say why the code is deleted, and where single use can b…
BobbyHo b64f111
test(coderd/oauth2provider): enforce the redemption overlap in the test
BobbyHo 270bfb5
Merge branch 'plat480-3-single-use-code' into plat481-1-narrow-refres…
BobbyHo f644e52
fix(coderd/oauth2provider): bound and sanitize the token endpoint's e…
BobbyHo 663fa85
fix(coderd/oauth2provider): narrow the access token, not the grant
BobbyHo 8f87b2d
fix(coderd/oauth2provider): name the way out when a refresh cannot widen
BobbyHo f54bbbc
fix(coderd/oauth2provider): canonicalize the ceiling once in narrowAc…
BobbyHo 8d5f168
refactor(coderd/oauth2provider): address the review's nits and notes
BobbyHo e1b4f06
docs(admin/integrations): file the refresh narrowing under the code i…
BobbyHo 2ba380a
test(coderd/oauth2provider): assert through the endpoint, not around it
BobbyHo 755b5a1
fix(coderd/oauth2provider): honour scope on the exchange, and log sco…
BobbyHo e1f3f75
docs(coderd/oauth2provider): trim the scope comments
BobbyHo 4243eb4
fix(coderd): make OAuth2 refresh token redemption single-use under co…
BobbyHo d15dca4
docs(coderd/oauth2provider): trim the single-use refresh comment
BobbyHo b94b304
test(coderd/oauth2provider): share the single-use race harness with t…
BobbyHo b6018df
refactor(coderd/oauth2provider): declare the refresh delete error, do…
BobbyHo 1c3f276
test(coderd/oauth2provider): pin the refresh race at the token read
BobbyHo 81bad9e
docs(coderd/oauth2provider): say plainly why the refresh delete is in…
BobbyHo 8fc16f0
fix(coderd/oauth2provider): let the refresh delete alone arbitrate th…
BobbyHo 210409d
test(coderd/oauth2provider): pin invalid_grant for a refresh whose ke…
BobbyHo 9a7fba4
fix(coderd/oauth2provider): stop echoing a scope that names nothing
BobbyHo c8d07ad
fix(coderd/oauth2provider): pin READ COMMITTED for the single-use del…
BobbyHo b55edf3
fix(coderd/oauth2provider): log a refused reuse of a code or refresh …
BobbyHo 17cc715
docs(coderd/database): give the returning-row key delete the same doc…
BobbyHo 7abfb3f
test(coderd/database/dbauthz): pin that a missed fetch still matches …
BobbyHo 9510422
test(coderd/oauth2provider): bound the race barrier and check the acc…
BobbyHo 8d1c4f8
Merge remote-tracking branch 'origin/main' into plat481-1-narrow-refr…
BobbyHo 283cad4
Merge branch 'plat481-1-narrow-refresh-scope' into plat481-2-single-u…
BobbyHo 017c725
Merge remote-tracking branch 'origin/main' into plat481-2-single-use-…
BobbyHo dbdff37
Merge branch 'main' into plat481-2-single-use-refresh
BobbyHo fefddb5
Merge branch 'main' into plat481-2-single-use-refresh
BobbyHo 2bacd8c
Merge branch 'main' into plat481-2-single-use-refresh
BobbyHo 1cebdf7
Merge branch 'main' into plat481-2-single-use-refresh
BobbyHo ea5e03f
refactor(coderd/oauth2provider): extract OAuth2 client authentication…
BobbyHo 097e59a
test(coderd/oauth2provider): create the test context inside each para…
BobbyHo 49e9f5d
docs(coderd/oauth2provider): shorten the mergeBasicClientAuth comment
BobbyHo 6bbace7
docs(coderd/oauth2provider): shorten the authenticateClient comments
BobbyHo 12e30c2
Merge branch 'main' into plat481-2-single-use-refresh
BobbyHo 5b571d1
Merge branch 'plat481-2-single-use-refresh' into coder-sec-348-authen…
BobbyHo af19d96
docs(coderd/oauth2provider): explain the app binding in authenticateC…
BobbyHo 314e184
chore(coderd/oauth2provider): address review of the client auth helpers
BobbyHo 4876e0c
Merge branch 'main' into coder-sec-348-authenticate-client
BobbyHo 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.
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.
Uh oh!
There was an error while loading. Please reload this page.