@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
|
@@ -12,7 +12,14 @@
|
|
|
12
12
|
* cannot bind fails start() with the address and the setting named and
|
|
13
13
|
* the server never reports itself serving (stigmer#1089), and a server
|
|
14
14
|
* on an ephemeral port gets an ephemeral lane whose minted download
|
|
15
|
-
* URLs reach it
|
|
15
|
+
* URLs reach it;
|
|
16
|
+
* - the skill transfer lane's capability URLs on an ephemeral unified
|
|
17
|
+
* port name the port the server bound, and a PUT to one reaches it
|
|
18
|
+
* (stigmer#1386);
|
|
19
|
+
* - a served console's MCP OAuth callback is derived on the public
|
|
20
|
+
* origin the operator named in SKILL_TRANSFER_BASE_URL, whatever the
|
|
21
|
+
* port, and without one an ephemeral port still derives nothing
|
|
22
|
+
* (stigmer#1200).
|
|
16
23
|
*/
|
|
17
24
|
import { createClient } from "@connectrpc/connect";
|
|
18
25
|
import { createGrpcTransport } from "@connectrpc/connect-node";
|
|
@@ -22,6 +29,7 @@ import {
|
|
|
22
29
|
} from "@stigmer/protos/grpc/health/v1/health_pb";
|
|
23
30
|
import { ArtifactCommandController } from "@stigmer/protos/ai/stigmer/agentic/artifact/v1/command_pb";
|
|
24
31
|
import { ArtifactQueryController } from "@stigmer/protos/ai/stigmer/agentic/artifact/v1/query_pb";
|
|
32
|
+
import { SkillCommandController } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/command_pb";
|
|
25
33
|
import {
|
|
26
34
|
createServer as netCreateServer,
|
|
27
35
|
connect as netConnect,
|
|
@@ -29,13 +37,15 @@ import {
|
|
|
29
37
|
import type { AddressInfo } from "node:net";
|
|
30
38
|
import { describe, expect, it } from "vitest";
|
|
31
39
|
|
|
32
|
-
import { mkdtempSync } from "node:fs";
|
|
40
|
+
import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
|
|
33
41
|
import { tmpdir } from "node:os";
|
|
34
42
|
import path from "node:path";
|
|
35
43
|
|
|
36
44
|
import { loadConfig } from "../config.js";
|
|
37
45
|
import { composeServer } from "../compose.js";
|
|
38
46
|
import { createLogger } from "../logger.js";
|
|
47
|
+
import type { LogEntry, Logger } from "../logger.js";
|
|
48
|
+
import { seedOrganizations } from "../../domain/organization/__tests__/support.js";
|
|
39
49
|
|
|
40
50
|
const silentLogger = createLogger({
|
|
41
51
|
level: "error",
|
|
@@ -43,7 +53,7 @@ const silentLogger = createLogger({
|
|
|
43
53
|
write: () => {},
|
|
44
54
|
});
|
|
45
55
|
|
|
46
|
-
function compose(env: NodeJS.ProcessEnv = {}) {
|
|
56
|
+
function compose(env: NodeJS.ProcessEnv = {}, logger: Logger = silentLogger) {
|
|
47
57
|
// Each composed server gets a throwaway database — the storage stage
|
|
48
58
|
// opens DB_PATH for real (never the developer's ~/.stigmer).
|
|
49
59
|
const testDir = mkdtempSync(path.join(tmpdir(), "compose-test-"));
|
|
@@ -63,7 +73,7 @@ function compose(env: NodeJS.ProcessEnv = {}) {
|
|
|
63
73
|
});
|
|
64
74
|
return composeServer({
|
|
65
75
|
config,
|
|
66
|
-
logger
|
|
76
|
+
logger,
|
|
67
77
|
portOverride: 0,
|
|
68
78
|
host: "127.0.0.1",
|
|
69
79
|
});
|
|
@@ -165,3 +175,109 @@ describe("the artifact download lane", () => {
|
|
|
165
175
|
}
|
|
166
176
|
});
|
|
167
177
|
});
|
|
178
|
+
|
|
179
|
+
describe("the skill transfer lane", () => {
|
|
180
|
+
it("mints upload URLs for the port an ephemeral unified listener bound, and a PUT to one reaches it", async () => {
|
|
181
|
+
const server = await compose();
|
|
182
|
+
const port = await server.start();
|
|
183
|
+
try {
|
|
184
|
+
const transport = createGrpcTransport({
|
|
185
|
+
baseUrl: `http://127.0.0.1:${port}`,
|
|
186
|
+
});
|
|
187
|
+
await seedOrganizations(transport, ["acme"]);
|
|
188
|
+
const command = createClient(SkillCommandController, transport);
|
|
189
|
+
// The lane stages bytes as given; the archive is validated at push,
|
|
190
|
+
// which this case does not reach.
|
|
191
|
+
const body = new TextEncoder().encode("staged skill bytes\n");
|
|
192
|
+
const minted = await command.createArtifactUploadUrl({
|
|
193
|
+
org: "acme",
|
|
194
|
+
sizeBytes: BigInt(body.length),
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
// The bound port, never localhost:0 or the config default 7234.
|
|
198
|
+
expect(Number(new URL(minted.url).port)).toBe(port);
|
|
199
|
+
const put = await fetch(minted.url, {
|
|
200
|
+
method: "PUT",
|
|
201
|
+
body,
|
|
202
|
+
headers: { "content-type": "application/zip" },
|
|
203
|
+
});
|
|
204
|
+
expect(put.status).toBe(204);
|
|
205
|
+
} finally {
|
|
206
|
+
await server.shutdown();
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
describe("the MCP OAuth callback", () => {
|
|
212
|
+
/** A console export the console lane discovers: the app shell alone. */
|
|
213
|
+
function consoleExport(): string {
|
|
214
|
+
const dir = path.join(
|
|
215
|
+
mkdtempSync(path.join(tmpdir(), "compose-console-")),
|
|
216
|
+
"console",
|
|
217
|
+
);
|
|
218
|
+
mkdirSync(dir, { recursive: true });
|
|
219
|
+
writeFileSync(path.join(dir, "index.html"), "<html>app shell</html>");
|
|
220
|
+
return dir;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/** A logger that keeps every entry at or above info, for the wiring-time lines. */
|
|
224
|
+
function capturingLogger(): { logger: Logger; entries: LogEntry[] } {
|
|
225
|
+
const entries: LogEntry[] = [];
|
|
226
|
+
const logger = createLogger({
|
|
227
|
+
level: "info",
|
|
228
|
+
pretty: false,
|
|
229
|
+
write: () => {},
|
|
230
|
+
sink: (entry) => entries.push(entry),
|
|
231
|
+
});
|
|
232
|
+
return { logger, entries };
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
it("derives the served console's callback on the named public origin, on an ephemeral port too", async () => {
|
|
236
|
+
const { logger, entries } = capturingLogger();
|
|
237
|
+
const server = await compose(
|
|
238
|
+
{
|
|
239
|
+
STIGMER_CONSOLE_DIR: consoleExport(),
|
|
240
|
+
SKILL_TRANSFER_BASE_URL: "https://stigmer.example.test/",
|
|
241
|
+
},
|
|
242
|
+
logger,
|
|
243
|
+
);
|
|
244
|
+
await server.start();
|
|
245
|
+
try {
|
|
246
|
+
const derived = entries.find((entry) =>
|
|
247
|
+
entry.message.startsWith(
|
|
248
|
+
"STIGMER_OAUTH_REDIRECT_URI is not set — deriving",
|
|
249
|
+
),
|
|
250
|
+
);
|
|
251
|
+
expect(derived?.fields).toEqual({
|
|
252
|
+
redirectUri: "https://stigmer.example.test/auth/oauth/callback",
|
|
253
|
+
from: "public-origin",
|
|
254
|
+
});
|
|
255
|
+
} finally {
|
|
256
|
+
await server.shutdown();
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
it("derives nothing on an ephemeral port when no public origin is named", async () => {
|
|
261
|
+
const { logger, entries } = capturingLogger();
|
|
262
|
+
const server = await compose(
|
|
263
|
+
{ STIGMER_CONSOLE_DIR: consoleExport() },
|
|
264
|
+
logger,
|
|
265
|
+
);
|
|
266
|
+
await server.start();
|
|
267
|
+
try {
|
|
268
|
+
const redirectLines = entries.filter((entry) =>
|
|
269
|
+
entry.message.startsWith("STIGMER_OAUTH_REDIRECT_URI is not set"),
|
|
270
|
+
);
|
|
271
|
+
expect(
|
|
272
|
+
redirectLines.map((entry) => [entry.level, entry.message]),
|
|
273
|
+
).toEqual([
|
|
274
|
+
[
|
|
275
|
+
"warn",
|
|
276
|
+
"STIGMER_OAUTH_REDIRECT_URI is not set — OAuth Connect flows for MCP servers are unavailable (initiateOAuthConnect will refuse)",
|
|
277
|
+
],
|
|
278
|
+
]);
|
|
279
|
+
} finally {
|
|
280
|
+
await server.shutdown();
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
});
|
|
@@ -31,6 +31,10 @@ const PINNED: Readonly<
|
|
|
31
31
|
revision: 1,
|
|
32
32
|
fingerprint: "iam_policy{principal=field:spec.principal.id}",
|
|
33
33
|
},
|
|
34
|
+
memory: {
|
|
35
|
+
revision: 1,
|
|
36
|
+
fingerprint: "memory{subject=field:spec.subject_identity_account_id}",
|
|
37
|
+
},
|
|
34
38
|
session: {
|
|
35
39
|
revision: 1,
|
|
36
40
|
fingerprint:
|
|
@@ -1,38 +1,149 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pins the OAuth redirect-URI posture: a configured value wins, a served
|
|
3
|
-
* console
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* console derives the console's callback page on the unified port's public
|
|
4
|
+
* origin when one is named (stigmer#1200) and on localhost at a known port
|
|
5
|
+
* otherwise, and a server with no console, or with neither an origin nor a
|
|
6
|
+
* known port, derives nothing (today's warn and refusal stand).
|
|
6
7
|
*/
|
|
7
8
|
import { describe, expect, it } from "vitest";
|
|
8
9
|
|
|
9
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
CONSOLE_OAUTH_CALLBACK_PATH,
|
|
12
|
+
resolveOAuthRedirectUri,
|
|
13
|
+
} from "../oauth-redirect-uri.js";
|
|
10
14
|
|
|
11
15
|
describe("resolveOAuthRedirectUri", () => {
|
|
12
16
|
it("keeps a configured value whatever else is true", () => {
|
|
13
|
-
expect(
|
|
17
|
+
expect(
|
|
18
|
+
resolveOAuthRedirectUri({
|
|
19
|
+
configured: "https://app.stigmer.test/auth/oauth/callback",
|
|
20
|
+
servesConsole: true,
|
|
21
|
+
publicOrigin: "",
|
|
22
|
+
port: 7777,
|
|
23
|
+
}),
|
|
24
|
+
).toEqual({
|
|
14
25
|
kind: "configured",
|
|
15
26
|
uri: "https://app.stigmer.test/auth/oauth/callback",
|
|
16
27
|
});
|
|
17
|
-
expect(
|
|
28
|
+
expect(
|
|
29
|
+
resolveOAuthRedirectUri({
|
|
30
|
+
configured: "https://app.stigmer.test/cb",
|
|
31
|
+
servesConsole: false,
|
|
32
|
+
publicOrigin: "",
|
|
33
|
+
port: 0,
|
|
34
|
+
}),
|
|
35
|
+
).toEqual({
|
|
18
36
|
kind: "configured",
|
|
19
37
|
uri: "https://app.stigmer.test/cb",
|
|
20
38
|
});
|
|
21
39
|
});
|
|
22
40
|
|
|
41
|
+
it("keeps a configured value over a named public origin", () => {
|
|
42
|
+
expect(
|
|
43
|
+
resolveOAuthRedirectUri({
|
|
44
|
+
configured: "https://console.stigmer.test/auth/oauth/callback",
|
|
45
|
+
servesConsole: true,
|
|
46
|
+
publicOrigin: "https://api.stigmer.test",
|
|
47
|
+
port: 7777,
|
|
48
|
+
}),
|
|
49
|
+
).toEqual({
|
|
50
|
+
kind: "configured",
|
|
51
|
+
uri: "https://console.stigmer.test/auth/oauth/callback",
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
23
55
|
it("derives the console's callback page at localhost on the unified port when the console is served", () => {
|
|
24
|
-
expect(
|
|
56
|
+
expect(
|
|
57
|
+
resolveOAuthRedirectUri({
|
|
58
|
+
configured: "",
|
|
59
|
+
servesConsole: true,
|
|
60
|
+
publicOrigin: "",
|
|
61
|
+
port: 7777,
|
|
62
|
+
}),
|
|
63
|
+
).toEqual({
|
|
25
64
|
kind: "derived",
|
|
26
65
|
uri: `http://localhost:7777${CONSOLE_OAUTH_CALLBACK_PATH}`,
|
|
66
|
+
from: "loopback",
|
|
27
67
|
});
|
|
28
68
|
expect(CONSOLE_OAUTH_CALLBACK_PATH).toBe("/auth/oauth/callback");
|
|
29
69
|
});
|
|
30
70
|
|
|
71
|
+
it("derives the callback on the named public origin rather than localhost", () => {
|
|
72
|
+
expect(
|
|
73
|
+
resolveOAuthRedirectUri({
|
|
74
|
+
configured: "",
|
|
75
|
+
servesConsole: true,
|
|
76
|
+
publicOrigin: "https://stigmer.example.test",
|
|
77
|
+
port: 7234,
|
|
78
|
+
}),
|
|
79
|
+
).toEqual({
|
|
80
|
+
kind: "derived",
|
|
81
|
+
uri: "https://stigmer.example.test/auth/oauth/callback",
|
|
82
|
+
from: "public-origin",
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("reads an origin written with a trailing slash as the same origin", () => {
|
|
87
|
+
expect(
|
|
88
|
+
resolveOAuthRedirectUri({
|
|
89
|
+
configured: "",
|
|
90
|
+
servesConsole: true,
|
|
91
|
+
publicOrigin: "https://stigmer.example.test/",
|
|
92
|
+
port: 7234,
|
|
93
|
+
}),
|
|
94
|
+
).toEqual({
|
|
95
|
+
kind: "derived",
|
|
96
|
+
uri: "https://stigmer.example.test/auth/oauth/callback",
|
|
97
|
+
from: "public-origin",
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("derives on a named public origin even when the port is not known until listen", () => {
|
|
102
|
+
expect(
|
|
103
|
+
resolveOAuthRedirectUri({
|
|
104
|
+
configured: "",
|
|
105
|
+
servesConsole: true,
|
|
106
|
+
publicOrigin: "https://stigmer.example.test",
|
|
107
|
+
port: 0,
|
|
108
|
+
}),
|
|
109
|
+
).toEqual({
|
|
110
|
+
kind: "derived",
|
|
111
|
+
uri: "https://stigmer.example.test/auth/oauth/callback",
|
|
112
|
+
from: "public-origin",
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
31
116
|
it("derives nothing for a server that serves no console", () => {
|
|
32
|
-
expect(
|
|
117
|
+
expect(
|
|
118
|
+
resolveOAuthRedirectUri({
|
|
119
|
+
configured: "",
|
|
120
|
+
servesConsole: false,
|
|
121
|
+
publicOrigin: "",
|
|
122
|
+
port: 7777,
|
|
123
|
+
}),
|
|
124
|
+
).toEqual({
|
|
125
|
+
kind: "absent",
|
|
126
|
+
});
|
|
127
|
+
expect(
|
|
128
|
+
resolveOAuthRedirectUri({
|
|
129
|
+
configured: "",
|
|
130
|
+
servesConsole: false,
|
|
131
|
+
publicOrigin: "https://stigmer.example.test",
|
|
132
|
+
port: 7777,
|
|
133
|
+
}),
|
|
134
|
+
).toEqual({ kind: "absent" });
|
|
33
135
|
});
|
|
34
136
|
|
|
35
|
-
it("derives nothing when
|
|
36
|
-
expect(
|
|
137
|
+
it("derives nothing when neither a public origin is named nor the port known", () => {
|
|
138
|
+
expect(
|
|
139
|
+
resolveOAuthRedirectUri({
|
|
140
|
+
configured: "",
|
|
141
|
+
servesConsole: true,
|
|
142
|
+
publicOrigin: "",
|
|
143
|
+
port: 0,
|
|
144
|
+
}),
|
|
145
|
+
).toEqual({
|
|
146
|
+
kind: "absent",
|
|
147
|
+
});
|
|
37
148
|
});
|
|
38
149
|
});
|
|
@@ -1,25 +1,84 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pins the skill transfer origin
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Pins the skill transfer lane's origin (boot/skill-transfer-origin.ts).
|
|
3
|
+
*
|
|
4
|
+
* The base: a configured value wins over any port; a known unified port
|
|
5
|
+
* renders the loopback origin every fixed-port install has always had; an
|
|
6
|
+
* ephemeral one reads the port the listener bound, and a read before the
|
|
7
|
+
* bind throws instead of minting a URL for a port nothing listens on
|
|
8
|
+
* (stigmer#1386).
|
|
9
|
+
*
|
|
10
|
+
* The verdict: loopback on the relay is fine for a single-operator install
|
|
11
|
+
* and a warning under the require-authentication posture, an unset base
|
|
12
|
+
* counting as loopback; a public origin is reachable whatever the posture;
|
|
13
|
+
* a bucket driver makes the base URL unused; an unparseable base URL is
|
|
14
|
+
* not mistaken for loopback.
|
|
7
15
|
*/
|
|
8
16
|
import { describe, expect, it } from "vitest";
|
|
9
17
|
|
|
10
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
assessSkillTransferOrigin,
|
|
20
|
+
resolveSkillTransferBaseUrl,
|
|
21
|
+
UNSET_BASE_URL_NOTE,
|
|
22
|
+
} from "../skill-transfer-origin.js";
|
|
11
23
|
|
|
12
|
-
describe("
|
|
13
|
-
|
|
24
|
+
describe("resolveSkillTransferBaseUrl", () => {
|
|
25
|
+
const neverBound = (): number | undefined => undefined;
|
|
26
|
+
|
|
27
|
+
it.each([0, 7234])(
|
|
28
|
+
"a configured base wins over a unified port of %d, as given",
|
|
29
|
+
(unifiedPort) => {
|
|
30
|
+
expect(
|
|
31
|
+
resolveSkillTransferBaseUrl({
|
|
32
|
+
configured: "https://api.example.com/",
|
|
33
|
+
unifiedPort,
|
|
34
|
+
boundPort: neverBound,
|
|
35
|
+
}),
|
|
36
|
+
).toBe("https://api.example.com/");
|
|
37
|
+
},
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
it("a known unified port renders the loopback origin once, byte-identical to the retired config default", () => {
|
|
14
41
|
expect(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
42
|
+
resolveSkillTransferBaseUrl({
|
|
43
|
+
configured: "",
|
|
44
|
+
unifiedPort: 7234,
|
|
45
|
+
boundPort: neverBound,
|
|
19
46
|
}),
|
|
20
|
-
).
|
|
47
|
+
).toBe("http://localhost:7234");
|
|
21
48
|
});
|
|
22
49
|
|
|
50
|
+
it("an ephemeral unified port reads the bound port, and throws before the bind", () => {
|
|
51
|
+
let bound: number | undefined;
|
|
52
|
+
const base = resolveSkillTransferBaseUrl({
|
|
53
|
+
configured: "",
|
|
54
|
+
unifiedPort: 0,
|
|
55
|
+
boundPort: () => bound,
|
|
56
|
+
});
|
|
57
|
+
if (typeof base !== "function") {
|
|
58
|
+
throw new Error("an ephemeral unified port must resolve per mint");
|
|
59
|
+
}
|
|
60
|
+
expect(() => base()).toThrow(
|
|
61
|
+
"skill transfer URL requested before the unified port bound",
|
|
62
|
+
);
|
|
63
|
+
bound = 49152;
|
|
64
|
+
expect(base()).toBe("http://localhost:49152");
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
describe("assessSkillTransferOrigin", () => {
|
|
69
|
+
it.each(["", "http://localhost:7234"])(
|
|
70
|
+
"loopback (%j) on a single-operator install is correct",
|
|
71
|
+
(configured) => {
|
|
72
|
+
expect(
|
|
73
|
+
assessSkillTransferOrigin({
|
|
74
|
+
configured,
|
|
75
|
+
relaysThroughServer: true,
|
|
76
|
+
requireAuthentication: false,
|
|
77
|
+
}),
|
|
78
|
+
).toEqual({ kind: "loopback-local" });
|
|
79
|
+
},
|
|
80
|
+
);
|
|
81
|
+
|
|
23
82
|
it.each([
|
|
24
83
|
"http://localhost:7234",
|
|
25
84
|
"http://127.0.0.1:7234",
|
|
@@ -27,22 +86,32 @@ describe("assessSkillTransferOrigin", () => {
|
|
|
27
86
|
"http://0.0.0.0:7234",
|
|
28
87
|
])(
|
|
29
88
|
"loopback (%s) under the require-authentication posture is the warning, naming the URL",
|
|
30
|
-
(
|
|
89
|
+
(configured) => {
|
|
31
90
|
expect(
|
|
32
91
|
assessSkillTransferOrigin({
|
|
33
|
-
|
|
92
|
+
configured,
|
|
34
93
|
relaysThroughServer: true,
|
|
35
94
|
requireAuthentication: true,
|
|
36
95
|
}),
|
|
37
|
-
).toEqual({ kind: "loopback-hosted", baseUrl });
|
|
96
|
+
).toEqual({ kind: "loopback-hosted", baseUrl: configured });
|
|
38
97
|
},
|
|
39
98
|
);
|
|
40
99
|
|
|
100
|
+
it("an unset base under the require-authentication posture is the warning, naming it unset", () => {
|
|
101
|
+
expect(
|
|
102
|
+
assessSkillTransferOrigin({
|
|
103
|
+
configured: "",
|
|
104
|
+
relaysThroughServer: true,
|
|
105
|
+
requireAuthentication: true,
|
|
106
|
+
}),
|
|
107
|
+
).toEqual({ kind: "loopback-hosted", baseUrl: UNSET_BASE_URL_NOTE });
|
|
108
|
+
});
|
|
109
|
+
|
|
41
110
|
it("a public origin is reachable under either posture", () => {
|
|
42
111
|
for (const requireAuthentication of [true, false]) {
|
|
43
112
|
expect(
|
|
44
113
|
assessSkillTransferOrigin({
|
|
45
|
-
|
|
114
|
+
configured: "https://api.example.com",
|
|
46
115
|
relaysThroughServer: true,
|
|
47
116
|
requireAuthentication,
|
|
48
117
|
}),
|
|
@@ -51,19 +120,21 @@ describe("assessSkillTransferOrigin", () => {
|
|
|
51
120
|
});
|
|
52
121
|
|
|
53
122
|
it("a driver that signs its own URLs makes the base URL unused, loopback or not", () => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
123
|
+
for (const configured of ["", "http://localhost:7234"]) {
|
|
124
|
+
expect(
|
|
125
|
+
assessSkillTransferOrigin({
|
|
126
|
+
configured,
|
|
127
|
+
relaysThroughServer: false,
|
|
128
|
+
requireAuthentication: true,
|
|
129
|
+
}),
|
|
130
|
+
).toEqual({ kind: "unused" });
|
|
131
|
+
}
|
|
61
132
|
});
|
|
62
133
|
|
|
63
134
|
it("an unparseable base URL is not loopback; its failure is loud on the first mint instead", () => {
|
|
64
135
|
expect(
|
|
65
136
|
assessSkillTransferOrigin({
|
|
66
|
-
|
|
137
|
+
configured: "not a url",
|
|
67
138
|
relaysThroughServer: true,
|
|
68
139
|
requireAuthentication: true,
|
|
69
140
|
}),
|