credentials

package
v0.0.0-...-77c6198 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveRepoKey

func DeriveRepoKey(masterKey, repoUUID string) (string, error)

DeriveRepoKey (K_r) Deriva uma chave única para o repositório baseada na Master Key (do Config) e no UUID do Persistence. K_r = HKDF(hash=SHA256, secret=MasterKey, salt=nil, info="repo:"+RepoUUID)

func DeriveRepoKeys

func DeriveRepoKeys(masterKey string, rk KeyDerivationParams) (string, error)

func ValidateHMAC

func ValidateHMAC[T hmac.Signable](ctx context.Context, secret string, req T) (bool, error)

Types

type KeyDerivationOptions

type KeyDerivationOptions func(*KeyDerivationParams)

func WithExtra

func WithExtra(extra string) KeyDerivationOptions

func WithNameSpace

func WithNameSpace(ns KeyNamespace) KeyDerivationOptions

type KeyDerivationParams

type KeyDerivationParams struct {
	RepoID  string
	NS      KeyNamespace
	Version int
	Extra   string
}

func FindContextParams

func FindContextParams(ctx context.Context, persistence ports.Persistence, managedRepoIdentifier string, opts ...KeyDerivationOptions) (*KeyDerivationParams, error)

func NewDerivationParams

func NewDerivationParams(metadata *model.RepositoryMetadata, opts ...KeyDerivationOptions) *KeyDerivationParams

func (KeyDerivationParams) Info

func (k KeyDerivationParams) Info() string

func (KeyDerivationParams) Salt

func (k KeyDerivationParams) Salt() []byte

func (KeyDerivationParams) Valid

func (k KeyDerivationParams) Valid() bool

type KeyNamespace

type KeyNamespace string
const (
	Global  KeyNamespace = "repo"
	NSPlan  KeyNamespace = "plan"
	NSApply KeyNamespace = "apply"
)

Jump to

Keyboard shortcuts

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