Documentation
¶
Index ¶
- Constants
- func NewTokenSource(ctx context.Context, opts ...auth.Option) oauth2.TokenSource
- type Implementation
- type Provider
- func (Provider) GetAccessTokenOptionsForArtifactRepository(string) ([]auth.Option, error)
- func (Provider) GetAccessTokenOptionsForCluster(opts ...auth.Option) ([][]auth.Option, error)
- func (Provider) GetAudiences(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) NewRESTConfig(ctx context.Context, accessTokens []auth.Token, opts ...auth.Option) (*auth.RESTConfig, error)
- func (p Provider) NewTokenForServiceAccount(ctx context.Context, oidcToken string, serviceAccount corev1.ServiceAccount, ...) (auth.Token, error)
- func (Provider) ParseArtifactRepository(artifactRepository string) (string, error)
- type StaticTokenSupplier
- type Token
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)
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
GetAccessTokenOptionsForArtifactRepository implements auth.Provider.
func (Provider) GetAccessTokenOptionsForCluster ¶ added in v0.21.0
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) 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.
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.
type StaticTokenSupplier ¶ added in v0.21.0
type StaticTokenSupplier string
StaticTokenSupplier provides a static OIDC token.
func (StaticTokenSupplier) SubjectToken ¶ added in v0.21.0
func (s StaticTokenSupplier) SubjectToken(context.Context, externalaccount.SupplierOptions) (string, error)
SubjectToken implements externalaccount.SubjectTokenSupplier.