oidc

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package oidc provides GitHub Actions OIDC token acquisition and caching.

The Provider fetches short-lived JWTs from the GitHub Actions OIDC endpoint (ACTIONS_ID_TOKEN_REQUEST_URL) and caches them per audience, refreshing automatically before they expire.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider acquires and caches GitHub Actions OIDC tokens. Tokens are keyed by audience and refreshed automatically before expiry.

func NewProvider

func NewProvider(requestURL, requestToken string) *Provider

NewProvider creates a new Provider using the given OIDC request URL and bearer token. These values come from the ACTIONS_ID_TOKEN_REQUEST_URL and ACTIONS_ID_TOKEN_REQUEST_TOKEN environment variables respectively.

func (*Provider) Token

func (p *Provider) Token(ctx context.Context, audience string) (string, error)

Token returns a valid OIDC JWT for the given audience, refreshing the cache if needed. It returns an error if token acquisition fails.

Jump to

Keyboard shortcuts

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