Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is the gateway into the auth functionality provided by Vault.
See https://www.vaultproject.io/api-docs/auth for more information.
func (*Client) Automatic ¶
Automatic handles login and renewal automatically for you in the background using the configured auth method.
Tokens are renewed 5 seconds before expiration if eligible. If a lease is less than 5 seconds long, the token will be replaced instead of attempting renewal.
All login and renewal events and any associated errors are sent to the returned events channel. This channel haas a buffer of 1 to help the event receiver keep up with the events. If the channel is ignored or events are not received quickly enough, events will be dropped and not sent to the channel to avoid impeding the authentication process.
In the event that the context is canceled, login and renewals will be halted and the events channel will be closed.
func (*Client) GetToken ¶
GetToken returns the internal Vault auth token that the client uses to communicate with Vault.
func (*Client) Login ¶
Login authenticates against Vault using the configured auth method and sets the internal auth token that the client uses to communicate with Vault.
func (*Client) RenewSelf ¶
RenewSelf initiates a token renewal request for the internal Vault auth token that the client uses to communicate with Vault.
See https://www.vaultproject.io/api/auth/token#renew-a-token-self for more information.
type Event ¶
type Event struct {
// Type indicates the type of the authentication event, either "login" or "renew".
Type string
// Err indicates when there was a problem authenticating with Vault.
Err error
}
Event is used to communicate authentication happenings.
type Method ¶
Method represents a way of authenticating against Vault using one of the officially supported techniques.
For more information, see https://www.vaultproject.io/docs/auth
type Token ¶
type Token struct {
// Value is a string representation of the token, used when interacting with the Vault Client.
Value string
// Expiration indicates when the token expires and must be renewed or regenerated.
Expiration time.Duration
// Renewable indicates whether the token can be renewed or must be regenerated.
Renewable bool
}
Token represents a Vault authentication token.
This is used throughout vaultx to authenticate with Vault.
type TokenManager ¶
type TokenManager interface {
// SetToken sets the Vault auth token.
SetToken(token Token)
// GetToken returns the Vault auth token.
GetToken() Token
}
TokenManager manages Vault auth tokens.