@stigmer/server 3.27.2 → 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 +3 -3
- package/dist/authorization/authorizer.js +3 -3
- package/dist/authorization/derived-tuples.js +6 -1
- 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/domain/workflowexecution/list-index.d.ts +1 -1
- package/dist/extensions/list-read-scope.d.ts +18 -2
- package/dist/extensions/list-read-scope.d.ts.map +1 -1
- package/dist/extensions/list-read-scope.js +20 -1
- package/dist/extensions/list-read-scope.js.map +1 -1
- package/dist/index.d.ts +7 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- package/src/authorization/README.md +41 -34
- package/src/authorization/__tests__/authorizer.test.ts +5 -14
- package/src/authorization/__tests__/derived-tuples.test.ts +29 -27
- 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 +12 -20
- 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 +3 -3
- package/src/authorization/derived-tuples.ts +7 -2
- 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/compose.ts +9 -7
- package/src/extensions/__tests__/built-in-authorization-composed.test.ts +3 -6
- package/src/extensions/list-read-scope.ts +30 -3
- package/src/index.ts +15 -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__/enterprise-model.ts +0 -59
- 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
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AAajG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,WAAW,aAAc,SAAQ,qBAAqB;IAC1D,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,C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AE,CAAC,CA2Bd"}
|
|
@@ -3,8 +3,27 @@
|
|
|
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
|
|
@@ -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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AC,CAAC;IACjD,MAAM,OAAO,GAAoB,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QACxD,MAAM,KAAK,GAAkB;YAC3B,GAAG,uBAAuB,CAAC,IAAI,EAAE,QAAQ,CAAC;YAC1C,MAAM,EAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE;SACxC,CAAC;QACF,MAAM,mBAAmB,GAAG,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACxD,OAAO,mBAAmB,KAAK,SAAS;YACtC,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,mBAAmB,EAAE,CAAC;IACxC,CAAC,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACvE,OAAO,OAAO,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,17 +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";
|
|
98
96
|
export { restrictListByReadScope } from "./extensions/list-read-scope.js";
|
|
97
|
+
export { InternalCallerOfferedError } from "./extensions/list-read-scope.js";
|
|
99
98
|
export type { ScheduleFireCallerMint } from "./extensions/schedule-fire-caller.js";
|
|
100
99
|
export { ScheduleFireCallerRefusedError } from "./extensions/schedule-fire-caller.js";
|
|
101
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":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,YAAY,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,aAAa,EACb,QAAQ,EACR,OAAO,GACR,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,4BAA4B,EAC5B,kBAAkB,EAClB,2BAA2B,EAC3B,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,WAAW,EACX,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AASlC,YAA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YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAcpC,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMzD,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kCAAkC,EAAE,MAAM,0BAA0B,CAAC;AAS9E,OAAO,EACL,4BAA4B,EAC5B,eAAe,EACf,gBAAgB,IAAI,sCAAsC,GAC3D,MAAM,4CAA4C,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,18 +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";
|
|
66
72
|
// The one consumption idiom of the list read scope for post-scan list lanes:
|
|
67
73
|
// exported so a list lane a composition serves from its own table narrows
|
|
68
74
|
// its rows exactly as the library's lanes do, instead of building each
|
|
69
75
|
// candidate's authorization facts by hand.
|
|
70
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";
|
|
71
81
|
export { ScheduleFireCallerRefusedError } from "./extensions/schedule-fire-caller.js";
|
|
72
82
|
export { createErrorBoundaryInterceptor } from "./pipeline/interceptors/error-boundary.js";
|
|
73
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":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,wCAAwC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAkEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAe3E,OAAO,EACL,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,iCAAiC,CAAC;AAQzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAQ1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAW1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAKnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAQ9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAU3E,OAAO,EAAE,4BAA4B,EAAE,MA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AqE;AACrE,uEAAuE;AACvE,iEAAiE;AACjE,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,aAAa,GACd,MAAM,4BAA4B,CAAC;AAepC,OAAO,EAAE,kCAAkC,EAAE,MAAM,0BAA0B,CAAC;AAE9E,yEAAyE;AACzE,wEAAwE;AACxE,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,wEAAwE;AACxE,kDAAkD;AAClD,OAAO,EACL,4BAA4B,EAC5B,eAAe,EACf,gBAAgB,IAAI,sCAAsC,GAC3D,MAAM,4CAA4C,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;AA0BrE,oEAAoE;AACpE,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
|
|
@@ -61,14 +69,9 @@ editions; the cloud stores what open source computes.
|
|
|
61
69
|
source may be seeded with candidates' facts (the list scope), so a seeded
|
|
62
70
|
object's tuples derive without a read of its row; a `derived` rule still reads
|
|
63
71
|
the row it needs.
|
|
64
|
-
- `
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
byte-exact mirror of the cloud's `fga/tests/`); the cloud runs it over the
|
|
68
|
-
live files at the re-pin. What it does not run it reports in three reasons: a
|
|
69
|
-
target kind the model does not declare, a `list_objects` assertion, and an
|
|
70
|
-
assertion whose walk read a grant through a type the model does not declare
|
|
71
|
-
(the cloud's platform tenancy, `identity_provider#platform_user`).
|
|
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.
|
|
72
75
|
|
|
73
76
|
- `authorizer.ts` — the `Authorizer` driver, arm for arm the cloud's
|
|
74
77
|
(`stigmer-cloud src/authorizer/fga-authorizer.ts`): the four pre-check denials
|
|
@@ -103,14 +106,18 @@ editions; the cloud stores what open source computes.
|
|
|
103
106
|
## Proof
|
|
104
107
|
|
|
105
108
|
`__tests__/store-tests.test.ts` is the proof that this evaluator answers the
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
`__tests__/
|
|
113
|
-
|
|
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:
|
|
114
121
|
alias matching, the memo, the bounds, the source and the two derived rules on
|
|
115
122
|
both store drivers. The four drivers are pinned arm by arm on both store drivers
|
|
116
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")],
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* source, an absent object answering nothing, a store fault propagating
|
|
15
15
|
* as the fault it is — the ratified store-fault mapping, which is what
|
|
16
16
|
* lets the driver above fold it to `unavailable` and never to a denial.
|
|
17
|
-
* Its grants-to-teams arm evaluates the Enterprise team
|
|
18
|
-
*
|
|
17
|
+
* Its grants-to-teams arm evaluates the built-in model's Enterprise team
|
|
18
|
+
* type: a grant to a team reaches its members and nobody
|
|
19
19
|
* who left the organization, and a person in no team — every open-source
|
|
20
20
|
* caller — still costs the source exactly one read.
|
|
21
21
|
*/
|
|
@@ -44,21 +44,12 @@ import { deriveTuples, newDerivedTupleSource } from "../derived-tuples.js";
|
|
|
44
44
|
import { checkRelation } from "../evaluator.js";
|
|
45
45
|
import { rowFactsOf } from "../facts.js";
|
|
46
46
|
import { builtInModel } from "../model/index.js";
|
|
47
|
-
import type { KindDeclaration } from "../model/rewrite.js";
|
|
48
47
|
import type { Person } from "../tuples.js";
|
|
49
48
|
import { formatTuple, parseObjectRef } from "../tuples.js";
|
|
50
49
|
import { driverFixtures, dropPostgresFixture } from "./drivers.js";
|
|
51
50
|
import type { OpenedStore } from "./drivers.js";
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
|
|
55
|
-
function declared(type: string): KindDeclaration {
|
|
56
|
-
const declaration = builtInModel.byType(type);
|
|
57
|
-
if (declaration === undefined) {
|
|
58
|
-
throw new Error(`${type} is declared in this slice`);
|
|
59
|
-
}
|
|
60
|
-
return declaration;
|
|
61
|
-
}
|
|
51
|
+
import { fixtureRow, storedDeclaration } from "./support.js";
|
|
52
|
+
import type { StoredKindDeclaration } from "./support.js";
|
|
62
53
|
|
|
63
54
|
function derivedFor(
|
|
64
55
|
type: string,
|
|
@@ -69,7 +60,7 @@ function derivedFor(
|
|
|
69
60
|
spec?: Readonly<Record<string, unknown>>;
|
|
70
61
|
},
|
|
71
62
|
): string[] {
|
|
72
|
-
const declaration =
|
|
63
|
+
const declaration = storedDeclaration(type);
|
|
73
64
|
const row = fixtureRow(declaration, {
|
|
74
65
|
id: `${type}-1`,
|
|
75
66
|
org: facts.org ?? "acme",
|
|
@@ -301,7 +292,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
|
|
|
301
292
|
opened = await fixture.open();
|
|
302
293
|
counted = countingPolicies(newResourceIamPolicyStore(opened.store));
|
|
303
294
|
accounts = newResourceIdentityAccountStore(opened.store);
|
|
304
|
-
const organization =
|
|
295
|
+
const organization = storedDeclaration("organization");
|
|
305
296
|
await opened.store.saveResource(
|
|
306
297
|
ApiResourceKind.organization,
|
|
307
298
|
"acme",
|
|
@@ -313,7 +304,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
|
|
|
313
304
|
createdBy: ROOT.accountId,
|
|
314
305
|
}),
|
|
315
306
|
);
|
|
316
|
-
const agent =
|
|
307
|
+
const agent = storedDeclaration("agent");
|
|
317
308
|
await opened.store.saveResource(
|
|
318
309
|
ApiResourceKind.agent,
|
|
319
310
|
"agt_team",
|
|
@@ -439,17 +430,28 @@ describe.each(driverFixtures(SEEDED_KINDS))(
|
|
|
439
430
|
).toEqual([]);
|
|
440
431
|
});
|
|
441
432
|
|
|
442
|
-
it("an absent object,
|
|
433
|
+
it("an absent object, a declared kind this edition stores no row of, a rowless kind, or a kind the model does not declare answers no tuples", async () => {
|
|
443
434
|
const source = sourceFor(ROOT);
|
|
444
435
|
expect(
|
|
445
436
|
await source.tuplesOf(parseObjectRef("agent:agt_missing"), "owner"),
|
|
446
437
|
).toEqual([]);
|
|
438
|
+
// Declared, served by the wider editions: the store has no such row.
|
|
447
439
|
expect(
|
|
448
440
|
await source.tuplesOf(
|
|
449
441
|
parseObjectRef("identity_provider:idp"),
|
|
450
442
|
"owner",
|
|
451
443
|
),
|
|
452
444
|
).toEqual([]);
|
|
445
|
+
// Rowless: no row is loaded for it at all.
|
|
446
|
+
expect(
|
|
447
|
+
await source.tuplesOf(parseObjectRef("platform:stigmer"), "operator"),
|
|
448
|
+
).toEqual([]);
|
|
449
|
+
expect(
|
|
450
|
+
await source.tuplesOf(
|
|
451
|
+
parseObjectRef("api_resource_version:v1"),
|
|
452
|
+
"owner",
|
|
453
|
+
),
|
|
454
|
+
).toEqual([]);
|
|
453
455
|
expect(
|
|
454
456
|
await source.tuplesOf(parseObjectRef("nonsense:x"), "owner"),
|
|
455
457
|
).toEqual([]);
|
|
@@ -468,7 +470,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
|
|
|
468
470
|
|
|
469
471
|
it("a source seeded with a candidate's facts derives that object's tuples WITHOUT loading its row; the parent hop still loads", async () => {
|
|
470
472
|
let rowReads = 0;
|
|
471
|
-
const agent =
|
|
473
|
+
const agent = storedDeclaration("agent");
|
|
472
474
|
const seeded = newDerivedTupleSource(
|
|
473
475
|
{
|
|
474
476
|
store: {
|
|
@@ -523,7 +525,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
|
|
|
523
525
|
// carry, so the rule loads the row — one read, stated in the list
|
|
524
526
|
// scope's cost pin as well.
|
|
525
527
|
let rowReads = 0;
|
|
526
|
-
const instance =
|
|
528
|
+
const instance = storedDeclaration("agent_instance");
|
|
527
529
|
const row = fixtureRow(instance, {
|
|
528
530
|
id: "ai_seeded",
|
|
529
531
|
org: "acme",
|
|
@@ -575,7 +577,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
|
|
|
575
577
|
|
|
576
578
|
/**
|
|
577
579
|
* The grants made to a person's teams, through the real source and the
|
|
578
|
-
* evaluator over the Enterprise team type
|
|
580
|
+
* evaluator over the built-in model's Enterprise team type. Seeded:
|
|
579
581
|
* `acme` with Dave a member and Root its owner; `tm_core` and
|
|
580
582
|
* `tm_other` in `acme`; Dave and Erin granted `member` on `tm_core`,
|
|
581
583
|
* Erin holding no organization role (she left); `agt_core` shared with
|
|
@@ -591,7 +593,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
|
|
|
591
593
|
};
|
|
592
594
|
|
|
593
595
|
async function seed(
|
|
594
|
-
declaration:
|
|
596
|
+
declaration: StoredKindDeclaration,
|
|
595
597
|
facts: Parameters<typeof fixtureRow>[1],
|
|
596
598
|
): Promise<void> {
|
|
597
599
|
await opened.store.saveResource(
|
|
@@ -605,14 +607,14 @@ describe.each(driverFixtures(SEEDED_KINDS))(
|
|
|
605
607
|
beforeEach(async () => {
|
|
606
608
|
opened = await fixture.open();
|
|
607
609
|
counted = countingPolicies(newResourceIamPolicyStore(opened.store));
|
|
608
|
-
await seed(
|
|
610
|
+
await seed(storedDeclaration("organization"), {
|
|
609
611
|
id: "acme",
|
|
610
612
|
org: "",
|
|
611
613
|
visibility: ApiResourceVisibility.visibility_private,
|
|
612
614
|
createdBy: ROOT.accountId,
|
|
613
615
|
});
|
|
614
616
|
for (const id of ["tm_core", "tm_other"]) {
|
|
615
|
-
await seed(
|
|
617
|
+
await seed(storedDeclaration("team"), {
|
|
616
618
|
id,
|
|
617
619
|
org: "acme",
|
|
618
620
|
visibility: ApiResourceVisibility.visibility_private,
|
|
@@ -623,7 +625,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
|
|
|
623
625
|
["agt_core", "tm_core"],
|
|
624
626
|
["agt_other", "tm_other"],
|
|
625
627
|
] as const) {
|
|
626
|
-
await seed(
|
|
628
|
+
await seed(storedDeclaration("agent"), {
|
|
627
629
|
id,
|
|
628
630
|
org: "acme",
|
|
629
631
|
visibility: ApiResourceVisibility.visibility_private,
|
|
@@ -664,7 +666,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
|
|
|
664
666
|
store: opened.store,
|
|
665
667
|
policies: counted.policies,
|
|
666
668
|
accounts: newResourceIdentityAccountStore(opened.store),
|
|
667
|
-
model:
|
|
669
|
+
model: builtInModel,
|
|
668
670
|
},
|
|
669
671
|
person,
|
|
670
672
|
);
|
|
@@ -676,7 +678,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
|
|
|
676
678
|
relation: string,
|
|
677
679
|
): Promise<boolean> {
|
|
678
680
|
return checkRelation(
|
|
679
|
-
{ model:
|
|
681
|
+
{ model: builtInModel, source: sourceFor(person) },
|
|
680
682
|
parseObjectRef(object),
|
|
681
683
|
relation,
|
|
682
684
|
person,
|
|
@@ -762,7 +764,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
|
|
|
762
764
|
id: string,
|
|
763
765
|
facts: Omit<Parameters<typeof fixtureRow>[1], "id">,
|
|
764
766
|
): Promise<void> {
|
|
765
|
-
const declaration =
|
|
767
|
+
const declaration = storedDeclaration(type);
|
|
766
768
|
await opened.store.saveResource(
|
|
767
769
|
declaration.kind,
|
|
768
770
|
id,
|