integrationtests

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

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 (TestServiceProvider) LookupToken

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

Jump to

Keyboard shortcuts

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