@coffre/conformance 0.1.1 → 0.1.2

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/dist/main.js CHANGED
@@ -826,7 +826,6 @@ async function using(open, use) {
826
826
  const KEYS = {
827
827
  KEK_ID: "conformance-1",
828
828
  KEK: "Y29mZnJlLWxvY2FsLWRldi1rZWstMzItYnl0ZXMhISE=",
829
- SIGNING_KEY: "Y29mZnJlLWxvY2FsLXZhdWx0LXNpZ25pbmctc2VlZCE=",
830
829
  AUDIT_CHAIN_KEY: "Y29mZnJlLWxvY2FsLWF1ZGl0LWNoYWluLWtleS0zMmI="
831
830
  };
832
831
  //#endregion
@@ -968,7 +967,6 @@ async function boot(kind, at, options) {
968
967
  AUDIT_CHAIN_KEY: KEYS.AUDIT_CHAIN_KEY,
969
968
  KEK_ID: KEYS.KEK_ID,
970
969
  KEK: KEYS.KEK,
971
- SIGNING_KEY: KEYS.SIGNING_KEY,
972
970
  ROOT_ADMINS: ROOT_ADMIN,
973
971
  CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE: runtime,
974
972
  CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_VAULT_HYPERDRIVE: vaultRuntime,
@@ -1001,7 +999,6 @@ async function boot(kind, at, options) {
1001
999
  DATABASE_URL: `file:${database}`,
1002
1000
  KEK_ID: KEYS.KEK_ID,
1003
1001
  KEK: KEYS.KEK,
1004
- SIGNING_KEY: KEYS.SIGNING_KEY,
1005
1002
  ROOT_ADMINS: ROOT_ADMIN
1006
1003
  });
1007
1004
  await until("the vault socket", async () => existsSync(socket), 30, alive);
@@ -2092,7 +2089,7 @@ async function earlierCheckpoint(deployment, { admin }) {
2092
2089
  const signed = rows.filter((row) => row.author === "vault" && row.action === "audit.checkpoint" && row.decision === "allow");
2093
2090
  expect(signed.length >= 2, "two checkpoints are needed");
2094
2091
  const [head] = await sql.query("SELECT * FROM audit_chain_head");
2095
- const seed = Buffer.from(KEYS.SIGNING_KEY, "base64");
2092
+ const seed = Buffer.from(hkdfSync("sha256", Buffer.from(KEYS.KEK, "base64"), Buffer.alloc(0), "coffre.vault.signing-key.v1", 32));
2096
2093
  const signingKey = createPrivateKey({
2097
2094
  key: Buffer.concat([Buffer.from("302e020100300506032b657004220420", "hex"), seed]),
2098
2095
  format: "der",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffre/conformance",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Checks a coffre deployment from outside: what it must never do, whatever code it runs.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "jose": "6.2.3",
33
33
  "pg": "8.16.3",
34
- "@coffre/db": "0.1.1"
34
+ "@coffre/db": "0.1.2"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "26.1.1",
@@ -39,7 +39,7 @@
39
39
  "oauth4webapi": "3.8.8",
40
40
  "tsdown": "0.23.0",
41
41
  "typescript": "5.9.3",
42
- "@coffre/client": "0.1.1"
42
+ "@coffre/client": "0.1.2"
43
43
  },
44
44
  "scripts": {
45
45
  "build": "tsdown",
@@ -17,7 +17,8 @@ export async function earlierCheckpoint(deployment: Deployment, { admin }: Peopl
17
17
  const signed = rows.filter((row) => row.author === 'vault' && row.action === 'audit.checkpoint' && row.decision === 'allow');
18
18
  expect(signed.length >= 2, 'two checkpoints are needed');
19
19
  const [head] = await sql.query('SELECT * FROM audit_chain_head');
20
- const seed = Buffer.from(KEYS.SIGNING_KEY, 'base64');
20
+ // The vault's signing key, which it derives from its KEK: HKDF-SHA-256 under the vault's label.
21
+ const seed = Buffer.from(hkdfSync('sha256', Buffer.from(KEYS.KEK, 'base64'), Buffer.alloc(0), 'coffre.vault.signing-key.v1', 32));
21
22
  const signingKey = createPrivateKey({ key: Buffer.concat([Buffer.from('302e020100300506032b657004220420', 'hex'), seed]), format: 'der', type: 'pkcs8' });
22
23
  const keys = {
23
24
  app: Buffer.from(hkdfSync('sha256', Buffer.from(KEYS.AUDIT_CHAIN_KEY, 'base64'), Buffer.alloc(0), 'coffre.audit.app.v2', 32)),
package/src/fixtures.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  // Local fixtures, as in .env.dev: none of them is a secret anywhere else.
2
+ // The vault derives its signing key from the KEK, as every deployment with
3
+ // a local KEK does.
2
4
  export const KEYS = {
3
5
  KEK_ID: 'conformance-1',
4
6
  KEK: 'Y29mZnJlLWxvY2FsLWRldi1rZWstMzItYnl0ZXMhISE=',
5
- SIGNING_KEY: 'Y29mZnJlLWxvY2FsLXZhdWx0LXNpZ25pbmctc2VlZCE=',
6
7
  AUDIT_CHAIN_KEY: 'Y29mZnJlLWxvY2FsLWF1ZGl0LWNoYWluLWtleS0zMmI=',
7
8
  };
package/src/harness.ts CHANGED
@@ -194,7 +194,6 @@ export async function boot(kind: Kind, at: string, options: HarnessOptions): Pro
194
194
  AUDIT_CHAIN_KEY: KEYS.AUDIT_CHAIN_KEY,
195
195
  KEK_ID: KEYS.KEK_ID,
196
196
  KEK: KEYS.KEK,
197
- SIGNING_KEY: KEYS.SIGNING_KEY,
198
197
  ROOT_ADMINS: ROOT_ADMIN,
199
198
  CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE: runtime,
200
199
  CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_VAULT_HYPERDRIVE: vaultRuntime,
@@ -228,7 +227,6 @@ export async function boot(kind: Kind, at: string, options: HarnessOptions): Pro
228
227
  DATABASE_URL: `file:${database}`,
229
228
  KEK_ID: KEYS.KEK_ID,
230
229
  KEK: KEYS.KEK,
231
- SIGNING_KEY: KEYS.SIGNING_KEY,
232
230
  ROOT_ADMINS: ROOT_ADMIN,
233
231
  });
234
232
  await until('the vault socket', async () => existsSync(socket), 30, alive);