credentials

package
v0.3.12 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 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 CollectEnvKeys added in v0.3.11

func CollectEnvKeys(v any, out map[string]struct{})

CollectEnvKeys walks JSON-decoded values and records env: variable names.

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 ManifestFromAPIIndex added in v0.3.11

func ManifestFromAPIIndex(data []byte) (map[string]map[string]struct{}, error)

ManifestFromAPIIndex maps each apis key (scope) to allowed env keys.

func ManifestFromMCPFile added in v0.3.11

func ManifestFromMCPFile(data []byte) (map[string]map[string]struct{}, error)

ManifestFromMCPFile maps each mcpServers key to allowed env keys under scope mcp.<name>.

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 MergeManifests added in v0.3.11

func MergeManifests(parts ...map[string]map[string]struct{}) map[string]map[string]struct{}

MergeManifests unions scope maps; later maps overwrite key sets for the same scope.

func ParseSecretsMasterKey added in v0.3.4

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

ParseSecretsMasterKey derives a 32-byte AES key via SHA-256(passphrase).

func ScopedStorageKey added in v0.3.12

func ScopedStorageKey(scope, storageKey string) string

ScopedStorageKey names an integration secret entry in secrets.enc.json or dotenv.

func SecretFromContext

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

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

func ValidateIntegrationScope added in v0.3.12

func ValidateIntegrationScope(scope string) error

ValidateIntegrationScope reports whether scope is a non-empty mcp.* or openapi.* credential scope.

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