secrets

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 13 Imported by: 0

README

Secrets Management

TODO

Documentation

Overview

Package secrets provides a set of utilities for working with secrets in Go.

Index

Constants

View Source
const (
	CredType   = "CredType"
	TextSecret = "TextSecret"
)
View Source
const (
	LocalStoreProvider = "localStore"
)

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(encrypted, key []byte) (message []byte, err error)

func AesDecryptStr

func AesDecryptStr(encrypted, key string) (message string, err error)

func AesEncrypt

func AesEncrypt(key, message []byte) (encrypted []byte, err error)

func AesEncryptStr

func AesEncryptStr(key, message string) (encrypted string, err error)

Types

type Credential

type Credential struct {
	Value       []byte
	LastUpdated time.Time
	Version     string
	MetaData    map[string]interface{}
}

func (*Credential) Str

func (c *Credential) Str() (s string)

Str function gets the Credential.Value field as string

func (*Credential) Type

func (c *Credential) Type() (s string)

Type Returns the type of the credential

type Manager

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

func GetManager

func GetManager() *Manager

func (*Manager) Register

func (m *Manager) Register(store Store)

func (*Manager) Store

func (m *Manager) Store(name string) (store Store)

type Store

type Store interface {
	Get(key string, ctx context.Context) (*Credential, error)
	Write(key string, credential *Credential, ctx context.Context) error
	Provider() string
}

func NewLocalStore

func NewLocalStore(storeFile, masterKey string) (s Store, err error)

Jump to

Keyboard shortcuts

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