@stigmer/server 3.27.1 → 3.28.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 +2 -0
- package/dist/authorization/authorizer.d.ts +7 -5
- package/dist/authorization/authorizer.d.ts.map +1 -1
- package/dist/authorization/authorizer.js +7 -5
- package/dist/authorization/authorizer.js.map +1 -1
- package/dist/authorization/derived-tuples.d.ts +3 -1
- package/dist/authorization/derived-tuples.d.ts.map +1 -1
- package/dist/authorization/derived-tuples.js +52 -2
- package/dist/authorization/derived-tuples.js.map +1 -1
- package/dist/authorization/evaluator.d.ts +9 -10
- package/dist/authorization/evaluator.d.ts.map +1 -1
- package/dist/authorization/evaluator.js.map +1 -1
- package/dist/authorization/list-read-scope.d.ts.map +1 -1
- package/dist/authorization/list-read-scope.js +29 -18
- package/dist/authorization/list-read-scope.js.map +1 -1
- package/dist/authorization/model/bindings.d.ts +41 -0
- package/dist/authorization/model/bindings.d.ts.map +1 -0
- package/dist/authorization/model/bindings.js +89 -0
- package/dist/authorization/model/bindings.js.map +1 -0
- package/dist/authorization/model/data/authorization-model.json +3114 -0
- package/dist/authorization/model/default-of.d.ts +2 -2
- package/dist/authorization/model/execution-viewer.d.ts +3 -0
- package/dist/authorization/model/execution-viewer.d.ts.map +1 -0
- package/dist/authorization/model/execution-viewer.js +50 -0
- package/dist/authorization/model/execution-viewer.js.map +1 -0
- package/dist/authorization/model/index.d.ts +33 -21
- package/dist/authorization/model/index.d.ts.map +1 -1
- package/dist/authorization/model/index.js +74 -52
- package/dist/authorization/model/index.js.map +1 -1
- package/dist/authorization/model/openfga-json.d.ts +18 -0
- package/dist/authorization/model/openfga-json.d.ts.map +1 -0
- package/dist/authorization/model/openfga-json.js +266 -0
- package/dist/authorization/model/openfga-json.js.map +1 -0
- package/dist/authorization/model/rewrite.d.ts +39 -67
- package/dist/authorization/model/rewrite.d.ts.map +1 -1
- package/dist/authorization/model/rewrite.js +1 -117
- package/dist/authorization/model/rewrite.js.map +1 -1
- package/dist/authorization/strict-json.d.ts +20 -0
- package/dist/authorization/strict-json.d.ts.map +1 -0
- package/dist/authorization/strict-json.js +45 -0
- package/dist/authorization/strict-json.js.map +1 -0
- package/dist/boot/compose.d.ts.map +1 -1
- package/dist/boot/compose.js +9 -7
- package/dist/boot/compose.js.map +1 -1
- package/dist/boot/list-indexes.d.ts.map +1 -1
- package/dist/boot/list-indexes.js +6 -0
- package/dist/boot/list-indexes.js.map +1 -1
- package/dist/domain/iampolicy/list-index.d.ts +2 -0
- package/dist/domain/iampolicy/list-index.d.ts.map +1 -0
- package/dist/domain/iampolicy/list-index.js +32 -0
- package/dist/domain/iampolicy/list-index.js.map +1 -0
- package/dist/domain/iampolicy/resource-store.d.ts.map +1 -1
- package/dist/domain/iampolicy/resource-store.js +24 -11
- package/dist/domain/iampolicy/resource-store.js.map +1 -1
- package/dist/domain/workflowexecution/list-index.d.ts +1 -1
- package/dist/extensions/list-read-scope.d.ts +20 -3
- package/dist/extensions/list-read-scope.d.ts.map +1 -1
- package/dist/extensions/list-read-scope.js +22 -2
- package/dist/extensions/list-read-scope.js.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- package/src/authorization/README.md +48 -39
- package/src/authorization/__tests__/authorizer.test.ts +5 -14
- package/src/authorization/__tests__/derived-tuples.test.ts +192 -17
- package/src/authorization/__tests__/evaluator.test.ts +53 -160
- package/src/authorization/__tests__/facts.test.ts +5 -11
- package/src/authorization/__tests__/list-read-scope.measure.test.ts +424 -62
- package/src/authorization/__tests__/list-read-scope.test.ts +15 -14
- package/src/authorization/__tests__/organization-directory.test.ts +2 -2
- package/src/authorization/__tests__/store-test-kit.ts +246 -0
- package/src/authorization/__tests__/store-tests.test.ts +91 -223
- package/src/authorization/__tests__/support.ts +30 -2
- package/src/authorization/__tests__/throwaway-model.ts +75 -0
- package/src/authorization/__tests__/wire-permissions.test.ts +141 -107
- package/src/authorization/authorizer.ts +7 -5
- package/src/authorization/derived-tuples.ts +105 -16
- package/src/authorization/evaluator.ts +8 -10
- package/src/authorization/list-read-scope.ts +37 -22
- package/src/authorization/model/__tests__/openfga-json.test.ts +353 -0
- package/src/authorization/model/__tests__/registry.test.ts +102 -276
- package/src/authorization/model/bindings.ts +131 -0
- package/src/authorization/model/data/authorization-model.json +3114 -0
- package/src/authorization/model/default-of.ts +2 -2
- package/src/authorization/model/execution-viewer.ts +56 -0
- package/src/authorization/model/index.ts +81 -72
- package/src/authorization/model/openfga-json.ts +310 -0
- package/src/authorization/model/rewrite.ts +39 -188
- package/src/authorization/strict-json.ts +52 -0
- package/src/boot/__tests__/list-indexes.test.ts +4 -0
- package/src/boot/compose.ts +9 -7
- package/src/boot/list-indexes.ts +6 -0
- package/src/domain/iampolicy/__tests__/resource-store.test.ts +65 -5
- package/src/domain/iampolicy/list-index.ts +33 -0
- package/src/domain/iampolicy/resource-store.ts +24 -11
- package/src/extensions/__tests__/built-in-authorization-composed.test.ts +3 -6
- package/src/extensions/list-read-scope.ts +32 -4
- package/src/index.ts +20 -44
- package/dist/authorization/model/agent.d.ts +0 -2
- package/dist/authorization/model/agent.d.ts.map +0 -1
- package/dist/authorization/model/agent.js +0 -43
- package/dist/authorization/model/agent.js.map +0 -1
- package/dist/authorization/model/agent_channel.d.ts +0 -2
- package/dist/authorization/model/agent_channel.d.ts.map +0 -1
- package/dist/authorization/model/agent_channel.js +0 -39
- package/dist/authorization/model/agent_channel.js.map +0 -1
- package/dist/authorization/model/agent_execution.d.ts +0 -2
- package/dist/authorization/model/agent_execution.d.ts.map +0 -1
- package/dist/authorization/model/agent_execution.js +0 -25
- package/dist/authorization/model/agent_execution.js.map +0 -1
- package/dist/authorization/model/agent_instance.d.ts +0 -2
- package/dist/authorization/model/agent_instance.d.ts.map +0 -1
- package/dist/authorization/model/agent_instance.js +0 -48
- package/dist/authorization/model/agent_instance.js.map +0 -1
- package/dist/authorization/model/agent_share.d.ts +0 -2
- package/dist/authorization/model/agent_share.d.ts.map +0 -1
- package/dist/authorization/model/agent_share.js +0 -29
- package/dist/authorization/model/agent_share.js.map +0 -1
- package/dist/authorization/model/api_key.d.ts +0 -2
- package/dist/authorization/model/api_key.d.ts.map +0 -1
- package/dist/authorization/model/api_key.js +0 -27
- package/dist/authorization/model/api_key.js.map +0 -1
- package/dist/authorization/model/artifact.d.ts +0 -2
- package/dist/authorization/model/artifact.d.ts.map +0 -1
- package/dist/authorization/model/artifact.js +0 -27
- package/dist/authorization/model/artifact.js.map +0 -1
- package/dist/authorization/model/channel_app.d.ts +0 -2
- package/dist/authorization/model/channel_app.d.ts.map +0 -1
- package/dist/authorization/model/channel_app.js +0 -28
- package/dist/authorization/model/channel_app.js.map +0 -1
- package/dist/authorization/model/environment.d.ts +0 -2
- package/dist/authorization/model/environment.d.ts.map +0 -1
- package/dist/authorization/model/environment.js +0 -33
- package/dist/authorization/model/environment.js.map +0 -1
- package/dist/authorization/model/execution_context.d.ts +0 -2
- package/dist/authorization/model/execution_context.d.ts.map +0 -1
- package/dist/authorization/model/execution_context.js +0 -19
- package/dist/authorization/model/execution_context.js.map +0 -1
- package/dist/authorization/model/iam_policy.d.ts +0 -2
- package/dist/authorization/model/iam_policy.d.ts.map +0 -1
- package/dist/authorization/model/iam_policy.js +0 -31
- package/dist/authorization/model/iam_policy.js.map +0 -1
- package/dist/authorization/model/identity_account.d.ts +0 -2
- package/dist/authorization/model/identity_account.d.ts.map +0 -1
- package/dist/authorization/model/identity_account.js +0 -25
- package/dist/authorization/model/identity_account.js.map +0 -1
- package/dist/authorization/model/mcp_server.d.ts +0 -2
- package/dist/authorization/model/mcp_server.d.ts.map +0 -1
- package/dist/authorization/model/mcp_server.js +0 -38
- package/dist/authorization/model/mcp_server.js.map +0 -1
- package/dist/authorization/model/memory.d.ts +0 -2
- package/dist/authorization/model/memory.d.ts.map +0 -1
- package/dist/authorization/model/memory.js +0 -26
- package/dist/authorization/model/memory.js.map +0 -1
- package/dist/authorization/model/oauth_app.d.ts +0 -2
- package/dist/authorization/model/oauth_app.d.ts.map +0 -1
- package/dist/authorization/model/oauth_app.js +0 -31
- package/dist/authorization/model/oauth_app.js.map +0 -1
- package/dist/authorization/model/organization.d.ts +0 -2
- package/dist/authorization/model/organization.d.ts.map +0 -1
- package/dist/authorization/model/organization.js +0 -58
- package/dist/authorization/model/organization.js.map +0 -1
- package/dist/authorization/model/platform_client.d.ts +0 -2
- package/dist/authorization/model/platform_client.d.ts.map +0 -1
- package/dist/authorization/model/platform_client.js +0 -31
- package/dist/authorization/model/platform_client.js.map +0 -1
- package/dist/authorization/model/plugin.d.ts +0 -2
- package/dist/authorization/model/plugin.d.ts.map +0 -1
- package/dist/authorization/model/plugin.js +0 -45
- package/dist/authorization/model/plugin.js.map +0 -1
- package/dist/authorization/model/schedule.d.ts +0 -2
- package/dist/authorization/model/schedule.d.ts.map +0 -1
- package/dist/authorization/model/schedule.js +0 -34
- package/dist/authorization/model/schedule.js.map +0 -1
- package/dist/authorization/model/session.d.ts +0 -2
- package/dist/authorization/model/session.d.ts.map +0 -1
- package/dist/authorization/model/session.js +0 -38
- package/dist/authorization/model/session.js.map +0 -1
- package/dist/authorization/model/skill.d.ts +0 -2
- package/dist/authorization/model/skill.d.ts.map +0 -1
- package/dist/authorization/model/skill.js +0 -39
- package/dist/authorization/model/skill.js.map +0 -1
- package/dist/authorization/model/workflow.d.ts +0 -2
- package/dist/authorization/model/workflow.d.ts.map +0 -1
- package/dist/authorization/model/workflow.js +0 -39
- package/dist/authorization/model/workflow.js.map +0 -1
- package/dist/authorization/model/workflow_execution.d.ts +0 -2
- package/dist/authorization/model/workflow_execution.d.ts.map +0 -1
- package/dist/authorization/model/workflow_execution.js +0 -33
- package/dist/authorization/model/workflow_execution.js.map +0 -1
- package/dist/authorization/model/workflow_instance.d.ts +0 -2
- package/dist/authorization/model/workflow_instance.d.ts.map +0 -1
- package/dist/authorization/model/workflow_instance.js +0 -96
- package/dist/authorization/model/workflow_instance.js.map +0 -1
- package/dist/authorization/store-test-kit.d.ts +0 -62
- package/dist/authorization/store-test-kit.d.ts.map +0 -1
- package/dist/authorization/store-test-kit.js +0 -265
- package/dist/authorization/store-test-kit.js.map +0 -1
- package/src/authorization/__tests__/fixtures/fga/agent-channel-owner.fga.yaml +0 -112
- package/src/authorization/__tests__/fixtures/fga/agent-instance-creation.fga.yaml +0 -177
- package/src/authorization/__tests__/fixtures/fga/agent-share-owner.fga.yaml +0 -109
- package/src/authorization/__tests__/fixtures/fga/artifact-org-and-owner.fga.yaml +0 -128
- package/src/authorization/__tests__/fixtures/fga/blueprint-private-visibility.fga.yaml +0 -318
- package/src/authorization/__tests__/fixtures/fga/channel-app-owner.fga.yaml +0 -125
- package/src/authorization/__tests__/fixtures/fga/channel-participation.fga.yaml +0 -201
- package/src/authorization/__tests__/fixtures/fga/channel-session-visibility.fga.yaml +0 -187
- package/src/authorization/__tests__/fixtures/fga/default-instance-inheritance.fga.yaml +0 -214
- package/src/authorization/__tests__/fixtures/fga/mcp-server-authoring.fga.yaml +0 -129
- package/src/authorization/__tests__/fixtures/fga/memory-subject-only.fga.yaml +0 -72
- package/src/authorization/__tests__/fixtures/fga/org-admin-owner-inheritance.fga.yaml +0 -308
- package/src/authorization/__tests__/fixtures/fga/org-shared-environment.fga.yaml +0 -144
- package/src/authorization/__tests__/fixtures/fga/platform-visibility.fga.yaml +0 -199
- package/src/authorization/__tests__/fixtures/fga/provider-standing-viewer.fga.yaml +0 -40
- package/src/authorization/__tests__/fixtures/fga/reserved-label-writer.fga.yaml +0 -41
- package/src/authorization/__tests__/fixtures/fga/schedule-owner.fga.yaml +0 -113
- package/src/authorization/__tests__/fixtures/fga/schedule-session-visibility.fga.yaml +0 -214
- package/src/authorization/__tests__/fixtures/fga/session-personal-resource.fga.yaml +0 -117
- package/src/authorization/__tests__/fixtures/fga/workflow-execution-sharing.fga.yaml +0 -190
- package/src/authorization/model/agent.ts +0 -64
- package/src/authorization/model/agent_channel.ts +0 -57
- package/src/authorization/model/agent_execution.ts +0 -33
- package/src/authorization/model/agent_instance.ts +0 -66
- package/src/authorization/model/agent_share.ts +0 -40
- package/src/authorization/model/api_key.ts +0 -28
- package/src/authorization/model/artifact.ts +0 -38
- package/src/authorization/model/channel_app.ts +0 -39
- package/src/authorization/model/environment.ts +0 -48
- package/src/authorization/model/execution_context.ts +0 -20
- package/src/authorization/model/iam_policy.ts +0 -42
- package/src/authorization/model/identity_account.ts +0 -26
- package/src/authorization/model/mcp_server.ts +0 -59
- package/src/authorization/model/memory.ts +0 -27
- package/src/authorization/model/oauth_app.ts +0 -43
- package/src/authorization/model/organization.ts +0 -59
- package/src/authorization/model/platform_client.ts +0 -43
- package/src/authorization/model/plugin.ts +0 -66
- package/src/authorization/model/schedule.ts +0 -49
- package/src/authorization/model/session.ts +0 -50
- package/src/authorization/model/skill.ts +0 -60
- package/src/authorization/model/workflow.ts +0 -60
- package/src/authorization/model/workflow_execution.ts +0 -46
- package/src/authorization/model/workflow_instance.ts +0 -125
- package/src/authorization/store-test-kit.ts +0 -395
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-index.d.ts","sourceRoot":"","sources":["../../../src/domain/iampolicy/list-index.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,kBAAkB,uEAO7B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The IamPolicy list index (store/list-index.ts): `principal` is the key
|
|
3
|
+
* the open-source adapter's `findByPrincipal` reads (resource-store.ts).
|
|
4
|
+
* It is not a lane's index: the built-in authorizer reads a person's rows,
|
|
5
|
+
* and the rows granted to each team they belong to, on every check and
|
|
6
|
+
* every list batch (authorization/derived-tuples.ts), and without the key
|
|
7
|
+
* each of those reads decodes the whole kind — a table that grows with
|
|
8
|
+
* every member, organization and grant.
|
|
9
|
+
*
|
|
10
|
+
* The key is the principal's id alone: a key reads one string field, and
|
|
11
|
+
* an id carries its kind's prefix (`ida_` for an account, `tm_` for a
|
|
12
|
+
* team), so the index narrows to one principal and the adapter's
|
|
13
|
+
* predicate on (kind, id) keeps the answer exact whatever the index
|
|
14
|
+
* returns. A policy is not organization-scoped the way a lane's rows are,
|
|
15
|
+
* so the read names no organization; the key table's lookup index leads
|
|
16
|
+
* with the key, not the organization (the v6 migration of each driver).
|
|
17
|
+
*
|
|
18
|
+
* A change to `keys` bumps `revision` (boot/__tests__/list-indexes.test.ts
|
|
19
|
+
* pins the pair).
|
|
20
|
+
*/
|
|
21
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
22
|
+
import { IamPolicySchema } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/api_pb";
|
|
23
|
+
import { declareListIndex, field } from "../../store/list-index.js";
|
|
24
|
+
export const iamPolicyListIndex = declareListIndex({
|
|
25
|
+
kind: ApiResourceKind.iam_policy,
|
|
26
|
+
schema: IamPolicySchema,
|
|
27
|
+
revision: 1,
|
|
28
|
+
keys: {
|
|
29
|
+
principal: field("spec.principal.id"),
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=list-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-index.js","sourceRoot":"","sources":["../../../src/domain/iampolicy/list-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AACtH,OAAO,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAErF,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;IACjD,IAAI,EAAE,eAAe,CAAC,UAAU;IAChC,MAAM,EAAE,eAAe;IACvB,QAAQ,EAAE,CAAC;IACX,IAAI,EAAE;QACJ,SAAS,EAAE,KAAK,CAAC,mBAAmB,CAAC;KACtC;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-store.d.ts","sourceRoot":"","sources":["../../../src/domain/iampolicy/resource-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resource-store.d.ts","sourceRoot":"","sources":["../../../src/domain/iampolicy/resource-store.ts"],"names":[],"mappings":"AAkDA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAItD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAgBjD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,CA6GtE"}
|
|
@@ -4,14 +4,21 @@
|
|
|
4
4
|
* §3a, §4). The composition root installs it when no extension registers
|
|
5
5
|
* `drivers.iamPolicyStore`.
|
|
6
6
|
*
|
|
7
|
-
* Reads. `findById` is a PRIMARY-KEY read.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
7
|
+
* Reads. `findById` is a PRIMARY-KEY read. `findByPrincipal` is an
|
|
8
|
+
* INDEXED read through the kind's list index (list-index.ts), because the
|
|
9
|
+
* built-in authorizer calls it on every check and every list batch — for
|
|
10
|
+
* the person, and once more per team they belong to — and a scan there
|
|
11
|
+
* costs a decode of every row the server holds, per call (measured
|
|
12
|
+
* 2026-09-24: about 4.6 microseconds per row, 47 ms a check at ten
|
|
13
|
+
* thousand rows on sqlite). The index narrows by the principal's id; the
|
|
14
|
+
* (kind, id) predicate decides, so the answer is exact whatever the index
|
|
15
|
+
* returns, and the store keeps it exact while an older binary still
|
|
16
|
+
* writes (store/interface.ts, `queryResources`). Every other find decodes
|
|
17
|
+
* `listResources(iam_policy)` and filters in memory: they serve the grant
|
|
18
|
+
* path and the access lists, not the check, and the row count behind them
|
|
19
|
+
* is members × organizations on a self-host. The filters are the cloud
|
|
20
|
+
* store's WHERE clauses restated over the proto (store.ts names each), so
|
|
21
|
+
* a driver's test over either edition reads the same contract.
|
|
15
22
|
*
|
|
16
23
|
* Writes. `save` refuses a policy whose id is not its triple's derived id
|
|
17
24
|
* (constants.ts policyIdFor): open source has no legacy random ids, and a
|
|
@@ -39,6 +46,7 @@ import { IamPolicySchema } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/api
|
|
|
39
46
|
import { kindEnumName } from "../../pipeline/apiresource-meta.js";
|
|
40
47
|
import { ResourceNotFoundError } from "../../store/interface.js";
|
|
41
48
|
import { USER_GRANT_PRINCIPAL_KINDS, policyIdFor } from "./constants.js";
|
|
49
|
+
import { iamPolicyListIndex } from "./list-index.js";
|
|
42
50
|
import { DuplicatePolicyError } from "./store.js";
|
|
43
51
|
const KIND = ApiResourceKind.iam_policy;
|
|
44
52
|
/**
|
|
@@ -63,7 +71,7 @@ export function newResourceIamPolicyStore(store) {
|
|
|
63
71
|
throw error;
|
|
64
72
|
}
|
|
65
73
|
}
|
|
66
|
-
/** Every row of the kind, decoded — the scan behind every
|
|
74
|
+
/** Every row of the kind, decoded — the scan behind every read but by id and by principal. */
|
|
67
75
|
async function all() {
|
|
68
76
|
const rows = await store.listResources(KIND);
|
|
69
77
|
return rows.map((bytes) => fromBinary(IamPolicySchema, bytes));
|
|
@@ -86,8 +94,13 @@ export function newResourceIamPolicyStore(store) {
|
|
|
86
94
|
await store.deleteResource(KIND, id);
|
|
87
95
|
},
|
|
88
96
|
findById: readById,
|
|
89
|
-
findByPrincipal(principalKind, principalId) {
|
|
90
|
-
|
|
97
|
+
async findByPrincipal(principalKind, principalId) {
|
|
98
|
+
const rows = await store.queryResources(iamPolicyListIndex, {
|
|
99
|
+
anyKey: [{ name: "principal", value: principalId }],
|
|
100
|
+
});
|
|
101
|
+
return rows
|
|
102
|
+
.map((row) => fromBinary(IamPolicySchema, row.data))
|
|
103
|
+
.filter((policy) => onPrincipal(policy, principalKind, principalId));
|
|
91
104
|
},
|
|
92
105
|
findByResource(resourceKind, resourceId) {
|
|
93
106
|
return where((policy) => onResource(policy, resourceKind, resourceId));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-store.js","sourceRoot":"","sources":["../../../src/domain/iampolicy/resource-store.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"resource-store.js","sourceRoot":"","sources":["../../../src/domain/iampolicy/resource-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAEtH,OAAO,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGlD,MAAM,IAAI,GAAG,eAAe,CAAC,UAAU,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,8BAA8B,GAClC,0BAA0B,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/D,MAAM,wBAAwB,GAA0B,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAE7E,MAAM,UAAU,yBAAyB,CAAC,KAAY;IACpD,KAAK,UAAU,QAAQ,CAAC,EAAU;QAChC,IAAI,CAAC;YACH,OAAO,MAAM,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,eAAe,CAAC,CAAC;QA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,EAAE,IAAI,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,CACzE,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,MAAiB;IACnC,OAAO,MAAM,CAAC,IAAI,EAAE,QAAQ,IAAI,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const workflowExecutionListIndex: import("../../store/list-index.js").ListIndexDeclaration<"
|
|
1
|
+
export declare const workflowExecutionListIndex: import("../../store/list-index.js").ListIndexDeclaration<"workflow" | "workflow_instance">;
|
|
2
2
|
//# sourceMappingURL=list-index.d.ts.map
|
|
@@ -174,11 +174,27 @@ export interface ListReadScope {
|
|
|
174
174
|
* `caller` is never the `internal` class: `restrictListByReadScope`,
|
|
175
175
|
* the one consumption idiom, answers that class before any driver is
|
|
176
176
|
* asked (the header's contract line). A driver that is offered it has
|
|
177
|
-
* been reached around the idiom and
|
|
178
|
-
* evaluate the server as a
|
|
177
|
+
* been reached around the idiom and refuses with
|
|
178
|
+
* `InternalCallerOfferedError` rather than evaluate the server as a
|
|
179
|
+
* person.
|
|
179
180
|
*/
|
|
180
181
|
restrictListEntries(caller: CallerIdentity, kind: ApiResourceKind, entries: ReadonlyArray<ListEntryMeta>): Promise<ReadonlySet<string>>;
|
|
181
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* The restrict verb's refusal of the `internal` class (its doc above):
|
|
185
|
+
* thrown by a driver that is offered the server acting as itself, which
|
|
186
|
+
* `restrictListByReadScope` answers before any driver is asked. Being
|
|
187
|
+
* offered it means a list lane reached the driver around that idiom, and
|
|
188
|
+
* evaluating the server as a person would answer a quiet short list, the
|
|
189
|
+
* failure stigmer#1207 fixed. It is a consumer bug, never a denial (a
|
|
190
|
+
* denial is an empty set): the lane faults and the pipeline answers its
|
|
191
|
+
* sanitized INTERNAL. One type for every edition's driver, so each refuses
|
|
192
|
+
* the class the same way.
|
|
193
|
+
*/
|
|
194
|
+
export declare class InternalCallerOfferedError extends Error {
|
|
195
|
+
readonly kind: ApiResourceKind;
|
|
196
|
+
constructor(kind: ApiResourceKind);
|
|
197
|
+
}
|
|
182
198
|
/**
|
|
183
199
|
* The shape every stored API resource message presents to the shared
|
|
184
200
|
* helper — the metadata fields the scope's candidates are built from, the
|
|
@@ -202,7 +218,8 @@ export interface ScopedListResource {
|
|
|
202
218
|
/**
|
|
203
219
|
* The ONE consumption idiom for post-scan lanes (the shared-step
|
|
204
220
|
* discipline of pipeline/steps/authorization-tuples.ts, rendered as a
|
|
205
|
-
* helper because half the lanes are direct handlers
|
|
221
|
+
* helper because half the lanes are direct handlers; on the barrel, so a
|
|
222
|
+
* composition's lane over its own table narrows the same way):
|
|
206
223
|
*
|
|
207
224
|
* - no scope composed → the input array unchanged (byte-identity;
|
|
208
225
|
* `requestOrg` deliberately not consulted — the OSS single-tenant
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-read-scope.d.ts","sourceRoot":"","sources":["../../src/extensions/list-read-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2HG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAC3H,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;
|
|
1
|
+
{"version":3,"file":"list-read-scope.d.ts","sourceRoot":"","sources":["../../src/extensions/list-read-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,MAAM,EAAE,MAAM,CAAC,CAAC;QAChC,UAAU,CAAC,EAAE,qBAAqB,CAAC;KACpC,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC;CACvC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,uBAAuB,CAAC,CAAC,SAAS,kBAAkB,EACxE,KAAK,EAAE,aAAa,GAAG,SAAS,EAChC,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,eAAe,EACrB,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAC3B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,CAAC,EAAE,CAAC,CA2Bd"}
|
|
@@ -3,12 +3,32 @@
|
|
|
3
3
|
// protos and each other, so there is no cycle. Deliberate — one resolver
|
|
4
4
|
// for the tuple writer, the point-check driver and the list reader beats
|
|
5
5
|
// a copy in the seam.
|
|
6
|
-
import { inheritedAuthorizationParentOf } from "../pipeline/apiresource-meta.js";
|
|
6
|
+
import { inheritedAuthorizationParentOf, kindEnumName, } from "../pipeline/apiresource-meta.js";
|
|
7
7
|
import { rowAuthorizationFactsOf } from "../pipeline/steps/authorization-facts.js";
|
|
8
|
+
/**
|
|
9
|
+
* The restrict verb's refusal of the `internal` class (its doc above):
|
|
10
|
+
* thrown by a driver that is offered the server acting as itself, which
|
|
11
|
+
* `restrictListByReadScope` answers before any driver is asked. Being
|
|
12
|
+
* offered it means a list lane reached the driver around that idiom, and
|
|
13
|
+
* evaluating the server as a person would answer a quiet short list, the
|
|
14
|
+
* failure stigmer#1207 fixed. It is a consumer bug, never a denial (a
|
|
15
|
+
* denial is an empty set): the lane faults and the pipeline answers its
|
|
16
|
+
* sanitized INTERNAL. One type for every edition's driver, so each refuses
|
|
17
|
+
* the class the same way.
|
|
18
|
+
*/
|
|
19
|
+
export class InternalCallerOfferedError extends Error {
|
|
20
|
+
kind;
|
|
21
|
+
constructor(kind) {
|
|
22
|
+
super(`the internal caller class was offered to the list scope for kind '${kindEnumName(kind)}' — the shared helper answers that class before any driver; a list lane reached the driver around it`);
|
|
23
|
+
this.name = "InternalCallerOfferedError";
|
|
24
|
+
this.kind = kind;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
8
27
|
/**
|
|
9
28
|
* The ONE consumption idiom for post-scan lanes (the shared-step
|
|
10
29
|
* discipline of pipeline/steps/authorization-tuples.ts, rendered as a
|
|
11
|
-
* helper because half the lanes are direct handlers
|
|
30
|
+
* helper because half the lanes are direct handlers; on the barrel, so a
|
|
31
|
+
* composition's lane over its own table narrows the same way):
|
|
12
32
|
*
|
|
13
33
|
* - no scope composed → the input array unchanged (byte-identity;
|
|
14
34
|
* `requestOrg` deliberately not consulted — the OSS single-tenant
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-read-scope.js","sourceRoot":"","sources":["../../src/extensions/list-read-scope.ts"],"names":[],"mappings":"AAgIA,sEAAsE;AACtE,uEAAuE;AACvE,yEAAyE;AACzE,yEAAyE;AACzE,sBAAsB;AACtB,OAAO,
|
|
1
|
+
{"version":3,"file":"list-read-scope.js","sourceRoot":"","sources":["../../src/extensions/list-read-scope.ts"],"names":[],"mappings":"AAgIA,sEAAsE;AACtE,uEAAuE;AACvE,yEAAyE;AACzE,yEAAyE;AACzE,sBAAsB;AACtB,OAAO,EACL,8BAA8B,EAC9B,YAAY,GACb,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAuEnF;;;;;;;;;;GAUG;AACH,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAC1C,IAAI,CAAkB;IAE/B,YAAY,IAAqB;QAC/B,KAAK,CACH,qEAAqE,YAAY,CAAC,IAAI,CAAC,sGAAsG,CAC9L,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;QACzC,IAAI,CAAC,IAAI,G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AAO,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAChF,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,yBAAyB,CAChC,IAAqB;IAIrB,MAAM,MAAM,GAAG,8BAA8B,CAAC,IAAI,CAAC,CAAC;IACpD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC;IACzB,CAAC;IACD,OAAO,CAAC,WAAW,EAAE,EAAE,CACrB,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC;AAClE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
* to this file are owner-visible surface changes, extended only through
|
|
11
11
|
* gates (the DD-005 review property: a surface change is a one-file diff).
|
|
12
12
|
*
|
|
13
|
+
* One data file is published beside it, through its own exports entry:
|
|
14
|
+
* `@stigmer/server/authorization-model.json`, the compiled authorization
|
|
15
|
+
* model (OpenFGA's JSON, generated from fga/model, whose README states the
|
|
16
|
+
* file's contract). Every edition reads those bytes: this server
|
|
17
|
+
* evaluates them, and an edition that runs OpenFGA applies them.
|
|
18
|
+
*
|
|
13
19
|
* The surface is exactly what the ratified architecture names (blueprint
|
|
14
20
|
* 20260826.02/03 §1) and the parameter types those entries force:
|
|
15
21
|
* - the compose entry and config loading (composeServer + its options'
|
|
@@ -85,16 +91,10 @@ export type { PlatformTokenClaimValue, PlatformTokenRefusal, PlatformTokenSignin
|
|
|
85
91
|
export { PLATFORM_TOKEN_ISSUER, PLATFORM_TOKEN_REFUSAL_MESSAGES, TOKEN_TYPE_CLAIM, decodeVerifiedPlatformTokenPayload, platformTokenRefusalError, signPlatformToken, stringClaim, verifyPlatformToken, } from "./platformtoken/envelope.js";
|
|
86
92
|
export type { PlatformTokenKeyMaterial, PlatformTokenKeyRing, PlatformTokenSigner, SigningPlatformTokenKeyRing, } from "./platformtoken/key-ring.js";
|
|
87
93
|
export { DEFAULT_PLATFORM_TOKEN_TTL_SECONDS, canSign, platformTokenKeyRingFromPem, } from "./platformtoken/key-ring.js";
|
|
88
|
-
export type { DerivedRelation, KindDeclaration, Rewrite, SubjectType, } from "./authorization/model/rewrite.js";
|
|
89
|
-
export type { Model } from "./authorization/model/index.js";
|
|
90
|
-
export { builtInModel, declarationFor, newModel, } from "./authorization/model/index.js";
|
|
91
|
-
export type { ObjectRef, Person, Subject, Tuple, TupleSource, } from "./authorization/tuples.js";
|
|
92
|
-
export type { EvaluationFault } from "./authorization/evaluator.js";
|
|
93
|
-
export { AuthorizationEvaluationError, MAX_RESOLUTION_DEPTH, checkRelation, } from "./authorization/evaluator.js";
|
|
94
|
-
export type { StoreTestCase, StoreTestDocument, StoreTestKit, StoreTestSkip, StoreTestSkipReason, } from "./authorization/store-test-kit.js";
|
|
95
|
-
export { parseStoreTestDocument, storeTestCases, } from "./authorization/store-test-kit.js";
|
|
96
94
|
export { NOT_FOUND_EXEMPT_KINDS } from "./authorization/authorizer.js";
|
|
97
95
|
export type { ListReadScope, ListEntryMeta, } from "./extensions/list-read-scope.js";
|
|
96
|
+
export { restrictListByReadScope } from "./extensions/list-read-scope.js";
|
|
97
|
+
export { InternalCallerOfferedError } from "./extensions/list-read-scope.js";
|
|
98
98
|
export type { ScheduleFireCallerMint } from "./extensions/schedule-fire-caller.js";
|
|
99
99
|
export { ScheduleFireCallerRefusedError } from "./extensions/schedule-fire-caller.js";
|
|
100
100
|
export type { VisitorErrorPolicy } from "./pipeline/interceptors/error-boundary.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":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,CAAC;AACpD,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,GAClC,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAQrE,YAAY,EACV,cAAc,EACd,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,0CAA0C,CAAC;AAOlD,YAAY,EACV,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
* to this file are owner-visible surface changes, extended only through
|
|
11
11
|
* gates (the DD-005 review property: a surface change is a one-file diff).
|
|
12
12
|
*
|
|
13
|
+
* One data file is published beside it, through its own exports entry:
|
|
14
|
+
* `@stigmer/server/authorization-model.json`, the compiled authorization
|
|
15
|
+
* model (OpenFGA's JSON, generated from fga/model, whose README states the
|
|
16
|
+
* file's contract). Every edition reads those bytes: this server
|
|
17
|
+
* evaluates them, and an edition that runs OpenFGA applies them.
|
|
18
|
+
*
|
|
13
19
|
* The surface is exactly what the ratified architecture names (blueprint
|
|
14
20
|
* 20260826.02/03 §1) and the parameter types those entries force:
|
|
15
21
|
* - the compose entry and config loading (composeServer + its options'
|
|
@@ -56,13 +62,22 @@ export { newSystemManagedPlatformClient } from "./domain/platformclient/system-m
|
|
|
56
62
|
export { SYSTEM_SHARE_CLIENT_SLUG } from "./domain/platformclient/constants.js";
|
|
57
63
|
export { PLATFORM_TOKEN_ISSUER, PLATFORM_TOKEN_REFUSAL_MESSAGES, TOKEN_TYPE_CLAIM, decodeVerifiedPlatformTokenPayload, platformTokenRefusalError, signPlatformToken, stringClaim, verifyPlatformToken, } from "./platformtoken/envelope.js";
|
|
58
64
|
export { DEFAULT_PLATFORM_TOKEN_TTL_SECONDS, canSign, platformTokenKeyRingFromPem, } from "./platformtoken/key-ring.js";
|
|
59
|
-
export { builtInModel, declarationFor, newModel, } from "./authorization/model/index.js";
|
|
60
|
-
export { AuthorizationEvaluationError, MAX_RESOLUTION_DEPTH, checkRelation, } from "./authorization/evaluator.js";
|
|
61
|
-
export { parseStoreTestDocument, storeTestCases, } from "./authorization/store-test-kit.js";
|
|
62
65
|
// The kinds whose missing row the built-in authorizer denies instead of
|
|
63
|
-
// answering not-found
|
|
64
|
-
//
|
|
66
|
+
// answering not-found: exported so a composition that authorizes with its
|
|
67
|
+
// own engine and probes existence itself pins its exemptions to this set.
|
|
68
|
+
// The model the authorizer evaluates is not exported as code: it is the
|
|
69
|
+
// data subpath `@stigmer/server/authorization-model.json` (this file's
|
|
70
|
+
// header).
|
|
65
71
|
export { NOT_FOUND_EXEMPT_KINDS } from "./authorization/authorizer.js";
|
|
72
|
+
// The one consumption idiom of the list read scope for post-scan list lanes:
|
|
73
|
+
// exported so a list lane a composition serves from its own table narrows
|
|
74
|
+
// its rows exactly as the library's lanes do, instead of building each
|
|
75
|
+
// candidate's authorization facts by hand.
|
|
76
|
+
export { restrictListByReadScope } from "./extensions/list-read-scope.js";
|
|
77
|
+
// The seam's refusal of the `internal` caller class on the restrict verb,
|
|
78
|
+
// which that idiom answers before any driver is asked: exported so a
|
|
79
|
+
// composition's driver refuses the class exactly as the built-in one does.
|
|
80
|
+
export { InternalCallerOfferedError } from "./extensions/list-read-scope.js";
|
|
66
81
|
export { ScheduleFireCallerRefusedError } from "./extensions/schedule-fire-caller.js";
|
|
67
82
|
export { createErrorBoundaryInterceptor } from "./pipeline/interceptors/error-boundary.js";
|
|
68
83
|
// The tuple lifecycle's resolution, for a kind a composition serves outside
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"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E,yEAAyE;AACzE,iDAAiD;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigmer/server",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.28.0",
|
|
4
4
|
"description": "The Stigmer OSS control plane as a composable library: composeServer, the extension registry and the driver seams a composition builds on. The self-contained deployable of the same server is @stigmer/server-slim.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"import": "./dist/index.js"
|
|
11
11
|
},
|
|
12
|
+
"./authorization-model.json": "./src/authorization/model/data/authorization-model.json",
|
|
12
13
|
"./package.json": "./package.json"
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
@@ -62,11 +63,11 @@
|
|
|
62
63
|
"@connectrpc/connect-node": "^2.0.0",
|
|
63
64
|
"@kubernetes/client-node": "2.0.0",
|
|
64
65
|
"@opentelemetry/api": "^1.9.0",
|
|
65
|
-
"@stigmer/outbound": "3.
|
|
66
|
-
"@stigmer/plugin-package": "3.
|
|
67
|
-
"@stigmer/protos": "3.
|
|
68
|
-
"@stigmer/temporal-codecs": "3.
|
|
69
|
-
"@stigmer/zip-structure": "3.
|
|
66
|
+
"@stigmer/outbound": "3.28.0",
|
|
67
|
+
"@stigmer/plugin-package": "3.28.0",
|
|
68
|
+
"@stigmer/protos": "3.28.0",
|
|
69
|
+
"@stigmer/temporal-codecs": "3.28.0",
|
|
70
|
+
"@stigmer/zip-structure": "3.28.0",
|
|
70
71
|
"@temporalio/activity": "1.16.2",
|
|
71
72
|
"@temporalio/client": "1.16.2",
|
|
72
73
|
"@temporalio/common": "1.16.2",
|
|
@@ -11,27 +11,35 @@ reading aggregates it does not own — resources through the generic `Store`,
|
|
|
11
11
|
accounts through the `IdentityAccountStore` port, roles through the
|
|
12
12
|
`IamPolicyStore` port — and writes nothing.
|
|
13
13
|
|
|
14
|
-
The idea, once:
|
|
15
|
-
|
|
16
|
-
`kind_meta.authorization` except the one that is a fact, the
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
The idea, once: authorization is one OpenFGA model (`../../fga/model`, compiled
|
|
15
|
+
into `model/data/authorization-model.json`), and every tuple it reads is derived
|
|
16
|
+
from a row by `kind_meta.authorization` except the one that is a fact, the
|
|
17
|
+
IamPolicy row. An edition that runs OpenFGA applies that model and stores the
|
|
18
|
+
tuples; this server evaluates the same bytes over the same tuples, derived from
|
|
19
|
+
the row when a check asks instead of stored. One model and one meaning of
|
|
20
|
+
authorization in every edition; the hosted edition stores what open source
|
|
21
|
+
computes.
|
|
20
22
|
|
|
21
23
|
## Parts
|
|
22
24
|
|
|
23
|
-
- `model/rewrite.ts` — the
|
|
24
|
-
(`this` with its type restrictions, `computed`, `from`,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
(`
|
|
33
|
-
`
|
|
34
|
-
`
|
|
25
|
+
- `model/rewrite.ts` — the evaluator's vocabulary: the five relation-rewrite
|
|
26
|
+
forms the model uses (`this` with its type restrictions, `computed`, `from`,
|
|
27
|
+
`union`, `intersection`, nested to any depth) and a kind's declaration.
|
|
28
|
+
- `model/openfga-json.ts` — the reader of the compiled model: OpenFGA's JSON as
|
|
29
|
+
`unknown`, turned into that vocabulary, every unknown key and every form the
|
|
30
|
+
evaluator does not run (`but not`, wildcards, conditions) refused by name at
|
|
31
|
+
module load, and what OpenFGA's validator proved re-asserted, so a hand edit
|
|
32
|
+
fails the boot, never an answer.
|
|
33
|
+
- `model/bindings.ts` — what JSON cannot carry: each type's row schema
|
|
34
|
+
(`ROWLESS` for `platform`, which resolves over tuples alone) and the two
|
|
35
|
+
relations no row carries as a `kind_meta` fact: `default_of` on the two
|
|
36
|
+
instance kinds (`model/default-of.ts`, from the blueprint's
|
|
37
|
+
`status.default_instance_id`) and `execution_viewer` on the workflow instance
|
|
38
|
+
(`model/execution-viewer.ts`, from `spec.execution_visibility`).
|
|
39
|
+
- `model/index.ts` — the built-in model: the reader joined with the bindings,
|
|
40
|
+
every type in `fga.mod` order, answered by kind or by FGA type name. It
|
|
41
|
+
declares every type, whichever edition serves it; the tier decides what an
|
|
42
|
+
edition evaluates (`authorizer.ts`, arm 2).
|
|
35
43
|
- `tuples.ts` — the tuple vocabulary (object, relation, subject; the string
|
|
36
44
|
notation), the `Person` type (the caller as the model sees them: account id
|
|
37
45
|
plus the aliases a creator stamp may carry). The model declares no wildcard
|
|
@@ -54,19 +62,16 @@ editions; the cloud stores what open source computes.
|
|
|
54
62
|
the tuple lifecycle's create-time resolution, pinned equal to it.
|
|
55
63
|
- `derived-tuples.ts` — the derivation (the cloud driver's shapes, from the
|
|
56
64
|
facts) and the source that joins it with the person's IamPolicy rows, read
|
|
57
|
-
once per source
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
target kind the model does not declare, a `list_objects` assertion, and an
|
|
68
|
-
assertion whose walk read a grant through a type the model does not declare
|
|
69
|
-
(the cloud's platform tenancy, `identity_provider#platform_user`).
|
|
65
|
+
once per source, and with the rows granted to each team the person holds
|
|
66
|
+
`member` on (one read more per team; open source serves no team, so its
|
|
67
|
+
callers never pay it). The two edition-specific facts live here: the
|
|
68
|
+
organization's owner is a row, and a stamp that names no person is no tuple. A
|
|
69
|
+
source may be seeded with candidates' facts (the list scope), so a seeded
|
|
70
|
+
object's tuples derive without a read of its row; a `derived` rule still reads
|
|
71
|
+
the row it needs.
|
|
72
|
+
- `strict-json.ts` — the strict reads both data inputs share (the compiled
|
|
73
|
+
model and the store tests): an unknown key or a wrong shape is a fault naming
|
|
74
|
+
where, never a half-read input.
|
|
70
75
|
|
|
71
76
|
- `authorizer.ts` — the `Authorizer` driver, arm for arm the cloud's
|
|
72
77
|
(`stigmer-cloud src/authorizer/fga-authorizer.ts`): the four pre-check denials
|
|
@@ -101,14 +106,18 @@ editions; the cloud stores what open source computes.
|
|
|
101
106
|
## Proof
|
|
102
107
|
|
|
103
108
|
`__tests__/store-tests.test.ts` is the proof that this evaluator answers the
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
`__tests__/
|
|
111
|
-
|
|
109
|
+
model the way OpenFGA does: it runs every suite under `../../fga/tests/` through
|
|
110
|
+
the store-test kit (`__tests__/store-test-kit.ts`), every `check` and every
|
|
111
|
+
`list_objects` assertion, nothing skipped, and the same suites run on the real
|
|
112
|
+
engine (`make test-authorization-model`, CI's `ci.authorization-model`).
|
|
113
|
+
`__tests__/facts.test.ts` pins that the derivation reads a row to the same links
|
|
114
|
+
and shapes the tuple lifecycle writes from, for every kind with stored rows.
|
|
115
|
+
`model/__tests__/registry.test.ts` pins the model to `fga.mod`, each binding to
|
|
116
|
+
the message `kind_meta` names, and the team grants to `team_grantable_roles`;
|
|
117
|
+
`model/__tests__/openfga-json.test.ts` pins every refusal of the reader;
|
|
118
|
+
`__tests__/wire-permissions.test.ts` pins that every question an RPC annotation
|
|
119
|
+
in `@stigmer/protos` asks is a relation the model defines, today's known gaps
|
|
120
|
+
pinned by name. The rest pin the machinery:
|
|
112
121
|
alias matching, the memo, the bounds, the source and the two derived rules on
|
|
113
122
|
both store drivers. The four drivers are pinned arm by arm on both store drivers
|
|
114
123
|
(`__tests__/authorizer.test.ts`, `organization-directory.test.ts`,
|
|
@@ -50,11 +50,10 @@ import {
|
|
|
50
50
|
newBuiltInAuthorizer,
|
|
51
51
|
} from "../authorizer.js";
|
|
52
52
|
import { builtInModel, newModel } from "../model/index.js";
|
|
53
|
-
import type { KindDeclaration } from "../model/rewrite.js";
|
|
54
|
-
import { computed, declareKind } from "../model/rewrite.js";
|
|
55
53
|
import { driverFixtures, dropPostgresFixture } from "./drivers.js";
|
|
56
54
|
import type { OpenedStore } from "./drivers.js";
|
|
57
|
-
import { fixtureRow } from "./support.js";
|
|
55
|
+
import { fixtureRow, storedDeclaration } from "./support.js";
|
|
56
|
+
import { computed, throwawayDeclaration } from "./throwaway-model.js";
|
|
58
57
|
|
|
59
58
|
const silentLogger = createLogger({
|
|
60
59
|
level: "error",
|
|
@@ -104,14 +103,6 @@ function check(
|
|
|
104
103
|
return { permission, resourceKind, resourceId };
|
|
105
104
|
}
|
|
106
105
|
|
|
107
|
-
function declared(type: string): KindDeclaration {
|
|
108
|
-
const declaration = builtInModel.byType(type);
|
|
109
|
-
if (declaration === undefined) {
|
|
110
|
-
throw new Error(`${type} is declared`);
|
|
111
|
-
}
|
|
112
|
-
return declaration;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
106
|
const SEEDED_KINDS: ReadonlyArray<ApiResourceKind> = [
|
|
116
107
|
ApiResourceKind.iam_policy,
|
|
117
108
|
ApiResourceKind.identity_account,
|
|
@@ -200,7 +191,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
|
|
|
200
191
|
spec?: Record<string, unknown>;
|
|
201
192
|
},
|
|
202
193
|
) {
|
|
203
|
-
const declaration =
|
|
194
|
+
const declaration = storedDeclaration(type);
|
|
204
195
|
await opened.store.saveResource(
|
|
205
196
|
declaration.kind,
|
|
206
197
|
id,
|
|
@@ -649,9 +640,9 @@ describe.each(driverFixtures(SEEDED_KINDS))(
|
|
|
649
640
|
});
|
|
650
641
|
|
|
651
642
|
it("a broken model (a relation cycle) is a fault, not a lockout", async () => {
|
|
652
|
-
const cyclic =
|
|
643
|
+
const cyclic = throwawayDeclaration({
|
|
653
644
|
kind: ApiResourceKind.agent,
|
|
654
|
-
schema:
|
|
645
|
+
schema: storedDeclaration("agent").schema,
|
|
655
646
|
source: "test",
|
|
656
647
|
relations: [
|
|
657
648
|
["a", computed("b")],
|