escrow

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package escrow holds the restore key rules over the operator's escrow set (ADR-0204 Decisions 4, 5): the secrets key and the master secret a generation names, matched by content fingerprint, and the credentials a new master changes. funcd never writes the escrow set.

Index

Constants

View Source
const SecretsDir, MasterDir = "secrets", "master"

The escrow set's key directories (Decision 4).

Variables

This section is empty.

Functions

func CheckSecretsKey

func CheckSecretsKey(m backup.Manifest, configured []byte, dir string) error

CheckSecretsKey requires the restore's secrets key to have the fingerprint m names, or both to be absent; else fault.Invalid naming that fingerprint and the escrow file matching it, if any. nil configured ⇒ no key.

func Find

func Find(dir, sub, fp string) (string, error)

Find returns the file under dir/sub whose envelope.Fingerprint is fp; none ⇒ fault.NotFound naming fp, the fingerprints found and every symlink that does not resolve. Symlinked files and directories count as regular ones. The bytes are fingerprinted as they are, so an escrow copy must be byte-exact.

Types

type Derived

type Derived struct {
	Kind            v1.Kind
	Namespace, Name string
	Credential      string
}

Derived is one credential a new master secret changes: Credential is "s3-keypair" or "catalog-token".

func ListChanged

func ListChanged(ctx context.Context, plan MasterPlan, st store.Store) ([]Derived, error)

ListChanged reads the loaded store for every credential derived from the master (Decision 5): a Function's spec.blob keypair (addS3Env) and spec.catalogs token (resolveCatalogEnv), a CatalogService's spec.blob keypair (engineEnv); keypairs gateway on or off, since a copy may predate the config. nil unless plan.List.

type MasterPlan

type MasterPlan struct {
	Install []byte
	Path    string
	List    bool
}

MasterPlan is what a restore does with the master secret after the load: write Install, when set, to Path 0600; List: acceptNew took another master, or m names none, so ListChanged prints the credentials that change.

func PlanMaster

func PlanMaster(m backup.Manifest, masterFile, dataDir, dir string, acceptNew bool) (MasterPlan, error)

PlanMaster, before any part is read, writes nothing (Decision 5): a set masterFile must have m's fingerprint; unset, the matching file under dir/MasterDir is to be installed at Decision 7's path; else fault.Invalid naming the fingerprint, unless acceptNew. m naming no master is no check, nothing installed, and a list of what may change.

Jump to

Keyboard shortcuts

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