Help us shape the future of Go! Take the 2026 Go Developer Survey

actionsoidc

package
v0.59.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package actionsoidc fetches OIDC ID tokens from the GitHub/Forgejo Actions token endpoint. Both providers expose the same contract: a job granted the 'id-token: write' permission gets the ACTIONS_ID_TOKEN_REQUEST_URL and ACTIONS_ID_TOKEN_REQUEST_TOKEN environment variables, and a GET request to that URL with the request token as a bearer credential returns a JSON object with the ID token in its "value" field.

Index

Constants

View Source
const (
	// EnvRequestURL is the environment variable holding the URL of the
	// GitHub/Forgejo Actions OIDC token request endpoint.
	EnvRequestURL = "ACTIONS_ID_TOKEN_REQUEST_URL"

	// EnvRequestToken is the environment variable holding the bearer token used
	// to authenticate the request to the endpoint in EnvRequestURL.
	EnvRequestToken = "ACTIONS_ID_TOKEN_REQUEST_TOKEN"
)

Variables

This section is empty.

Functions

func FetchToken

func FetchToken(ctx context.Context, audiences []string) (string, error)

FetchToken requests an OIDC ID token for the given audiences from the GitHub/Forgejo Actions token endpoint. Each audience is sent as a repeated "audience" query parameter; whether and how the endpoint folds them into the token's aud claim is up to the provider. The endpoint URL and the request bearer token are read from the EnvRequestURL and EnvRequestToken environment variables, which Actions injects into a job that has the 'id-token: write' permission.

Types

This section is empty.

Jump to

Keyboard shortcuts

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