Documentation ¶
Index ¶
- type NotifyingTokenStorage
- func (n NotifyingTokenStorage) Delete(ctx context.Context, owner *api.SPIAccessToken) error
- func (n NotifyingTokenStorage) Get(ctx context.Context, owner *api.SPIAccessToken) (*api.Token, error)
- func (n NotifyingTokenStorage) Store(ctx context.Context, owner *api.SPIAccessToken, token *api.Token) error
- type TestTokenStorage
- type TokenStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotifyingTokenStorage ¶ added in v0.3.0
type NotifyingTokenStorage struct { // Client is the kubernetes client to use to create the v1beta1.SPIAccessTokenDataUpdate objects. Client client.Client // TokenStorage is the token storage to delegate the actual storage operations to. TokenStorage TokenStorage }
NotifyingTokenStorage is a wrapper around TokenStorage that also automatically creates the v1beta1.SPIAccessTokenDataUpdate objects.
func (NotifyingTokenStorage) Delete ¶ added in v0.3.0
func (n NotifyingTokenStorage) Delete(ctx context.Context, owner *api.SPIAccessToken) error
func (NotifyingTokenStorage) Get ¶ added in v0.3.0
func (n NotifyingTokenStorage) Get(ctx context.Context, owner *api.SPIAccessToken) (*api.Token, error)
func (NotifyingTokenStorage) Store ¶ added in v0.3.0
func (n NotifyingTokenStorage) Store(ctx context.Context, owner *api.SPIAccessToken, token *api.Token) error
type TestTokenStorage ¶ added in v0.3.0
type TestTokenStorage struct { StoreImpl func(context.Context, *api.SPIAccessToken, *api.Token) error GetImpl func(ctx context.Context, token *api.SPIAccessToken) (*api.Token, error) DeleteImpl func(context.Context, *api.SPIAccessToken) error }
func (TestTokenStorage) Delete ¶ added in v0.3.0
func (t TestTokenStorage) Delete(ctx context.Context, owner *api.SPIAccessToken) error
func (TestTokenStorage) Get ¶ added in v0.3.0
func (t TestTokenStorage) Get(ctx context.Context, owner *api.SPIAccessToken) (*api.Token, error)
func (TestTokenStorage) Store ¶ added in v0.3.0
func (t TestTokenStorage) Store(ctx context.Context, owner *api.SPIAccessToken, token *api.Token) error
type TokenStorage ¶
type TokenStorage interface { Store(ctx context.Context, owner *api.SPIAccessToken, token *api.Token) error Get(ctx context.Context, owner *api.SPIAccessToken) (*api.Token, error) Delete(ctx context.Context, owner *api.SPIAccessToken) error }
TokenStorage is a simple interface on top of Kubernetes client to perform CRUD operations on the tokens. This is done so that we can provide either secret-based or Vault-based implementation.
func CreateTestVaultTokenStorage ¶ added in v0.3.0
func CreateTestVaultTokenStorage(t vtesting.T) (*vault.TestCluster, TokenStorage)
func NewSecretsStorage ¶ added in v0.3.0
func NewSecretsStorage(cl client.Client) (TokenStorage, error)
NewSecretsStorage creates a new `TokenStorage` instance using the provided Kubernetes client.
func NewVaultStorage ¶ added in v0.3.0
func NewVaultStorage(role string, vaultHost string, serviceAccountToken string) (TokenStorage, error)
NewVaultStorage creates a new `TokenStorage` instance using the provided Vault instance.
Click to show internal directories.
Click to hide internal directories.