feat(studio-cp): mint GKE tokens via gcp_auth instead of exec plugin (studio#119) - #123
Merged
Conversation
…(studio#119) k8s_client_for() previously left kube-rs to shell out to gke-gcloud-auth-plugin for GKE contexts. Even with fix-path-env (#122) fixing PATH inheritance in general, this still depends on the plugin binary being installed and PATH-resolvable at all. When the resolved kubeconfig context's exec command is exactly "gke-gcloud-auth-plugin", fetch the bearer token in-process via gcp_auth instead — it walks the same Application Default Credentials chain the plugin itself reads (gcloud user creds / GOOGLE_APPLICATION_CREDENTIALS / GCE-GKE metadata server) — and set it directly on AuthInfo.token, clearing the exec block. No subprocess, no PATH dependency, for GKE specifically. Other exec-based providers (e.g. Azure kubelogin) have no equivalent pure-Rust replacement identified, so they still rely on fix-path-env. Ref #119.
This was referenced Aug 28, 2026
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.
Summary
Item 3 of #119's runbook.
k8s_client_for()previously always let kube-rs shell out to whatever exec plugin a kubeconfig context declares. For GKE contexts that'sgke-gcloud-auth-plugin— even with #122 (fix-path-env) fixing PATH inheritance in general, this still requires the plugin binary to actually be installed and correctly resolvable.Fix
When the resolved context's
exec.commandis exactly"gke-gcloud-auth-plugin", skip the exec step entirely: fetch the bearer token in-process viagcp_auth(MIT), which walks the same Application Default Credentials chain the plugin itself reads (gcloud user creds →GOOGLE_APPLICATION_CREDENTIALS→ GCE/GKE metadata server), then set it directly onAuthInfo.token(aSecretBox<str>, viasecrecy::SecretBox::new) and clearAuthInfo.exec. No subprocess, no PATH dependency, for GKE specifically.Other exec-based providers (Azure
kubeloginis the one identified in #119) have no pure-Rust equivalent found — they still rely on #122's fix-path-env as the general-purpose fallback.Verification
aws-sdk-ec2OOM limitation as fix(oab-mcp): install rustls CryptoProvider before first TLS handshake (studio#119) #120 (confirmed again this session,cargo check -p oab-mcp -j 1OOMs on it regardless of target crate).gcp_auth::provider(),TokenProvider::token(&[scope]) -> Token,Token::as_str(), andsecrecy::SecretBox::new(Box<S>) -> Self.secrecyis pinned to0.10to match kube 0.99's own resolved version (confirmed viacargo tree -e features -i ringearlier in k8s New Fleet wizard: rustls CryptoProvider panic + auth UX follow-ups #119's diagnosis, which showedsecrecy v0.10.3in the graph) —kube::configdoesn't re-export the type, so this needs to be the same resolved crate version forAuthInfo.token's type to unify with whatSecretBox::newproduces here.build-testjob is the real compile gate.Ref #119.
🤖 Generated with Claude Code