Documentation ¶
Index ¶
- func LookupConcreteToken(tokenPointer **api.SPIAccessToken) ...
- func PersistConcreteMetadata(metadata *api.TokenMetadata) func(context.Context, client.Client, *api.SPIAccessToken) error
- type TestServiceProvider
- func (t TestServiceProvider) CheckRepositoryAccess(ctx context.Context, cl client.Client, accessCheck *api.SPIAccessCheck) (*api.SPIAccessCheckStatus, error)
- func (t TestServiceProvider) GetBaseUrl() string
- func (t TestServiceProvider) GetOAuthEndpoint() string
- func (t TestServiceProvider) GetType() api.ServiceProviderType
- func (t TestServiceProvider) LookupToken(ctx context.Context, cl client.Client, binding *api.SPIAccessTokenBinding) (*api.SPIAccessToken, error)
- func (t TestServiceProvider) MapToken(ctx context.Context, binding *api.SPIAccessTokenBinding, ...) (serviceprovider.AccessTokenMapper, error)
- func (t TestServiceProvider) OAuthScopesFor(permissions *api.Permissions) []string
- func (t TestServiceProvider) PersistMetadata(ctx context.Context, cl client.Client, token *api.SPIAccessToken) error
- func (t *TestServiceProvider) Reset()
- func (t TestServiceProvider) Validate(ctx context.Context, validated serviceprovider.Validated) (serviceprovider.ValidationResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LookupConcreteToken ¶ added in v0.3.0
func LookupConcreteToken(tokenPointer **api.SPIAccessToken) func(ctx context.Context, cl client.Client, binding *api.SPIAccessTokenBinding) (*api.SPIAccessToken, error)
LookupConcreteToken returns a function that can be used as the TestServiceProvider.LookupTokenImpl that just returns a freshly loaded version of the provided token. The token is a pointer to a pointer to the token so that this can also support lazily initialized tokens.
func PersistConcreteMetadata ¶ added in v0.3.0
func PersistConcreteMetadata(metadata *api.TokenMetadata) func(context.Context, client.Client, *api.SPIAccessToken) error
PersistConcreteMetadata returns a function that can be used as the TestServiceProvider.PersistMetadataImpl that stores the provided metadata to any token.
Types ¶
type TestServiceProvider ¶
type TestServiceProvider struct { LookupTokenImpl func(context.Context, client.Client, *api.SPIAccessTokenBinding) (*api.SPIAccessToken, error) PersistMetadataImpl func(context.Context, client.Client, *api.SPIAccessToken) error GetBaseUrlImpl func() string OAuthScopesForImpl func(permissions *api.Permissions) []string GetTypeImpl func() api.ServiceProviderType GetOauthEndpointImpl func() string CheckRepositoryAccessImpl func(context.Context, client.Client, *api.SPIAccessCheck) (*api.SPIAccessCheckStatus, error) MapTokenImpl func(context.Context, *api.SPIAccessTokenBinding, *api.SPIAccessToken, *api.Token) (serviceprovider.AccessTokenMapper, error) ValidateImpl func(context.Context, serviceprovider.Validated) (serviceprovider.ValidationResult, error) }
TestServiceProvider is an implementation of the serviceprovider.ServiceProvider interface that can be modified by supplying custom implementations of each of the interface methods. It provides dummy implementations of them, too, so that no null pointer dereferences should occur under normal operation.
func (TestServiceProvider) CheckRepositoryAccess ¶ added in v0.5.1
func (t TestServiceProvider) CheckRepositoryAccess(ctx context.Context, cl client.Client, accessCheck *api.SPIAccessCheck) (*api.SPIAccessCheckStatus, error)
func (TestServiceProvider) GetBaseUrl ¶
func (t TestServiceProvider) GetBaseUrl() string
func (TestServiceProvider) GetOAuthEndpoint ¶
func (t TestServiceProvider) GetOAuthEndpoint() string
func (TestServiceProvider) GetType ¶
func (t TestServiceProvider) GetType() api.ServiceProviderType
func (TestServiceProvider) LookupToken ¶
func (t TestServiceProvider) LookupToken(ctx context.Context, cl client.Client, binding *api.SPIAccessTokenBinding) (*api.SPIAccessToken, error)
func (TestServiceProvider) MapToken ¶ added in v0.5.5
func (t TestServiceProvider) MapToken(ctx context.Context, binding *api.SPIAccessTokenBinding, token *api.SPIAccessToken, tokenData *api.Token) (serviceprovider.AccessTokenMapper, error)
func (TestServiceProvider) OAuthScopesFor ¶ added in v0.6.8
func (t TestServiceProvider) OAuthScopesFor(permissions *api.Permissions) []string
func (TestServiceProvider) PersistMetadata ¶ added in v0.3.0
func (t TestServiceProvider) PersistMetadata(ctx context.Context, cl client.Client, token *api.SPIAccessToken) error
func (*TestServiceProvider) Reset ¶
func (t *TestServiceProvider) Reset()
func (TestServiceProvider) Validate ¶ added in v0.5.5
func (t TestServiceProvider) Validate(ctx context.Context, validated serviceprovider.Validated) (serviceprovider.ValidationResult, error)