@stigmer/server 3.40.1 → 3.41.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/dist/authorization/authorizer.d.ts +16 -10
- package/dist/authorization/authorizer.d.ts.map +1 -1
- package/dist/authorization/authorizer.js +17 -9
- package/dist/authorization/authorizer.js.map +1 -1
- package/dist/authorization/derived-tuples.d.ts +7 -3
- package/dist/authorization/derived-tuples.d.ts.map +1 -1
- package/dist/authorization/derived-tuples.js +62 -6
- package/dist/authorization/derived-tuples.js.map +1 -1
- package/dist/authorization/evaluator.d.ts +11 -7
- package/dist/authorization/evaluator.d.ts.map +1 -1
- package/dist/authorization/evaluator.js +16 -10
- package/dist/authorization/evaluator.js.map +1 -1
- package/dist/authorization/list-read-scope.d.ts +4 -0
- package/dist/authorization/list-read-scope.d.ts.map +1 -1
- package/dist/authorization/list-read-scope.js +1 -0
- package/dist/authorization/list-read-scope.js.map +1 -1
- package/dist/authorization/model/data/authorization-model.json +830 -67
- package/dist/authorization/model/execution-viewer.d.ts.map +1 -1
- package/dist/authorization/model/execution-viewer.js +26 -24
- package/dist/authorization/model/execution-viewer.js.map +1 -1
- package/dist/authorization/model/index.d.ts +4 -1
- package/dist/authorization/model/index.d.ts.map +1 -1
- package/dist/authorization/model/index.js +4 -1
- package/dist/authorization/model/index.js.map +1 -1
- package/dist/authorization/model/rewrite.d.ts +5 -3
- package/dist/authorization/model/rewrite.d.ts.map +1 -1
- package/dist/authorization/organization-directory.d.ts +44 -0
- package/dist/authorization/organization-directory.d.ts.map +1 -1
- package/dist/authorization/organization-directory.js +1 -0
- package/dist/authorization/organization-directory.js.map +1 -1
- package/dist/authorization/person.d.ts +14 -1
- package/dist/authorization/person.d.ts.map +1 -1
- package/dist/authorization/person.js +16 -0
- package/dist/authorization/person.js.map +1 -1
- package/dist/authorization/policy-check.d.ts +52 -0
- package/dist/authorization/policy-check.d.ts.map +1 -0
- package/dist/authorization/policy-check.js +35 -0
- package/dist/authorization/policy-check.js.map +1 -0
- package/dist/authorization/posture.d.ts +30 -4
- package/dist/authorization/posture.d.ts.map +1 -1
- package/dist/authorization/posture.js +58 -0
- package/dist/authorization/posture.js.map +1 -1
- package/dist/authorization/resource-creators.d.ts +4 -0
- package/dist/authorization/resource-creators.d.ts.map +1 -0
- package/dist/authorization/resource-creators.js +44 -0
- package/dist/authorization/resource-creators.js.map +1 -0
- package/dist/authorization/trusted-local-authorizer.d.ts +9 -0
- package/dist/authorization/trusted-local-authorizer.d.ts.map +1 -0
- package/dist/authorization/trusted-local-authorizer.js +70 -0
- package/dist/authorization/trusted-local-authorizer.js.map +1 -0
- package/dist/authorization/tuples.d.ts +12 -0
- package/dist/authorization/tuples.d.ts.map +1 -1
- package/dist/authorization/tuples.js +3 -0
- package/dist/authorization/tuples.js.map +1 -1
- package/dist/boot/compose.d.ts.map +1 -1
- package/dist/boot/compose.js +132 -43
- package/dist/boot/compose.js.map +1 -1
- package/dist/boot/config.d.ts +22 -7
- package/dist/boot/config.d.ts.map +1 -1
- package/dist/boot/config.js +2 -1
- package/dist/boot/config.js.map +1 -1
- package/dist/boot/inprocess.d.ts.map +1 -1
- package/dist/boot/inprocess.js +10 -4
- package/dist/boot/inprocess.js.map +1 -1
- package/dist/boot/list-indexes.d.ts.map +1 -1
- package/dist/boot/list-indexes.js +6 -1
- package/dist/boot/list-indexes.js.map +1 -1
- package/dist/boot/logger.d.ts +3 -1
- package/dist/boot/logger.d.ts.map +1 -1
- package/dist/boot/logger.js +3 -1
- package/dist/boot/logger.js.map +1 -1
- package/dist/boot/oauth-redirect-uri.d.ts +33 -12
- package/dist/boot/oauth-redirect-uri.d.ts.map +1 -1
- package/dist/boot/oauth-redirect-uri.js +43 -14
- package/dist/boot/oauth-redirect-uri.js.map +1 -1
- package/dist/boot/skill-transfer-origin.d.ts +46 -14
- package/dist/boot/skill-transfer-origin.d.ts.map +1 -1
- package/dist/boot/skill-transfer-origin.js +53 -13
- package/dist/boot/skill-transfer-origin.js.map +1 -1
- package/dist/domain/agentchannel/steps.d.ts +8 -6
- package/dist/domain/agentchannel/steps.d.ts.map +1 -1
- package/dist/domain/agentchannel/steps.js +9 -7
- package/dist/domain/agentchannel/steps.js.map +1 -1
- package/dist/domain/agentexecution/controller.d.ts +7 -0
- package/dist/domain/agentexecution/controller.d.ts.map +1 -1
- package/dist/domain/agentexecution/controller.js +1 -1
- package/dist/domain/agentexecution/controller.js.map +1 -1
- package/dist/domain/agentexecution/create-steps.d.ts +26 -12
- package/dist/domain/agentexecution/create-steps.d.ts.map +1 -1
- package/dist/domain/agentexecution/create-steps.js +61 -43
- package/dist/domain/agentexecution/create-steps.js.map +1 -1
- package/dist/domain/agentexecution/submit-approval.d.ts.map +1 -1
- package/dist/domain/agentexecution/submit-approval.js +9 -6
- package/dist/domain/agentexecution/submit-approval.js.map +1 -1
- package/dist/domain/agentexecution/submit-file-decision.d.ts.map +1 -1
- package/dist/domain/agentexecution/submit-file-decision.js +5 -4
- package/dist/domain/agentexecution/submit-file-decision.js.map +1 -1
- package/dist/domain/agentshare/steps.d.ts +5 -3
- package/dist/domain/agentshare/steps.d.ts.map +1 -1
- package/dist/domain/agentshare/steps.js +6 -4
- package/dist/domain/agentshare/steps.js.map +1 -1
- package/dist/domain/apikey/verifier.d.ts +7 -0
- package/dist/domain/apikey/verifier.d.ts.map +1 -1
- package/dist/domain/apikey/verifier.js +34 -1
- package/dist/domain/apikey/verifier.js.map +1 -1
- package/dist/domain/channelapp/controller.d.ts +4 -3
- package/dist/domain/channelapp/controller.d.ts.map +1 -1
- package/dist/domain/channelapp/controller.js.map +1 -1
- package/dist/domain/executioncontext/steps.d.ts +2 -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/iampolicy/access-lists.d.ts.map +1 -1
- package/dist/domain/iampolicy/access-lists.js +57 -2
- package/dist/domain/iampolicy/access-lists.js.map +1 -1
- package/dist/domain/iampolicy/change.d.ts +53 -0
- package/dist/domain/iampolicy/change.d.ts.map +1 -0
- package/dist/domain/iampolicy/change.js +44 -0
- package/dist/domain/iampolicy/change.js.map +1 -0
- package/dist/domain/iampolicy/constants.d.ts +6 -0
- package/dist/domain/iampolicy/constants.d.ts.map +1 -1
- package/dist/domain/iampolicy/constants.js +6 -0
- package/dist/domain/iampolicy/constants.js.map +1 -1
- package/dist/domain/iampolicy/controller.d.ts.map +1 -1
- package/dist/domain/iampolicy/controller.js +9 -5
- package/dist/domain/iampolicy/controller.js.map +1 -1
- package/dist/domain/iampolicy/grant-path.d.ts +31 -13
- package/dist/domain/iampolicy/grant-path.d.ts.map +1 -1
- package/dist/domain/iampolicy/grant-path.js +216 -19
- package/dist/domain/iampolicy/grant-path.js.map +1 -1
- package/dist/domain/iampolicy/membership.d.ts +11 -3
- package/dist/domain/iampolicy/membership.d.ts.map +1 -1
- package/dist/domain/iampolicy/membership.js +18 -13
- package/dist/domain/iampolicy/membership.js.map +1 -1
- package/dist/domain/iampolicy/resource-store.d.ts.map +1 -1
- package/dist/domain/iampolicy/resource-store.js +4 -0
- package/dist/domain/iampolicy/resource-store.js.map +1 -1
- package/dist/domain/iampolicy/role-lifecycle.d.ts.map +1 -1
- package/dist/domain/iampolicy/role-lifecycle.js +2 -2
- package/dist/domain/iampolicy/role-lifecycle.js.map +1 -1
- package/dist/domain/iampolicy/roles.d.ts.map +1 -1
- package/dist/domain/iampolicy/roles.js +7 -0
- package/dist/domain/iampolicy/roles.js.map +1 -1
- package/dist/domain/iampolicy/steps.d.ts +4 -3
- package/dist/domain/iampolicy/steps.d.ts.map +1 -1
- package/dist/domain/iampolicy/steps.js +7 -7
- package/dist/domain/iampolicy/steps.js.map +1 -1
- package/dist/domain/iampolicy/store-contract.d.ts.map +1 -1
- package/dist/domain/iampolicy/store-contract.js +22 -1
- package/dist/domain/iampolicy/store-contract.js.map +1 -1
- package/dist/domain/iampolicy/store.d.ts +18 -5
- package/dist/domain/iampolicy/store.d.ts.map +1 -1
- package/dist/domain/iampolicy/store.js.map +1 -1
- package/dist/domain/identityaccount/constants.d.ts +15 -0
- package/dist/domain/identityaccount/constants.d.ts.map +1 -1
- package/dist/domain/identityaccount/constants.js +17 -0
- package/dist/domain/identityaccount/constants.js.map +1 -1
- package/dist/domain/identityaccount/controller.d.ts.map +1 -1
- package/dist/domain/identityaccount/controller.js +17 -6
- package/dist/domain/identityaccount/controller.js.map +1 -1
- package/dist/domain/identityaccount/resolve.d.ts +47 -0
- package/dist/domain/identityaccount/resolve.d.ts.map +1 -1
- package/dist/domain/identityaccount/resolve.js +38 -1
- package/dist/domain/identityaccount/resolve.js.map +1 -1
- package/dist/domain/identityaccount/resource-store.d.ts.map +1 -1
- package/dist/domain/identityaccount/resource-store.js +11 -1
- package/dist/domain/identityaccount/resource-store.js.map +1 -1
- package/dist/domain/identityaccount/steps.d.ts +2 -1
- package/dist/domain/identityaccount/steps.d.ts.map +1 -1
- package/dist/domain/identityaccount/steps.js +4 -3
- package/dist/domain/identityaccount/steps.js.map +1 -1
- package/dist/domain/identityaccount/store-contract.js +2 -2
- package/dist/domain/identityaccount/store-contract.js.map +1 -1
- package/dist/domain/identityaccount/store.d.ts +6 -1
- package/dist/domain/identityaccount/store.d.ts.map +1 -1
- package/dist/domain/mcpserver/connect-sandbox.d.ts +67 -0
- package/dist/domain/mcpserver/connect-sandbox.d.ts.map +1 -0
- package/dist/domain/mcpserver/connect-sandbox.js +64 -0
- package/dist/domain/mcpserver/connect-sandbox.js.map +1 -0
- package/dist/domain/mcpserver/connect.d.ts +42 -10
- package/dist/domain/mcpserver/connect.d.ts.map +1 -1
- package/dist/domain/mcpserver/connect.js +147 -40
- package/dist/domain/mcpserver/connect.js.map +1 -1
- package/dist/domain/mcpserver/controller.js +4 -2
- package/dist/domain/mcpserver/controller.js.map +1 -1
- package/dist/domain/mcpserver/engine.d.ts +26 -7
- package/dist/domain/mcpserver/engine.d.ts.map +1 -1
- package/dist/domain/mcpserver/engine.js.map +1 -1
- package/dist/domain/mcpserver/start-connect.d.ts +5 -0
- package/dist/domain/mcpserver/start-connect.d.ts.map +1 -1
- package/dist/domain/mcpserver/start-connect.js +38 -15
- package/dist/domain/mcpserver/start-connect.js.map +1 -1
- package/dist/domain/memory/controller.js +2 -1
- package/dist/domain/memory/controller.js.map +1 -1
- package/dist/domain/memory/list-index.d.ts +2 -0
- package/dist/domain/memory/list-index.d.ts.map +1 -0
- package/dist/domain/memory/list-index.js +31 -0
- package/dist/domain/memory/list-index.js.map +1 -0
- package/dist/domain/memory/queries.d.ts +10 -0
- package/dist/domain/memory/queries.d.ts.map +1 -0
- package/dist/domain/memory/queries.js +54 -0
- package/dist/domain/memory/queries.js.map +1 -0
- package/dist/domain/memory/steps.d.ts +13 -11
- package/dist/domain/memory/steps.d.ts.map +1 -1
- package/dist/domain/memory/steps.js +26 -57
- package/dist/domain/memory/steps.js.map +1 -1
- package/dist/domain/organization/steps.d.ts.map +1 -1
- package/dist/domain/organization/steps.js +1 -1
- package/dist/domain/organization/steps.js.map +1 -1
- package/dist/domain/platformclient/mint.d.ts.map +1 -1
- package/dist/domain/platformclient/mint.js +2 -2
- package/dist/domain/platformclient/mint.js.map +1 -1
- package/dist/domain/platformclient/verifier.d.ts.map +1 -1
- package/dist/domain/platformclient/verifier.js +6 -3
- package/dist/domain/platformclient/verifier.js.map +1 -1
- package/dist/domain/plugin/push.d.ts.map +1 -1
- package/dist/domain/plugin/push.js +1 -0
- package/dist/domain/plugin/push.js.map +1 -1
- package/dist/domain/schedule/steps.d.ts +3 -1
- package/dist/domain/schedule/steps.d.ts.map +1 -1
- package/dist/domain/schedule/steps.js +3 -1
- package/dist/domain/schedule/steps.js.map +1 -1
- package/dist/domain/skill/push.d.ts.map +1 -1
- package/dist/domain/skill/push.js +1 -0
- package/dist/domain/skill/push.js.map +1 -1
- package/dist/domain/workflow/registry/data/task-kind-registry.json +27 -1
- package/dist/domain/workflowexecution/submit-approval.d.ts +5 -2
- package/dist/domain/workflowexecution/submit-approval.d.ts.map +1 -1
- package/dist/domain/workflowexecution/submit-approval.js +1 -1
- package/dist/domain/workflowexecution/submit-approval.js.map +1 -1
- package/dist/domain/workflowexecution/submit-file-decision.d.ts +5 -2
- package/dist/domain/workflowexecution/submit-file-decision.d.ts.map +1 -1
- package/dist/domain/workflowexecution/submit-file-decision.js +1 -1
- package/dist/domain/workflowexecution/submit-file-decision.js.map +1 -1
- package/dist/domain/workflowexecution/submit-workflow-task-approval.d.ts.map +1 -1
- package/dist/domain/workflowexecution/submit-workflow-task-approval.js +12 -1
- package/dist/domain/workflowexecution/submit-workflow-task-approval.js.map +1 -1
- package/dist/domain/workflowinstance/controller.d.ts +6 -3
- package/dist/domain/workflowinstance/controller.d.ts.map +1 -1
- package/dist/domain/workflowinstance/controller.js +12 -7
- package/dist/domain/workflowinstance/controller.js.map +1 -1
- package/dist/domain/workflowinstance/steps.d.ts +31 -0
- package/dist/domain/workflowinstance/steps.d.ts.map +1 -1
- package/dist/domain/workflowinstance/steps.js +88 -1
- package/dist/domain/workflowinstance/steps.js.map +1 -1
- package/dist/extensions/composed-services.d.ts +56 -0
- package/dist/extensions/composed-services.d.ts.map +1 -0
- package/dist/extensions/composed-services.js +2 -0
- package/dist/extensions/composed-services.js.map +1 -0
- package/dist/extensions/drivers.d.ts +32 -1
- package/dist/extensions/drivers.d.ts.map +1 -1
- package/dist/extensions/identity.d.ts +4 -1
- package/dist/extensions/identity.d.ts.map +1 -1
- package/dist/extensions/identity.js +4 -1
- package/dist/extensions/identity.js.map +1 -1
- package/dist/extensions/registry.d.ts +37 -0
- package/dist/extensions/registry.d.ts.map +1 -1
- package/dist/extensions/registry.js +50 -0
- package/dist/extensions/registry.js.map +1 -1
- package/dist/extensions/resource-authorization.d.ts +78 -0
- package/dist/extensions/resource-authorization.d.ts.map +1 -1
- package/dist/extensions/resource-row-reader.d.ts +43 -0
- package/dist/extensions/resource-row-reader.d.ts.map +1 -0
- package/dist/extensions/resource-row-reader.js +2 -0
- package/dist/extensions/resource-row-reader.js.map +1 -0
- package/dist/extensions/visitor-classifier.d.ts +41 -0
- package/dist/extensions/visitor-classifier.d.ts.map +1 -0
- package/dist/extensions/visitor-classifier.js +2 -0
- package/dist/extensions/visitor-classifier.js.map +1 -0
- package/dist/identity/oidc-userinfo.d.ts +6 -1
- package/dist/identity/oidc-userinfo.d.ts.map +1 -1
- package/dist/identity/oidc-userinfo.js.map +1 -1
- package/dist/identity/oidc-verifier.d.ts.map +1 -1
- package/dist/identity/oidc-verifier.js +37 -8
- package/dist/identity/oidc-verifier.js.map +1 -1
- package/dist/index.d.ts +14 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -9
- package/dist/index.js.map +1 -1
- package/dist/pipeline/errors.d.ts +8 -0
- package/dist/pipeline/errors.d.ts.map +1 -1
- package/dist/pipeline/errors.js +25 -16
- package/dist/pipeline/errors.js.map +1 -1
- package/dist/pipeline/interceptors/auth.d.ts +17 -9
- package/dist/pipeline/interceptors/auth.d.ts.map +1 -1
- package/dist/pipeline/interceptors/auth.js +17 -9
- package/dist/pipeline/interceptors/auth.js.map +1 -1
- package/dist/pipeline/steps/authorization-tuples.d.ts +23 -1
- package/dist/pipeline/steps/authorization-tuples.d.ts.map +1 -1
- package/dist/pipeline/steps/authorization-tuples.js +42 -0
- package/dist/pipeline/steps/authorization-tuples.js.map +1 -1
- package/dist/pipeline/steps/authorize.d.ts +6 -5
- package/dist/pipeline/steps/authorize.d.ts.map +1 -1
- package/dist/pipeline/steps/authorize.js +6 -5
- package/dist/pipeline/steps/authorize.js.map +1 -1
- package/dist/pipeline/steps/defaults.d.ts +12 -0
- package/dist/pipeline/steps/defaults.d.ts.map +1 -1
- package/dist/pipeline/steps/defaults.js +42 -7
- package/dist/pipeline/steps/defaults.js.map +1 -1
- package/dist/pipeline/steps/guard-memory-capture.d.ts +13 -15
- package/dist/pipeline/steps/guard-memory-capture.d.ts.map +1 -1
- package/dist/pipeline/steps/guard-memory-capture.js +2 -3
- package/dist/pipeline/steps/guard-memory-capture.js.map +1 -1
- package/dist/runnerauth/built-in-runner-credential-provider.d.ts +0 -2
- package/dist/runnerauth/built-in-runner-credential-provider.d.ts.map +1 -1
- package/dist/runnerauth/built-in-runner-credential-provider.js +8 -17
- package/dist/runnerauth/built-in-runner-credential-provider.js.map +1 -1
- package/dist/runnerauth/runner-credential-provider.d.ts +17 -7
- package/dist/runnerauth/runner-credential-provider.d.ts.map +1 -1
- package/dist/runnerauth/runner-credential-provider.js.map +1 -1
- package/dist/sandbox/docker.d.ts.map +1 -1
- package/dist/sandbox/docker.js +3 -0
- package/dist/sandbox/docker.js.map +1 -1
- package/dist/sandbox/kubernetes.d.ts.map +1 -1
- package/dist/sandbox/kubernetes.js +3 -0
- package/dist/sandbox/kubernetes.js.map +1 -1
- package/dist/sandbox/local-process.d.ts.map +1 -1
- package/dist/sandbox/local-process.js +4 -0
- package/dist/sandbox/local-process.js.map +1 -1
- package/dist/sandbox/provisioner.d.ts +18 -6
- package/dist/sandbox/provisioner.d.ts.map +1 -1
- package/dist/sandbox/provisioner.js.map +1 -1
- package/dist/temporal/manager.d.ts +5 -0
- package/dist/temporal/manager.d.ts.map +1 -1
- package/dist/temporal/manager.js +9 -0
- package/dist/temporal/manager.js.map +1 -1
- package/dist/temporal/mcpserver/engine-client.d.ts +2 -2
- package/dist/temporal/mcpserver/engine-client.d.ts.map +1 -1
- package/dist/temporal/mcpserver/engine-client.js +6 -4
- package/dist/temporal/mcpserver/engine-client.js.map +1 -1
- package/dist/temporal/mcpserver/names.d.ts +13 -2
- package/dist/temporal/mcpserver/names.d.ts.map +1 -1
- package/dist/temporal/mcpserver/names.js +15 -2
- package/dist/temporal/mcpserver/names.js.map +1 -1
- package/dist/temporal/sdk-logger.d.ts +74 -0
- package/dist/temporal/sdk-logger.d.ts.map +1 -0
- package/dist/temporal/sdk-logger.js +143 -0
- package/dist/temporal/sdk-logger.js.map +1 -0
- package/package.json +6 -6
- package/src/authorization/README.md +18 -6
- package/src/authorization/__tests__/authorizer.test.ts +5 -1
- package/src/authorization/__tests__/derived-tuples.test.ts +26 -0
- package/src/authorization/__tests__/evaluator.test.ts +4 -0
- package/src/authorization/__tests__/list-read-scope.test.ts +11 -5
- package/src/authorization/__tests__/store-tests.test.ts +3 -1
- package/src/authorization/__tests__/trusted-local-authorizer.test.ts +155 -0
- package/src/authorization/__tests__/unit-owned-kinds.test.ts +420 -0
- package/src/authorization/__tests__/wire-permissions.test.ts +31 -2
- package/src/authorization/authorizer.ts +21 -10
- package/src/authorization/derived-tuples.ts +92 -18
- package/src/authorization/evaluator.ts +30 -15
- package/src/authorization/list-read-scope.ts +4 -0
- package/src/authorization/model/__tests__/registry.test.ts +23 -0
- package/src/authorization/model/data/authorization-model.json +830 -67
- package/src/authorization/model/execution-viewer.ts +32 -27
- package/src/authorization/model/index.ts +4 -1
- package/src/authorization/model/rewrite.ts +5 -3
- package/src/authorization/organization-directory.ts +4 -0
- package/src/authorization/person.ts +32 -1
- package/src/authorization/policy-check.ts +105 -0
- package/src/authorization/posture.ts +45 -4
- package/src/authorization/resource-creators.ts +48 -0
- package/src/authorization/trusted-local-authorizer.ts +91 -0
- package/src/authorization/tuples.ts +17 -0
- package/src/boot/__tests__/compose.test.ts +120 -4
- package/src/boot/__tests__/list-indexes.test.ts +4 -0
- package/src/boot/__tests__/oauth-redirect-uri.test.ts +121 -10
- package/src/boot/__tests__/skill-transfer-origin.test.ts +96 -25
- package/src/boot/compose.ts +153 -61
- package/src/boot/config.ts +28 -12
- package/src/boot/inprocess.ts +18 -4
- package/src/boot/list-indexes.ts +6 -1
- package/src/boot/logger.ts +3 -1
- package/src/boot/oauth-redirect-uri.ts +62 -17
- package/src/boot/skill-transfer-origin.ts +71 -16
- package/src/domain/agent/__tests__/agent.test.ts +42 -1
- package/src/domain/agentchannel/__tests__/agentchannel.test.ts +9 -0
- package/src/domain/agentchannel/__tests__/channel-runtime.test.ts +2 -0
- package/src/domain/agentchannel/__tests__/create-authorization.test.ts +7 -6
- package/src/domain/agentchannel/steps.ts +9 -7
- package/src/domain/agentexecution/__tests__/agentexecution.test.ts +148 -56
- package/src/domain/agentexecution/__tests__/create-steps.test.ts +175 -12
- package/src/domain/agentexecution/__tests__/file-review-seed.ts +91 -0
- package/src/domain/agentexecution/controller.ts +8 -0
- package/src/domain/agentexecution/create-steps.ts +74 -44
- package/src/domain/agentexecution/submit-approval.ts +9 -6
- package/src/domain/agentexecution/submit-file-decision.ts +5 -4
- package/src/domain/agentinstance/__tests__/agentinstance.test.ts +2 -0
- package/src/domain/agentshare/__tests__/agentshare.test.ts +17 -0
- package/src/domain/agentshare/__tests__/create-authorization.test.ts +5 -4
- package/src/domain/agentshare/steps.ts +6 -4
- package/src/domain/apikey/__tests__/verifier.test.ts +73 -1
- package/src/domain/apikey/verifier.ts +45 -1
- package/src/domain/artifact/__tests__/artifact.test.ts +13 -24
- package/src/domain/channelapp/__tests__/channelapp.test.ts +7 -0
- package/src/domain/channelapp/controller.ts +4 -3
- package/src/domain/environment/__tests__/environment.test.ts +13 -0
- package/src/domain/executioncontext/__tests__/executioncontext.test.ts +2 -0
- package/src/domain/executioncontext/steps.ts +2 -1
- package/src/domain/iampolicy/__tests__/access-lists.test.ts +79 -0
- package/src/domain/iampolicy/__tests__/change.test.ts +63 -0
- package/src/domain/iampolicy/__tests__/controller.test.ts +39 -3
- package/src/domain/iampolicy/__tests__/grant-path.test.ts +595 -27
- package/src/domain/iampolicy/__tests__/iampolicy.test.ts +33 -2
- package/src/domain/iampolicy/__tests__/membership.test.ts +47 -5
- package/src/domain/iampolicy/__tests__/resource-store.test.ts +1 -0
- package/src/domain/iampolicy/__tests__/role-lifecycle.test.ts +41 -8
- package/src/domain/iampolicy/__tests__/roles.test.ts +3 -2
- package/src/domain/iampolicy/__tests__/steps.test.ts +75 -6
- package/src/domain/iampolicy/__tests__/support.ts +68 -4
- package/src/domain/iampolicy/access-lists.ts +70 -2
- package/src/domain/iampolicy/change.ts +109 -0
- package/src/domain/iampolicy/constants.ts +8 -0
- package/src/domain/iampolicy/controller.ts +17 -3
- package/src/domain/iampolicy/grant-path.ts +349 -31
- package/src/domain/iampolicy/membership.ts +32 -12
- package/src/domain/iampolicy/resource-store.ts +4 -0
- package/src/domain/iampolicy/role-lifecycle.ts +2 -0
- package/src/domain/iampolicy/roles.ts +8 -0
- package/src/domain/iampolicy/steps.ts +15 -5
- package/src/domain/iampolicy/store-contract.ts +37 -1
- package/src/domain/iampolicy/store.ts +19 -5
- package/src/domain/identityaccount/__tests__/resolve.test.ts +246 -2
- package/src/domain/identityaccount/__tests__/resource-store.test.ts +1 -1
- package/src/domain/identityaccount/constants.ts +20 -0
- package/src/domain/identityaccount/controller.ts +20 -5
- package/src/domain/identityaccount/resolve.ts +80 -1
- package/src/domain/identityaccount/resource-store.ts +14 -1
- package/src/domain/identityaccount/steps.ts +4 -3
- package/src/domain/identityaccount/store-contract.ts +4 -4
- package/src/domain/identityaccount/store.ts +6 -1
- package/src/domain/mcpserver/__tests__/connect-authorization.test.ts +1 -0
- package/src/domain/mcpserver/__tests__/connect.test.ts +358 -15
- package/src/domain/mcpserver/__tests__/mcpserver.test.ts +2 -0
- package/src/domain/mcpserver/__tests__/oauth-handshake.test.ts +2 -0
- package/src/domain/mcpserver/__tests__/store-faults.test.ts +2 -0
- package/src/domain/mcpserver/connect-sandbox.ts +135 -0
- package/src/domain/mcpserver/connect.ts +226 -56
- package/src/domain/mcpserver/controller.ts +8 -2
- package/src/domain/mcpserver/engine.ts +24 -6
- package/src/domain/mcpserver/start-connect.ts +49 -10
- package/src/domain/memory/__tests__/memory.test.ts +92 -22
- package/src/domain/memory/__tests__/queries.test.ts +173 -0
- package/src/domain/memory/controller.ts +2 -1
- package/src/domain/memory/list-index.ts +32 -0
- package/src/domain/memory/queries.ts +72 -0
- package/src/domain/memory/steps.ts +26 -63
- package/src/domain/oauthapp/__tests__/oauthapp.test.ts +14 -0
- package/src/domain/organization/__tests__/support.ts +41 -0
- package/src/domain/organization/steps.ts +1 -0
- package/src/domain/platformclient/mint.ts +6 -2
- package/src/domain/platformclient/verifier.ts +6 -3
- package/src/domain/plugin/__tests__/plugin.test.ts +11 -24
- package/src/domain/plugin/push.ts +1 -0
- package/src/domain/schedule/__tests__/schedule.composed.test.ts +2 -0
- package/src/domain/schedule/steps.ts +3 -1
- package/src/domain/session/__tests__/session.test.ts +2 -0
- package/src/domain/skill/__tests__/skill.test.ts +7 -25
- package/src/domain/skill/push.ts +1 -0
- package/src/domain/workflow/__tests__/workflow.test.ts +2 -0
- package/src/domain/workflow/registry/data/task-kind-registry.json +27 -1
- package/src/domain/workflowexecution/__tests__/forward-attribution-composed.test.ts +270 -0
- package/src/domain/workflowexecution/__tests__/submit-workflow-task-approval.test.ts +196 -0
- package/src/domain/workflowexecution/__tests__/workflowexecution.test.ts +3 -57
- package/src/domain/workflowexecution/submit-approval.ts +9 -2
- package/src/domain/workflowexecution/submit-file-decision.ts +6 -1
- package/src/domain/workflowexecution/submit-workflow-task-approval.ts +23 -5
- package/src/domain/workflowinstance/controller.ts +27 -9
- package/src/domain/workflowinstance/steps.ts +123 -1
- package/src/extensions/__tests__/apikey-before-sign-in-composed.test.ts +172 -0
- package/src/extensions/__tests__/built-in-authorization-composed.test.ts +80 -1
- package/src/extensions/__tests__/composed-services-composed.test.ts +236 -0
- package/src/extensions/__tests__/extension-composition.test.ts +229 -16
- package/src/extensions/__tests__/identity-account-composed.test.ts +84 -4
- package/src/extensions/__tests__/list-read-scope-composed.test.ts +2 -0
- package/src/extensions/__tests__/registry.test.ts +147 -1
- package/src/extensions/__tests__/secret-cleanup-composed.test.ts +2 -0
- package/src/extensions/__tests__/visitor-classifier-points.test.ts +42 -0
- package/src/extensions/composed-services.ts +61 -0
- package/src/extensions/drivers.ts +33 -1
- package/src/extensions/identity.ts +4 -1
- package/src/extensions/registry.ts +105 -0
- package/src/extensions/resource-authorization.ts +87 -0
- package/src/extensions/resource-row-reader.ts +43 -0
- package/src/extensions/visitor-classifier.ts +41 -0
- package/src/identity/__tests__/oidc-verifier.test.ts +38 -12
- package/src/identity/oidc-userinfo.ts +6 -1
- package/src/identity/oidc-verifier.ts +42 -8
- package/src/index.ts +61 -6
- package/src/pipeline/__tests__/steps.test.ts +31 -4
- package/src/pipeline/errors.ts +30 -16
- package/src/pipeline/interceptors/auth.ts +17 -9
- package/src/pipeline/steps/__tests__/authorization-tuples.test.ts +20 -0
- package/src/pipeline/steps/__tests__/guard-memory-capture.test.ts +72 -15
- package/src/pipeline/steps/authorization-tuples.ts +54 -0
- package/src/pipeline/steps/authorize.ts +6 -5
- package/src/pipeline/steps/defaults.ts +52 -7
- package/src/pipeline/steps/guard-memory-capture.ts +15 -20
- package/src/runnerauth/__tests__/built-in-runner-credential-provider.test.ts +1 -1
- package/src/runnerauth/__tests__/runner-subject-composed.test.ts +13 -0
- package/src/runnerauth/bound-execution.ts +2 -2
- package/src/runnerauth/built-in-runner-credential-provider.ts +8 -21
- package/src/runnerauth/runner-credential-provider.ts +17 -7
- package/src/sandbox/__tests__/docker.integration.test.ts +4 -0
- package/src/sandbox/__tests__/kubernetes.test.ts +18 -1
- package/src/sandbox/__tests__/local-process.integration.test.ts +4 -0
- package/src/sandbox/__tests__/provisioner.test.ts +1 -0
- package/src/sandbox/docker.ts +3 -0
- package/src/sandbox/kubernetes.ts +3 -0
- package/src/sandbox/local-process.ts +4 -0
- package/src/sandbox/provisioner.ts +18 -6
- package/src/store/postgres/__tests__/support.ts +11 -2
- package/src/temporal/README.md +1 -0
- package/src/temporal/__tests__/manager.test.ts +56 -4
- package/src/temporal/__tests__/sdk-log-workflows.ts +26 -0
- package/src/temporal/__tests__/sdk-logger.e2e.test.ts +150 -0
- package/src/temporal/__tests__/sdk-logger.test.ts +238 -0
- package/src/temporal/manager.ts +9 -0
- package/src/temporal/mcpserver/engine-client.ts +8 -3
- package/src/temporal/mcpserver/names.ts +16 -2
- package/src/temporal/sdk-logger.ts +173 -0
- package/dist/authorization/lane-admission.d.ts +0 -50
- package/dist/authorization/lane-admission.d.ts.map +0 -1
- package/dist/authorization/lane-admission.js +0 -13
- package/dist/authorization/lane-admission.js.map +0 -1
- package/src/authorization/__tests__/lane-admission.test.ts +0 -115
- package/src/authorization/lane-admission.ts +0 -73
|
@@ -6,9 +6,12 @@
|
|
|
6
6
|
* direction of the mutual edge) and enforces the same-org rule; Update
|
|
7
7
|
* enforces spec.workflow_id immutability (oss#646); UpdateVisibility
|
|
8
8
|
* rejects default instances (oss#556, the FAILED_PRECONDITION wins over
|
|
9
|
-
* the level check as in Cloud); UpdateExecutionVisibility
|
|
10
|
-
* run-observability axis
|
|
11
|
-
*
|
|
9
|
+
* the level check as in Cloud); UpdateExecutionVisibility is the one door
|
|
10
|
+
* that changes the run-observability axis after create (Update and Apply
|
|
11
|
+
* keep the stored level) and tells a composed tuple driver the audience it
|
|
12
|
+
* names, as create does — open source derives `execution_viewer` from the
|
|
13
|
+
* row at check time, an edition that stores tuples writes it
|
|
14
|
+
* (stigmer-cloud#720); Delete deliberately does NOT
|
|
12
15
|
* cascade executions (oss#582 — run history survives its instance).
|
|
13
16
|
*
|
|
14
17
|
* Pipeline per RPC mirrors the Go step chains character-for-character.
|
|
@@ -108,8 +111,11 @@ import { ResourceNotFoundError } from "../../store/interface.js";
|
|
|
108
111
|
import type { Store } from "../../store/interface.js";
|
|
109
112
|
import { workflowInstanceSearchExtractor } from "./search-extractor.js";
|
|
110
113
|
import {
|
|
114
|
+
newCreateExecutionVisibilityTuplesStep,
|
|
111
115
|
newLoadParentWorkflowStep,
|
|
116
|
+
newPreserveExecutionVisibilityStep,
|
|
112
117
|
newRejectDefaultWorkflowInstanceVisibilityUpdateStep,
|
|
118
|
+
newUpdateExecutionVisibilityTuplesStep,
|
|
113
119
|
newValidateInstanceUpdateStep,
|
|
114
120
|
newValidateSameOrgBusinessRuleStep,
|
|
115
121
|
resolveWorkflowInstanceCreateTargets,
|
|
@@ -208,6 +214,9 @@ async function createInstance(
|
|
|
208
214
|
deps.logger,
|
|
209
215
|
),
|
|
210
216
|
)
|
|
217
|
+
.addStep(
|
|
218
|
+
newCreateExecutionVisibilityTuplesStep(deps.authorizationLifecycle),
|
|
219
|
+
)
|
|
211
220
|
.addStep(
|
|
212
221
|
newIndexSearchStep(
|
|
213
222
|
deps.store,
|
|
@@ -247,6 +256,7 @@ async function update(
|
|
|
247
256
|
.addStep(newLoadExistingStep(deps.store))
|
|
248
257
|
.addStep(newValidateInstanceUpdateStep())
|
|
249
258
|
.addStep(newBuildUpdateStateStep())
|
|
259
|
+
.addStep(newPreserveExecutionVisibilityStep())
|
|
250
260
|
.addStep(newGuardReservedLabelsStep(deps.authorizer))
|
|
251
261
|
.addStep(newNormalizeReferencesStep())
|
|
252
262
|
.addStep(newValidateReferencesStep(deps.store))
|
|
@@ -468,12 +478,14 @@ function newSetInstanceVisibilityStep(): PipelineStep<UpdateVisibilityDesc> {
|
|
|
468
478
|
|
|
469
479
|
// ---------------------------------------------------------------------------
|
|
470
480
|
// updateExecutionVisibility — update_execution_visibility.go: a targeted
|
|
471
|
-
// spec update (only spec.execution_visibility changes)
|
|
472
|
-
//
|
|
473
|
-
//
|
|
474
|
-
//
|
|
475
|
-
//
|
|
476
|
-
// cloud
|
|
481
|
+
// spec update (only spec.execution_visibility changes), and the one door
|
|
482
|
+
// that changes it after create. Open source authorizes run reads from the
|
|
483
|
+
// row itself (authorization/model/execution-viewer.ts), so the persisted
|
|
484
|
+
// level is the grant; a composed tuple driver hears the audience the new
|
|
485
|
+
// level names after the persist (UpdateExecutionVisibilityTuples,
|
|
486
|
+
// stigmer-cloud#720) and makes its stored tuples match. Deliberately NOT
|
|
487
|
+
// guarded for default instances — cloud allows it on them too; do not
|
|
488
|
+
// "fix" that.
|
|
477
489
|
// ---------------------------------------------------------------------------
|
|
478
490
|
|
|
479
491
|
const UPDATE_EXECUTION_VISIBILITY_INSTANCE_KEY =
|
|
@@ -520,6 +532,12 @@ async function updateExecutionVisibility(
|
|
|
520
532
|
"PersistInstanceForExecutionVisibilityUpdate",
|
|
521
533
|
),
|
|
522
534
|
)
|
|
535
|
+
.addStep(
|
|
536
|
+
newUpdateExecutionVisibilityTuplesStep(
|
|
537
|
+
deps.authorizationLifecycle,
|
|
538
|
+
UPDATE_EXECUTION_VISIBILITY_INSTANCE_KEY,
|
|
539
|
+
),
|
|
540
|
+
)
|
|
523
541
|
.addStep(
|
|
524
542
|
newIndexInstanceStep(
|
|
525
543
|
deps.store,
|
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
* pkg/domain/workflowinstance/controller: parent-workflow load through the
|
|
4
4
|
* in-process workflow client (the other direction of the mutual edge),
|
|
5
5
|
* the same-org business rule, the spec.workflow_id immutability guard
|
|
6
|
-
* (oss#646),
|
|
6
|
+
* (oss#646), the default-instance visibility guard (oss#556), and the run
|
|
7
|
+
* audience's lifecycle: `spec.execution_visibility` is set at create and
|
|
8
|
+
* changed only by updateExecutionVisibility (Update and Apply keep the
|
|
9
|
+
* stored level, the oss#573 rule for metadata.visibility), and both doors
|
|
10
|
+
* tell a composed tuple driver the audience the level names
|
|
11
|
+
* (stigmer-cloud#720). Proven by
|
|
7
12
|
* workflowinstance.conformance.test.ts (CONFORMANCE_TARGET=local) and
|
|
8
13
|
* the family test ../workflow/__tests__/workflow.test.ts (the mutual edge
|
|
9
14
|
* makes the two domains one testable unit).
|
|
@@ -15,10 +20,15 @@ import { WorkflowSchema } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/a
|
|
|
15
20
|
import type { Workflow } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/api_pb";
|
|
16
21
|
import { WorkflowInstanceSchema } from "@stigmer/protos/ai/stigmer/agentic/workflowinstance/v1/api_pb";
|
|
17
22
|
import type { WorkflowInstance } from "@stigmer/protos/ai/stigmer/agentic/workflowinstance/v1/api_pb";
|
|
23
|
+
import { WorkflowExecutionVisibility } from "@stigmer/protos/ai/stigmer/agentic/workflowinstance/v1/spec_pb";
|
|
18
24
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
19
25
|
import { IamPermission } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
|
|
20
26
|
|
|
21
27
|
import type { Logger } from "../../boot/logger.js";
|
|
28
|
+
import type {
|
|
29
|
+
ExecutionVisibilityChangedEvent,
|
|
30
|
+
ResourceAuthorizationLifecycle,
|
|
31
|
+
} from "../../extensions/resource-authorization.js";
|
|
22
32
|
import { isServerComposedRequest } from "../../extensions/identity.js";
|
|
23
33
|
import { isDefaultInstance } from "../../pipeline/apiresource-labels.js";
|
|
24
34
|
import {
|
|
@@ -30,6 +40,10 @@ import {
|
|
|
30
40
|
import type { PipelineStep } from "../../pipeline/pipeline.js";
|
|
31
41
|
import type { RequestContext } from "../../pipeline/request-context.js";
|
|
32
42
|
import type { AuthorizationTarget } from "../../pipeline/steps/authorize.js";
|
|
43
|
+
import {
|
|
44
|
+
executionAudienceShapes,
|
|
45
|
+
notifyExecutionVisibilityChanged,
|
|
46
|
+
} from "../../pipeline/steps/authorization-tuples.js";
|
|
33
47
|
import { EXISTING_RESOURCE_KEY } from "../../pipeline/steps/load-existing.js";
|
|
34
48
|
import { rejectDefaultInstanceVisibilityUpdate } from "../../pipeline/steps/validate-visibility.js";
|
|
35
49
|
import { ResourceNotFoundError } from "../../store/interface.js";
|
|
@@ -211,6 +225,114 @@ export function newValidateInstanceUpdateStep(): PipelineStep<InstanceDesc> {
|
|
|
211
225
|
};
|
|
212
226
|
}
|
|
213
227
|
|
|
228
|
+
/**
|
|
229
|
+
* PreserveExecutionVisibility — the run audience is update-immutable: the
|
|
230
|
+
* stored `spec.execution_visibility` replaces whatever the request carried,
|
|
231
|
+
* after BuildUpdateState's full spec replacement. updateExecutionVisibility
|
|
232
|
+
* is its one door after create, so a manifest re-applied without the field,
|
|
233
|
+
* or with a stale level, never silently narrows who can observe the runs;
|
|
234
|
+
* ignored rather than rejected for the reason BuildUpdateState ignores a
|
|
235
|
+
* request-carried metadata.visibility (oss#573): the level has a legitimate
|
|
236
|
+
* second door, so a stale value is routine and must not fail the update.
|
|
237
|
+
* Runs after LoadExisting; Apply delegates to Update, so the apply door is
|
|
238
|
+
* covered too, and Update needs no run-audience event.
|
|
239
|
+
*/
|
|
240
|
+
export function newPreserveExecutionVisibilityStep(): PipelineStep<InstanceDesc> {
|
|
241
|
+
return {
|
|
242
|
+
name: "PreserveExecutionVisibility",
|
|
243
|
+
execute(ctx: RequestContext<InstanceDesc>): void {
|
|
244
|
+
const existing = ctx.get(EXISTING_RESOURCE_KEY) as
|
|
245
|
+
| WorkflowInstance
|
|
246
|
+
| undefined;
|
|
247
|
+
if (existing === undefined) {
|
|
248
|
+
throw internalError(
|
|
249
|
+
new Error("existing workflow instance not found in context"),
|
|
250
|
+
"existing workflow instance not found in context",
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
const merged = ctx.newState;
|
|
254
|
+
if (merged.spec !== undefined) {
|
|
255
|
+
merged.spec.executionVisibility =
|
|
256
|
+
existing.spec?.executionVisibility ??
|
|
257
|
+
WorkflowExecutionVisibility.unspecified;
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** The run-audience event for a persisted instance: the audience its stored level names. */
|
|
264
|
+
function executionVisibilityEventOf(
|
|
265
|
+
instance: WorkflowInstance,
|
|
266
|
+
): ExecutionVisibilityChangedEvent {
|
|
267
|
+
return {
|
|
268
|
+
instanceKind: ApiResourceKind.workflow_instance,
|
|
269
|
+
instanceId: instance.metadata?.id ?? "",
|
|
270
|
+
orgId: instance.metadata?.org ?? "",
|
|
271
|
+
shapes: [
|
|
272
|
+
...executionAudienceShapes(
|
|
273
|
+
instance.spec?.executionVisibility ??
|
|
274
|
+
WorkflowExecutionVisibility.unspecified,
|
|
275
|
+
),
|
|
276
|
+
],
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* CreateExecutionVisibilityTuples — post-persist in the create chain,
|
|
282
|
+
* beside CreateAuthorizationTuples: an instance created with a level that
|
|
283
|
+
* names an audience (ORGANIZATION) tells the driver, which writes the
|
|
284
|
+
* `execution_viewer` tuple the run history is read through. A private or
|
|
285
|
+
* unset create names nobody and fires nothing (there is no tuple to
|
|
286
|
+
* remove). The failure copy is the create lane's own.
|
|
287
|
+
*/
|
|
288
|
+
export function newCreateExecutionVisibilityTuplesStep(
|
|
289
|
+
lifecycle: ResourceAuthorizationLifecycle | undefined,
|
|
290
|
+
): PipelineStep<InstanceDesc> {
|
|
291
|
+
return {
|
|
292
|
+
name: "CreateExecutionVisibilityTuples",
|
|
293
|
+
async execute(ctx: RequestContext<InstanceDesc>): Promise<void> {
|
|
294
|
+
const event = executionVisibilityEventOf(ctx.newState);
|
|
295
|
+
if (event.shapes.length === 0) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
await notifyExecutionVisibilityChanged(
|
|
299
|
+
lifecycle,
|
|
300
|
+
event,
|
|
301
|
+
"failed to create authorization tuples",
|
|
302
|
+
);
|
|
303
|
+
},
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* UpdateExecutionVisibilityTuples — post-persist in the
|
|
309
|
+
* updateExecutionVisibility chain: fires the audience the new level names,
|
|
310
|
+
* the empty one included, every time. The event is the target state, so a
|
|
311
|
+
* repeat of the same level converges and a transition away from
|
|
312
|
+
* ORGANIZATION removes the tuple without knowing the old level.
|
|
313
|
+
*/
|
|
314
|
+
export function newUpdateExecutionVisibilityTuplesStep<
|
|
315
|
+
Desc extends DescMessage,
|
|
316
|
+
>(
|
|
317
|
+
lifecycle: ResourceAuthorizationLifecycle | undefined,
|
|
318
|
+
instanceKey: string,
|
|
319
|
+
): PipelineStep<Desc> {
|
|
320
|
+
return {
|
|
321
|
+
name: "UpdateExecutionVisibilityTuples",
|
|
322
|
+
async execute(ctx: RequestContext<Desc>): Promise<void> {
|
|
323
|
+
const instance = ctx.get(instanceKey) as WorkflowInstance | undefined;
|
|
324
|
+
if (instance?.metadata === undefined || instance.metadata.id === "") {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
await notifyExecutionVisibilityChanged(
|
|
328
|
+
lifecycle,
|
|
329
|
+
executionVisibilityEventOf(instance),
|
|
330
|
+
"failed to update execution visibility tuples",
|
|
331
|
+
);
|
|
332
|
+
},
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
|
|
214
336
|
/**
|
|
215
337
|
* RejectDefaultInstanceVisibilityUpdate — update_visibility.go: rejects
|
|
216
338
|
* visibility updates on a workflow's system-managed default instance — the
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pins stigmer/stigmer#1169 end to end: an API key created while the
|
|
3
|
+
* server trusted every caller is refused BY NAME once sign-in is turned
|
|
4
|
+
* on, and a key created after signing in works.
|
|
5
|
+
*
|
|
6
|
+
* Two boots over ONE data directory, the upgrade a self-hoster makes:
|
|
7
|
+
* 1. Trusted-local, with an operator email configured: the laptop
|
|
8
|
+
* creates an Organization and an API key over the wire. The key's
|
|
9
|
+
* creator stamp is the operator's email, the one principal that
|
|
10
|
+
* posture has.
|
|
11
|
+
* 2. The same directory boots with the require-authentication posture
|
|
12
|
+
* (a unit that vouches for unsigned JWT-shaped tokens and declares
|
|
13
|
+
* the posture, composed-support.ts; the open-source OIDC self-host's
|
|
14
|
+
* shape). The old key is refused UNAUTHENTICATED with the sentence
|
|
15
|
+
* and the API_KEY_CREATED_BEFORE_SIGN_IN reason, not admitted as a
|
|
16
|
+
* bare email that every later check would deny as "Permission
|
|
17
|
+
* denied". The operator then signs in, which is a different account,
|
|
18
|
+
* derived from the issuer's subject; creates a key; and that key
|
|
19
|
+
* authenticates as the account that created it.
|
|
20
|
+
*
|
|
21
|
+
* The verifier's per-arm proofs (the "system" stamp, the email-shaped
|
|
22
|
+
* issuer subject, the read count) are domain/apikey/__tests__/verifier.test.ts;
|
|
23
|
+
* this file is the upgrade's definition of done at the wire.
|
|
24
|
+
*/
|
|
25
|
+
import { mkdtempSync, rmSync } from "node:fs";
|
|
26
|
+
import { tmpdir } from "node:os";
|
|
27
|
+
import path from "node:path";
|
|
28
|
+
|
|
29
|
+
import { Code, ConnectError, createClient } from "@connectrpc/connect";
|
|
30
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
31
|
+
|
|
32
|
+
import { ApiKeyCommandController } from "@stigmer/protos/ai/stigmer/iam/apikey/v1/command_pb";
|
|
33
|
+
import { IdentityAccountCommandController } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/command_pb";
|
|
34
|
+
import { IdentityAccountQueryController } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/query_pb";
|
|
35
|
+
import { OrganizationCommandController } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/command_pb";
|
|
36
|
+
import { ErrorInfoSchema } from "@stigmer/protos/google/rpc/error_details_pb";
|
|
37
|
+
|
|
38
|
+
import { loadConfig } from "../../boot/config.js";
|
|
39
|
+
import { composeServer } from "../../boot/compose.js";
|
|
40
|
+
import type { ComposedServer } from "../../boot/compose.js";
|
|
41
|
+
import {
|
|
42
|
+
API_KEY_CREATED_BEFORE_SIGN_IN,
|
|
43
|
+
API_KEY_CREATED_BEFORE_SIGN_IN_MESSAGE,
|
|
44
|
+
} from "../../domain/apikey/verifier.js";
|
|
45
|
+
import { accountIdFor } from "../../domain/identityaccount/constants.js";
|
|
46
|
+
import {
|
|
47
|
+
resetOperatorIdentityForTests,
|
|
48
|
+
setOperatorIdentity,
|
|
49
|
+
} from "../../pipeline/steps/defaults.js";
|
|
50
|
+
import type { ServerExtension } from "../registry.js";
|
|
51
|
+
import {
|
|
52
|
+
baseConfig,
|
|
53
|
+
fakeJwt,
|
|
54
|
+
fakeVerifier,
|
|
55
|
+
silentLogger,
|
|
56
|
+
transportFor,
|
|
57
|
+
} from "./composed-support.js";
|
|
58
|
+
|
|
59
|
+
const OPERATOR_EMAIL = "operator@example.com";
|
|
60
|
+
const OPERATOR_SUBJECT = "fake|operator";
|
|
61
|
+
const ORG = "laptop-org";
|
|
62
|
+
|
|
63
|
+
describe("an API key created before sign-in was turned on (composed server, two boots over one directory; stigmer/stigmer#1169)", () => {
|
|
64
|
+
let dir: string;
|
|
65
|
+
let server: ComposedServer;
|
|
66
|
+
let port: number;
|
|
67
|
+
let preSignInKey = "";
|
|
68
|
+
|
|
69
|
+
const signInOn: ServerExtension = {
|
|
70
|
+
name: "fake-oidc-only",
|
|
71
|
+
requireAuthentication: true,
|
|
72
|
+
identityVerifiers: [fakeVerifier],
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
async function boot(extensions: ServerExtension[]): Promise<void> {
|
|
76
|
+
server = await composeServer({
|
|
77
|
+
config: loadConfig({
|
|
78
|
+
...baseConfig(dir),
|
|
79
|
+
STIGMER_OPERATOR_EMAIL: OPERATOR_EMAIL,
|
|
80
|
+
STIGMER_OPERATOR_NAME: "The Operator",
|
|
81
|
+
}),
|
|
82
|
+
logger: silentLogger,
|
|
83
|
+
extensions,
|
|
84
|
+
portOverride: 0,
|
|
85
|
+
host: "127.0.0.1",
|
|
86
|
+
});
|
|
87
|
+
port = await server.start();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function apiKeyInput(name: string) {
|
|
91
|
+
return {
|
|
92
|
+
apiVersion: "iam.stigmer.ai/v1",
|
|
93
|
+
kind: "ApiKey",
|
|
94
|
+
metadata: { name, org: ORG },
|
|
95
|
+
spec: { neverExpires: true },
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
beforeAll(async () => {
|
|
100
|
+
dir = mkdtempSync(path.join(tmpdir(), "apikey-before-sign-in-"));
|
|
101
|
+
setOperatorIdentity(OPERATOR_EMAIL, "The Operator");
|
|
102
|
+
await boot([]);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
afterAll(async () => {
|
|
106
|
+
await server.shutdown();
|
|
107
|
+
resetOperatorIdentityForTests();
|
|
108
|
+
rmSync(dir, { recursive: true, force: true });
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it("boot 1: the laptop creates an Organization and a key, stamped with the operator's email", async () => {
|
|
112
|
+
await createClient(
|
|
113
|
+
OrganizationCommandController,
|
|
114
|
+
transportFor(port),
|
|
115
|
+
).create({
|
|
116
|
+
apiVersion: "tenancy.stigmer.ai/v1",
|
|
117
|
+
kind: "Organization",
|
|
118
|
+
metadata: { name: ORG, slug: ORG, org: "" },
|
|
119
|
+
spec: { description: ORG },
|
|
120
|
+
});
|
|
121
|
+
const created = await createClient(
|
|
122
|
+
ApiKeyCommandController,
|
|
123
|
+
transportFor(port),
|
|
124
|
+
).create(apiKeyInput("runner"));
|
|
125
|
+
|
|
126
|
+
preSignInKey = created.spec?.keyHash ?? "";
|
|
127
|
+
expect(preSignInKey).toMatch(/^stk_/);
|
|
128
|
+
expect(created.status?.audit?.specAudit?.createdBy?.id).toBe(
|
|
129
|
+
OPERATOR_EMAIL,
|
|
130
|
+
);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it("boot 2: with sign-in on, that key is refused by name", async () => {
|
|
134
|
+
await server.shutdown();
|
|
135
|
+
await boot([signInOn]);
|
|
136
|
+
|
|
137
|
+
const refusal = await createClient(
|
|
138
|
+
IdentityAccountQueryController,
|
|
139
|
+
transportFor(port, preSignInKey),
|
|
140
|
+
)
|
|
141
|
+
.whoAmI({})
|
|
142
|
+
.then(
|
|
143
|
+
() => undefined,
|
|
144
|
+
(error: unknown) => ConnectError.from(error),
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
expect(refusal?.code).toBe(Code.Unauthenticated);
|
|
148
|
+
expect(refusal?.rawMessage).toBe(API_KEY_CREATED_BEFORE_SIGN_IN_MESSAGE);
|
|
149
|
+
const [info] = refusal?.findDetails(ErrorInfoSchema) ?? [];
|
|
150
|
+
expect(info?.reason).toBe(API_KEY_CREATED_BEFORE_SIGN_IN);
|
|
151
|
+
expect(info?.domain).toBe("stigmer.ai");
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it("boot 2: a key created after signing in authenticates as the account that created it", async () => {
|
|
155
|
+
const operator = fakeJwt(OPERATOR_SUBJECT, OPERATOR_EMAIL);
|
|
156
|
+
await createClient(
|
|
157
|
+
IdentityAccountCommandController,
|
|
158
|
+
transportFor(port, operator),
|
|
159
|
+
).provisionMyAccount({});
|
|
160
|
+
const created = await createClient(
|
|
161
|
+
ApiKeyCommandController,
|
|
162
|
+
transportFor(port, operator),
|
|
163
|
+
).create(apiKeyInput("runner-after-sign-in"));
|
|
164
|
+
|
|
165
|
+
const me = await createClient(
|
|
166
|
+
IdentityAccountQueryController,
|
|
167
|
+
transportFor(port, created.spec?.keyHash ?? ""),
|
|
168
|
+
).whoAmI({});
|
|
169
|
+
|
|
170
|
+
expect(me.metadata?.id).toBe(accountIdFor(OPERATOR_SUBJECT));
|
|
171
|
+
});
|
|
172
|
+
});
|
|
@@ -29,7 +29,12 @@
|
|
|
29
29
|
* nothing to separate; the laptop's rows are stamped `"system"`):
|
|
30
30
|
* tokenless reads and organization enumeration keep working, and
|
|
31
31
|
* the retired public level is refused here exactly as it is under
|
|
32
|
-
* every other posture (the level is gone, not gated).
|
|
32
|
+
* every other posture (the level is gone, not gated). One question
|
|
33
|
+
* is answered as under sign-in: a request naming an Organization the
|
|
34
|
+
* server does not hold is NOT_FOUND with the same sentence, whether
|
|
35
|
+
* it writes (a create, an apply, a session) or reads (a usage
|
|
36
|
+
* report), so nothing is stored under a slug no Organization holds
|
|
37
|
+
* (stigmer#1163). The OIDC arm pins the same sentence beside it.
|
|
33
38
|
* - a unit's own Authorizer: nothing built in is installed; the unit's
|
|
34
39
|
* answer stands even against the founder.
|
|
35
40
|
*
|
|
@@ -67,6 +72,7 @@ import type { Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
|
67
72
|
import { AgentExecutionQueryController } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/query_pb";
|
|
68
73
|
import { EnvironmentCommandController } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/command_pb";
|
|
69
74
|
import { EnvironmentQueryController } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/query_pb";
|
|
75
|
+
import { SessionCommandController } from "@stigmer/protos/ai/stigmer/agentic/session/v1/command_pb";
|
|
70
76
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
71
77
|
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
72
78
|
import { ApiKeyCommandController } from "@stigmer/protos/ai/stigmer/iam/apikey/v1/command_pb";
|
|
@@ -102,6 +108,10 @@ const VISITOR = "fake|visitor";
|
|
|
102
108
|
const ORG = "built-in-org";
|
|
103
109
|
/** Founded AFTER the member provisioned: the member holds no row on it. */
|
|
104
110
|
const OTHER_ORG = "built-in-other-org";
|
|
111
|
+
/** Never created on any server in this file: the phantom target of stigmer#1163. */
|
|
112
|
+
const MISSING_ORG = "never-created-org";
|
|
113
|
+
/** The load-first chain's copy for it, which every posture's Authorize step answers. */
|
|
114
|
+
const MISSING_ORG_NOT_FOUND = `Organization not found: ${MISSING_ORG}`;
|
|
105
115
|
|
|
106
116
|
function apiKeyInput(name: string) {
|
|
107
117
|
return {
|
|
@@ -318,6 +328,20 @@ describe("built-in authorizer (composed server, OIDC with no unit Authorizer: th
|
|
|
318
328
|
).toBe(Code.NotFound);
|
|
319
329
|
});
|
|
320
330
|
|
|
331
|
+
it("a create into an Organization that does not exist is NOT_FOUND with the load-first copy — the sentence the trusted-local arm pins too (stigmer#1163)", async () => {
|
|
332
|
+
const failure = await failureOf(
|
|
333
|
+
createClient(AgentCommandController, asFounder()).create(
|
|
334
|
+
agentInput(
|
|
335
|
+
"Phantom Agent",
|
|
336
|
+
ApiResourceVisibility.visibility_org,
|
|
337
|
+
MISSING_ORG,
|
|
338
|
+
),
|
|
339
|
+
),
|
|
340
|
+
);
|
|
341
|
+
expect(failure.code).toBe(Code.NotFound);
|
|
342
|
+
expect(failure.rawMessage).toBe(MISSING_ORG_NOT_FOUND);
|
|
343
|
+
});
|
|
344
|
+
|
|
321
345
|
it("an outsider on an EXISTING organization and its agent hears PERMISSION_DENIED — the cloud's answer; NOT_FOUND is for what does not exist", async () => {
|
|
322
346
|
expect(
|
|
323
347
|
await codeOf(
|
|
@@ -646,6 +670,61 @@ describe("built-in authorizer (composed server, trusted-local: the permissive de
|
|
|
646
670
|
});
|
|
647
671
|
expect(search.entries.length).toBeGreaterThanOrEqual(2);
|
|
648
672
|
});
|
|
673
|
+
|
|
674
|
+
it("a request naming an Organization that does not exist is NOT_FOUND, as under sign-in, and stores nothing (stigmer#1163)", async () => {
|
|
675
|
+
const anonymous = transportFor(port);
|
|
676
|
+
const agents = createClient(AgentCommandController, anonymous);
|
|
677
|
+
const phantom = agentInput(
|
|
678
|
+
"Phantom Laptop Agent",
|
|
679
|
+
ApiResourceVisibility.visibility_org,
|
|
680
|
+
MISSING_ORG,
|
|
681
|
+
);
|
|
682
|
+
const refusals = [
|
|
683
|
+
["create", await failureOf(agents.create(phantom))],
|
|
684
|
+
["apply", await failureOf(agents.apply(phantom))],
|
|
685
|
+
[
|
|
686
|
+
"a session",
|
|
687
|
+
await failureOf(
|
|
688
|
+
createClient(SessionCommandController, anonymous).create({
|
|
689
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
690
|
+
kind: "Session",
|
|
691
|
+
metadata: { name: "Phantom Session", org: MISSING_ORG },
|
|
692
|
+
spec: {},
|
|
693
|
+
}),
|
|
694
|
+
),
|
|
695
|
+
],
|
|
696
|
+
[
|
|
697
|
+
"a usage report",
|
|
698
|
+
await failureOf(
|
|
699
|
+
createClient(
|
|
700
|
+
AgentExecutionQueryController,
|
|
701
|
+
anonymous,
|
|
702
|
+
).getOrgUsageReport({
|
|
703
|
+
orgId: MISSING_ORG,
|
|
704
|
+
fromDate: "2026-09-01",
|
|
705
|
+
toDate: "2026-09-30",
|
|
706
|
+
}),
|
|
707
|
+
),
|
|
708
|
+
],
|
|
709
|
+
] as const;
|
|
710
|
+
for (const [lane, failure] of refusals) {
|
|
711
|
+
expect(failure.code, lane).toBe(Code.NotFound);
|
|
712
|
+
expect(failure.rawMessage, lane).toBe(MISSING_ORG_NOT_FOUND);
|
|
713
|
+
}
|
|
714
|
+
// The search lane skips authorization and indexes on write, so a
|
|
715
|
+
// phantom row would surface here; the laptop's full scan finds none.
|
|
716
|
+
const search = await createClient(SearchService, anonymous).search({
|
|
717
|
+
kinds: [ApiResourceKind.agent],
|
|
718
|
+
org: MISSING_ORG,
|
|
719
|
+
});
|
|
720
|
+
expect(search.entries).toEqual([]);
|
|
721
|
+
// The positive beside it: the same agent, applied into the
|
|
722
|
+
// Organization the server holds, lands.
|
|
723
|
+
const landed = await agents.apply(
|
|
724
|
+
agentInput("Phantom Laptop Agent", ApiResourceVisibility.visibility_org),
|
|
725
|
+
);
|
|
726
|
+
expect(landed.metadata?.org).toBe(ORG);
|
|
727
|
+
});
|
|
649
728
|
});
|
|
650
729
|
|
|
651
730
|
/**
|