vault

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 4 Imported by: 9

Documentation

Overview

Copyright (C) 2021-2023, Kubefirst

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

Index

Constants

View Source
const (

	// Name for the Secret that gets created that contains root auth data
	VaultSecretName string = "vault-unseal-secret"
	// Namespace that Vault runs in
	VaultNamespace string = "vault"
	// number of recovery shares for Vault unseal
	RecoveryShares int = 5
	// number of recovery keys for Vault
	RecoveryThreshold int = 3
	// number of secret shares for Vault unseal
	SecretShares = 5
	// number of secret threshold Vault unseal
	SecretThreshold = 3
)

Variables

This section is empty.

Functions

func NewVault

func NewVault() vaultapi.Config

Types

type HealthResponse

type HealthResponse struct {
	Initialized                bool   `json:"initialized"`
	Sealed                     bool   `json:"sealed"`
	Standby                    bool   `json:"standby"`
	PerformanceStandby         bool   `json:"performance_standby"`
	ReplicationPerformanceMode string `json:"replication_performance_mode"`
	ReplicationDRMode          string `json:"replication_dr_mode"`
	ServerTimeUTC              int    `json:"server_time_utc"`
	Version                    string `json:"version"`
	ClusterName                string `json:"cluster_name"`
	ClusterID                  string `json:"cluster_id"`
}

HealthResponse specifies the content of a health response from a vault API https://developer.hashicorp.com/vault/api-docs/system/health#sample-response

type InitRequest

type InitRequest struct {
	SecretShares    int `json:"secret_shares"`
	SecretThreshold int `json:"secret_threshold"`
}

InitRequest specifies the content of an `init` operation against a vault API https://developer.hashicorp.com/vault/api-docs/system/init#sample-payload

type InitResponse

type InitResponse struct {
	Keys       []string `json:"keys"`
	KeysBase64 []string `json:"keys_base64"`
	RootToken  string   `json:"root_token"`
}

InitResponse specifies the content of an `init` operation response from a vault API https://developer.hashicorp.com/vault/api-docs/system/init#sample-response-1

type RaftJoinRequest

type RaftJoinRequest struct {
	LeaderAPIAddress string `json:"leader_api_addr"`
}

type RaftJoinResponse

type RaftJoinResponse struct {
}

type UnsealRequest

type UnsealRequest struct {
	Key string `json:"key"`
}

UnsealRequest specifies the content of an `unseal` operation against a vault API https://developer.hashicorp.com/vault/api-docs/system/unseal#sample-payload

type UnsealResponse

type UnsealResponse struct {
	Sealed      bool   `json:"sealed"`
	T           int    `json:"t"`
	N           int    `json:"n"`
	Progress    int    `json:"progress"`
	Version     string `json:"version"`
	ClusterName string `json:"cluster_name"`
	ClusterID   string `json:"cluster_id"`
}

UnsealResponse specifies the content of an `unseal` operation response from a vault API t holds the threshold and n holds the number of shares https://developer.hashicorp.com/vault/api-docs/system/unseal#sample-response

type VaultConfiguration

type VaultConfiguration struct {
	Config vaultapi.Config
}

func (*VaultConfiguration) AutoUnseal

func (conf *VaultConfiguration) AutoUnseal() (*vaultapi.InitResponse, error)

func (*VaultConfiguration) GetUserPassword

func (conf *VaultConfiguration) GetUserPassword(endpoint string, token string, username string, key string) (string, error)

GetUserPassword retrieves the password for a Vault user at the users mount path

type VaultUnsealOptions

type VaultUnsealOptions struct {
	HighAvailability     bool
	HighAvailabilityType string
	Nodes                int
	RaftLeader           bool
	RaftFollower         bool
	UseAPI               bool
	VaultAPIAddress      string
}

Jump to

Keyboard shortcuts

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