providers

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: Apache-2.0 Imports: 4 Imported by: 15

Documentation

Overview

Package providers defines the APIs for providers to detect their relevance and register themselves to furnish OIDC tokens within a given environment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enabled

func Enabled(ctx context.Context) bool

Enabled checks whether any of the registered providers are enabled in this execution context.

func Provide

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

Provide fetches an OIDC token from one of the active providers.

func Register

func Register(name string, p Interface)

Register is used by providers to participate in furnishing OIDC tokens.

Types

type Interface

type Interface interface {
	// Enabled returns true if the provider is enabled.
	Enabled(ctx context.Context) bool

	// Provide returns an OIDC token scoped to the provided audience.
	Provide(ctx context.Context, audience string) (string, error)
}

Interface is what providers need to implement to participate in furnishing OIDC tokens.

func ProvideFrom added in v1.9.0

func ProvideFrom(ctx context.Context, provider string) (Interface, error)

ProvideFrom fetches the specified provider

Directories

Path Synopsis
Package filesystem defines an implementation of the providers.Interface that reads identity tokens from a well-known filesystem location.
Package filesystem defines an implementation of the providers.Interface that reads identity tokens from a well-known filesystem location.
Package github defines a github implementation of the providers.Interface.
Package github defines a github implementation of the providers.Interface.
Package google defines a google implementation of the providers.Interface.
Package google defines a google implementation of the providers.Interface.
Package spiffe defines a SPIFFE/SPIRE implementation of the providers.Interface.
Package spiffe defines a SPIFFE/SPIRE implementation of the providers.Interface.

Jump to

Keyboard shortcuts

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