wif

package
v1.94.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2026 License: BSD-3-Clause Imports: 16 Imported by: 0

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

func ObtainProviderToken(ctx context.Context, audience string) (string, error)

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:

  1. GitHub Actions (strongest env signals; may run atop any cloud)
  2. AWS via IMDSv2 token endpoint (does not require env vars)
  3. GCP via metadata header semantics
  4. Azure via metadata endpoint

Types

type Environment

type Environment string
const (
	EnvGitHub Environment = "github"
	EnvAWS    Environment = "aws"
	EnvGCP    Environment = "gcp"
	EnvNone   Environment = "none"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL