token

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx context.Context, cfg LoginConfig, forceRefresh bool) ([]byte, error)

Get retrieves a Chainguard token, refreshing it if expired/non-existent or forceRefresh == true. If automatic authentication is disabled, returns an unauthenticated error.

Types

type LoginConfig

type LoginConfig struct {
	// Auth0Connection is the social login to use with Auth0.
	// Must be one of: github, gitlab, google-oauth2
	Auth0Connection string

	// Audience is the audience of the Chainguard token.
	Audience string

	// Disabled determines if this package should attempt to refresh missing
	// and expired tokens automatically.
	Disabled bool

	// IdentityID is the exact UIDP of a Chainguard identity to assume.
	IdentityID string

	// IdentityProvider is the exact UIDP of a custom identity provider
	// to use for authentication. If empty, Auth0 is assumed.
	IdentityProvider string

	// IdentityToken is a path to an OIDC token, or literal identity token.
	IdentityToken string

	// Issuer is the URL of the Chainguard token issuer.
	Issuer string

	// OrgName is the verified organization name that defines a custom
	// identity provider to use for authentication.
	OrgName string

	// UserAgent is the user-agent to set during token exchange.
	UserAgent string

	// UseRefreshTokens indicates if refresh tokens should be created
	// and exchanged for access tokens.
	UseRefreshTokens bool
}

LoginConfig configures options for fetching and refreshing Chainguard a token.

Jump to

Keyboard shortcuts

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