secrets

package
v0.0.0-...-e3fd340 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8sRESTConfigFactory

type K8sRESTConfigFactory struct {
	// contains filtered or unexported fields
}

K8sRESTConfigFactory is an implementation of the RESTConfigFactory interface that doles out configs based on a base one.

func NewRESTConfigFactory

func NewRESTConfigFactory(cfg *rest.Config, insecure bool) *K8sRESTConfigFactory

NewRestConfigFactory creates and returns a RESTConfigFactory with a known config.

func (*K8sRESTConfigFactory) Create

func (r *K8sRESTConfigFactory) Create(token string) (*rest.Config, error)

Create implements the RESTConfigFactory interface.

type KubeSecretGetter

type KubeSecretGetter struct {
	// contains filtered or unexported fields
}

KubeSecretGetter is an implementation of SecretGetter.

func New

New creates and returns a KubeSecretGetter that looks up secrets in k8s.

func NewFromConfig

func NewFromConfig(cfg *rest.Config, insecure bool) *KubeSecretGetter

NewFromConfig creates a secret getter from a rest.Config.

func (KubeSecretGetter) SecretToken

func (k KubeSecretGetter) SecretToken(ctx context.Context, authToken string, id types.NamespacedName, key string) (string, error)

SecretToken looks for a namespaced secret, and returns the 'token' key from it, or an error if not found.

type MockSecret

type MockSecret struct {
	// contains filtered or unexported fields
}

MockSecret implements the SecretGetter interface.

func NewMock

func NewMock() MockSecret

NewMock returns a simple secret getter.

func (MockSecret) AddStubResponse

func (k MockSecret) AddStubResponse(authToken string, secretID types.NamespacedName, token, key string)

AddStubResponse is a mock method that sets up a token to be returned.

func (MockSecret) SecretToken

func (k MockSecret) SecretToken(ctx context.Context, authToken string, secretID types.NamespacedName, key string) (string, error)

Secret implements the SecretGetter interface.

type RESTConfigFactory

type RESTConfigFactory interface {
	Create(token string) (*rest.Config, error)
}

RESTConfigFactory creates and returns new Kubernetes client configurations for accessing the API.

type SecretGetter

type SecretGetter interface {
	SecretToken(ctx context.Context, authToken string, id types.NamespacedName, key string) (string, error)
}

SecretGetter takes a namespaced name and finds a secret with that name, or returns an error.

Jump to

Keyboard shortcuts

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