Skip to content

Commit 8c5d68f

Browse files
committed
chore(changeset): cli and types patch for the host crypto provider seam
Claude-Session: https://claude.ai/code/session_016WV4czs7cUFAphQEUFSrcz Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9f346ac commit 8c5d68f

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@objectstack/cli': patch
3+
'@objectstack/types': patch
4+
---
5+
6+
feat(cli): `os serve` seals secrets with the crypto provider a plugin registers, so a KMS- or Vault-backed provider can hold the keys
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
A plugin supplies the host's secret crypto provider by registering an `ICryptoProvider` as the kernel service `crypto-provider` — `CRYPTO_PROVIDER_SERVICE`, new in `@objectstack/types` — with `ctx.registerService` in its `init()`, and declaring it in `providesServices`. `os serve` then hands that one provider to everything that seals a `sys_secret` row: the data engine (secret fields), the datasource secret binder (datasource credentials) and the default settings service (encrypted settings). Before, `os serve` built `LocalCryptoProvider` itself after every plugin hook and overwrote whatever a plugin had set.
12+
13+
Without a registration nothing changes: the host keeps `LocalCryptoProvider`, keyed off `OS_SECRET_KEY` or the persisted key file exactly as before, and a production boot without a stable key still refuses at `kernel:ready` with the same message. The one difference is that the default settings service now shares that local provider instead of building a second one from the same key source; what either sealed, the other opens.
14+
15+
The provider holds every secret's key, so the boot refuses rather than guess:
16+
17+
- two plugins that both declare `providesServices: ['crypto-provider']` refuse before either initializes, both named (an undeclared second `registerService` is refused by the kernel, naming the service);
18+
- a provider registered after plugin init, or the registered one replaced, refuses once the boot is up;
19+
- a value registered under the name that is not an `ICryptoProvider` refuses, naming the missing methods;
20+
- a secret sealed or opened while plugins are still initializing is refused, never sealed by a provider the boot has not chosen yet.
21+
22+
No refusal prints a registered value.

0 commit comments

Comments
 (0)