-
Notifications
You must be signed in to change notification settings - Fork 195
Support Pushed Auth Request by RFC-9126 #768
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
migregal
wants to merge
13
commits into
zitadel:main
Choose a base branch
from
migregal:issue/10239
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
13 commits
Select commit
Hold shift + click to select a range
2b8b178
feat: impl basic structs
migregal a16fc75
feat: update rp impl
migregal ea10e5c
feat: impl new server API wrappers to support PAR
migregal 1d1f0f9
feat: hide even more empty AuthRequest's fields from storage
migregal 4148266
chore(deps): bump github.com/go-chi/chi/v5 in the go_modules group (#…
dependabot[bot] 8a78866
fix: omit empty assertion fields in client creds request (#745)
jonyoder b557f64
feat: impl minialistic rp client logic
migregal 8bf66b3
feat: beautify call
migregal bccd0f4
feat: reuse proper HTTP status for PAR request
migregal 00b3ebb
feat: fix API validation
migregal 7352228
feat: remove explicit nil check
migregal 9454a39
feat: Merge branch 'main' into issue/10239
migregal b5a92ac
feat: remove PAR impl from Legacy Server
migregal 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,28 +67,31 @@ const ( | |
| // AuthRequest according to: | ||
| // https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest | ||
| type AuthRequest struct { | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding |
||
| Scopes SpaceDelimitedArray `json:"scope" schema:"scope"` | ||
| ResponseType ResponseType `json:"response_type" schema:"response_type"` | ||
| ClientID string `json:"client_id" schema:"client_id"` | ||
| RedirectURI string `json:"redirect_uri" schema:"redirect_uri"` | ||
|
|
||
| State string `json:"state" schema:"state"` | ||
| Nonce string `json:"nonce" schema:"nonce"` | ||
|
|
||
| ResponseMode ResponseMode `json:"response_mode" schema:"response_mode"` | ||
| Display Display `json:"display" schema:"display"` | ||
| Prompt SpaceDelimitedArray `json:"prompt" schema:"prompt"` | ||
| MaxAge *uint `json:"max_age" schema:"max_age"` | ||
| UILocales Locales `json:"ui_locales" schema:"ui_locales"` | ||
| IDTokenHint string `json:"id_token_hint" schema:"id_token_hint"` | ||
| LoginHint string `json:"login_hint" schema:"login_hint"` | ||
| ACRValues SpaceDelimitedArray `json:"acr_values" schema:"acr_values"` | ||
|
|
||
| CodeChallenge string `json:"code_challenge" schema:"code_challenge"` | ||
| CodeChallengeMethod CodeChallengeMethod `json:"code_challenge_method" schema:"code_challenge_method"` | ||
| Scopes SpaceDelimitedArray `json:"scope,omitempty" schema:"scope"` | ||
| ResponseType ResponseType `json:"response_type,omitempty" schema:"response_type"` | ||
| ClientID string `json:"client_id,omitempty" schema:"client_id"` | ||
| RedirectURI string `json:"redirect_uri,omitempty" schema:"redirect_uri"` | ||
|
|
||
| State string `json:"state,omitempty" schema:"state"` | ||
| Nonce string `json:"nonce,omitempty" schema:"nonce"` | ||
|
|
||
| ResponseMode ResponseMode `json:"response_mode,omitempty" schema:"response_mode"` | ||
| Display Display `json:"display,omitempty" schema:"display"` | ||
| Prompt SpaceDelimitedArray `json:"prompt,omitempty" schema:"prompt"` | ||
| MaxAge *uint `json:"max_age,omitempty" schema:"max_age"` | ||
| UILocales Locales `json:"ui_locales,omitempty" schema:"ui_locales"` | ||
| IDTokenHint string `json:"id_token_hint,omitempty" schema:"id_token_hint"` | ||
| LoginHint string `json:"login_hint,omitempty" schema:"login_hint"` | ||
| ACRValues SpaceDelimitedArray `json:"acr_values,omitempty" schema:"acr_values"` | ||
|
|
||
| CodeChallenge string `json:"code_challenge,omitempty" schema:"code_challenge"` | ||
| CodeChallengeMethod CodeChallengeMethod `json:"code_challenge_method,omitempty" schema:"code_challenge_method"` | ||
|
|
||
| // RequestParam enables OIDC requests to be passed in a single, self-contained parameter (as JWT, called Request Object) | ||
| RequestParam string `schema:"request"` | ||
| RequestParam string `schema:"request,omitempty"` | ||
|
|
||
| // RequestParam enables OIDC requests to be passed via intermediate cache (RFC-9126) | ||
| RequestURI string `schema:"request_uri,omitempty"` | ||
| } | ||
|
|
||
| func (a *AuthRequest) LogValue() slog.Value { | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package oidc | ||
|
|
||
| // PARRequest implements | ||
|
|
||
| // https://datatracker.ietf.org/doc/html/rfc9126#name-request, | ||
|
|
||
| // 2.1 Request. | ||
|
|
||
| type PARRequest AuthRequest | ||
|
|
||
| // PARResponse implements | ||
|
|
||
| // https://www.rfc-editor.org/rfc/rfc8628#section-3.2 | ||
|
|
||
| // 3.2. Successful Response. | ||
|
|
||
| type PARResponse struct { | ||
| RequestURI string `json:"request_uri"` | ||
|
|
||
| ExpiresIn int `json:"expires_in"` | ||
| } |
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.
Yeah, I know that's a little bit dirty and can be done better
Open to discussion on this logic because it seems like therre is no good way to wrap existing x/oauth2 implementation
Looking forward for golang/go#65956 - once it'll be accepted to stdlib, we'll be able to get rid of a mess introduced in current PR