Skip to content

Request cloud-platform scope in ControlPlaneClient credentials (fixes #4)#5

Open
lokic233 wants to merge 1 commit into
AI-Hypercomputer:mainfrom
lokic233:fix/control-plane-auth-scopes
Open

Request cloud-platform scope in ControlPlaneClient credentials (fixes #4)#5
lokic233 wants to merge 1 commit into
AI-Hypercomputer:mainfrom
lokic233:fix/control-plane-auth-scopes

Conversation

@lokic233

Copy link
Copy Markdown

Summary

ControlPlaneClient.__init__ calls google.auth.default() without scopes. For external_account (Workload Identity Federation) credentials this yields an unscoped credential, which makes the downstream STS token exchange / service-account impersonation malformed. The Hypercompute Cluster control plane then rejects every request with HTTP 400 INVALID_ARGUMENT, breaking MLRun create/get for any GKE workload that authenticates via WIF.

This is deterministic (not transient / propagation-related) and is masked in typical manual testing because interactive user ADC carries an implicit scope.

Fix

Pass the cloud-platform scope explicitly:

self.credentials, _ = google.auth.default(
    scopes=["https://www.googleapis.com/auth/cloud-platform"]
)
  • One call site, no new imports.
  • Behavior unchanged for user ADC; fixes the external_account path.
  • ast.parse OK; applies on current main.

Testing

Verified on a GKE (TPU v7x, plain-SPMD) workload authenticating as a GSA via Workload Identity Federation (external_account ADC): before the change, create_ml_run/get_ml_run failed with 400 INVALID_ARGUMENT; after the change, control-plane calls succeed and the MLRun is created.

Fixes #4

google.auth.default() was called without scopes. For external_account
(Workload Identity Federation) credentials this yields an unscoped
credential, which produces a malformed STS token exchange / service-account
impersonation and causes the Hypercompute Cluster control plane to reject
every request with HTTP 400 INVALID_ARGUMENT. This breaks MLRun create/get
for GKE workloads authenticating via WIF.

Pass scopes=['https://www.googleapis.com/auth/cloud-platform'] explicitly so
token minting is well-formed for both user ADC and external_account creds.

Fixes AI-Hypercomputer#4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ControlPlaneClient uses google.auth.default() without scopes → 400 INVALID_ARGUMENT under Workload Identity Federation (external_account)

1 participant