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.
Overview
Adds the ability to compose new group claims elements in the OIDC connector, based on other claims.
So this OIDC connector config:
Would result in this element in the group claim which looks like this::
bk::acme-inc::super-duper-app::main
What this PR does / why we need it
After
dex/pull/2806
we are able to authenticate with JWT generated by CI systems.The claim provided by those system are usually static and if the upstream OIDC service doesn't support sophisticated query language in its IAM/RBAC mechanism the operator might be enable to find a configuration that provided the needed granularity.
For example, lets say you want a specific Buildkiite pipeline to run a sync action on an ArgoCD instance.
These are claim provided by Buildkite CI/CD system:
AFAIKT ArgoCD doesn't have fancy query language in its RBAC config (regexs are supported to action field only)
So If you want to allow pipelines runs from a specific repo and branch combination, you would need to combine
organization_slug
,pipeline_slug
andbuild_branch
claims ( notice thesub
claim includes the git commit, making it unusable as reference for RBAC ).With this PR you'll be able to concatenate/compose multiple claims to a new element in the group claim:
This would be the resulting group :
bk::acme-inc::super-duper-app::main
And you can refrence it in ArgoCD RBAC like so:
Special notes for your reviewer
This is intended as a temporary solution until a more flexible solution is provided via
https://github.com/dexidp/dex/issues/1635
.Because the problem is uniq to service-tied JWTs and only relevant for OIDC I believe a connecter-specific solution is acceptable.
Does this PR introduce a user-facing change?