@powerhousedao/reactor-workflow 6.2.3-dev.28 → 6.2.3-dev.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -138,8 +138,15 @@ One of them carries a caveat worth knowing before a deployment depends on it.
138
138
  **The secrets key is not optional in production.** Unset, `loadKey` generates
139
139
  `./.ph/secrets.key` — relative to the working directory, like the bundle cache
140
140
  and the attachment staging dir. A host whose working directory does not survive
141
- a restart comes back with a new key, and every stored connection secret is
142
- undecryptable.
141
+ a restart would come back with a new key, so the store guards against it:
142
+
143
+ - A host passes `secretsKeyFile: false` when its database outlives the working
144
+ directory, and the store then requires `PH_WORKFLOWS_SECRETS_MASTER_KEY`
145
+ (`MasterKeyRequiredError`). Switchboard does this when its read model is on
146
+ Postgres.
147
+ - The first key a namespace is used with is fingerprinted into
148
+ `secret_key_check`. Any other key is refused (`MasterKeyMismatchError`)
149
+ instead of failing later as an undecryptable secret.
143
150
 
144
151
  Only the host process reads any of these. The worker child is forked with an
145
152
  empty environment, so the two settings it enforces travel on the wire instead:
package/dist/index.d.ts CHANGED
@@ -45,6 +45,7 @@ interface WorkflowRuntimeHostDeps {
45
45
  attachments?: AttachmentClientLike;
46
46
  canReadAttachmentRef?(documentId: string, ref: string): Promise<boolean>;
47
47
  secrets?: SecretStore;
48
+ secretsKeyFile?: string | false;
48
49
  logger?: ILogger;
49
50
  }
50
51
  //#endregion