-
Notifications
You must be signed in to change notification settings - Fork 37
fix(authz): use standard Keycloak token exchange #3754
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 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
699cc1e
DSPX-3636 use standard keycloak token exchange
jp-ayyappan effb70b
fix(authz): support keycloak standard token exchange
jp-ayyappan c259a2c
DSPX-3636 test standard Keycloak token exchange
jp-ayyappan 3433d6d
Update tests-bdd/cukes/steps_encryption.go
jp-ayyappan ca51bee
DSPX-3636 annotate test credentials
jp-ayyappan 11fc8f0
DSPX-3636 use public Keycloak image
jp-ayyappan 0c86cd4
DSPX-3636 fix Keycloak CI checks
jp-ayyappan 370e01a
DSPX-3636 use mirrored standard Keycloak image
jp-ayyappan 8ac3a37
DSPX-3636 align Keycloak bootstrap env vars
jp-ayyappan 6009756
DSPX-3636 fix fixtures lint
jp-ayyappan 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package fixtures | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/Nerzal/gocloak/v13" | ||
| ) | ||
|
|
||
| func TestWithStandardTokenExchangeEnabled(t *testing.T) { | ||
| existingAttributes := map[string]string{ | ||
| "client.secret.creation.time": "12345", | ||
| } | ||
| client := gocloak.Client{ | ||
| Attributes: &existingAttributes, | ||
| } | ||
|
|
||
| updatedClient := withStandardTokenExchangeEnabled(client) | ||
|
|
||
| if updatedClient.Attributes == nil { | ||
| t.Fatal("expected attributes to be set") | ||
| } | ||
| if got := (*updatedClient.Attributes)[standardTokenExchangeEnabledAttribute]; got != "true" { | ||
| t.Fatalf("expected %s to be true, got %q", standardTokenExchangeEnabledAttribute, got) | ||
| } | ||
| if got := (*updatedClient.Attributes)["client.secret.creation.time"]; got != "12345" { | ||
| t.Fatalf("expected existing attribute to be preserved, got %q", got) | ||
| } | ||
| if _, ok := existingAttributes[standardTokenExchangeEnabledAttribute]; ok { | ||
| t.Fatal("expected original attributes map to remain unchanged") | ||
| } | ||
| } | ||
|
|
||
| func TestWithStandardTokenExchangeEnabledInitializesAttributes(t *testing.T) { | ||
| updatedClient := withStandardTokenExchangeEnabled(gocloak.Client{}) | ||
|
|
||
| if updatedClient.Attributes == nil { | ||
| t.Fatal("expected attributes to be initialized") | ||
| } | ||
| if got := (*updatedClient.Attributes)[standardTokenExchangeEnabledAttribute]; got != "true" { | ||
| t.Fatalf("expected %s to be true, got %q", standardTokenExchangeEnabledAttribute, got) | ||
| } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.