Documentation
¶
Index ¶
- Constants
- func ConsulGet(key string) ([]byte, error)
- func Decode(obj any, secretFetcher SecretFetcher, encDecoder SecretFetcher) (any, error)
- func Decrypt(v any) (any, error)
- func DecryptInplace(v any) error
- func FileExists(file string) (bool, error)
- func Md5Hex(data []byte) string
- func NewAppRoleVaultClient(addr string, roleId string, secretId string) (*vault.Client, error)
- func NewEnvAppRoleVaultClient() (*vault.Client, error)
- type EncDecoder
- type LazyVaultSecretFetcher
- type SecretFetcher
- type VaultConf
- type VaultSecretFetcher
Constants ¶
View Source
const ( EnvConsulAddr = "CONSUL_ADDR" EnvConsulToken = "CONSUL_TOKEN" )
View Source
const ( EnvVaultAddr = "VAULT_ADDR" EnvVaultRoleId = "VAULT_ROLE_ID" EnvVaultSecretId = "VAULT_SECRET_ID" EnvVaultTmpDir = "VAULT_TMP_DIR" )
View Source
const (
EnvConfigKey = "CONFIG_KEY"
)
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
func Decode(obj any, secretFetcher SecretFetcher, encDecoder SecretFetcher) (any, error)
Decode decrypts the encrypted string fields start with `ENC~` in fields tree of obj and returns the decrypted obj.
func DecryptInplace ¶ added in v0.3.0
func FileExists ¶
func NewAppRoleVaultClient ¶
func NewEnvAppRoleVaultClient ¶
func NewEnvAppRoleVaultClient() (*vault.Client, error)
Types ¶
type EncDecoder ¶
type EncDecoder struct {
// contains filtered or unexported fields
}
func NewDefaultEncDecoder ¶
func NewDefaultEncDecoder() *EncDecoder
func NewEncDecoder ¶
func NewEncDecoder(key string) *EncDecoder
type LazyVaultSecretFetcher ¶
type LazyVaultSecretFetcher struct {
// contains filtered or unexported fields
}
func NewLazyVaultSecretFetcher ¶
func NewLazyVaultSecretFetcher() *LazyVaultSecretFetcher
type SecretFetcher ¶
type VaultSecretFetcher ¶
type VaultSecretFetcher struct {
// contains filtered or unexported fields
}
func NewVaultSecretFetcher ¶
func NewVaultSecretFetcher(client *vault.Client) *VaultSecretFetcher
func (*VaultSecretFetcher) Close ¶
func (f *VaultSecretFetcher) Close() error
Click to show internal directories.
Click to hide internal directories.