Documentation ¶
Index ¶
- Constants
- type AuthMethod
- type Client
- func (c *Client) AddHooks(_ context.Context, hooks ...Hook)
- func (c *Client) Authenticate() error
- func (c *Client) AutoRenewToken(ctx context.Context)
- func (c *Client) Clone(opts ...Options) (*Client, error)
- func (c *Client) Close() error
- func (c *Client) Logical(ctx context.Context) *Logical
- func (c *Client) Sys(ctx context.Context) *Sys
- func (c *Client) TokenRenewer() (*api.Renewer, error)
- type ClientAuthentication
- type ClientConfig
- type ConnectionProperties
- type Hook
- type KeyOption
- type KeyOptions
- type KubernetesClient
- type KubernetesConfig
- type Logical
- func (l *Logical) Post(path string, data interface{}) (ret *api.Secret, err error)
- func (l *Logical) Read(path string) (ret *api.Secret, err error)
- func (l *Logical) ReadWithData(path string, data map[string][]string) (ret *api.Secret, err error)
- func (l *Logical) WithContext(ctx context.Context) *Logical
- func (l *Logical) Write(path string, data interface{}) (ret *api.Secret, err error)
- func (l *Logical) WriteWithMethod(method, path string, data interface{}) (ret *api.Secret, err error)
- type Options
- type SSLProperties
- type Sys
- type TokenClientAuthentication
- type TokenRefresher
- type TransitEngine
Constants ¶
const ( Token = AuthMethod("token") Kubernetes = AuthMethod("kubernetes") )
const (
PropertyPrefix = "cloud.vault"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthMethod ¶
type AuthMethod string
func (*AuthMethod) UnmarshalText ¶
func (a *AuthMethod) UnmarshalText(data []byte) error
UnmarshalText encoding.TextUnmarshaler
type Client ¶
func (*Client) Authenticate ¶
func (*Client) AutoRenewToken ¶
AutoRenewToken start a TokenRefresher to automatically manage and renew vault token
type ClientAuthentication ¶
ClientAuthentication interface represents a vault auth method https://www.vaultproject.io/docs/auth
type ClientConfig ¶
type ClientConfig struct { // Config raw config of vault driver *api.Config // Properties from bootstrap.BootstrapConfig. Typically set via WithProperties() Properties ConnectionProperties // ClientAuth used by the client and internal token refresher to authenticate with Vault server ClientAuth ClientAuthentication // Hooks instrumentation points Hooks []Hook }
type ConnectionProperties ¶
type ConnectionProperties struct { Host string `json:"host"` Port int `json:"port"` Scheme string `json:"scheme"` Authentication AuthMethod `json:"authentication"` SSL SSLProperties `json:"ssl"` Kubernetes KubernetesConfig `json:"kubernetes"` Token string `json:"token"` }
func (ConnectionProperties) Address ¶
func (p ConnectionProperties) Address() string
type KeyOptions ¶
type KeyOptions func(opt *KeyOption)
type KubernetesClient ¶
type KubernetesClient struct {
// contains filtered or unexported fields
}
func TokenKubernetesAuthentication ¶
func TokenKubernetesAuthentication(kubernetesConfig KubernetesConfig) *KubernetesClient
type KubernetesConfig ¶
type Logical ¶
func (*Logical) ReadWithData ¶
ReadWithData override api.Logical with proper hooks Note: data is sent as HTTP parameters
func (*Logical) WithContext ¶
WithContext make a copy of current Logical with a new context
type Options ¶
type Options func(cfg *ClientConfig) error
func WithProperties ¶
func WithProperties(p ConnectionProperties) Options
type SSLProperties ¶
type TokenClientAuthentication ¶
type TokenClientAuthentication string
type TokenRefresher ¶
type TokenRefresher struct {
// contains filtered or unexported fields
}
TokenRefresher performs renewal & refreshment of a client's token renewal can occur when a token's ttl is completed, refresh occurs when a token cannot be renewed (e.g max TTL is reached)
func NewTokenRefresher ¶
func NewTokenRefresher(client *Client) *TokenRefresher
func (*TokenRefresher) Start ¶
func (r *TokenRefresher) Start(ctx context.Context)
Start will begin the processes of token renewal & refreshing
func (*TokenRefresher) Stop ¶
func (r *TokenRefresher) Stop()
Stop will stop the token renewal/refreshing processes
type TransitEngine ¶
type TransitEngine interface { PrepareKey(ctx context.Context, kid string) error Encrypt(ctx context.Context, kid string, plaintext []byte) ([]byte, error) Decrypt(ctx context.Context, kid string, cipher []byte) ([]byte, error) }
func NewTransitEngine ¶
func NewTransitEngine(client *Client, opts ...KeyOptions) TransitEngine