Documentation ¶
Index ¶
- type Client
- func (v *Client) GenerateNewAppRoleSecret(secretID, appRoleName string) (string, error)
- func (v *Client) GetAppRoleName() (string, error)
- func (v *Client) GetAppRoleSecretIDTtl(secretID, roleName string) (time.Duration, error)
- func (v Client) GetKvSecret(path string) (map[string]string, error)
- func (v Client) GetOIDCTokenByValidation(roleID string) (string, error)
- func (v Client) GetSecret(path string) (*api.Secret, error)
- func (v Client) MustRevokeToken()
- func (v Client) RevokeToken() error
- func (v *Client) SetAppRoleMountPoint(appRoleMountpoint string)
- func (v Client) WriteKvSecret(path string, newSecret map[string]string) error
- type Config
- type JwtPayload
- type VaultCredentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles communication with Vault
func NewClientWithAppRole ¶ added in v1.85.0
NewClientWithAppRole instantiates a new client and obtains a token via the AppRole auth method
func (*Client) GenerateNewAppRoleSecret ¶ added in v1.108.0
GenerateNewAppRoleSecret creates a new secret-id
func (*Client) GetAppRoleName ¶ added in v1.108.0
GetAppRoleName returns the AppRole role name which was used to authenticate. Returns "" when AppRole authentication wasn't used
func (*Client) GetAppRoleSecretIDTtl ¶ added in v1.108.0
GetAppRoleSecretIDTtl returns the remaining time until the given secret-id expires
func (Client) GetKvSecret ¶
GetKvSecret reads secret from the KV engine. It Automatically transforms the logical path to the HTTP API Path for the corresponding KV Engine version
func (Client) GetOIDCTokenByValidation ¶ added in v1.361.0
GetOIDCTokenByValidation returns the token if token is expired then get a new token else return old token
func (Client) MustRevokeToken ¶ added in v1.130.0
func (v Client) MustRevokeToken()
MustRevokeToken same as RevokeToken but the programm is terminated with an error if this fails. Should be used in defer statements only.
func (Client) RevokeToken ¶ added in v1.130.0
RevokeToken revokes the token which is currently used. The client can't be used anymore after this function was called.
func (*Client) SetAppRoleMountPoint ¶ added in v1.108.0
SetAppRoleMountPoint sets the path under which the approle auth backend is mounted
type JwtPayload ¶ added in v1.361.0
type JwtPayload struct {
Expire int64 `json:"exp"`
}