gcp

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const ProviderName = "gcp"

ProviderName is the name of the GCP authentication provider.

Variables

This section is empty.

Functions

func NewTokenSource

func NewTokenSource(ctx context.Context, opts ...auth.Option) oauth2.TokenSource

NewTokenSource creates a new token source for the given context and options.

Types

type Implementation

type Implementation interface {
	DefaultTokenSource(ctx context.Context, scope ...string) (oauth2.TokenSource, error)
	NewTokenSource(ctx context.Context, conf externalaccount.Config) (oauth2.TokenSource, error)
}

Implementation provides the required methods of the GCP libraries.

type Provider

type Provider struct{ Implementation }

Provider implements the auth.Provider interface for GCP authentication.

func (Provider) GetAudience

func (Provider) GetAudience(ctx context.Context) (string, error)

GetAudience implements auth.Provider.

func (Provider) GetIdentity

func (Provider) GetIdentity(serviceAccount corev1.ServiceAccount) (string, error)

GetIdentity implements auth.Provider.

func (Provider) GetName

func (Provider) GetName() string

GetName implements auth.Provider.

func (Provider) NewArtifactRegistryCredentials added in v0.12.0

func (Provider) NewArtifactRegistryCredentials(_ context.Context, _ string,
	accessToken auth.Token, _ ...auth.Option) (*auth.ArtifactRegistryCredentials, error)

NewArtifactRegistryCredentials implements auth.Provider.

func (Provider) NewControllerToken added in v0.12.0

func (p Provider) NewControllerToken(ctx context.Context, opts ...auth.Option) (auth.Token, error)

NewControllerToken implements auth.Provider.

func (Provider) NewTokenForServiceAccount

func (p Provider) NewTokenForServiceAccount(ctx context.Context, oidcToken string,
	serviceAccount corev1.ServiceAccount, opts ...auth.Option) (auth.Token, error)

NewTokenForServiceAccount implements auth.Provider.

func (Provider) ParseArtifactRepository added in v0.12.0

func (Provider) ParseArtifactRepository(artifactRepository string) (string, error)

ParseArtifactRepository implements auth.Provider.

type Token

type Token struct{ oauth2.Token }

Token is the GCP token.

func (*Token) GetDuration

func (t *Token) GetDuration() time.Duration

GetDuration implements auth.Token.

func (*Token) Source

func (t *Token) Source() oauth2.TokenSource

Source gets a token source for the token to use with GCP libraries.

type TokenSupplier

type TokenSupplier string

TokenSupplier provides a static OIDC token.

func (TokenSupplier) SubjectToken

SubjectToken implements externalaccount.SubjectTokenSupplier.

Jump to

Keyboard shortcuts

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