@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
|
@@ -94,9 +94,15 @@ import { metadataOf, parentIdOf } from "./shapes.js";
|
|
|
94
94
|
* validation).
|
|
95
95
|
*
|
|
96
96
|
* The org floor: kinds flagged defaults_to_org_visibility (blueprints —
|
|
97
|
-
* shared org assets) keep the org-viewer shape at
|
|
98
|
-
*
|
|
99
|
-
*
|
|
97
|
+
* shared org assets) keep the org-viewer shape at the platform level, so
|
|
98
|
+
* sharing a blueprint beyond the org never hides it from its own org's
|
|
99
|
+
* catalog.
|
|
100
|
+
*
|
|
101
|
+
* The retired public level has no shape here. No stored row holds it once
|
|
102
|
+
* the store migration has run, so no transition FROM it reaches this
|
|
103
|
+
* policy; a deployment that still holds public rows must move them through
|
|
104
|
+
* updateVisibility on the release that knew the level, whose reconciler
|
|
105
|
+
* deletes the wildcard grant, before it runs this one.
|
|
100
106
|
*/
|
|
101
107
|
export function visibilityShapesFor(
|
|
102
108
|
kind: ApiResourceKind,
|
|
@@ -112,14 +118,6 @@ export function visibilityShapesFor(
|
|
|
112
118
|
shapes.add("org-viewer");
|
|
113
119
|
}
|
|
114
120
|
break;
|
|
115
|
-
case ApiResourceVisibility.visibility_public:
|
|
116
|
-
if (config?.supportsPublic === true) {
|
|
117
|
-
shapes.add("public-viewer");
|
|
118
|
-
if (orgFloor) {
|
|
119
|
-
shapes.add("org-viewer");
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
break;
|
|
123
121
|
case ApiResourceVisibility.visibility_platform:
|
|
124
122
|
if (config?.supportsPlatform === true) {
|
|
125
123
|
shapes.add("platform-viewer");
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthorizeResolvedTarget — the ONE mid-chain authorization step: the
|
|
3
|
+
* question a lane can only ask once its chain has loaded something the
|
|
4
|
+
* position-1 annotation could not key on.
|
|
5
|
+
*
|
|
6
|
+
* The `Authorize` step resolves its target from the REQUEST (a field path
|
|
7
|
+
* over the input), so it cannot serve two shapes of lane, and both are
|
|
8
|
+
* `is_skip_authorization` on the wire for that reason alone:
|
|
9
|
+
*
|
|
10
|
+
* - a read by reference: the request carries an org and a slug, the
|
|
11
|
+
* target is the row the loader finds, and the question is exactly the
|
|
12
|
+
* one the kind's `get` asks by id — `can_view` on that row, with the
|
|
13
|
+
* `get` annotation's byte-pinned copy. `loadedTargetAsMethod(get)` is
|
|
14
|
+
* that resolver: it reads the row under TARGET_RESOURCE_KEY and asks the
|
|
15
|
+
* sibling `get` descriptor's annotation about its id, so the two lanes
|
|
16
|
+
* cannot drift (one annotation owns the permission and the copy; a
|
|
17
|
+
* `get` that is itself a skip makes the reference read a skip too).
|
|
18
|
+
* - a parent-gated create: the request names a parent (an agent to
|
|
19
|
+
* schedule, share, channel-bind or instantiate; a workflow to
|
|
20
|
+
* instantiate), the domain's resolve step loads and stashes it, and the
|
|
21
|
+
* question is the caller's standing on that parent (or on the row's
|
|
22
|
+
* organization), with the copy the lane has always answered.
|
|
23
|
+
*
|
|
24
|
+
* The step owns nothing but the position and the evaluation: a PURE
|
|
25
|
+
* resolver over the request context names the questions (kind, id,
|
|
26
|
+
* permission, copy), in the order the lane asks them; the first refusal
|
|
27
|
+
* answers. The evaluation is `authorizeTarget` (authorize.ts): allow
|
|
28
|
+
* proceeds, deny is PERMISSION_DENIED with the copy, not-found is NOT_FOUND
|
|
29
|
+
* as the load-first chain would answer, unavailable is INTERNAL, and the
|
|
30
|
+
* `internal` class alone is exempt — the annotation's skip arms do not
|
|
31
|
+
* apply, because the caller IS the enforcement the annotation opted out of.
|
|
32
|
+
*
|
|
33
|
+
* Two contracts a resolver keeps. It returns an EMPTY list only for an arm
|
|
34
|
+
* the lane has modelled as "nothing to ask" (a default instance the server
|
|
35
|
+
* composed for the run's human, whose access already follows the parent);
|
|
36
|
+
* an absent stash, a parent the chain guaranteed and did not deliver, is a
|
|
37
|
+
* chain invariant broken and the resolver THROWS, so a mis-ordered chain
|
|
38
|
+
* fails loudly instead of silently reopening the lane. And it names the
|
|
39
|
+
* questions in the anti-probing order: the organization's bar before the
|
|
40
|
+
* parent's where both are asked, so an outsider learns nothing about the
|
|
41
|
+
* parent's grants from which copy came back.
|
|
42
|
+
*
|
|
43
|
+
* Position: immediately after the step that loads what the resolver reads,
|
|
44
|
+
* before the duplicate check, before any engine or store side effect, and
|
|
45
|
+
* before any step whose refusal would reveal the loaded row (a same-org
|
|
46
|
+
* rule that names the parent's organization, an enrichment that reads the
|
|
47
|
+
* row's connections).
|
|
48
|
+
*
|
|
49
|
+
* The step's name is the shared vocabulary for every NEW lane. The lanes
|
|
50
|
+
* that carried a hand-written copy of this body before it existed keep
|
|
51
|
+
* their frozen names through `stepName` — the version ladder's own
|
|
52
|
+
* precedent (LoadSkillByReference and LoadPluginByReference are one
|
|
53
|
+
* factory) — because a step name is never renamed.
|
|
54
|
+
*
|
|
55
|
+
* Sibling: `AuthorizeRunTarget` runs the same evaluation over the record
|
|
56
|
+
* being built (`ctx.newState`) and carries the run-gate doctrine an
|
|
57
|
+
* edition's lane admission keys on; this step reads what the chain LOADED
|
|
58
|
+
* and carries no doctrine of its own.
|
|
59
|
+
*/
|
|
60
|
+
import type { DescMessage, DescMethod, Message } from "@bufbuild/protobuf";
|
|
61
|
+
|
|
62
|
+
import type { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
63
|
+
|
|
64
|
+
import type { Authorizer } from "../../extensions/authorizer.js";
|
|
65
|
+
import type { PipelineStep } from "../pipeline.js";
|
|
66
|
+
import type { RequestContext } from "../request-context.js";
|
|
67
|
+
import { metadataOf } from "./shapes.js";
|
|
68
|
+
import { TARGET_RESOURCE_KEY } from "./load-target.js";
|
|
69
|
+
import {
|
|
70
|
+
authorizeTarget,
|
|
71
|
+
resolveAnnotatedCheck,
|
|
72
|
+
type AuthorizationTarget,
|
|
73
|
+
} from "./authorize.js";
|
|
74
|
+
|
|
75
|
+
/** The step's shared name; a folded lane passes its own frozen name instead. */
|
|
76
|
+
export const AUTHORIZE_RESOLVED_TARGET_STEP = "AuthorizeResolvedTarget";
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Names the questions a lane asks, in order, over the request context after
|
|
80
|
+
* its chain has loaded the target. Pure: no store, no clock, no side effect.
|
|
81
|
+
* Empty means the lane has nothing to ask on this request; an invariant the
|
|
82
|
+
* chain broke (an absent stash) is a throw, never an empty list.
|
|
83
|
+
*/
|
|
84
|
+
export type ResolvedTargetResolver<Desc extends DescMessage> = (
|
|
85
|
+
ctx: RequestContext<Desc>,
|
|
86
|
+
) => ReadonlyArray<AuthorizationTarget>;
|
|
87
|
+
|
|
88
|
+
export function newAuthorizeResolvedTargetStep<Desc extends DescMessage>(
|
|
89
|
+
authorizer: Authorizer,
|
|
90
|
+
resolve: ResolvedTargetResolver<Desc>,
|
|
91
|
+
stepName: string = AUTHORIZE_RESOLVED_TARGET_STEP,
|
|
92
|
+
): PipelineStep<Desc> {
|
|
93
|
+
return {
|
|
94
|
+
name: stepName,
|
|
95
|
+
async execute(ctx: RequestContext<Desc>): Promise<void> {
|
|
96
|
+
for (const target of resolve(ctx)) {
|
|
97
|
+
await authorizeTarget(authorizer, ctx.callerIdentity, target);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** The request shape every `getByReference` lane runs on. */
|
|
104
|
+
export type GetByReferenceDesc = typeof ApiResourceReferenceSchema;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The reads' resolver: the row the loader stashed under TARGET_RESOURCE_KEY,
|
|
108
|
+
* authorized exactly as `get` would authorize it by id. The `get`
|
|
109
|
+
* descriptor's annotation supplies the kind, the permission and the copy;
|
|
110
|
+
* the loaded row's id is the target override (a reference has no `value`
|
|
111
|
+
* field for the annotation's path to read). A `get` that is public, skip
|
|
112
|
+
* or unannotated makes this a no-op — the reference read is never stricter
|
|
113
|
+
* than the read by id, and never laxer.
|
|
114
|
+
*/
|
|
115
|
+
export function loadedTargetAsMethod(
|
|
116
|
+
get: DescMethod,
|
|
117
|
+
): ResolvedTargetResolver<GetByReferenceDesc> {
|
|
118
|
+
return (ctx) => {
|
|
119
|
+
const loaded = ctx.get(TARGET_RESOURCE_KEY) as Message | undefined;
|
|
120
|
+
const id = loaded === undefined ? undefined : metadataOf(loaded)?.id;
|
|
121
|
+
if (id === undefined) {
|
|
122
|
+
throw new Error(
|
|
123
|
+
`${AUTHORIZE_RESOLVED_TARGET_STEP}: no loaded target with metadata under ${TARGET_RESOURCE_KEY}; the loader must run first`,
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
const target = resolveAnnotatedCheck(get, ctx.input, { resourceId: id });
|
|
127
|
+
return target === undefined ? [] : [target];
|
|
128
|
+
};
|
|
129
|
+
}
|
|
@@ -56,6 +56,14 @@
|
|
|
56
56
|
* names no kind because the target is the loaded row's resource). The
|
|
57
57
|
* annotation keeps owning the permission, the copy and the skip arms in
|
|
58
58
|
* both shapes; only the target is the handler's.
|
|
59
|
+
*
|
|
60
|
+
* The annotation read itself is one pure function, `resolveAnnotatedCheck`,
|
|
61
|
+
* so a third entry shape needs no third copy of it: the resolved-target
|
|
62
|
+
* step (authorize-resolved-target.ts) authorizes a row a chain LOADED as
|
|
63
|
+
* a sibling method's annotation would — a read by reference asks exactly
|
|
64
|
+
* what its `get` asks, target override and all — and every lane whose
|
|
65
|
+
* position-1 annotation is a skip because the target is not in the request
|
|
66
|
+
* answers its question there, with the same four arms.
|
|
59
67
|
*/
|
|
60
68
|
import { Code, ConnectError } from "@connectrpc/connect";
|
|
61
69
|
import type { DescMethod, DescMessage, Message } from "@bufbuild/protobuf";
|
|
@@ -137,6 +145,49 @@ export interface AuthorizeTargetOverride {
|
|
|
137
145
|
readonly resourceId: string;
|
|
138
146
|
}
|
|
139
147
|
|
|
148
|
+
/**
|
|
149
|
+
* One question for the Authorizer together with the lane's deny copy: the
|
|
150
|
+
* unit `authorizeResolvedResource` consumes, whether the annotation named
|
|
151
|
+
* it (`resolveAnnotatedCheck`) or a chain's own resolver did (the run gate,
|
|
152
|
+
* the resolved-target step).
|
|
153
|
+
*/
|
|
154
|
+
export interface AuthorizationTarget extends AuthzCheck {
|
|
155
|
+
readonly deniedMessage: string;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* The annotation's answer for one method: the target it names for this
|
|
160
|
+
* request, or `undefined` when it names none — `is_public`,
|
|
161
|
+
* `is_skip_authorization`, or no config at all. Pure over the descriptor
|
|
162
|
+
* and the request; the `internal` exemption is the evaluation's, not the
|
|
163
|
+
* annotation's, so it is not applied here. Exported so a chain step can
|
|
164
|
+
* authorize a loaded row exactly as a SIBLING method's annotation would
|
|
165
|
+
* (a read by reference asks what its `get` asks) without a second copy of
|
|
166
|
+
* the skip arms or the field-path resolution.
|
|
167
|
+
*/
|
|
168
|
+
export function resolveAnnotatedCheck(
|
|
169
|
+
method: DescMethod,
|
|
170
|
+
input: Message,
|
|
171
|
+
override?: AuthorizeTargetOverride,
|
|
172
|
+
): AuthorizationTarget | undefined {
|
|
173
|
+
if (
|
|
174
|
+
getOption(method, is_public) ||
|
|
175
|
+
getOption(method, is_skip_authorization)
|
|
176
|
+
) {
|
|
177
|
+
return undefined;
|
|
178
|
+
}
|
|
179
|
+
if (!hasOption(method, rpcAuthorizationConfig)) {
|
|
180
|
+
return undefined;
|
|
181
|
+
}
|
|
182
|
+
const config = getOption(method, rpcAuthorizationConfig);
|
|
183
|
+
return {
|
|
184
|
+
permission: config.permission,
|
|
185
|
+
resourceKind: override?.resourceKind ?? resolveResourceKind(input, config),
|
|
186
|
+
resourceId: override?.resourceId ?? resolveResourceId(input, config),
|
|
187
|
+
deniedMessage: config.errorMsg,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
140
191
|
/**
|
|
141
192
|
* The Authorize evaluation for direct handlers: identical skip arms,
|
|
142
193
|
* target resolution, and decision-to-wire mapping as the pipeline step
|
|
@@ -153,27 +204,33 @@ export async function authorizeDirect(
|
|
|
153
204
|
if (identity.callerClass === "internal") {
|
|
154
205
|
return;
|
|
155
206
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
getOption(method, is_skip_authorization)
|
|
159
|
-
) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
if (!hasOption(method, rpcAuthorizationConfig)) {
|
|
207
|
+
const target = resolveAnnotatedCheck(method, input, override);
|
|
208
|
+
if (target === undefined) {
|
|
163
209
|
return;
|
|
164
210
|
}
|
|
165
|
-
|
|
211
|
+
return authorizeTarget(authorizer, identity, target);
|
|
212
|
+
}
|
|
166
213
|
|
|
214
|
+
/**
|
|
215
|
+
* `authorizeResolvedResource` over an AuthorizationTarget: the check the
|
|
216
|
+
* Authorizer sees carries exactly the three fields of an AuthzCheck, never
|
|
217
|
+
* the copy, so a recording Authorizer (a test's, a driver's audit line)
|
|
218
|
+
* observes the question and nothing else.
|
|
219
|
+
*/
|
|
220
|
+
export function authorizeTarget(
|
|
221
|
+
authorizer: Authorizer,
|
|
222
|
+
identity: CallerIdentity,
|
|
223
|
+
target: AuthorizationTarget,
|
|
224
|
+
): Promise<void> {
|
|
167
225
|
return authorizeResolvedResource(
|
|
168
226
|
authorizer,
|
|
169
227
|
identity,
|
|
170
228
|
{
|
|
171
|
-
permission:
|
|
172
|
-
resourceKind:
|
|
173
|
-
|
|
174
|
-
resourceId: override?.resourceId ?? resolveResourceId(input, config),
|
|
229
|
+
permission: target.permission,
|
|
230
|
+
resourceKind: target.resourceKind,
|
|
231
|
+
resourceId: target.resourceId,
|
|
175
232
|
},
|
|
176
|
-
|
|
233
|
+
target.deniedMessage,
|
|
177
234
|
);
|
|
178
235
|
}
|
|
179
236
|
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
import type { DescMessage } from "@bufbuild/protobuf";
|
|
38
38
|
import { Code, ConnectError } from "@connectrpc/connect";
|
|
39
39
|
|
|
40
|
+
import { isServerComposedRequest } from "../../extensions/identity.js";
|
|
40
41
|
import type { PipelineStep } from "../pipeline.js";
|
|
41
42
|
import type { RequestContext } from "../request-context.js";
|
|
42
43
|
import type { RunnerCredentialProvider } from "../../runnerauth/runner-credential-provider.js";
|
|
@@ -61,7 +62,7 @@ export function newGuardMemoryCaptureStep<Desc extends DescMessage>(
|
|
|
61
62
|
name: "GuardMemoryCapture",
|
|
62
63
|
async execute(ctx: RequestContext<Desc>): Promise<void> {
|
|
63
64
|
const caller = ctx.callerIdentity;
|
|
64
|
-
if (caller
|
|
65
|
+
if (isServerComposedRequest(caller)) {
|
|
65
66
|
// Server-composed traversals are not capture requests from a
|
|
66
67
|
// credential; the entry-point request already passed the gate.
|
|
67
68
|
return;
|
|
@@ -55,6 +55,7 @@ import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/
|
|
|
55
55
|
import { IamPermission } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
|
|
56
56
|
|
|
57
57
|
import type { Authorizer } from "../../extensions/authorizer.js";
|
|
58
|
+
import { isServerComposedRequest } from "../../extensions/identity.js";
|
|
58
59
|
import { internalError } from "../errors.js";
|
|
59
60
|
import type { PipelineStep } from "../pipeline.js";
|
|
60
61
|
import type { RequestContext } from "../request-context.js";
|
|
@@ -117,15 +118,11 @@ export function newGuardReservedLabelsStep<Desc extends DescMessage>(
|
|
|
117
118
|
return {
|
|
118
119
|
name: "GuardReservedLabels",
|
|
119
120
|
async execute(ctx: RequestContext<Desc>): Promise<void> {
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
//
|
|
125
|
-
// cloud#386): the trust decision was made by the service code
|
|
126
|
-
// that built it — default-instance factories stamp reserved
|
|
127
|
-
// labels by design, even when the call propagates the user's
|
|
128
|
-
// identity for attribution (ruling R5).
|
|
121
|
+
if (isServerComposedRequest(ctx.callerIdentity)) {
|
|
122
|
+
// The Java isInProcessCall arm (cloud#386): the trust decision was
|
|
123
|
+
// made by the service code that built the request — default-instance
|
|
124
|
+
// factories stamp reserved labels by design, even when the call
|
|
125
|
+
// propagates the user's identity for attribution (ruling R5).
|
|
129
126
|
return;
|
|
130
127
|
}
|
|
131
128
|
const state = stateOf(ctx);
|
|
@@ -8,7 +8,6 @@ import type { DescMessage, MessageShape } from "@bufbuild/protobuf";
|
|
|
8
8
|
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
|
9
9
|
|
|
10
10
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
11
|
-
import { AuthorizationScopeType } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/authorization_config_pb";
|
|
12
11
|
|
|
13
12
|
import type { Store } from "../../store/interface.js";
|
|
14
13
|
import { getKindMeta } from "../apiresource-meta.js";
|
|
@@ -85,11 +84,15 @@ export async function findResourceByLabelAndOrg<Desc extends DescMessage>(
|
|
|
85
84
|
}
|
|
86
85
|
|
|
87
86
|
/**
|
|
88
|
-
* Rejects a getByReference lookup that omits org
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
87
|
+
* Rejects a getByReference lookup that omits org — Go RequireOrgForReference,
|
|
88
|
+
* widened to every kind that has a reference lane. A slug is unique only
|
|
89
|
+
* WITHIN an org, so an org-less reference resolves globally and the first
|
|
90
|
+
* match wins: for an org-scoped kind that crosses tenant boundaries, and
|
|
91
|
+
* for an owner-only kind (the execution context) it let a caller name a
|
|
92
|
+
* slug and receive whichever organization's row matched first. Every kind
|
|
93
|
+
* with a reference lane is served per organization, so the rule is the
|
|
94
|
+
* same for all of them. The message matches the cloud edition verbatim
|
|
95
|
+
* (cross-edition error contract); the kind name comes from kind_meta.
|
|
93
96
|
*
|
|
94
97
|
* Belongs at the getByReference boundary only — the low-level slug finders
|
|
95
98
|
* are legitimately called with a relative (possibly empty) org by internal
|
|
@@ -102,23 +105,16 @@ export function requireOrgForReference(
|
|
|
102
105
|
if (org !== "") {
|
|
103
106
|
return;
|
|
104
107
|
}
|
|
105
|
-
let scopeType: AuthorizationScopeType | undefined;
|
|
106
108
|
let kindName: string;
|
|
107
109
|
try {
|
|
108
|
-
|
|
109
|
-
scopeType = meta.authorization?.scopeType;
|
|
110
|
-
kindName = meta.name;
|
|
110
|
+
kindName = getKindMeta(kind).name;
|
|
111
111
|
} catch (error) {
|
|
112
112
|
throw internalError(
|
|
113
113
|
error,
|
|
114
114
|
"failed to resolve kind metadata for reference org check",
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
|
-
|
|
118
|
-
// AUTHORIZATION_SCOPE_TYPE_ORGANIZATION generates as ORGANIZATION.
|
|
119
|
-
if (scopeType === AuthorizationScopeType.ORGANIZATION) {
|
|
120
|
-
throw invalidArgumentError(`org is required for ${kindName} lookup`);
|
|
121
|
-
}
|
|
117
|
+
throw invalidArgumentError(`org is required for ${kindName} lookup`);
|
|
122
118
|
}
|
|
123
119
|
|
|
124
120
|
// The two list-step helpers below are duplicated per package in Go (each
|