@cat-factory/worker 0.94.0 → 0.94.1
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/infrastructure/repositories/D1PublicApiKeyRepository.d.ts.map +1 -1
- package/dist/infrastructure/repositories/D1PublicApiKeyRepository.js +4 -3
- package/dist/infrastructure/repositories/D1PublicApiKeyRepository.js.map +1 -1
- package/migrations/0054_public_api_key_created_by.sql +9 -0
- package/package.json +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"D1PublicApiKeyRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1PublicApiKeyRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAErF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"D1PublicApiKeyRepository.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1PublicApiKeyRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAErF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AA8B3D,uEAAuE;AACvE,qBAAa,wBAAyB,YAAW,sBAAsB;IACrE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,UAAU,CAAA;KAAE,EAErC;IAEK,GAAG,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBnD;IAEK,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAM5D;IAEK,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAUxE;IAEK,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKpD;IAEK,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOvE;CACF"}
|
|
@@ -6,6 +6,7 @@ function rowToRecord(row) {
|
|
|
6
6
|
label: row.label,
|
|
7
7
|
scope: row.scope,
|
|
8
8
|
secretHash: row.secret_hash,
|
|
9
|
+
createdByUserId: row.created_by_user_id,
|
|
9
10
|
createdAt: row.created_at,
|
|
10
11
|
lastUsedAt: row.last_used_at,
|
|
11
12
|
revokedAt: row.revoked_at,
|
|
@@ -20,9 +21,9 @@ export class D1PublicApiKeyRepository {
|
|
|
20
21
|
async add(record) {
|
|
21
22
|
await this.db
|
|
22
23
|
.prepare(`INSERT INTO public_api_keys
|
|
23
|
-
(id, account_id, workspace_id, label, scope, secret_hash, created_at, last_used_at, revoked_at)
|
|
24
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`)
|
|
25
|
-
.bind(record.id, record.accountId, record.workspaceId, record.label, record.scope, record.secretHash, record.createdAt, record.lastUsedAt, record.revokedAt)
|
|
24
|
+
(id, account_id, workspace_id, label, scope, secret_hash, created_by_user_id, created_at, last_used_at, revoked_at)
|
|
25
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`)
|
|
26
|
+
.bind(record.id, record.accountId, record.workspaceId, record.label, record.scope, record.secretHash, record.createdByUserId, record.createdAt, record.lastUsedAt, record.revokedAt)
|
|
26
27
|
.run();
|
|
27
28
|
}
|
|
28
29
|
async getById(id) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"D1PublicApiKeyRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1PublicApiKeyRepository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"D1PublicApiKeyRepository.js","sourceRoot":"","sources":["../../../src/infrastructure/repositories/D1PublicApiKeyRepository.ts"],"names":[],"mappings":"AAiBA,SAAS,WAAW,CAAC,GAAoB;IACvC,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,WAAW,EAAE,GAAG,CAAC,YAAY;QAC7B,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,KAAK,EAAE,GAAG,CAAC,KAAuB;QAClC,UAAU,EAAE,GAAG,CAAC,WAAW;QAC3B,eAAe,EAAE,GAAG,CAAC,kBAAkB;QACvC,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,UAAU,EAAE,GAAG,CAAC,YAAY;QAC5B,SAAS,EAAE,GAAG,CAAC,UAAU;KAC1B,CAAA;AACH,CAAC;AAED,uEAAuE;AACvE,MAAM,OAAO,wBAAwB;IAClB,EAAE,CAAY;IAE/B,YAAY,EAAE,EAAE,EAAsB;QACpC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,MAA0B;QAClC,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CACN;;+CAEuC,CACxC;aACA,IAAI,CACH,MAAM,CAAC,EAAE,EACT,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,eAAe,EACtB,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,SAAS,CACjB;aACA,GAAG,EAAE,CAAA;IACV,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,EAAE;aACtB,OAAO,CAAC,4CAA4C,CAAC;aACrD,IAAI,CAAC,EAAE,CAAC;aACR,KAAK,EAAmB,CAAA;QAC3B,OAAO,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACtC,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,WAAmB;QACvC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,EAAE;aAC9B,OAAO,CACN;;mCAE2B,CAC5B;aACA,IAAI,CAAC,WAAW,CAAC;aACjB,GAAG,EAAmB,CAAA;QACzB,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IACzC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAU,EAAE,EAAU;QACnC,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CAAC,0DAA0D,CAAC;aACnE,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC;aACZ,GAAG,EAAE,CAAA;IACV,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,WAAmB,EAAE,EAAU,EAAE,EAAU;QACtD,MAAM,IAAI,CAAC,EAAE;aACV,OAAO,CACN,oGAAoG,CACrG;aACA,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,WAAW,CAAC;aACzB,GAAG,EAAE,CAAA;IACV,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-- Record the minter of an inbound public-API key (workspace-rbac initiative, slice 7 — side
|
|
2
|
+
-- doors). A key now carries `created_by_user_id`: the signed-in user who minted it, for audit +
|
|
3
|
+
-- UI attribution (the keys panel surfaces "created by"). Nullable — a dev-open mint has no
|
|
4
|
+
-- session, and pre-existing rows predate the column. It is NOT an authorization input: a
|
|
5
|
+
-- public-API key is a workspace-scoped SERVICE credential that intentionally OUTLIVES its
|
|
6
|
+
-- minter's workspace access (revocation is an explicit admin action, so an external integration
|
|
7
|
+
-- doesn't break when its author is offboarded). No FK, for the same reason. Mirrored on Node by
|
|
8
|
+
-- the `created_by_user_id` column on the Drizzle `public_api_keys` table.
|
|
9
|
+
ALTER TABLE public_api_keys ADD COLUMN created_by_user_id TEXT;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/worker",
|
|
3
|
-
"version": "0.94.
|
|
3
|
+
"version": "0.94.1",
|
|
4
4
|
"description": "Reusable Cloudflare Worker library (Hono + D1) exposing the Agent Architecture Board core: the `createApp()` Hono factory, the default fetch/scheduled/queue handler, and the Durable Object + Workflow classes. Deployments (see deploy/backend) supply the wrangler.toml + config and re-export these.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,22 +42,22 @@
|
|
|
42
42
|
"pino": "^10.3.1",
|
|
43
43
|
"valibot": "^1.4.2",
|
|
44
44
|
"workers-ai-provider": "^3.3.1",
|
|
45
|
-
"@cat-factory/agents": "0.62.
|
|
46
|
-
"@cat-factory/caching": "0.10.
|
|
47
|
-
"@cat-factory/
|
|
48
|
-
"@cat-factory/
|
|
49
|
-
"@cat-factory/eks": "0.1.
|
|
50
|
-
"@cat-factory/
|
|
51
|
-
"@cat-factory/
|
|
52
|
-
"@cat-factory/integrations": "0.86.
|
|
53
|
-
"@cat-factory/
|
|
54
|
-
"@cat-factory/observability-
|
|
55
|
-
"@cat-factory/
|
|
56
|
-
"@cat-factory/orchestration": "0.123.
|
|
57
|
-
"@cat-factory/prompt-fragments": "0.13.
|
|
58
|
-
"@cat-factory/provider-cloudflare": "0.7.
|
|
59
|
-
"@cat-factory/server": "0.
|
|
60
|
-
"@cat-factory/spend": "0.12.
|
|
45
|
+
"@cat-factory/agents": "0.62.9",
|
|
46
|
+
"@cat-factory/caching": "0.10.6",
|
|
47
|
+
"@cat-factory/consensus": "0.10.70",
|
|
48
|
+
"@cat-factory/contracts": "0.147.1",
|
|
49
|
+
"@cat-factory/eks": "0.1.97",
|
|
50
|
+
"@cat-factory/gates": "0.5.54",
|
|
51
|
+
"@cat-factory/gitlab": "0.10.16",
|
|
52
|
+
"@cat-factory/integrations": "0.86.1",
|
|
53
|
+
"@cat-factory/kernel": "0.139.1",
|
|
54
|
+
"@cat-factory/observability-langfuse": "0.7.224",
|
|
55
|
+
"@cat-factory/observability-otel": "0.2.6",
|
|
56
|
+
"@cat-factory/orchestration": "0.123.1",
|
|
57
|
+
"@cat-factory/prompt-fragments": "0.13.37",
|
|
58
|
+
"@cat-factory/provider-cloudflare": "0.7.241",
|
|
59
|
+
"@cat-factory/server": "0.137.0",
|
|
60
|
+
"@cat-factory/spend": "0.12.50"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@cloudflare/vitest-pool-workers": "^0.18.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"typescript": "7.0.2",
|
|
66
66
|
"vitest": "^4.1.10",
|
|
67
67
|
"wrangler": "^4.110.0",
|
|
68
|
-
"@cat-factory/conformance": "0.11.
|
|
68
|
+
"@cat-factory/conformance": "0.11.14"
|
|
69
69
|
},
|
|
70
70
|
"scripts": {
|
|
71
71
|
"build": "tsc -b tsconfig.build.json",
|