vaultonic

package module
v0.0.0-...-ea95de6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 8 Imported by: 0

README

Vaultonic

Build Status

Gin middleware to provide some integrations with Hashicorp Vault.

Why?

The idea is to simplify tasks like: Secret Store, App Configuration, Data Encryption, etc.

Installation

$ go get github.com/wallacepf/vaultonic

Usage

TBC

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VaultMiddleware

func VaultMiddleware(parameters VaultParams) gin.HandlerFunc

Types

type AppRoleWriteCustomSecretIdResponse

type AppRoleWriteCustomSecretIdResponse struct {
	SecretId         string `json:"secret_id,omitempty"`
	SecretIdAccessor string `json:"secret_id_accessor,omitempty"`
	SecretIdNumUses  int32  `json:"secret_id_num_uses,omitempty"`
	SecretIdTtl      int32  `json:"secret_id_ttl,omitempty"`
}

type Vault

type Vault struct {
	// contains filtered or unexported fields
}

func VaultClient

func VaultClient(params VaultParams) (*Vault, *vault.Secret, error)

func (*Vault) Encrypt

func (v *Vault) Encrypt(ctx context.Context, data []byte) (map[string]interface{}, error)

func (*Vault) Kvget

func (v *Vault) Kvget(ctx context.Context, secret string) (map[string]interface{}, error)

func (*Vault) Kvput

func (v *Vault) Kvput(ctx context.Context, secret string, k string, vl string) (*vault.KVSecret, error)

type VaultParams

type VaultParams struct {
	Address              string
	ApproleRoleID        string
	ApproleWrappedSecret string
	KeyName              string
	KvPath               string
	SecretPath           string
}

Jump to

Keyboard shortcuts

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