feat: Extract groups and namespaces claims from JWT in OidcTokenParser#6089
Draft
aniketpalu wants to merge 22 commits intofeast-dev:masterfrom
Draft
feat: Extract groups and namespaces claims from JWT in OidcTokenParser#6089aniketpalu wants to merge 22 commits intofeast-dev:masterfrom
aniketpalu wants to merge 22 commits intofeast-dev:masterfrom
Conversation
Signed-off-by: Aniket Paluskar <[email protected]>
Signed-off-by: Aniket Paluskar <[email protected]>
…tacting the identity provider Signed-off-by: Aniket Paluskar <[email protected]>
Signed-off-by: Aniket Paluskar <[email protected]>
Signed-off-by: Aniket Paluskar <[email protected]>
…t, reject stray auth_discovery_url/client_id without client_secret Signed-off-by: Aniket Paluskar <[email protected]>
… _is_oidc_client_config helper Signed-off-by: Aniket Paluskar <[email protected]>
…one == None Signed-off-by: Aniket Paluskar <[email protected]>
…ed KeyError Signed-off-by: Aniket Paluskar <[email protected]>
Signed-off-by: Aniket Paluskar <[email protected]>
Signed-off-by: Aniket Paluskar <[email protected]>
Signed-off-by: Aniket Paluskar <[email protected]>
Signed-off-by: Aniket Paluskar <[email protected]>
Signed-off-by: Aniket Paluskar <[email protected]>
Signed-off-by: Aniket Paluskar <[email protected]>
…eQL substring sanitization check Signed-off-by: Aniket Paluskar <[email protected]>
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 this PR does / why we need it:
Extracts
groupsandnamespacesclaims from the decoded JWT inOidcTokenParser.user_details_from_access_token()and passes them to theUserobject.Previously, the OIDC token parser only read
preferred_usernameandresource_accessroles from the JWT, always returningUser(username, roles)with empty groups and namespaces. This meant thatGroupBasedPolicy,NamespaceBasedPolicy, andCombinedGroupNamespacePolicycould never grant access for OIDC-authenticated users — even when the JWT contained valid claims.Server-Side Changes
Files:
oidc_token_parser.py,utils.pyWhen
auth.type: oidc, the Feast server now handles two types of incoming tokens:preferred_username,groups, androles. Used byGroupBasedPolicy.kubernetes.ioclaim, delegated to existingKubernetesTokenParserwhich validates via TokenAccessReview and extracts namespace. Used byNamespaceBasedPolicy.Token type detection happens before any cryptographic validation — a lightweight unverified decode checks for the
kubernetes.ioclaim. If the K8s API is unavailable (non-K8s deployment), the server falls back to Keycloak-only mode.Client-Side Changes
Files:
oidc_authentication_client_manager.py,auth_model.py,repo_config.pyOidcAuthClientManager.get_token()now supports multiple token sources with clear priority:token,token_env_var, orclient_secret+ IDP network callFEAST_OIDC_TOKENenv var, then mounted SA token fileThis means a workbench pod with just
auth: {type: oidc}automatically picks up its SA token. Human users can setFEAST_OIDC_TOKEN. Existingclient_credentials/ROPG flows are unchanged.Which issue(s) this PR fixes:
#6088
Misc