symfonic.services.switching.keys¶
keys ¶
KEY / LIB-EA — the envelope signing-key lifecycle, in both deployment modes.
Operated platforms provision keys from a secret manager; library mode derives one locally from an adopter-supplied secret. Both end up in the same keyset with the same three states, so verification behaves identically — library mode is not a reduced security tier.
Keyset ¶
key_id → (material, state), with exactly one active key.
Key material never leaves this object: there is no accessor that returns
it, __repr__ names only ids and states, and signing happens here rather
than in the caller. A getter would be convenient exactly once and then live
forever in a log line.
Source code in src/symfonic/services/switching/keys.py
derive_library_key ¶
derive_library_key(secret: str, *, salt: bytes, info: bytes = b'symfonic-envelope') -> tuple[str, bytes]
LIB-EA-1 — HKDF-SHA256 from an adopter secret; key_id is its fingerprint.
LIB-EA-2 is the important half: there is no default secret. An adopter who configures nothing gets a construction error, not a package-wide shared key.