gcp

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: Apache-2.0 Imports: 17 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)
	GetCluster(ctx context.Context, cluster string, client *container.Service) (*container.Cluster, 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) GetAccessTokenOptionsForArtifactRepository added in v0.21.0

func (Provider) GetAccessTokenOptionsForArtifactRepository(string) ([]auth.Option, error)

GetAccessTokenOptionsForArtifactRepository implements auth.Provider.

func (Provider) GetAccessTokenOptionsForCluster added in v0.21.0

func (Provider) GetAccessTokenOptionsForCluster(opts ...auth.Option) ([][]auth.Option, error)

GetAccessTokenOptionsForCluster implements auth.Provider.

func (Provider) GetAudiences added in v0.21.0

func (Provider) GetAudiences(ctx context.Context, serviceAccount corev1.ServiceAccount) ([]string, error)

GetAudiences 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) NewRESTConfig added in v0.21.0

func (p Provider) NewRESTConfig(ctx context.Context, accessTokens []auth.Token,
	opts ...auth.Option) (*auth.RESTConfig, error)

NewRESTConfig 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 StaticTokenSupplier added in v0.21.0

type StaticTokenSupplier string

StaticTokenSupplier provides a static OIDC token.

func (StaticTokenSupplier) SubjectToken added in v0.21.0

SubjectToken implements externalaccount.SubjectTokenSupplier.

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.

Jump to

Keyboard shortcuts

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