Expand description
Backend capability enforcement: does each backend provide what the catalog requires?
Two declarations, two roles:
- Provides:
BackendRef::engines+BackendRef::capabilities+BackendRef::mint_key_types: what the server instance supports. In nix this comes from a version preset (VAULT_2_0,OPENBAO_2_5); a hand-written catalog supplies the same JSON (so a non-nix adapter works too). It is the version→capability table, in config rather than hardcoded in the binary. - Requires: what this deployment needs. Mostly derived (and so it
can’t drift): each key’s effective
Engineand itsKeyAlgorithm’srequired_capability. For the few non-key-derivable needs there is the explicitBackendRef::requireslist, unioned with the derived set.
Enforcement is required ⊆ provided. It is a pure catalog check: no
backend I/O and no extra Vault privilege, so it runs both at startup and in
the offline check lint, and needs no reachable server. The live cross-check
against a server’s real version is a separate (future) concern.
§Policy
CapabilityPolicy is the operator’s stance, a ceiling over each key’s
MissingPolicy:
strict(default, secure): any unmet requirement aborts startup; every gap is reported together.degraded, which defers to per-keymissing: a gap on amissing="error"key is still fatal; on any other key it is logged and the broker serves the rest (the runtimeUnsupportedbackstop catches the op if it is ever made).offskips the check entirely.
§Undeclared backends
A backend that declares no provides (engines, capabilities, and
mint_key_types all empty) is capability-unknown: the check is skipped
with a warning, even under strict. The agent can’t manufacture the data, and
failing closed on absence would punish every minimal catalog. Real enforcement
is opt-in by declaring the provides set (which the nix presets make trivial).
Structs§
- Capability
Error - A fatal capability-enforcement failure (fail closed). Carries every gap, not just the first, so one startup attempt surfaces all the misfits.
- Capability
Gap - One unmet capability requirement, for a single key, or (when
keyisNone) a backend-level explicitrequiresentry. - Capability
Summary - Summary of a non-fatal capability pass, for the startup log.
Enums§
- Capability
Policy - How startup handles a backend that cannot satisfy a required capability.
Functions§
- enforce_
capabilities - Validate every backend’s declared provides against what its keys (and its
explicit
requires) need, applyingpolicy.