|
oc_chat
|
Classes | |
| class | BundleResult |
Functions | |
| BundleResult | export_bundle (object registry, *, str|Path out, str|Path secrets_path, str|None slot=None, str|None encrypt_command=None) |
| BundleResult | bootstrap_machine (object registry, *, str|Path bundle_path, str|Path secrets_path, str|None decrypt_command=None) |
| str | _registry_id (object registry) |
| SecretBlock|None | _block_from_json (str slot, str phase, dict[str, object] value) |
Variables | |
| int | BUNDLE_VERSION = 1 |
Actor secret export and machine bootstrap helpers.
Purpose
-------
Move local actor HMAC secret blocks between machines without storing raw
secrets in the registry database.
Responsibilities
----------------
- Export selected ``agent_secrets.json`` blocks into a JSON bundle.
- Verify the bundle registry id before bootstrap.
- Install bundle blocks idempotently into the local secrets file.
Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
L2 - lifecycle events
L3 - semantic details
L4 - deep tracing
Contracts
---------
- Bundle JSON may contain secret material and is written with 0600 mode.
- Registry id mismatches abort before local secrets are changed.
- Encryption command hooks are deferred; callers get an explicit error.
Dependencies
------------
- json (read and write the bundle file)
- pathlib (bundle and secrets file paths)
- oc_chat.registry.auth.secrets_store (load, build and write the local secret blocks)
- oc_diagnostics (structured debug logging via _dbg)
|
protected |
|
protected |
| BundleResult oc_chat.registry.auth.bootstrap.bootstrap_machine | ( | object | registry, |
| * | , | ||
| str | Path | bundle_path, | ||
| str | Path | secrets_path, | ||
| str | None | decrypt_command = None ) |
Install secret blocks from a JSON bundle.
Definition at line 104 of file bootstrap.py.
| BundleResult oc_chat.registry.auth.bootstrap.export_bundle | ( | object | registry, |
| * | , | ||
| str | Path | out, | ||
| str | Path | secrets_path, | ||
| str | None | slot = None, | ||
| str | None | encrypt_command = None ) |
Write a JSON bundle of local secret blocks.
Definition at line 65 of file bootstrap.py.
| int oc_chat.registry.auth.bootstrap.BUNDLE_VERSION = 1 |
Definition at line 54 of file bootstrap.py.