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

gcp

package
v0.65.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 17 Imported by: 2

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 AccessToken added in v0.64.0

type AccessToken struct{ oauth2.Token }

AccessToken is the GCP access token.

func (*AccessToken) GetDuration added in v0.64.0

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

GetDuration implements auth.Credential.

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) GetAccessCredentialOptionsForArtifactRepository added in v0.64.0

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

GetAccessCredentialOptionsForArtifactRepository implements auth.Provider.

func (Provider) GetAccessCredentialOptionsForCluster added in v0.64.0

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

GetAccessCredentialOptionsForCluster implements auth.Provider.

func (Provider) GetAudiences added in v0.21.0

func (p Provider) GetAudiences(ctx context.Context, opts ...auth.Option) ([]string, error)

GetAudiences implements auth.Provider.

func (Provider) GetIdentity

func (Provider) GetIdentity(opts ...auth.Option) (string, error)

GetIdentity implements auth.Provider.

func (Provider) GetName

func (Provider) GetName() string

GetName implements auth.Provider.

func (Provider) NewAccessCredentialForIdentity added in v0.64.0

func (p Provider) NewAccessCredentialForIdentity(ctx context.Context, identity auth.Credential,
	opts ...auth.Option) (auth.Credential, error)

NewAccessCredentialForIdentity implements auth.Provider.

func (Provider) NewArtifactRegistryCredentials added in v0.12.0

func (Provider) NewArtifactRegistryCredentials(_ context.Context, _ string,
	accessCredential auth.Credential, _ ...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.Credential, error)

NewControllerToken implements auth.Provider.

func (Provider) NewRESTConfig added in v0.21.0

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

NewRESTConfig 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.

Jump to

Keyboard shortcuts

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