-
Notifications
You must be signed in to change notification settings - Fork 157
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
Add 'check oidc-config' command #4146
Merged
Merged
Conversation
This file contains 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
makkes
force-pushed
the
check-oidc-config
branch
3 times, most recently
from
November 24, 2023 10:15
6e61967
to
d1e9c95
Compare
Not sure why the test TestRefreshInvalidToken fails. It should really not be affected by anything within this PR. |
makkes
force-pushed
the
check-oidc-config
branch
2 times, most recently
from
November 24, 2023 14:54
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.
makkes
force-pushed
the
check-oidc-config
branch
from
November 24, 2023 15:03
24ecb2d
to
b806226
Compare
bigkevmcd
requested changes
Nov 24, 2023
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
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.
Thank you @makkes 🥇 |
Merged
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-config
is 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-config
command for validating and debugging OIDC configuration.Documentation Changes
added a link to the reference page at the bottom of this paragraph