secrets

package
v6.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SecretNameKey is a label on the openstorage.Volume object
	// which corresponds to the name of the secret which holds the
	// token information. Used for all secret providers
	SecretNameKey = "openstorage.io/auth-secret-name"

	// SecretNamespaceKey is a label on the openstorage.Volume object
	// which corresponds to the namespeace of the secret which holds the
	// token information. Used for all secret providers
	SecretNamespaceKey = "openstorage.io/auth-secret-namespace"

	// SecretTokenKey corresponds to the key at which the auth token is stored
	// in the secret. Used when secrets endpoint is kubernetes secrets
	SecretTokenKey = "auth-token"
)

Variables

View Source
var (
	// ErrSecretsNotInitialized is returned when the auth secret provider is not initialized
	ErrSecretsNotInitialized = errors.New("auth token secret instance not initialized")
	// ErrAuthTokenNotFound is returned when the auth token was not found in the secret
	ErrAuthTokenNotFound = errors.New("auth token was not found in the configured secret")
)

Functions

This section is empty.

Types

type Auth

type Auth interface {
	// GetToken returns the auth token obtained from the secret with
	// secretName with the provided secretContext from the configured secretContext
	GetToken(secretName string, secretContext string) (string, error)
	// Type returns the type of AuthTokenProvider
	Type() AuthTokenProviders
}

Auth interface provides helper routines to fetch authorization tokens from a secrets store

func NewAuth

func NewAuth(
	authProviderType AuthTokenProviders,
	s osecrets.Secrets,
) (Auth, error)

NewAuth returns a new instance of Auth implementation

type AuthTokenProviders

type AuthTokenProviders int

AuthTokenProviders is an enum indicating the type of secret store that is storing the auth token

const (
	TypeNone AuthTokenProviders = iota
	TypeK8s
	TypeDCOS
)

Jump to

Keyboard shortcuts

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