Documentation
¶
Index ¶
- func DeriveRepoKey(masterKey, repoUUID string) (string, error)
- func DeriveRepoKeys(masterKey string, rk KeyDerivationParams) (string, error)
- func ValidateHMAC[T hmac.Signable](ctx context.Context, secret string, req T) (bool, error)
- type KeyDerivationOptions
- type KeyDerivationParams
- type KeyNamespace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeriveRepoKey ¶
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)
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" )
Click to show internal directories.
Click to hide internal directories.