credentials

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SecretsMasterKeyEnv = "AGENTKIT_SECRETS_KEY"

SecretsMasterKeyEnv is the environment / credentials.config.env key for the AES-256 key used to encrypt secrets.enc.json. It is not subject to Prefix.

Variables

This section is empty.

Functions

func DecryptSecretsFile added in v0.3.4

func DecryptSecretsFile(data []byte, key []byte) (map[string]string, error)

DecryptSecretsFile parses and decrypts all entries in data.

func EncryptSecretsFile added in v0.3.4

func EncryptSecretsFile(entries map[string]string, key []byte) ([]byte, error)

EncryptSecretsFile serializes entries to encrypted JSON.

func EnvKey

func EnvKey(ref string) string

EnvKey normalizes refs like "env:OPENAI_API_KEY" to "OPENAI_API_KEY".

func MergeEncryptedSecretsFile added in v0.3.4

func MergeEncryptedSecretsFile(existing []byte, key []byte, updates map[string]string) ([]byte, error)

MergeEncryptedSecretsFile decrypts existing (if any), applies updates, and re-encrypts.

func ParseSecretsMasterKey added in v0.3.4

func ParseSecretsMasterKey(raw string) ([]byte, error)

ParseSecretsMasterKey decodes a 32-byte key from base64 (preferred) or hex.

func SecretFromContext

func SecretFromContext(ctx context.Context, ref string) (capscredentials.Secret, bool)

SecretFromContext returns a secret when ctx carries an override for ref.

func WithSecrets

func WithSecrets(ctx context.Context, secrets map[string]string) context.Context

WithSecrets returns a ctx whose refs resolve from secrets before a Store's default backend (for example environment variables).

Types

This section is empty.

Jump to

Keyboard shortcuts

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