Return status.bearerToken from minted tokens (fix 401s) #2
Reference in New Issue
Block a user
Delete Branch "benvin/fix-bearer-token"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Live validation against Rancher showed every minted credential (and every rotated root token) fails auth with HTTP 401. Root cause: ext.cattle.io token creation returns two fields —
status.value(just the secret fragment) andstatus.bearerToken(the full usable credential,ext/<name>:<secret>). The plugin returnedstatus.value, which does not authenticate.Verified directly:
bearerToken→ HTTP 200;valuealone → 401.Changes
client.go:MintTokenreturnsstatus.bearerToken, falling back tostatus.valueonly if a Rancher build omits it. Fixes both dynamic creds and root rotation.bearerToken; the lifecycle test asserts the minted token is theext/bearer form.