@stigmer/server 3.21.0 → 3.22.1-dev.20260922095755
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authorization/authorizer.d.ts +4 -8
- package/dist/authorization/authorizer.d.ts.map +1 -1
- package/dist/authorization/authorizer.js +5 -9
- package/dist/authorization/authorizer.js.map +1 -1
- package/dist/authorization/derived-tuples.d.ts.map +1 -1
- package/dist/authorization/derived-tuples.js +10 -25
- package/dist/authorization/derived-tuples.js.map +1 -1
- package/dist/authorization/evaluator.d.ts +13 -8
- package/dist/authorization/evaluator.d.ts.map +1 -1
- package/dist/authorization/evaluator.js +4 -20
- 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 +24 -20
- package/dist/authorization/list-read-scope.js.map +1 -1
- package/dist/authorization/model/agent.d.ts.map +1 -1
- package/dist/authorization/model/agent.js +4 -5
- package/dist/authorization/model/agent.js.map +1 -1
- package/dist/authorization/model/agent_instance.d.ts.map +1 -1
- package/dist/authorization/model/agent_instance.js +2 -2
- package/dist/authorization/model/agent_instance.js.map +1 -1
- package/dist/authorization/model/mcp_server.d.ts.map +1 -1
- package/dist/authorization/model/mcp_server.js +2 -2
- package/dist/authorization/model/mcp_server.js.map +1 -1
- package/dist/authorization/model/organization.d.ts.map +1 -1
- package/dist/authorization/model/organization.js +2 -0
- package/dist/authorization/model/organization.js.map +1 -1
- package/dist/authorization/model/plugin.d.ts.map +1 -1
- package/dist/authorization/model/plugin.js +3 -4
- package/dist/authorization/model/plugin.js.map +1 -1
- package/dist/authorization/model/rewrite.d.ts +8 -10
- package/dist/authorization/model/rewrite.d.ts.map +1 -1
- package/dist/authorization/model/rewrite.js +0 -3
- package/dist/authorization/model/rewrite.js.map +1 -1
- package/dist/authorization/model/skill.d.ts.map +1 -1
- package/dist/authorization/model/skill.js +2 -2
- package/dist/authorization/model/skill.js.map +1 -1
- package/dist/authorization/model/workflow.d.ts.map +1 -1
- package/dist/authorization/model/workflow.js +2 -2
- package/dist/authorization/model/workflow.js.map +1 -1
- package/dist/authorization/model/workflow_instance.d.ts.map +1 -1
- package/dist/authorization/model/workflow_instance.js +2 -2
- package/dist/authorization/model/workflow_instance.js.map +1 -1
- package/dist/authorization/organization-directory.d.ts.map +1 -1
- package/dist/authorization/organization-directory.js +2 -3
- package/dist/authorization/organization-directory.js.map +1 -1
- package/dist/authorization/store-test-kit.d.ts +0 -6
- package/dist/authorization/store-test-kit.d.ts.map +1 -1
- package/dist/authorization/store-test-kit.js +16 -62
- package/dist/authorization/store-test-kit.js.map +1 -1
- package/dist/authorization/tuples.d.ts +13 -32
- package/dist/authorization/tuples.d.ts.map +1 -1
- package/dist/authorization/tuples.js +3 -11
- package/dist/authorization/tuples.js.map +1 -1
- package/dist/domain/agent/controller.d.ts.map +1 -1
- package/dist/domain/agent/controller.js +6 -4
- package/dist/domain/agent/controller.js.map +1 -1
- package/dist/domain/agentchannel/controller.d.ts.map +1 -1
- package/dist/domain/agentchannel/controller.js +9 -2
- package/dist/domain/agentchannel/controller.js.map +1 -1
- package/dist/domain/agentchannel/steps.d.ts +19 -0
- package/dist/domain/agentchannel/steps.d.ts.map +1 -1
- package/dist/domain/agentchannel/steps.js +32 -0
- package/dist/domain/agentchannel/steps.js.map +1 -1
- package/dist/domain/agentexecution/controller.d.ts.map +1 -1
- package/dist/domain/agentexecution/controller.js +3 -1
- package/dist/domain/agentexecution/controller.js.map +1 -1
- package/dist/domain/agentinstance/controller.d.ts +5 -5
- package/dist/domain/agentinstance/controller.d.ts.map +1 -1
- package/dist/domain/agentinstance/controller.js +9 -5
- package/dist/domain/agentinstance/controller.js.map +1 -1
- package/dist/domain/agentinstance/steps.d.ts +43 -8
- package/dist/domain/agentinstance/steps.d.ts.map +1 -1
- package/dist/domain/agentinstance/steps.js +71 -8
- package/dist/domain/agentinstance/steps.js.map +1 -1
- package/dist/domain/agentshare/constants.d.ts +6 -11
- package/dist/domain/agentshare/constants.d.ts.map +1 -1
- package/dist/domain/agentshare/constants.js +8 -16
- package/dist/domain/agentshare/constants.js.map +1 -1
- package/dist/domain/agentshare/controller.d.ts.map +1 -1
- package/dist/domain/agentshare/controller.js +10 -2
- package/dist/domain/agentshare/controller.js.map +1 -1
- package/dist/domain/agentshare/steps.d.ts +61 -10
- package/dist/domain/agentshare/steps.d.ts.map +1 -1
- package/dist/domain/agentshare/steps.js +121 -117
- package/dist/domain/agentshare/steps.js.map +1 -1
- package/dist/domain/artifact/controller.js +21 -25
- package/dist/domain/artifact/controller.js.map +1 -1
- package/dist/domain/channelapp/controller.d.ts.map +1 -1
- package/dist/domain/channelapp/controller.js +2 -0
- package/dist/domain/channelapp/controller.js.map +1 -1
- package/dist/domain/environment/controller.d.ts.map +1 -1
- package/dist/domain/environment/controller.js +4 -3
- package/dist/domain/environment/controller.js.map +1 -1
- package/dist/domain/executioncontext/controller.d.ts.map +1 -1
- package/dist/domain/executioncontext/controller.js +4 -1
- package/dist/domain/executioncontext/controller.js.map +1 -1
- package/dist/domain/executioncontext/steps.d.ts.map +1 -1
- package/dist/domain/executioncontext/steps.js +2 -1
- package/dist/domain/executioncontext/steps.js.map +1 -1
- package/dist/domain/mcpserver/connect.d.ts.map +1 -1
- package/dist/domain/mcpserver/connect.js +8 -7
- package/dist/domain/mcpserver/connect.js.map +1 -1
- package/dist/domain/mcpserver/controller.d.ts.map +1 -1
- package/dist/domain/mcpserver/controller.js +5 -4
- package/dist/domain/mcpserver/controller.js.map +1 -1
- package/dist/domain/mcpserver/start-connect.d.ts.map +1 -1
- package/dist/domain/mcpserver/start-connect.js +8 -7
- package/dist/domain/mcpserver/start-connect.js.map +1 -1
- package/dist/domain/memory/controller.d.ts.map +1 -1
- package/dist/domain/memory/controller.js +6 -1
- package/dist/domain/memory/controller.js.map +1 -1
- package/dist/domain/memory/steps.d.ts +23 -0
- package/dist/domain/memory/steps.d.ts.map +1 -1
- package/dist/domain/memory/steps.js +35 -0
- package/dist/domain/memory/steps.js.map +1 -1
- package/dist/domain/oauthapp/controller.d.ts.map +1 -1
- package/dist/domain/oauthapp/controller.js +2 -0
- package/dist/domain/oauthapp/controller.js.map +1 -1
- package/dist/domain/plugin/controller.d.ts.map +1 -1
- package/dist/domain/plugin/controller.js +6 -27
- package/dist/domain/plugin/controller.js.map +1 -1
- package/dist/domain/plugin/push.d.ts +7 -5
- package/dist/domain/plugin/push.d.ts.map +1 -1
- package/dist/domain/plugin/push.js +8 -14
- package/dist/domain/plugin/push.js.map +1 -1
- package/dist/domain/schedule/controller.d.ts.map +1 -1
- package/dist/domain/schedule/controller.js +10 -2
- package/dist/domain/schedule/controller.js.map +1 -1
- package/dist/domain/schedule/steps.d.ts +19 -0
- package/dist/domain/schedule/steps.d.ts.map +1 -1
- package/dist/domain/schedule/steps.js +32 -0
- package/dist/domain/schedule/steps.js.map +1 -1
- package/dist/domain/session/controller.d.ts.map +1 -1
- package/dist/domain/session/controller.js +3 -2
- package/dist/domain/session/controller.js.map +1 -1
- package/dist/domain/session/steps.d.ts +8 -9
- package/dist/domain/session/steps.d.ts.map +1 -1
- package/dist/domain/session/steps.js +17 -21
- package/dist/domain/session/steps.js.map +1 -1
- package/dist/domain/skill/controller.d.ts.map +1 -1
- package/dist/domain/skill/controller.js +8 -19
- package/dist/domain/skill/controller.js.map +1 -1
- package/dist/domain/workflow/agent-call-references.d.ts +54 -0
- package/dist/domain/workflow/agent-call-references.d.ts.map +1 -0
- package/dist/domain/workflow/agent-call-references.js +97 -0
- package/dist/domain/workflow/agent-call-references.js.map +1 -0
- package/dist/domain/workflow/controller.d.ts.map +1 -1
- package/dist/domain/workflow/controller.js +44 -113
- package/dist/domain/workflow/controller.js.map +1 -1
- package/dist/domain/workflow/registry/data/task-kind-registry.json +1 -1
- package/dist/domain/workflow/validation/task-config-constraints.d.ts +10 -1
- package/dist/domain/workflow/validation/task-config-constraints.d.ts.map +1 -1
- package/dist/domain/workflow/validation/task-config-constraints.js +3 -2
- package/dist/domain/workflow/validation/task-config-constraints.js.map +1 -1
- package/dist/domain/workflow/version-resolution.d.ts +5 -0
- package/dist/domain/workflow/version-resolution.d.ts.map +1 -0
- package/dist/domain/workflow/version-resolution.js +113 -0
- package/dist/domain/workflow/version-resolution.js.map +1 -0
- package/dist/domain/workflowexecution/controller.d.ts.map +1 -1
- package/dist/domain/workflowexecution/controller.js +4 -2
- package/dist/domain/workflowexecution/controller.js.map +1 -1
- package/dist/domain/workflowinstance/controller.d.ts.map +1 -1
- package/dist/domain/workflowinstance/controller.js +9 -5
- package/dist/domain/workflowinstance/controller.js.map +1 -1
- package/dist/domain/workflowinstance/steps.d.ts +20 -0
- package/dist/domain/workflowinstance/steps.d.ts.map +1 -1
- package/dist/domain/workflowinstance/steps.js +39 -0
- package/dist/domain/workflowinstance/steps.js.map +1 -1
- package/dist/extensions/authorization-queries.d.ts +6 -5
- package/dist/extensions/authorization-queries.d.ts.map +1 -1
- package/dist/extensions/identity.d.ts +19 -0
- package/dist/extensions/identity.d.ts.map +1 -1
- package/dist/extensions/identity.js +22 -3
- package/dist/extensions/identity.js.map +1 -1
- package/dist/extensions/list-read-scope.d.ts +42 -8
- package/dist/extensions/list-read-scope.d.ts.map +1 -1
- package/dist/extensions/list-read-scope.js +13 -2
- package/dist/extensions/list-read-scope.js.map +1 -1
- package/dist/extensions/resource-authorization.d.ts +3 -2
- package/dist/extensions/resource-authorization.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pipeline/apiresource-meta.d.ts +12 -3
- package/dist/pipeline/apiresource-meta.d.ts.map +1 -1
- package/dist/pipeline/apiresource-meta.js +21 -10
- package/dist/pipeline/apiresource-meta.js.map +1 -1
- package/dist/pipeline/steps/authorization-tuples.d.ts +9 -3
- package/dist/pipeline/steps/authorization-tuples.d.ts.map +1 -1
- package/dist/pipeline/steps/authorization-tuples.js +9 -11
- package/dist/pipeline/steps/authorization-tuples.js.map +1 -1
- package/dist/pipeline/steps/authorize-resolved-target.d.ts +88 -0
- package/dist/pipeline/steps/authorize-resolved-target.d.ts.map +1 -0
- package/dist/pipeline/steps/authorize-resolved-target.js +36 -0
- package/dist/pipeline/steps/authorize-resolved-target.js.map +1 -0
- package/dist/pipeline/steps/authorize.d.ts +27 -0
- package/dist/pipeline/steps/authorize.d.ts.map +1 -1
- package/dist/pipeline/steps/authorize.js +49 -10
- package/dist/pipeline/steps/authorize.js.map +1 -1
- package/dist/pipeline/steps/guard-memory-capture.d.ts.map +1 -1
- package/dist/pipeline/steps/guard-memory-capture.js +2 -1
- package/dist/pipeline/steps/guard-memory-capture.js.map +1 -1
- package/dist/pipeline/steps/guard-reserved-labels.d.ts.map +1 -1
- package/dist/pipeline/steps/guard-reserved-labels.js +6 -7
- package/dist/pipeline/steps/guard-reserved-labels.js.map +1 -1
- package/dist/pipeline/steps/helpers.d.ts +9 -5
- package/dist/pipeline/steps/helpers.d.ts.map +1 -1
- package/dist/pipeline/steps/helpers.js +11 -15
- package/dist/pipeline/steps/helpers.js.map +1 -1
- package/dist/pipeline/steps/references.d.ts +178 -20
- package/dist/pipeline/steps/references.d.ts.map +1 -1
- package/dist/pipeline/steps/references.js +344 -43
- package/dist/pipeline/steps/references.js.map +1 -1
- package/dist/pipeline/steps/version-history.d.ts +11 -0
- package/dist/pipeline/steps/version-history.d.ts.map +1 -1
- package/dist/pipeline/steps/version-history.js +26 -0
- package/dist/pipeline/steps/version-history.js.map +1 -1
- package/dist/query/search/controller.js +0 -1
- package/dist/query/search/controller.js.map +1 -1
- package/dist/query/search/criteria.d.ts +1 -5
- package/dist/query/search/criteria.d.ts.map +1 -1
- package/dist/query/search/criteria.js +3 -13
- package/dist/query/search/criteria.js.map +1 -1
- package/dist/query/search/handler.d.ts +5 -4
- package/dist/query/search/handler.d.ts.map +1 -1
- package/dist/query/search/handler.js +7 -6
- package/dist/query/search/handler.js.map +1 -1
- package/dist/query/search/query-store.d.ts.map +1 -1
- package/dist/query/search/query-store.js +0 -2
- package/dist/query/search/query-store.js.map +1 -1
- package/dist/store/interface.d.ts +3 -6
- package/dist/store/interface.d.ts.map +1 -1
- package/dist/store/interface.js.map +1 -1
- package/dist/store/postgres/migrations.d.ts +3 -1
- package/dist/store/postgres/migrations.d.ts.map +1 -1
- package/dist/store/postgres/migrations.js +35 -1
- package/dist/store/postgres/migrations.js.map +1 -1
- package/dist/store/postgres/store.d.ts.map +1 -1
- package/dist/store/postgres/store.js +4 -9
- package/dist/store/postgres/store.js.map +1 -1
- package/dist/store/public-visibility-retired.d.ts +67 -0
- package/dist/store/public-visibility-retired.d.ts.map +1 -0
- package/dist/store/public-visibility-retired.js +55 -0
- package/dist/store/public-visibility-retired.js.map +1 -0
- package/dist/store/sqlite/migrations.d.ts +3 -1
- package/dist/store/sqlite/migrations.d.ts.map +1 -1
- package/dist/store/sqlite/migrations.js +36 -1
- package/dist/store/sqlite/migrations.js.map +1 -1
- package/dist/store/sqlite/store.d.ts.map +1 -1
- package/dist/store/sqlite/store.js +4 -8
- package/dist/store/sqlite/store.js.map +1 -1
- package/package.json +6 -6
- package/src/authorization/README.md +24 -26
- package/src/authorization/__tests__/authorizer.test.ts +10 -9
- package/src/authorization/__tests__/derived-tuples.test.ts +4 -11
- package/src/authorization/__tests__/evaluator.test.ts +14 -73
- package/src/authorization/__tests__/facts.test.ts +2 -2
- package/src/authorization/__tests__/fixtures/fga/blueprint-private-visibility.fga.yaml +6 -98
- package/src/authorization/__tests__/fixtures/fga/default-instance-inheritance.fga.yaml +4 -61
- package/src/authorization/__tests__/fixtures/fga/org-admin-owner-inheritance.fga.yaml +1 -21
- package/src/authorization/__tests__/fixtures/fga/platform-visibility.fga.yaml +1 -25
- package/src/authorization/__tests__/fixtures/fga/workflow-execution-sharing.fga.yaml +1 -3
- package/src/authorization/__tests__/list-read-scope.test.ts +41 -29
- package/src/authorization/__tests__/skip-lane-inventory.test.ts +160 -0
- package/src/authorization/__tests__/store-tests.test.ts +1 -6
- package/src/authorization/__tests__/tuples.test.ts +12 -11
- package/src/authorization/__tests__/wire-permissions.test.ts +5 -5
- package/src/authorization/authorizer.ts +4 -9
- package/src/authorization/derived-tuples.ts +14 -31
- package/src/authorization/evaluator.ts +15 -44
- package/src/authorization/list-read-scope.ts +27 -22
- package/src/authorization/model/__tests__/registry.test.ts +2 -0
- package/src/authorization/model/agent.ts +2 -5
- package/src/authorization/model/agent_instance.ts +0 -2
- package/src/authorization/model/mcp_server.ts +0 -2
- package/src/authorization/model/organization.ts +2 -0
- package/src/authorization/model/plugin.ts +1 -4
- package/src/authorization/model/rewrite.ts +8 -13
- package/src/authorization/model/skill.ts +0 -2
- package/src/authorization/model/workflow.ts +0 -2
- package/src/authorization/model/workflow_instance.ts +0 -2
- package/src/authorization/organization-directory.ts +1 -3
- package/src/authorization/store-test-kit.ts +16 -75
- package/src/authorization/tuples.ts +16 -39
- package/src/domain/agent/__tests__/agent.test.ts +11 -4
- package/src/domain/agent/controller.ts +17 -7
- package/src/domain/agentchannel/__tests__/agentchannel.test.ts +223 -48
- package/src/domain/agentchannel/__tests__/create-authorization.test.ts +58 -0
- package/src/domain/agentchannel/controller.ts +25 -1
- package/src/domain/agentchannel/steps.ts +40 -0
- package/src/domain/agentexecution/controller.ts +6 -1
- package/src/domain/agentinstance/__tests__/create-authorization.composed.test.ts +243 -0
- package/src/domain/agentinstance/__tests__/create-authorization.test.ts +144 -0
- package/src/domain/agentinstance/controller.ts +30 -17
- package/src/domain/agentinstance/steps.ts +82 -8
- package/src/domain/agentshare/__tests__/agentshare.test.ts +196 -172
- package/src/domain/agentshare/__tests__/create-authorization.test.ts +71 -0
- package/src/domain/agentshare/__tests__/member-audience.test.ts +113 -0
- package/src/domain/agentshare/constants.ts +14 -26
- package/src/domain/agentshare/controller.ts +27 -1
- package/src/domain/agentshare/steps.ts +168 -155
- package/src/domain/artifact/controller.ts +18 -22
- package/src/domain/channelapp/controller.ts +10 -0
- package/src/domain/environment/controller.ts +15 -8
- package/src/domain/executioncontext/__tests__/executioncontext.test.ts +1 -0
- package/src/domain/executioncontext/controller.ts +15 -1
- package/src/domain/executioncontext/steps.ts +2 -1
- package/src/domain/mcpserver/__tests__/mcpserver.test.ts +115 -28
- package/src/domain/mcpserver/__tests__/oauth-handshake.test.ts +53 -18
- package/src/domain/mcpserver/connect.ts +11 -10
- package/src/domain/mcpserver/controller.ts +19 -13
- package/src/domain/mcpserver/start-connect.ts +17 -11
- package/src/domain/memory/__tests__/create-authorization.test.ts +59 -0
- package/src/domain/memory/controller.ts +11 -0
- package/src/domain/memory/steps.ts +41 -0
- package/src/domain/oauthapp/controller.ts +10 -0
- package/src/domain/plugin/controller.ts +23 -44
- package/src/domain/plugin/push.ts +8 -16
- package/src/domain/schedule/__tests__/create-authorization.test.ts +58 -0
- package/src/domain/schedule/controller.ts +26 -1
- package/src/domain/schedule/steps.ts +45 -2
- package/src/domain/session/controller.ts +12 -4
- package/src/domain/session/steps.ts +24 -32
- package/src/domain/skill/controller.ts +24 -30
- package/src/domain/workflow/__tests__/agent-call-references.test.ts +222 -0
- package/src/domain/workflow/agent-call-references.ts +157 -0
- package/src/domain/workflow/controller.ts +86 -155
- package/src/domain/workflow/registry/data/task-kind-registry.json +1 -1
- package/src/domain/workflow/validation/task-config-constraints.ts +7 -3
- package/src/domain/workflow/version-resolution.ts +166 -0
- package/src/domain/workflowexecution/controller.ts +7 -2
- package/src/domain/workflowinstance/__tests__/create-authorization.test.ts +109 -0
- package/src/domain/workflowinstance/controller.ts +25 -12
- package/src/domain/workflowinstance/steps.ts +49 -1
- package/src/extensions/__tests__/built-in-authorization-composed.test.ts +32 -19
- package/src/extensions/__tests__/composed-support.ts +38 -4
- package/src/extensions/__tests__/extension-composition.test.ts +4 -4
- package/src/extensions/__tests__/identity.test.ts +44 -1
- package/src/extensions/__tests__/list-read-scope-composed.test.ts +96 -7
- package/src/extensions/__tests__/list-read-scope.test.ts +63 -0
- package/src/extensions/authorization-queries.ts +6 -5
- package/src/extensions/identity.ts +23 -5
- package/src/extensions/list-read-scope.ts +48 -8
- package/src/extensions/resource-authorization.ts +3 -5
- package/src/index.ts +0 -1
- package/src/pipeline/__tests__/supports-visibility.test.ts +112 -0
- package/src/pipeline/apiresource-meta.ts +21 -10
- package/src/pipeline/steps/__tests__/authorization-tuples.test.ts +18 -31
- package/src/pipeline/steps/__tests__/authorize-resolved-target.test.ts +285 -0
- package/src/pipeline/steps/__tests__/references.test.ts +703 -0
- package/src/pipeline/steps/authorization-tuples.ts +9 -11
- package/src/pipeline/steps/authorize-resolved-target.ts +129 -0
- package/src/pipeline/steps/authorize.ts +70 -13
- package/src/pipeline/steps/guard-memory-capture.ts +2 -1
- package/src/pipeline/steps/guard-reserved-labels.ts +6 -9
- package/src/pipeline/steps/helpers.ts +11 -15
- package/src/pipeline/steps/references.ts +578 -70
- package/src/pipeline/steps/version-history.ts +34 -0
- package/src/query/search/__tests__/criteria.test.ts +0 -4
- package/src/query/search/__tests__/query-store.test.ts +11 -40
- package/src/query/search/controller.ts +0 -1
- package/src/query/search/criteria.ts +0 -14
- package/src/query/search/handler.ts +6 -7
- package/src/query/search/query-store.ts +0 -2
- package/src/store/__tests__/public-visibility-retired.test.ts +127 -0
- package/src/store/__tests__/store-contract.ts +6 -51
- package/src/store/interface.ts +3 -6
- package/src/store/postgres/__tests__/migrations.test.ts +187 -6
- package/src/store/postgres/__tests__/store-contract.test.ts +0 -2
- package/src/store/postgres/migrations.ts +48 -1
- package/src/store/postgres/store.ts +4 -11
- package/src/store/public-visibility-retired.ts +119 -0
- package/src/store/sqlite/__tests__/migrations.test.ts +191 -5
- package/src/store/sqlite/migrations.ts +45 -1
- package/src/store/sqlite/store.ts +4 -10
- package/dist/pipeline/steps/visibility-gates.d.ts +0 -27
- package/dist/pipeline/steps/visibility-gates.d.ts.map +0 -1
- package/dist/pipeline/steps/visibility-gates.js +0 -139
- package/dist/pipeline/steps/visibility-gates.js.map +0 -1
- package/src/authorization/__tests__/fixtures/fga/cross-org-share-creation.fga.yaml +0 -98
- package/src/authorization/__tests__/fixtures/fga/public-visibility-setter.fga.yaml +0 -52
- package/src/pipeline/steps/__tests__/visibility-gates.test.ts +0 -187
- package/src/pipeline/steps/visibility-gates.ts +0 -174
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
* - owner SELF: <row>#owner@identity_account:<row id>
|
|
13
13
|
* - creator: <row>#creator@identity_account:<creator stamp> (kinds flagged requires_creator_tuple)
|
|
14
14
|
* - org-viewer: <row>#viewer@organization:<org>#viewer (visibility_org; cloud#257's shape)
|
|
15
|
-
* - public-viewer: <row>#viewer@identity_account:* with allow_public
|
|
16
15
|
* - platform-viewer: none — it fans out over identity providers, a kind this edition does not serve
|
|
17
16
|
*
|
|
18
17
|
* Two facts are this edition's own and are stated here, nowhere else:
|
|
@@ -91,11 +90,7 @@ import type {
|
|
|
91
90
|
Tuple,
|
|
92
91
|
TupleSource,
|
|
93
92
|
} from "./tuples.js";
|
|
94
|
-
import {
|
|
95
|
-
ACCOUNT_TYPE,
|
|
96
|
-
ALLOW_PUBLIC_CONDITION,
|
|
97
|
-
formatObjectRef,
|
|
98
|
-
} from "./tuples.js";
|
|
93
|
+
import { ACCOUNT_TYPE, formatObjectRef } from "./tuples.js";
|
|
99
94
|
|
|
100
95
|
/**
|
|
101
96
|
* Kinds whose `[identity_account]` owner is recorded as an IamPolicy row
|
|
@@ -184,12 +179,6 @@ function visibilitySubject(
|
|
|
184
179
|
object: { type: "organization", id: org },
|
|
185
180
|
relation: "viewer",
|
|
186
181
|
};
|
|
187
|
-
case "public-viewer":
|
|
188
|
-
return {
|
|
189
|
-
form: "wildcard",
|
|
190
|
-
type: ACCOUNT_TYPE,
|
|
191
|
-
condition: ALLOW_PUBLIC_CONDITION,
|
|
192
|
-
};
|
|
193
182
|
case "platform-viewer":
|
|
194
183
|
return undefined;
|
|
195
184
|
default: {
|
|
@@ -361,24 +350,18 @@ function tupleOfRow(row: IamPolicy): Tuple {
|
|
|
361
350
|
type: principal?.kind ?? "",
|
|
362
351
|
id: principal?.id ?? "",
|
|
363
352
|
};
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
form: "
|
|
377
|
-
type: principalObject.type,
|
|
378
|
-
condition: undefined,
|
|
379
|
-
};
|
|
380
|
-
} else {
|
|
381
|
-
subject = { form: "object", object: principalObject };
|
|
382
|
-
}
|
|
353
|
+
// A principal id of `*` (a wildcard row a cloud database may still hold
|
|
354
|
+
// from the retired public level) is read as an ordinary object id here:
|
|
355
|
+
// no person carries `*` among their aliases, so the row matches nobody
|
|
356
|
+
// and reads as the inert grant it is, never as a fault that would turn
|
|
357
|
+
// the resource unreadable.
|
|
358
|
+
const subject: Subject =
|
|
359
|
+
principal !== undefined && principal.relation !== ""
|
|
360
|
+
? {
|
|
361
|
+
form: "userset",
|
|
362
|
+
object: principalObject,
|
|
363
|
+
relation: principal.relation,
|
|
364
|
+
}
|
|
365
|
+
: { form: "object", object: principalObject };
|
|
383
366
|
return { object, relation: spec?.relation ?? "", subject };
|
|
384
367
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The evaluator — OpenFGA's check, over the built-in model and a tuple
|
|
3
3
|
* source, small because the model uses four rewrite forms and nothing
|
|
4
|
-
* else (model/rewrite.ts). `checkRelation(object, relation, person
|
|
4
|
+
* else (model/rewrite.ts). `checkRelation(object, relation, person)`
|
|
5
5
|
* answers "does this person hold this relation on this object" the way
|
|
6
6
|
* the cloud's engine answers it over stored tuples, so the two editions
|
|
7
|
-
* share one meaning of authorization.
|
|
7
|
+
* share one meaning of authorization. There is no context parameter: the
|
|
8
|
+
* model declares no condition, so a check has no posture to state.
|
|
8
9
|
*
|
|
9
10
|
* The walk, in the order a `.fga` line reads:
|
|
10
11
|
* - `this`: the tuples on (object, relation). A tuple counts only if
|
|
@@ -12,9 +13,7 @@
|
|
|
12
13
|
* OpenFGA makes at write time, made here at read time, so a derived
|
|
13
14
|
* tuple the model no longer admits denies instead of allowing. An
|
|
14
15
|
* object subject matches when it names one of the person's aliases;
|
|
15
|
-
* a userset subject is resolved on its own object
|
|
16
|
-
* honoured only under its condition (`allow_public` reads the
|
|
17
|
-
* context's `allow`; an unknown condition is a fault).
|
|
16
|
+
* a userset subject is resolved on its own object.
|
|
18
17
|
* - `computed`: the same object, another relation.
|
|
19
18
|
* - `from`: every object the tupleset relation links to (again within
|
|
20
19
|
* the tupleset line's type restriction), resolved for the relation.
|
|
@@ -44,19 +43,8 @@
|
|
|
44
43
|
*/
|
|
45
44
|
import type { Model } from "./model/index.js";
|
|
46
45
|
import type { Rewrite, SubjectType } from "./model/rewrite.js";
|
|
47
|
-
import type {
|
|
48
|
-
|
|
49
|
-
ObjectRef,
|
|
50
|
-
Person,
|
|
51
|
-
Subject,
|
|
52
|
-
TupleSource,
|
|
53
|
-
} from "./tuples.js";
|
|
54
|
-
import {
|
|
55
|
-
ACCOUNT_TYPE,
|
|
56
|
-
ALLOW_PUBLIC_CONDITION,
|
|
57
|
-
formatObjectRef,
|
|
58
|
-
pairKey,
|
|
59
|
-
} from "./tuples.js";
|
|
46
|
+
import type { ObjectRef, Person, Subject, TupleSource } from "./tuples.js";
|
|
47
|
+
import { ACCOUNT_TYPE, formatObjectRef, pairKey } from "./tuples.js";
|
|
60
48
|
|
|
61
49
|
/**
|
|
62
50
|
* OpenFGA's default resolution-depth limit (its `resolveNodeLimit`), so
|
|
@@ -67,11 +55,17 @@ import {
|
|
|
67
55
|
*/
|
|
68
56
|
export const MAX_RESOLUTION_DEPTH = 25;
|
|
69
57
|
|
|
58
|
+
/**
|
|
59
|
+
* The faults an evaluation can raise. Two are consumer bugs by the seam
|
|
60
|
+
* contracts (a kind the model does not declare; the `internal` class
|
|
61
|
+
* offered to the list scope's restrict verb, which the shared helper
|
|
62
|
+
* answers before any driver); the rest are the model's own.
|
|
63
|
+
*/
|
|
70
64
|
export type EvaluationFault =
|
|
71
65
|
| "undeclared-target-kind"
|
|
66
|
+
| "internal-caller-offered"
|
|
72
67
|
| "resolution-depth-exceeded"
|
|
73
|
-
| "resolution-cycle"
|
|
74
|
-
| "unknown-condition";
|
|
68
|
+
| "resolution-cycle";
|
|
75
69
|
|
|
76
70
|
/** A fault in the model or its evaluation — never a denial; the driver maps it to `unavailable`. */
|
|
77
71
|
export class AuthorizationEvaluationError extends Error {
|
|
@@ -94,7 +88,6 @@ export async function checkRelation(
|
|
|
94
88
|
object: ObjectRef,
|
|
95
89
|
relation: string,
|
|
96
90
|
person: Person,
|
|
97
|
-
context: CheckContext,
|
|
98
91
|
): Promise<boolean> {
|
|
99
92
|
if (deps.model.byType(object.type) === undefined) {
|
|
100
93
|
throw new AuthorizationEvaluationError(
|
|
@@ -102,7 +95,7 @@ export async function checkRelation(
|
|
|
102
95
|
`no declaration for kind '${object.type}' (target ${formatObjectRef(object)})`,
|
|
103
96
|
);
|
|
104
97
|
}
|
|
105
|
-
return new Walk(deps, person
|
|
98
|
+
return new Walk(deps, person).resolve(object, relation, 0);
|
|
106
99
|
}
|
|
107
100
|
|
|
108
101
|
/** One check's state: the memo and the in-progress set, over one source. */
|
|
@@ -113,7 +106,6 @@ class Walk {
|
|
|
113
106
|
constructor(
|
|
114
107
|
private readonly deps: EvaluationDeps,
|
|
115
108
|
private readonly person: Person,
|
|
116
|
-
private readonly context: CheckContext,
|
|
117
109
|
) {}
|
|
118
110
|
|
|
119
111
|
resolve(
|
|
@@ -227,15 +219,6 @@ class Walk {
|
|
|
227
219
|
allowed.relation === subject.relation,
|
|
228
220
|
) && (await this.resolve(subject.object, subject.relation, depth + 1))
|
|
229
221
|
);
|
|
230
|
-
case "wildcard": {
|
|
231
|
-
const allowed = restriction.some(
|
|
232
|
-
(entry) =>
|
|
233
|
-
entry.form === "wildcard" &&
|
|
234
|
-
entry.type === subject.type &&
|
|
235
|
-
entry.condition === subject.condition,
|
|
236
|
-
);
|
|
237
|
-
return allowed && this.conditionHolds(subject.condition);
|
|
238
|
-
}
|
|
239
222
|
default: {
|
|
240
223
|
const exhaustive: never = subject;
|
|
241
224
|
throw new Error(`unknown subject form: ${JSON.stringify(exhaustive)}`);
|
|
@@ -243,18 +226,6 @@ class Walk {
|
|
|
243
226
|
}
|
|
244
227
|
}
|
|
245
228
|
|
|
246
|
-
private conditionHolds(condition: string | undefined): boolean {
|
|
247
|
-
switch (condition) {
|
|
248
|
-
case ALLOW_PUBLIC_CONDITION:
|
|
249
|
-
return this.context.allow;
|
|
250
|
-
default:
|
|
251
|
-
throw new AuthorizationEvaluationError(
|
|
252
|
-
"unknown-condition",
|
|
253
|
-
`the model declares no condition '${String(condition)}'`,
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
229
|
/** The object types the tupleset line admits — `[organization]`, `[session]` — from its `this` nodes. */
|
|
259
230
|
private objectTypesOf(
|
|
260
231
|
object: ObjectRef,
|
|
@@ -11,12 +11,10 @@
|
|
|
11
11
|
* row a second time. A self-host's lists show a person exactly what a
|
|
12
12
|
* `get` would let them read.
|
|
13
13
|
*
|
|
14
|
-
* Both verbs ask
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* listing; the organization's own people still reach it through the
|
|
19
|
-
* org-viewer shape public also emits.
|
|
14
|
+
* Both verbs ask the same question a point check asks, `can_view` on the
|
|
15
|
+
* candidate: the model has no subject whose answer differs between a
|
|
16
|
+
* listing and a get, so a list is exactly the set of rows a get would
|
|
17
|
+
* read.
|
|
20
18
|
*
|
|
21
19
|
* - `restrictListEntries`: one derived source for the caller, seeded
|
|
22
20
|
* with every candidate's facts; one `checkRelation` per unique id —
|
|
@@ -38,17 +36,25 @@
|
|
|
38
36
|
* lane can show it either.
|
|
39
37
|
*
|
|
40
38
|
* The `internal` class — the server acting as itself over the in-process
|
|
41
|
-
* transport —
|
|
42
|
-
* the
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
39
|
+
* transport — is answered by the seam, not here: `restrictListByReadScope`
|
|
40
|
+
* returns the org-narrowed rows for the class before any driver is asked
|
|
41
|
+
* (extensions/list-read-scope.ts, the header's contract line), the
|
|
42
|
+
* Authorize step's trust-domain rule applied to a list answer. So this
|
|
43
|
+
* driver's `restrictListEntries` REFUSES the class (`internal-caller-offered`):
|
|
44
|
+
* being offered it means a caller reached the driver around the one
|
|
45
|
+
* consumption idiom, and evaluating the server as a person would return
|
|
46
|
+
* a quiet short list — the failure shape stigmer#1207 fixed. The
|
|
47
|
+
* enumeration verb has no helper in front of it and keeps its own arm:
|
|
48
|
+
* every id of the kind, as the built-in directory answers the class with
|
|
49
|
+
* every organization. No in-process edge reaches an enumeration lane
|
|
50
|
+
* today; the arm is pinned so a future one meets the rule.
|
|
46
51
|
*
|
|
47
52
|
* Faults THROW and are never an empty answer (the seam: an empty set means
|
|
48
53
|
* "authorized to see nothing"; an outage is the pipeline's sanitized
|
|
49
|
-
* INTERNAL). A kind the model does not declare
|
|
50
|
-
* seam's contract and faults through the
|
|
51
|
-
* declares exactly the open-source tier, so no
|
|
54
|
+
* INTERNAL). A kind the model does not declare, like the internal class
|
|
55
|
+
* above, is a consumer bug by the seam's contract and faults through the
|
|
56
|
+
* evaluator, loud; the model declares exactly the open-source tier, so no
|
|
57
|
+
* served lane can reach it.
|
|
52
58
|
*
|
|
53
59
|
* Logging. One debug line per call — kind, offered, kept, elapsed — what
|
|
54
60
|
* an operator needs to answer "why is Alice's list short" beside the
|
|
@@ -76,14 +82,11 @@ import { builtInModel } from "./model/index.js";
|
|
|
76
82
|
import type { KindDeclaration } from "./model/rewrite.js";
|
|
77
83
|
import type { AccountsByCaller } from "./person.js";
|
|
78
84
|
import { resolvePerson } from "./person.js";
|
|
79
|
-
import type {
|
|
85
|
+
import type { ObjectRef, Person } from "./tuples.js";
|
|
80
86
|
|
|
81
87
|
/** The relation every list lane reads through (the cloud's LIST_RELATION). */
|
|
82
88
|
const LIST_RELATION = "can_view";
|
|
83
89
|
|
|
84
|
-
/** The listing context: the public wildcard suppressed (the module header). */
|
|
85
|
-
const LISTING: CheckContext = { allow: false };
|
|
86
|
-
|
|
87
90
|
export interface BuiltInListReadScopeDeps {
|
|
88
91
|
readonly store: Store;
|
|
89
92
|
/** The port the grant path writes through — the person's rows are read from the same instance. */
|
|
@@ -130,7 +133,6 @@ export function newBuiltInListReadScope(
|
|
|
130
133
|
object,
|
|
131
134
|
LIST_RELATION,
|
|
132
135
|
person,
|
|
133
|
-
LISTING,
|
|
134
136
|
);
|
|
135
137
|
return allowed ? facts.id : undefined;
|
|
136
138
|
}),
|
|
@@ -188,6 +190,12 @@ export function newBuiltInListReadScope(
|
|
|
188
190
|
entries: ReadonlyArray<ListEntryMeta>,
|
|
189
191
|
): Promise<ReadonlySet<string>> {
|
|
190
192
|
requireDeclared(kind);
|
|
193
|
+
if (caller.callerClass === "internal") {
|
|
194
|
+
throw new AuthorizationEvaluationError(
|
|
195
|
+
"internal-caller-offered",
|
|
196
|
+
`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`,
|
|
197
|
+
);
|
|
198
|
+
}
|
|
191
199
|
// One candidate per unique id: a lane offers each row once, and a
|
|
192
200
|
// duplicate would only spend a walk to learn the same answer.
|
|
193
201
|
const unique = new Map<string, RowFacts>();
|
|
@@ -196,9 +204,6 @@ export function newBuiltInListReadScope(
|
|
|
196
204
|
unique.set(entry.id, rowFactsOfEntry(kind, entry));
|
|
197
205
|
}
|
|
198
206
|
}
|
|
199
|
-
if (caller.callerClass === "internal") {
|
|
200
|
-
return new Set(unique.keys());
|
|
201
|
-
}
|
|
202
207
|
return visibleAmong(caller, kind, [...unique.values()]);
|
|
203
208
|
},
|
|
204
209
|
|
|
@@ -104,6 +104,7 @@ const WIRE_PERMISSIONS_BY_TYPE: Readonly<
|
|
|
104
104
|
"can_create_environment",
|
|
105
105
|
"can_create_skill",
|
|
106
106
|
"can_create_plugin",
|
|
107
|
+
"can_create_mcp_server",
|
|
107
108
|
"can_create_idp",
|
|
108
109
|
"can_create_identity_account",
|
|
109
110
|
"can_create_oauth_app",
|
|
@@ -111,6 +112,7 @@ const WIRE_PERMISSIONS_BY_TYPE: Readonly<
|
|
|
111
112
|
"can_create_channel_app",
|
|
112
113
|
"can_create_execution_in",
|
|
113
114
|
"can_create_agent_share",
|
|
115
|
+
"can_create_agent_instance",
|
|
114
116
|
"can_grant_access",
|
|
115
117
|
"can_view_access",
|
|
116
118
|
"can_view_billing",
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
* read by whoever the visibility axis lets in. The `organization#member`
|
|
5
5
|
* and `organization#viewer` usersets on `viewer` are the org-visibility
|
|
6
6
|
* tuple's two shapes (the cloud writes `#viewer` since cloud#257; `#member`
|
|
7
|
-
* is the legacy shape it still honours),
|
|
8
|
-
*
|
|
9
|
-
* open-source tuple ever names.
|
|
7
|
+
* is the legacy shape it still honours), and `platform_viewer` is an
|
|
8
|
+
* identity-provider userset no open-source tuple ever names.
|
|
10
9
|
*/
|
|
11
10
|
import { AgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
12
11
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
@@ -17,7 +16,6 @@ import {
|
|
|
17
16
|
direct,
|
|
18
17
|
from,
|
|
19
18
|
objectOf,
|
|
20
|
-
publicWith,
|
|
21
19
|
union,
|
|
22
20
|
usersetOf,
|
|
23
21
|
} from "./rewrite.js";
|
|
@@ -44,7 +42,6 @@ export const agentDeclaration = declareKind({
|
|
|
44
42
|
union(
|
|
45
43
|
direct(
|
|
46
44
|
objectOf("identity_account"),
|
|
47
|
-
publicWith("identity_account", "allow_public"),
|
|
48
45
|
usersetOf("organization", "member"),
|
|
49
46
|
usersetOf("organization", "viewer"),
|
|
50
47
|
),
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
direct,
|
|
20
20
|
from,
|
|
21
21
|
objectOf,
|
|
22
|
-
publicWith,
|
|
23
22
|
union,
|
|
24
23
|
usersetOf,
|
|
25
24
|
} from "./rewrite.js";
|
|
@@ -38,7 +37,6 @@ export const agentInstanceDeclaration = declareKind({
|
|
|
38
37
|
union(
|
|
39
38
|
direct(
|
|
40
39
|
objectOf("identity_account"),
|
|
41
|
-
publicWith("identity_account", "allow_public"),
|
|
42
40
|
usersetOf("organization", "member"),
|
|
43
41
|
usersetOf("organization", "viewer"),
|
|
44
42
|
),
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
direct,
|
|
13
13
|
from,
|
|
14
14
|
objectOf,
|
|
15
|
-
publicWith,
|
|
16
15
|
union,
|
|
17
16
|
usersetOf,
|
|
18
17
|
} from "./rewrite.js";
|
|
@@ -39,7 +38,6 @@ export const mcpServerDeclaration = declareKind({
|
|
|
39
38
|
union(
|
|
40
39
|
direct(
|
|
41
40
|
objectOf("identity_account"),
|
|
42
|
-
publicWith("identity_account", "allow_public"),
|
|
43
41
|
usersetOf("organization", "member"),
|
|
44
42
|
usersetOf("organization", "viewer"),
|
|
45
43
|
),
|
|
@@ -39,6 +39,7 @@ export const organizationDeclaration = declareKind({
|
|
|
39
39
|
["can_create_environment", computed("member")],
|
|
40
40
|
["can_create_skill", computed("admin")],
|
|
41
41
|
["can_create_plugin", computed("admin")],
|
|
42
|
+
["can_create_mcp_server", computed("admin")],
|
|
42
43
|
["can_create_idp", computed("admin")],
|
|
43
44
|
["can_create_identity_account", computed("admin")],
|
|
44
45
|
["can_create_oauth_app", computed("admin")],
|
|
@@ -46,6 +47,7 @@ export const organizationDeclaration = declareKind({
|
|
|
46
47
|
["can_create_channel_app", computed("admin")],
|
|
47
48
|
["can_create_execution_in", union(computed("member"), computed("guest"))],
|
|
48
49
|
["can_create_agent_share", computed("admin")],
|
|
50
|
+
["can_create_agent_instance", computed("member")],
|
|
49
51
|
["can_grant_access", computed("admin")],
|
|
50
52
|
["can_view_access", computed("viewer")],
|
|
51
53
|
["can_view_billing", computed("viewer")],
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* Transcript of fga/model/agentic/plugin.fga — the unit of install, shaped
|
|
3
3
|
* exactly like a skill: an organization-owned blueprint whose owner is the
|
|
4
4
|
* installer (and, through the organization, its admins), whose viewers are
|
|
5
|
-
* the org's members and viewers
|
|
6
|
-
* platform viewer. Its verbs are the blueprint set: `can_view`, `can_edit`
|
|
5
|
+
* the org's members and viewers and the platform viewer. Its verbs are the blueprint set: `can_view`, `can_edit`
|
|
7
6
|
* (visibility), `can_delete` (uninstall), `can_grant_access`,
|
|
8
7
|
* `can_view_access`; `can_use` is carried as the model's word for
|
|
9
8
|
* "install from" though no wire permission names it yet.
|
|
@@ -21,7 +20,6 @@ import {
|
|
|
21
20
|
direct,
|
|
22
21
|
from,
|
|
23
22
|
objectOf,
|
|
24
|
-
publicWith,
|
|
25
23
|
union,
|
|
26
24
|
usersetOf,
|
|
27
25
|
} from "./rewrite.js";
|
|
@@ -48,7 +46,6 @@ export const pluginDeclaration = declareKind({
|
|
|
48
46
|
union(
|
|
49
47
|
direct(
|
|
50
48
|
objectOf("identity_account"),
|
|
51
|
-
publicWith("identity_account", "allow_public"),
|
|
52
49
|
usersetOf("organization", "member"),
|
|
53
50
|
usersetOf("organization", "viewer"),
|
|
54
51
|
),
|
|
@@ -6,12 +6,17 @@
|
|
|
6
6
|
* define organization: [organization] → direct(objectOf("organization"))
|
|
7
7
|
* define owner: [identity_account] or admin from organization
|
|
8
8
|
* → union(direct(objectOf("identity_account")), from("admin", "organization"))
|
|
9
|
-
* define viewer: [identity_account,
|
|
10
|
-
*
|
|
11
|
-
* → union(direct(objectOf(...),
|
|
9
|
+
* define viewer: [identity_account, organization#member, organization#viewer]
|
|
10
|
+
* or owner or platform_viewer
|
|
11
|
+
* → union(direct(objectOf(...), usersetOf(...), usersetOf(...)),
|
|
12
12
|
* computed("owner"), computed("platform_viewer"))
|
|
13
13
|
* define can_view: viewer → computed("viewer")
|
|
14
14
|
*
|
|
15
|
+
* A subject type is an object type or a userset; the model admits no
|
|
16
|
+
* wildcard (`type:*`) and declares no condition, so neither has a form
|
|
17
|
+
* here. The day a line needs one, the transcript cannot be written and
|
|
18
|
+
* the gap is a design act.
|
|
19
|
+
*
|
|
15
20
|
* A declaration file (model/<kind>.ts) is a TRANSCRIPT of its `.fga`
|
|
16
21
|
* file: the same relations, in the file's order, each line rewritten in
|
|
17
22
|
* these builders so a reader with the model open sees the same text, and
|
|
@@ -53,12 +58,6 @@ export type SubjectType =
|
|
|
53
58
|
readonly form: "userset";
|
|
54
59
|
readonly type: string;
|
|
55
60
|
readonly relation: string;
|
|
56
|
-
}
|
|
57
|
-
/** `[identity_account:* with allow_public]` — every object of the type, under the condition. */
|
|
58
|
-
| {
|
|
59
|
-
readonly form: "wildcard";
|
|
60
|
-
readonly type: string;
|
|
61
|
-
readonly condition: string;
|
|
62
61
|
};
|
|
63
62
|
|
|
64
63
|
export type Rewrite =
|
|
@@ -87,10 +86,6 @@ export function usersetOf(type: string, relation: string): SubjectType {
|
|
|
87
86
|
return { form: "userset", type, relation };
|
|
88
87
|
}
|
|
89
88
|
|
|
90
|
-
export function publicWith(type: string, condition: string): SubjectType {
|
|
91
|
-
return { form: "wildcard", type, condition };
|
|
92
|
-
}
|
|
93
|
-
|
|
94
89
|
export function direct(...subjects: ReadonlyArray<SubjectType>): Rewrite {
|
|
95
90
|
return { node: "this", subjects };
|
|
96
91
|
}
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
direct,
|
|
15
15
|
from,
|
|
16
16
|
objectOf,
|
|
17
|
-
publicWith,
|
|
18
17
|
union,
|
|
19
18
|
usersetOf,
|
|
20
19
|
} from "./rewrite.js";
|
|
@@ -41,7 +40,6 @@ export const skillDeclaration = declareKind({
|
|
|
41
40
|
union(
|
|
42
41
|
direct(
|
|
43
42
|
objectOf("identity_account"),
|
|
44
|
-
publicWith("identity_account", "allow_public"),
|
|
45
43
|
usersetOf("organization", "member"),
|
|
46
44
|
usersetOf("organization", "viewer"),
|
|
47
45
|
),
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
direct,
|
|
15
15
|
from,
|
|
16
16
|
objectOf,
|
|
17
|
-
publicWith,
|
|
18
17
|
union,
|
|
19
18
|
usersetOf,
|
|
20
19
|
} from "./rewrite.js";
|
|
@@ -41,7 +40,6 @@ export const workflowDeclaration = declareKind({
|
|
|
41
40
|
union(
|
|
42
41
|
direct(
|
|
43
42
|
objectOf("identity_account"),
|
|
44
|
-
publicWith("identity_account", "allow_public"),
|
|
45
43
|
usersetOf("organization", "member"),
|
|
46
44
|
usersetOf("organization", "viewer"),
|
|
47
45
|
),
|
|
@@ -30,7 +30,6 @@ import {
|
|
|
30
30
|
direct,
|
|
31
31
|
from,
|
|
32
32
|
objectOf,
|
|
33
|
-
publicWith,
|
|
34
33
|
union,
|
|
35
34
|
usersetOf,
|
|
36
35
|
} from "./rewrite.js";
|
|
@@ -84,7 +83,6 @@ export const workflowInstanceDeclaration = declareKind({
|
|
|
84
83
|
union(
|
|
85
84
|
direct(
|
|
86
85
|
objectOf("identity_account"),
|
|
87
|
-
publicWith("identity_account", "allow_public"),
|
|
88
86
|
usersetOf("organization", "member"),
|
|
89
87
|
usersetOf("organization", "viewer"),
|
|
90
88
|
),
|
|
@@ -32,8 +32,7 @@
|
|
|
32
32
|
* annotation, which is why this driver meets that caller at all: a
|
|
33
33
|
* skip lane hands the directory the identity the interceptor stamped,
|
|
34
34
|
* and no Authorize arm ran before it. Every other caller gets the
|
|
35
|
-
* evaluated list.
|
|
36
|
-
* though no organization line admits a wildcard.
|
|
35
|
+
* evaluated list.
|
|
37
36
|
* The controller loads each id it is handed and skips the ones whose row
|
|
38
37
|
* is gone (grants can outlive rows); the source has already loaded the
|
|
39
38
|
* row once for the evaluation — two primary-key reads per organization,
|
|
@@ -102,7 +101,6 @@ export function newBuiltInOrganizationDirectory(
|
|
|
102
101
|
{ type: ORGANIZATION, id },
|
|
103
102
|
"can_view",
|
|
104
103
|
person,
|
|
105
|
-
{ allow: false },
|
|
106
104
|
)
|
|
107
105
|
) {
|
|
108
106
|
visible.push(id);
|