Add 'check oidc-config' command#4146
Merged
yiannistri merged 9 commits intomainfrom Nov 27, 2023
Merged
Conversation
6e61967 to
d1e9c95
Compare
Member
Author
|
Not sure why the test TestRefreshInvalidToken fails. It should really not be affected by anything within this PR. |
1b3ea90 to
24ecb2d
Compare
The command validates a given OIDC configuration, either from a referenced Secret or from CLI flags. This will help users debug issues with Weave GitOps OIDC configuration as well as provide a way to validate a configuration before putting it on a cluster. The command consumes OIDC configuration from CLI flags or from a Secret on a cluster and sends the user through an OIDC authorization code flow. If it succeeds, the username and groups claims are logged to stdout. The command validates the Secret for missing fields and also prints all errors returned from the OIDC provider so that users know what went wrong. This will work out of the box with OIDC providers given they are configured to accept "http://localhost:9876" as a redirect URI.
24ecb2d to
b806226
Compare
bigkevmcd
requested changes
Nov 24, 2023
added 3 commits
November 24, 2023 16:44
This commit also aligns the existing `--claim-username` flag with the K8s one and renames it to `--username-claim`.
bigkevmcd
requested changes
Nov 24, 2023
bigkevmcd
approved these changes
Nov 24, 2023
added 3 commits
November 24, 2023 17:55
The generated files have been updated to reflect the updated version of the buf command.
golang.org/x/oauth2 changed its error handling in v0.8.0 (https://go-review.googlesource.com/c/oauth2/+/451076) to actually parse error responses and return the error code in the returned error variable.
Contributor
|
Thank you @makkes 🥇 |
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changed?
A new command
check oidc-configis introduced that validates a given OIDC configuration, either from a referenced Secret or from CLI flags.Example for an invalid configuration:
Example for a valid configuration:
Why was this change made?
This will help users debug issues with Weave GitOps OIDC configuration as well as provide a way to validate a configuration before putting it on a cluster.
How was this change implemented?
The command consumes OIDC configuration from CLI flags or from a Secret on a cluster and sends the user through an OIDC authorization code flow. If it succeeds, the username and groups claims are logged to stdout. The command validates the Secret for missing fields and also prints all errors returned from the OIDC provider so that users know what went wrong.
How did you validate the change?
There are unit tests and I manually validated the command with Azure, Google and on-prem Keycloak as IdPs.
Release notes
New
check oidc-configcommand for validating and debugging OIDC configuration.Documentation Changes
added a link to the reference page at the bottom of this paragraph