mirror of
https://github.com/tailscale/tailscale.git
synced 2026-02-08 09:12:00 +01:00
cmd/gitops-pusher: fix precedence when id token env var is empty
Fix precedence logic to skip federated identity logic when the associated environment variables are empty. Updates https://github.com/tailscale/gitops-acl-action/issues/71 Signed-off-by: Mario Minardi <mario@tailscale.com>
This commit is contained in:
parent
03461ea7fb
commit
b4d39e2fd9
@ -252,7 +252,7 @@ func getCredentials() (*http.Client, string) {
|
||||
TokenURL: fmt.Sprintf("https://%s/api/v2/oauth/token", *apiServer),
|
||||
}
|
||||
client = oauthConfig.Client(context.Background())
|
||||
} else if idok {
|
||||
} else if idok && idToken != "" && oiok && oauthId != "" {
|
||||
if exchangeJWTForToken, ok := tailscale.HookExchangeJWTForTokenViaWIF.GetOk(); ok {
|
||||
var err error
|
||||
apiKeyEnv, err = exchangeJWTForToken(context.Background(), fmt.Sprintf("https://%s", *apiServer), oauthId, idToken)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user