vault

package
v0.10.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserAgentRequestCallback added in v0.10.0

func UserAgentRequestCallback(agentFunc func(request *api.Request) string) api.RequestCallback

UserAgentRequestCallback takes a function that returns a user agent string and will invoke that function to set the user agent string on the request.

Types

type Client

type Client struct {
	Name    string
	Version string

	VaultClient *api.Client
	VaultConfig *api.Config
	// contains filtered or unexported fields
}

Client holds api.Client and handles state required to renew tokens and re-auth as required.

func NewClient

func NewClient(name, version string, logger hclog.Logger, vaultConfig *api.Config, authConfig config.AuthConfig, awsSes *session.Session) (*Client, error)

NewClient uses the AWS IAM auth method configured in a Vault cluster to authenticate the execution role and create a Vault API client.

func (*Client) Token

func (c *Client) Token(ctx context.Context) (string, error)

Token synchronously renews/re-auths as required and returns a Vault token.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL