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

oauth

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientCredentialsTokenProvider

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

ClientCredentialsTokenProvider implements the standard OAuth2 client credentials flow.

func (*ClientCredentialsTokenProvider) FetchToken

FetchToken gets the client secret from the secret reference and fetches the token from the provider token URL.

This implements TokenProvider.FetchToken.

type OIDCProvider

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

OIDCProvider extends ClientCredentialsTokenProvider with OIDC support.

func NewOIDCProvider

func NewOIDCProvider(client client.Client, oidcConfig egv1a1.OIDC) *OIDCProvider

NewOIDCProvider creates a new OIDC-aware provider.

func (*OIDCProvider) FetchToken

func (p *OIDCProvider) FetchToken(ctx context.Context) (*oauth2.Token, error)

FetchToken retrieves and validates tokens using the client credentials flow with OIDC support.

This implements TokenProvider.FetchToken.

type TokenProvider

type TokenProvider interface {
	// FetchToken will obtain oauth token using oidc credentials.
	FetchToken(ctx context.Context) (*oauth2.Token, error)
}

TokenProvider defines the interface for OAuth token providers.

Jump to

Keyboard shortcuts

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