Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ValidateKey ¶
ValidateKey verifies if the input secret's key is valid, returning an error if invalid
func ValidateValue ¶
ValidateValue verifies if the input secret's value is valid, returning an error if invalid
Types ¶
type Repository ¶
type Repository interface { // Create will create (or overwrite) the secret identified by `s.Key`, for user `username`, // returning its ID and an error Create(ctx context.Context, username string, s *Secret) (uint64, error) // Get fetches a secret identified by `key` for user `username`. Returns a secret and an error Get(ctx context.Context, username string, key string) (*Secret, error) // List returns all secrets belonging to user `username`, and an error List(ctx context.Context, username string) ([]*Secret, error) // Delete removes the secret identified by `key`, for user `username`. Returns an error Delete(ctx context.Context, username string, key string) error }
Repository describes the actions exposed by the secrets store
func WithTrace ¶
func WithTrace(r Repository) Repository
type Secret ¶
type Secret struct { ID uint64 `json:"id"` Key string `json:"key"` Value string `json:"value"` CreatedAt time.Time `json:"created_at"` }
Secret is a key-value pair where they Key is string type and Value is a slice of bytes. Secrets are encrypted then stored with a user-scoped private key
Click to show internal directories.
Click to hide internal directories.