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) 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) PersistMetadata(ctx context.Context, cl client.Client, token *api.SPIAccessToken) error
- func (t *TestServiceProvider) Reset()
- func (t TestServiceProvider) TranslateToScopes(permission api.Permission) []string
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 TranslateToScopesImpl func(permission api.Permission) []string GetTypeImpl func() api.ServiceProviderType GetOauthEndpointImpl func() string }
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) 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) 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) TranslateToScopes ¶
func (t TestServiceProvider) TranslateToScopes(permission api.Permission) []string