Documentation
¶
Index ¶
- Constants
- func NewTokenSource(ctx context.Context, opts ...auth.Option) oauth2.TokenSource
- type Implementation
- type Provider
- func (Provider) GetAudience(ctx context.Context, serviceAccount corev1.ServiceAccount) (string, error)
- func (Provider) GetIdentity(serviceAccount corev1.ServiceAccount) (string, error)
- func (Provider) GetName() string
- func (Provider) NewArtifactRegistryCredentials(_ context.Context, _ string, accessToken auth.Token, _ ...auth.Option) (*auth.ArtifactRegistryCredentials, error)
- func (p Provider) NewControllerToken(ctx context.Context, opts ...auth.Option) (auth.Token, error)
- func (p Provider) NewTokenForServiceAccount(ctx context.Context, oidcToken string, serviceAccount corev1.ServiceAccount, ...) (auth.Token, error)
- func (Provider) ParseArtifactRepository(artifactRepository string) (string, error)
- type Token
- type TokenSupplier
Constants ¶
const ProviderName = "gcp"
ProviderName is the name of the GCP authentication provider.
Variables ¶
This section is empty.
Functions ¶
func NewTokenSource ¶
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, serviceAccount corev1.ServiceAccount) (string, error)
GetAudience implements auth.Provider.
func (Provider) GetIdentity ¶
func (Provider) GetIdentity(serviceAccount corev1.ServiceAccount) (string, error)
GetIdentity 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
NewControllerToken implements auth.Provider.
type Token ¶
Token is the GCP token.
func (*Token) GetDuration ¶
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 ¶
func (s TokenSupplier) SubjectToken(context.Context, externalaccount.SupplierOptions) (string, error)
SubjectToken implements externalaccount.SubjectTokenSupplier.