secrets

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package secrets is the secrets delivery resolver (ADR-0022): it reads a function's bound Secret resources (auto-decrypted by the store's at-rest encryptor) and returns their data as an env-var map for worker injection — PDP-authorized (the secrets PEP). The actual env/tmpfs injection into the running worker is a P-M-successor's job; this is the delivery contract. The at-rest encryptor lives in internal/secrets/aesgcm.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsReservedKey

func IsReservedKey(k string) bool

IsReservedKey reports whether an env key is reserved by the runtime shim contract (FUNCD_ARTIFACT/HANDLER/PORT/POOL_MANIFEST/PORTFILE, …): a FUNCD_-prefixed key may never be shadowed by resolved Secret/ConfigMap Data (ADR-0057, reserved-env-not-overridable). A prefix guard (not an explicit set) keeps every current and future reserved key protected. This is the single definition — the internal/function + internal/services/catalog copies are deleted (ADR-0092).

func MergeEnvGuarded

func MergeEnvGuarded(dst, src map[string]string, log *slog.Logger)

MergeEnvGuarded merges src into dst, dropping (and logging via log, if non-nil) any key that IsReservedKey. It is the one guarded-merge reused by the Function reconciler, the CatalogService controller, and provider.ResolveEnv (ADR-0092). A nil log is tolerated (the drop is silent). It mutates only dst.

Types

type Deps

type Deps struct {
	Store      store.Store
	Authorizer auth.Authorizer
	Logger     *slog.Logger
}

Deps configures the secrets resolver (internal component, ADR-0002 §1).

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver reads decrypted Secrets and produces the env map the worker injects.

func NewResolver

func NewResolver(d Deps) (*Resolver, error)

NewResolver builds the secrets resolver. Store + Authorizer are required.

func (*Resolver) ResolveEnv

func (r *Resolver) ResolveEnv(ctx context.Context, id auth.Identity, ns v1.NamespaceName, names []string) (map[string]string, error)

ResolveEnv reads the named Secrets in ns (store-decrypted), PDP-authorized (read), and returns their merged Data as an env-var map for worker injection.

Directories

Path Synopsis
Package aesgcm is the V1 at-rest secrets encryptor (ADR-0022): an AES-256-GCM store.Encryptor that fills the ADR-0006 seam.
Package aesgcm is the V1 at-rest secrets encryptor (ADR-0022): an AES-256-GCM store.Encryptor that fills the ADR-0006 seam.

Jump to

Keyboard shortcuts

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