Documentation
¶
Index ¶
Constants ¶
const ( // TokenAuthMethodName is the name of the token-based auth method. TokenAuthMethodName = "token" // JWTAuthMethodName is the name of the JWT Auth Method. JWTAuthMethodName = "jwt" )
Variables ¶
var ErrNoAuthInfo = errors.New("no auth info returned")
ErrNoAuthInfo is an error, which is returned when a successful authentication to an Auth Method endpoint was performed, but no auth info was returned as part of the response.
var ErrNoAuthMethod = errors.New("no auth method implementation configured")
ErrNoAuthMethod is an error, which is returned when attempting to login using an Auth Method, but no Auth Method implementation was configured.
var ErrUnknownAuthMethod = errors.New("empty or unknown auth method specified")
ErrUnknownAuthMethod is an error, which is returned when creating a new Client using an unknown auth method. It is returned by NewFromConfig, which creates new Client based on provided config.VaultServerConfig settings.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a wrapper around vault.Client with additional funtionality such as renewing authentication tokens.
func NewFromConfig ¶
func NewFromConfig(conf *config.VaultEndpointConfig) (*Client, error)
NewFromConfig creates a new Client based on the provided config.VaultServerConfig settings.
func (*Client) ManageAuthTokenLifetime ¶
ManageAuthTokenLifetime starts managing the auth token lifetime.
It uses a periodic ticker, which will renew the auth token, if it is renewable. When the token is not renewable (e.g. batch tokens) a complete re-authentication will be done instead when ~ 80% of the token lifetime is reached.