Secrets API¶
features.secrets ¶
Envelope-encrypt JSON secrets — backward-compat shim.
Implementation moved to shared/master_key.py so shared.saga no longer imports features (broke the features <-> shared import cycles).
encrypt_json ¶
decrypt_json ¶
is_encrypted_blob ¶
Return True when the file is a readable encrypted envelope.
Reads the file and attempts decryption with this process's master key. The
previous version sniffed the first byte; because the envelope begins with a
random nonce, one byte in 256 looks like JSON ({, [, space, newline) and
real ciphertext was reported as plain JSON in 4 cases out of 256 (measured
69/4096 = 1.68%).
Source code in shared/master_key.py
_load_master_key ¶
Load or derive master key from keyring, .env, config, or environment.
If no key is found, auto-generates one and saves to .env for dev convenience.