Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultAuthRole = "k8svault-controller"
)
Variables ¶
View Source
var ( ErrVaultAddrNotFound = errors.New("Neither vault address nor a default vault address found") ErrFieldNotAvailable = errors.New("Source field to be mapped does not exist") ErrUnsupportedAuthType = errors.New("Unsupported vault authentication") ErrVaultConfig = errors.New("Failed to setup default vault configuration") ErrPathNotFound = errors.New("Vault path not found") )
Common errors
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthHandler ¶
type AuthHandler struct {
// contains filtered or unexported fields
}
AuthHandler is responsible for keeping a token alive and renewed and passing new tokens to the sink server
func NewAuthHandler ¶
func NewAuthHandler(opts AuthHandlerConfig) *AuthHandler
func (*AuthHandler) Authenticate ¶
func (ah *AuthHandler) Authenticate(ctx context.Context, am AuthMethod) error
type AuthHandlerConfig ¶
type AuthHandlerConfig struct { Writer Writer TokenWriter TokenWriter }
type AuthMethod ¶
type AuthMethod interface { // Authenticate returns a mount path, header, request body, and error. // The header may be nil if no special header is needed. Authenticate(context.Context) (string, http.Header, map[string]interface{}, error) }
AuthMethod is the interface that auto-auth methods implement for the agent to use.
func NewKubernetesAuthMethod ¶
func NewKubernetesAuthMethod(conf *AuthConfig) (AuthMethod, error)
NewKubernetesAuthMethod reads the user configuration and returns a configured AuthMethod
type AuthMethodRegistry ¶
type AuthMethodRegistry struct {
// contains filtered or unexported fields
}
func (*AuthMethodRegistry) Invoke ¶
func (r *AuthMethodRegistry) Invoke(name string, conf *v1beta1.VaultAuthSpec) (AuthMethod, error)
func (*AuthMethodRegistry) MustRegister ¶
func (r *AuthMethodRegistry) MustRegister(name string, init NewAuthMethod)
func (*AuthMethodRegistry) Register ¶
func (r *AuthMethodRegistry) Register(name string, init NewAuthMethod) error
type Mapper ¶
type Mapper interface { IsForceApply() bool GetPath() string GetFieldMapping() []v1beta1.FieldMapping }
Mapper retrieves mapping configuration
type NewAuthMethod ¶
type NewAuthMethod func(conf *v1beta1.VaultAuthSpec) (AuthMethod, error)
type ReadWriter ¶
type TokenWriter ¶
type TokenWriter interface {
SetToken(token string)
}
type VaultHandler ¶
type VaultHandler struct {
// contains filtered or unexported fields
}
VaultHandler
func NewHandler ¶
NewHandler creates a vault client handler If the config holds no vault address it will fallback to the env VAULT_ADDRESS
Click to show internal directories.
Click to hide internal directories.