Implement configurable OIDC JWT token authentication for ate-api-server. - #759
Open
Shruti Nair (SHRUTI6991) wants to merge 1 commit into
Open
Implement configurable OIDC JWT token authentication for ate-api-server.#759Shruti Nair (SHRUTI6991) wants to merge 1 commit into
Shruti Nair (SHRUTI6991) wants to merge 1 commit into
Conversation
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.
Title
feat(ateapi): support multiple OIDC JWT issuers and Bearer token authentication in kubectl-ate
Summary
Fixes #733.
This PR expands
ate-api-serverauthentication to support multiple, pluggable OIDC JWT providers through an authenticator chain (oidcauth). It replaces the single hardcoded Kubernetes ServiceAccount issuer verifier (k8sjwt) with support for both Kubernetes ServiceAccount JWTs and Human OIDC credentials (e.g., Google accounts).Additionally, this PR enhances
kubectl-atedeveloper experience by adding a global--token(-t) flag and support forATE_TOKEN/ATE_API_TOKENenvironment variables for authenticating CLI requests toateapi.Key Changes
oidcauthPackage:cmd/ateapi/internal/k8sjwtwithcmd/ateapi/internal/oidcauth.AuthenticatorandChaininterfaces for sequential evaluation of multiple OIDC issuers.subfor ServiceAccounts vs.emailfor human OIDC accounts).ate-api-serverConfiguration:cmd/ateapi/main.goflags to accept--k8s-jwt-issuer,--k8s-jwt-audience,--human-jwt-issuer, and--human-jwt-audience.authChaininateapiserver startup to validate incoming bearer tokens.kubectl-ate&ateclientAuthentication:--token(-t) flag tokubectl-ateroot command (cmd/kubectl-ate/internal/cmd/root.go).internal/ateclient/builder.goto checkTokenvariable orATE_TOKEN/ATE_API_TOKENenvironment variables when dialing gRPC services.hack/install-ate.shto configureATE_API_HUMAN_JWT_ISSUERandATE_API_HUMAN_JWT_AUDIENCEenv vars.manifests/ate-install/ate-api-server.yamlcontainer arguments.Testing Performed
go test ./cmd/ateapi/internal/oidcauth/...to verify OIDC token parsing, signature verification, claim extraction (subvsemail), and authenticator chain evaluation.go test ./internal/ateapiauth/...to ensure server bearer token authentication middleware behavior.make verify(gofmt, boilerplate headers,go vet, and module tidiness).kubectl-ateusing explicit--tokenflags andATE_TOKENenvironment variables against localate-api-server.