@coffre/conformance 0.15.0 → 0.16.0
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 +4 -6
- package/dist/main.js +968 -1336
- package/package.json +4 -4
- package/src/bundle.ts +7 -21
- package/src/checks/access.ts +14 -12
- package/src/checks/audit.ts +189 -295
- package/src/checks/canaries.ts +2 -15
- package/src/checks/cli.ts +39 -23
- package/src/checks/deletion.ts +18 -10
- package/src/checks/environments.ts +68 -49
- package/src/checks/logins.ts +32 -87
- package/src/checks/mcp.ts +83 -29
- package/src/checks/members.ts +127 -81
- package/src/checks/pages.ts +11 -17
- package/src/checks/people.ts +11 -0
- package/src/checks/signin.ts +25 -23
- package/src/checks/storage.ts +39 -78
- package/src/checks/surface.ts +22 -13
- package/src/checks/workloads.ts +32 -17
- package/src/database.ts +7 -28
- package/src/harness.ts +38 -62
- package/src/main.ts +5 -10
- package/src/report.ts +18 -1
- package/src/suite.ts +10 -23
- package/src/unserved.ts +9 -0
- package/src/checks/checkpoints.ts +0 -66
- package/src/checks/readiness.ts +0 -99
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coffre/conformance",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
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": {
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"jose": "6.2.3",
|
|
33
|
-
"@coffre/cli": "0.
|
|
34
|
-
"@coffre/db": "0.
|
|
33
|
+
"@coffre/cli": "0.16.0",
|
|
34
|
+
"@coffre/db": "0.16.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "26.1.1",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"tsdown": "0.23.0",
|
|
40
40
|
"typescript": "5.9.3",
|
|
41
41
|
"vite": "8.1.5",
|
|
42
|
-
"@coffre/client": "0.
|
|
42
|
+
"@coffre/client": "0.16.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsdown",
|
package/src/bundle.ts
CHANGED
|
@@ -13,31 +13,18 @@ import { join, relative } from 'node:path';
|
|
|
13
13
|
* A test holds this to the schema (@coffre/db).
|
|
14
14
|
*/
|
|
15
15
|
export const SERVER_TABLES = [
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'capped_alerts',
|
|
19
|
-
'consumed_tokens',
|
|
20
|
-
'device_authorizations',
|
|
16
|
+
'audit_archive',
|
|
17
|
+
'device_logins',
|
|
21
18
|
'dismissed_keys',
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'log_fence',
|
|
27
|
-
'log_read_days',
|
|
28
|
-
'log_reads',
|
|
29
|
-
'log_reads_cursor',
|
|
19
|
+
'enrollment_codes',
|
|
20
|
+
'log_head',
|
|
21
|
+
'log_index',
|
|
22
|
+
'log_pending',
|
|
30
23
|
'log_tiles',
|
|
31
|
-
'log_uses',
|
|
32
24
|
'mcp_approvals',
|
|
33
|
-
'mcp_connections',
|
|
34
25
|
'oauth_clients',
|
|
35
|
-
'secret_references',
|
|
36
26
|
'secret_versions',
|
|
37
|
-
'
|
|
38
|
-
'vault_grants',
|
|
39
|
-
'vault_members',
|
|
40
|
-
'vault_releases',
|
|
27
|
+
'spent_id_tokens',
|
|
41
28
|
];
|
|
42
29
|
|
|
43
30
|
/** What only server code carries. */
|
|
@@ -45,7 +32,6 @@ const MARKERS: { label: string; pattern: RegExp }[] = [
|
|
|
45
32
|
{ label: 'drizzle-orm', pattern: /drizzle:[A-Z]/ },
|
|
46
33
|
...SERVER_TABLES.map((name) => ({ label: `the table ${name}`, pattern: new RegExp(`\\b${name}\\b`) })),
|
|
47
34
|
{ label: 'pg', pattern: /cloudflare:sockets|pg-protocol|pgpass/ },
|
|
48
|
-
{ label: 'libsql', pattern: /@libsql|libsql/ },
|
|
49
35
|
{ label: 'a COFFRE_ variable read', pattern: /env\s*(\.|\[\s*['"`])COFFRE_/ },
|
|
50
36
|
];
|
|
51
37
|
|
package/src/checks/access.ts
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
// own pages, until they leave, and never too much at once.
|
|
3
3
|
import { bearer } from '../browser.ts';
|
|
4
4
|
import type { Deployment } from '../harness.ts';
|
|
5
|
-
import { expect, refused } from '../report.ts';
|
|
5
|
+
import { expect, refused, until } from '../report.ts';
|
|
6
6
|
import { BULK, canary, DEV, PROD, PROJECT, signIn, valuesIn, type Canaries, type People } from './people.ts';
|
|
7
7
|
import { connectedApp, discovers } from './mcp.ts';
|
|
8
8
|
import { pollDevice, startDevice } from './signin.ts';
|
|
9
|
-
import { listed } from './audit.ts';
|
|
10
9
|
|
|
11
10
|
export async function membersOnly(deployment: Deployment, { stranger }: People): Promise<string> {
|
|
12
11
|
const attempt = await signIn(deployment, stranger.browser, stranger.email);
|
|
@@ -93,27 +92,30 @@ export async function crossSite({ admin }: People, canaries: Canaries): Promise<
|
|
|
93
92
|
export async function offboarding(deployment: Deployment, { admin, leaver, service }: People, canaries: Canaries) {
|
|
94
93
|
const device = await startDevice(deployment);
|
|
95
94
|
await leaver.api.deviceLogins.decide(device.user_code, true);
|
|
96
|
-
// What they saw is what to rotate once they are gone
|
|
95
|
+
// What they saw is what to rotate once they are gone.
|
|
97
96
|
await leaver.cli.secrets.reveal(DEV);
|
|
98
|
-
const expected = Object.keys(valuesIn(canaries, DEV)).map((key) => `${DEV}/${key}`).sort();
|
|
99
|
-
const seen = (report: { exposed: { project: string; environment: string; key: string }[] }) => report.exposed.map((entry) => `${entry.project}/${entry.environment}/${entry.key}`).sort();
|
|
100
|
-
await listed(async () => same(seen(await admin.api.members.get(leaver.member)), expected));
|
|
101
97
|
// An app they connected is listed to an owner, and removal disconnects it.
|
|
102
98
|
const app = await connectedApp(deployment, leaver);
|
|
103
99
|
const before = await admin.api.members.get(leaver.member);
|
|
104
|
-
|
|
100
|
+
// A report that does not list apps (null) has not listed the app either.
|
|
101
|
+
expect(before.live.apps === 1 && before.apps?.length === 1, "the owner's report does not list the app the leaver connected", before.apps);
|
|
105
102
|
const { revoked, report } = await admin.api.members.remove(leaver.member);
|
|
106
103
|
expect(report !== null, "an owner's removal does not answer with the leaver's report");
|
|
107
|
-
expect(revoked.apps === 1 && report.live.apps === 0 && report.apps
|
|
104
|
+
expect(revoked.apps === 1 && report.live.apps === 0 && report.apps?.length === 0, 'removal does not say it disconnected their app', { revoked, apps: report.apps });
|
|
108
105
|
expect(!(await discovers(deployment, app)), "a removed member's app still reaches /mcp");
|
|
109
|
-
|
|
106
|
+
const exposed = report.exposed.map((entry) => `${entry.project}/${entry.environment}/${entry.key}`).sort();
|
|
107
|
+
const expected = Object.keys(valuesIn(canaries, DEV)).map((key) => `${DEV}/${key}`).sort();
|
|
108
|
+
expect(same(exposed, expected), 'the offboarding report does not name what they read', report.exposed);
|
|
110
109
|
|
|
111
|
-
|
|
110
|
+
// Within the vault's memory of who they are, 2 seconds (docs/design/0.16.md, D218): no change clears it.
|
|
111
|
+
await until("the refusal of a removed member's browser session", async () => (await leaver.browser.fetch('/api/me')).status === 401, 5);
|
|
112
|
+
await until("the refusal of a removed member's CLI session", () => leaver.cli.secrets.list(DEV).then(() => false, () => true), 5);
|
|
112
113
|
await refused("a removed member's CLI session read secrets", leaver.cli.secrets.list(DEV));
|
|
113
114
|
const again = await signIn(deployment, leaver.browser, leaver.email);
|
|
114
115
|
expect(!again.ok, 'a removed member signed in again');
|
|
115
116
|
|
|
116
117
|
await admin.api.members.remove(service.member);
|
|
118
|
+
await until("the refusal of a removed service's token", () => service.api.secrets.reveal(DEV).then(() => false, () => true), 5);
|
|
117
119
|
await refused("a removed service's token read secrets", service.api.secrets.reveal(DEV));
|
|
118
120
|
await admin.api.members.add(leaver.member);
|
|
119
121
|
await admin.api.access.set(leaver.member, { [DEV]: 'developer' });
|
|
@@ -127,7 +129,7 @@ export async function offboarding(deployment: Deployment, { admin, leaver, servi
|
|
|
127
129
|
expect(fresh.ok, 'a fresh provider callback could not sign the re-admitted member in');
|
|
128
130
|
await admin.api.members.remove(leaver.member);
|
|
129
131
|
await admin.api.members.remove(service.member);
|
|
130
|
-
return `the report names ${
|
|
132
|
+
return `the report names ${exposed.length} values and their connected app, which removal disconnects; re-admission revives no old session, token or approval; a fresh provider callback works`;
|
|
131
133
|
}
|
|
132
134
|
|
|
133
135
|
/**
|
|
@@ -178,7 +180,7 @@ export async function instanceRoles(deployment: Deployment, { admin, reader }: P
|
|
|
178
180
|
['an admin demoted the Owner', () => reader.api.members.add(admin.member, { role: 'admin' })],
|
|
179
181
|
['an admin removed the Owner', () => reader.api.members.remove(admin.member)],
|
|
180
182
|
] as const) {
|
|
181
|
-
// Not that the Owner is the last, which an Owner hears too: that only an Owner may.
|
|
183
|
+
// Not that the Owner is the last, which an Owner hears too: that only an Owner may, `not_allowed`, as in 0.14.7.
|
|
182
184
|
const refusal = await refused(what, call());
|
|
183
185
|
expect(refusal.status === 403 && refusal.reason === 'not_allowed', `${what}, or was refused for another reason`, refusal);
|
|
184
186
|
}
|