hashicorp

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VaultAddrViperKey = "vault.addr"
)
View Source
const (
	VaultAuthGithubTokenViperKey = "vault.auth.github-token"
)
View Source
const (
	VaultTokenViperKey = "vault.token"
)

Variables

This section is empty.

Functions

func Flags added in v0.3.1

func Flags(v *viper.Viper, f *pflag.FlagSet)

func VaultAddress

func VaultAddress(v *viper.Viper, f *pflag.FlagSet)

func VaultAuthGitHubToken

func VaultAuthGitHubToken(v *viper.Viper, f *pflag.FlagSet)

func VaultMount

func VaultMount(v *viper.Viper, f *pflag.FlagSet)

func VaultToken

func VaultToken(v *viper.Viper, f *pflag.FlagSet)

Types

type AuthConfig

type AuthConfig struct {
	Token       string
	GitHubToken string
}

type ClientConfig

type ClientConfig struct {
	Address string
	Path    string

	AgentAddress string

	Auth *AuthConfig

	HTTP *kilnhttp.ClientConfig

	MinRetryWait *kilntypes.Duration
	MaxRetryWait *kilntypes.Duration
	MaxRetries   *int

	RateLimit *RateLimitConfig
}

ClientConfig object that be converted into an api.Config later

func ClientConfigFromViper added in v0.3.1

func ClientConfigFromViper(v *viper.Viper) *ClientConfig

func (*ClientConfig) SetDefault

func (cfg *ClientConfig) SetDefault() *ClientConfig

func (*ClientConfig) ToHashicorpConfig

func (cfg *ClientConfig) ToHashicorpConfig() (*api.Config, error)

type KVv2Client

type KVv2Client struct {
	*api.Client
	// contains filtered or unexported fields
}

func NewKVv2Client

func NewKVv2Client(cfg *ClientConfig) (*KVv2Client, error)

func (*KVv2Client) Delete

func (c *KVv2Client) Delete(ctx context.Context, id string) error

func (*KVv2Client) Get

func (c *KVv2Client) Get(ctx context.Context, pth, version string) (secret *api.Secret, data, metadata map[string]interface{}, err error)

func (*KVv2Client) GithubLogin

func (c *KVv2Client) GithubLogin(ctx context.Context) (*api.SecretAuth, error)

func (*KVv2Client) HealthCheck

func (c *KVv2Client) HealthCheck(ctx context.Context) error

func (*KVv2Client) Init

func (c *KVv2Client) Init(ctx context.Context) error

func (*KVv2Client) IsKVv2

func (c *KVv2Client) IsKVv2(ctx context.Context, pth string) (mount string, isKVv2 bool, err error)

func (*KVv2Client) List

func (c *KVv2Client) List(ctx context.Context, pth string) ([]string, error)

func (*KVv2Client) Logger

func (c *KVv2Client) Logger() logrus.FieldLogger

func (*KVv2Client) LookupToken

func (c *KVv2Client) LookupToken(ctx context.Context, token string) (*api.Secret, error)

func (*KVv2Client) Put

func (c *KVv2Client) Put(ctx context.Context, id string, data map[string]interface{}) (*api.Secret, error)

func (*KVv2Client) SetLogger

func (c *KVv2Client) SetLogger(logger logrus.FieldLogger)

func (*KVv2Client) SetToken

func (c *KVv2Client) SetToken(token string)

func (*KVv2Client) UnwrapToken

func (c *KVv2Client) UnwrapToken(ctx context.Context, token string) (*api.Secret, error)

type RateLimitConfig

type RateLimitConfig struct {
	Rate  float64
	Burst int
}

Jump to

Keyboard shortcuts

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