vault

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Token renewal period is its TTL multiplied by this ratio
	AutoRenewPeriodRatio = 0.5
	TokenRetryPeriod     = 5 * time.Second

	TokenHeader   = "X-Vault-Token"
	WrapTTLHeader = "X-Vault-Wrap-Ttl"

	TokenCreateURL    = "/v1/auth/token/create"
	SelfTokenURL      = "/v1/auth/token/lookup-self"
	SelfTokenRenewURL = "/v1/auth/token/renew-self"

	SysHealthURL = "/v1/sys/health"

	AuthAppRoleURL  = "/v1/sys/auth/approle"
	AppRoleLoginURL = "/v1/auth/approle/login"
	AppRoleURL      = "/v1/auth/approle/role"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address  string `json:"address,omitempty"`
	RoleID   string `json:"role_id,omitempty"`
	SecretID string `json:"secret_id,omitempty"`
	Token    string `json:"token,omitempty"`
}

type RequestOptions

type RequestOptions struct {
	WrapTTL string

	Data map[string]interface{}
}

type Vault

type Vault interface {
	Login() error
	Request(method, urlPath string, options *RequestOptions) (*api.Secret, *api.Response, error)
	UnwrapSecretID(token string) error
	GetToken() string
}

func New

func New(c Config) Vault

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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