Documentation
¶
Overview ¶
Package wif deals with obtaining ID tokens from provider VMs to be used as part of Workload Identity Federation
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ObtainProviderToken ¶
ObtainProviderToken tries to detect what provider the client is running in and then tries to obtain an ID token for the audience that is passed as an argument To detect the environment, we do it in the following intentional order:
- GitHub Actions (strongest env signals; may run atop any cloud)
- Azure hosts that announce themselves via env vars (AKS workload identity, App Service / Container Apps identity endpoint); these must precede the metadata probes because AKS pods can reach the node's IMDS
- AWS via IMDSv2 token endpoint (does not require env vars)
- GCP via metadata header semantics
- Azure via IMDS (VMs, scale sets, container instances)
- AWS ECS via ECS token endpoint and env vars provided by ECS
Types ¶
type Environment ¶
type Environment string
const ( EnvGitHub Environment = "github" EnvAWS Environment = "aws" EnvGCP Environment = "gcp" EnvAzure Environment = "azure" EnvNone Environment = "none" )