@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-viewer.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/execution-viewer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execution-viewer.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/execution-viewer.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,eAAe,EAAE,eA8B7B,CAAC"}
|
|
@@ -11,40 +11,42 @@
|
|
|
11
11
|
* `#execution_viewer@organization:<org>#viewer`, the organization's full
|
|
12
12
|
* read audience (the relation also admits `#member`, the legacy shape),
|
|
13
13
|
* and `private` or unset derives nothing, so each run stays its
|
|
14
|
-
* triggerer's. Pure over the row; no related row is read.
|
|
14
|
+
* triggerer's. Pure over the row; no related row is read. Which level
|
|
15
|
+
* names which audience is `executionAudienceShapes`
|
|
16
|
+
* (pipeline/steps/authorization-tuples.ts), the one mapping this
|
|
17
|
+
* derivation and the lifecycle event a tuple-storing edition hears both
|
|
18
|
+
* read, so the two editions cannot disagree about who sees the runs.
|
|
15
19
|
*/
|
|
16
20
|
import { isMessage } from "@bufbuild/protobuf";
|
|
17
21
|
import { WorkflowInstanceSchema } from "@stigmer/protos/ai/stigmer/agentic/workflowinstance/v1/api_pb";
|
|
18
22
|
import { WorkflowExecutionVisibility } from "@stigmer/protos/ai/stigmer/agentic/workflowinstance/v1/spec_pb";
|
|
23
|
+
import { executionAudienceShapes } from "../../pipeline/steps/authorization-tuples.js";
|
|
19
24
|
export const executionViewer = (object, row) => {
|
|
20
25
|
if (!isMessage(row, WorkflowInstanceSchema)) {
|
|
21
26
|
return Promise.resolve([]);
|
|
22
27
|
}
|
|
23
28
|
const level = row.spec?.executionVisibility ?? WorkflowExecutionVisibility.unspecified;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
const org = row.metadata?.org ?? "";
|
|
30
|
+
if (org === "") {
|
|
31
|
+
return Promise.resolve([]);
|
|
32
|
+
}
|
|
33
|
+
return Promise.resolve([...executionAudienceShapes(level)].map((shape) => {
|
|
34
|
+
switch (shape) {
|
|
35
|
+
case "org-viewer":
|
|
36
|
+
return {
|
|
37
|
+
object,
|
|
38
|
+
relation: "execution_viewer",
|
|
39
|
+
subject: {
|
|
40
|
+
form: "userset",
|
|
41
|
+
object: { type: "organization", id: org },
|
|
42
|
+
relation: "viewer",
|
|
38
43
|
},
|
|
39
|
-
|
|
44
|
+
};
|
|
45
|
+
default: {
|
|
46
|
+
const exhaustive = shape;
|
|
47
|
+
throw new Error(`unknown execution audience: ${String(exhaustive)}`);
|
|
48
|
+
}
|
|
40
49
|
}
|
|
41
|
-
|
|
42
|
-
case WorkflowExecutionVisibility.unspecified:
|
|
43
|
-
return Promise.resolve([]);
|
|
44
|
-
default: {
|
|
45
|
-
const exhaustive = level;
|
|
46
|
-
throw new Error(`unknown execution visibility: ${String(exhaustive)}`);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
50
|
+
}));
|
|
49
51
|
};
|
|
50
52
|
//# sourceMappingURL=execution-viewer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-viewer.js","sourceRoot":"","sources":["../../../src/authorization/model/execution-viewer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"execution-viewer.js","sourceRoot":"","sources":["../../../src/authorization/model/execution-viewer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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CAAC,CAAC;YACvE,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -18,7 +18,10 @@
|
|
|
18
18
|
* evaluation (authorizer.ts, `kindServedByEdition`): open source refuses a
|
|
19
19
|
* check that targets `team`, `identity_provider`, `invitation` or
|
|
20
20
|
* `platform`, and a tuple that names one resolves over tuples alone, since
|
|
21
|
-
*
|
|
21
|
+
* open source stores no row of those kinds. An edition that serves them
|
|
22
|
+
* keeps their rows in its units' own stores and registers a reader for
|
|
23
|
+
* each (extensions/resource-row-reader.ts), which the derivation reads them
|
|
24
|
+
* through.
|
|
22
25
|
*
|
|
23
26
|
* `newModel` exists for tests that need a throwaway model (a cycle, a
|
|
24
27
|
* chain past the depth bound).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAGtH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAmB,eAAe,EAAE,MAAM,cAAc,CAAC;AAErE,MAAM,WAAW,KAAK;IACpB,yBAAyB;IACzB,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IACtD,MAAM,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe,GAAG,SAAS,CAAC;IAC3D,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAAC;CACnD;AAED,wBAAgB,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,eAAe,CAAC,GAAG,KAAK,CAe5E;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,EAC/B,QAAQ,EAAE,WAAW,CAAC,eAAe,EAAE,WAAW,CAAC,GAClD,aAAa,CAAC,eAAe,CAAC,CAoChC;AAED,iEAAiE;AACjE,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAC;AAEF,sGAAsG;AACtG,wBAAgB,cAAc,CAC5B,IAAI,EAAE,eAAe,GACpB,eAAe,GAAG,SAAS,CAE7B"}
|
|
@@ -18,7 +18,10 @@
|
|
|
18
18
|
* evaluation (authorizer.ts, `kindServedByEdition`): open source refuses a
|
|
19
19
|
* check that targets `team`, `identity_provider`, `invitation` or
|
|
20
20
|
* `platform`, and a tuple that names one resolves over tuples alone, since
|
|
21
|
-
*
|
|
21
|
+
* open source stores no row of those kinds. An edition that serves them
|
|
22
|
+
* keeps their rows in its units' own stores and registers a reader for
|
|
23
|
+
* each (extensions/resource-row-reader.ts), which the derivation reads them
|
|
24
|
+
* through.
|
|
22
25
|
*
|
|
23
26
|
* `newModel` exists for tests that need a throwaway model (a cycle, a
|
|
24
27
|
* chain past the depth bound).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/authorization/model/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/authorization/model/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAEtH,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,aAAa,MAAM,iCAAiC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAE,MA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AwB,CAAC,EAAE,aAAa,CAAC,CACrE,CAAC;AAEF,sGAAsG;AACtG,MAAM,UAAU,cAAc,CAC5B,IAAqB;IAErB,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
* define can_view: viewer → computed("viewer")
|
|
16
16
|
*
|
|
17
17
|
* `and` exists for one shape: a relation that is true only while another
|
|
18
|
-
* holds too
|
|
18
|
+
* holds too. Every direct grant on an organization-scoped type is bounded
|
|
19
|
+
* that way (`([identity_account] and affiliated from organization) or
|
|
20
|
+
* ...`), and a team's member is a person granted the role AND still one
|
|
19
21
|
* of the organization's viewers, so leaving the organization ends every
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
+
* grant with no cleanup. Operators nest to any depth, as the DSL's
|
|
23
|
+
* parentheses allow; the evaluator recurses through them.
|
|
22
24
|
* `but not`, wildcards (`type:*`) and conditions have no form here: the
|
|
23
25
|
* reader refuses them by name, and the day the model needs one is a
|
|
24
26
|
* design act.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rewrite.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/rewrite.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"rewrite.d.ts","sourceRoot":"","sources":["../../../src/authorization/model/rewrite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAE3H,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAEhE,0DAA0D;AAC1D,MAAM,MAAM,WAAW;AACrB,oEAAoE;AAClE;IAAE,QAAQ,CAAC,IAAI,EAAE,QA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tB;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;IACzC,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjD,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CACxD"}
|
|
@@ -1,4 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The built-in organization directory — open source's driver for the
|
|
3
|
+
* organization-directory seam (extensions/organization-directory.ts),
|
|
4
|
+
* composed under the built-in posture. The cloud's directory answers
|
|
5
|
+
* `findMyOrganizations` with OpenFGA's list-objects for
|
|
6
|
+
* `organization#can_view`; this one answers the same question over the
|
|
7
|
+
* derived source: the candidates are the organizations the person's own
|
|
8
|
+
* IamPolicy rows name (on open source a person reaches an organization
|
|
9
|
+
* through a role row and nothing else — the derivation writes no
|
|
10
|
+
* organization tuple), and each candidate is kept when
|
|
11
|
+
* `can_view` holds for the person, evaluated by the same evaluator the
|
|
12
|
+
* Authorizer uses. An evaluation rather than a relation filter, so the
|
|
13
|
+
* answer stays right if the grant scope ever widens past the four roles,
|
|
14
|
+
* and stays equal to the cloud's today.
|
|
15
|
+
*
|
|
16
|
+
* `refusesEnumeration` is TRUE, the cloud's posture: `find` is
|
|
17
|
+
* skip-authorization by annotation, so under an enforcing server it would
|
|
18
|
+
* hand every member every organization row — the list that lies. The
|
|
19
|
+
* first-party clients list through `findMyOrganizations`. Trusted-local
|
|
20
|
+
* composes no directory and keeps enumerating (one caller, nothing to
|
|
21
|
+
* hide from).
|
|
22
|
+
*
|
|
23
|
+
* A caller who resolves to no account (an idp-shaped subject before
|
|
24
|
+
* provisioning) holds no rows and is answered `[]`, never a fault: the
|
|
25
|
+
* conformance sibling's readiness probe is this very RPC with a fresh
|
|
26
|
+
* subject. The `internal` class — the server acting as itself over the
|
|
27
|
+
* in-process transport — is answered `ALL_ORGANIZATIONS`: the Authorize
|
|
28
|
+
* step treats that class as the in-process authorization skip (pipeline/
|
|
29
|
+
* interceptors/auth.ts, ruling Q4), and a directory answer IS an
|
|
30
|
+
* authorization answer, so a server-internal hop sees what the permissive
|
|
31
|
+
* default showed it. `findMyOrganizations` is skip-authorization by
|
|
32
|
+
* annotation, which is why this driver meets that caller at all: a
|
|
33
|
+
* skip lane hands the directory the identity the interceptor stamped,
|
|
34
|
+
* and no Authorize arm ran before it. Every other caller gets the
|
|
35
|
+
* evaluated list.
|
|
36
|
+
* The controller loads each id it is handed and skips the ones whose row
|
|
37
|
+
* is gone (grants can outlive rows); the source has already loaded the
|
|
38
|
+
* row once for the evaluation — two primary-key reads per organization,
|
|
39
|
+
* a handful per person, and the contract's own read is the controller's.
|
|
40
|
+
*/
|
|
41
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
1
42
|
import type { IamPolicyStore } from "../domain/iampolicy/store.js";
|
|
43
|
+
import type { ResourceRowReader } from "../extensions/resource-row-reader.js";
|
|
2
44
|
import type { OrganizationDirectory } from "../extensions/organization-directory.js";
|
|
3
45
|
import type { Store } from "../store/interface.js";
|
|
4
46
|
import type { Model } from "./model/index.js";
|
|
@@ -7,6 +49,8 @@ export interface BuiltInOrganizationDirectoryDeps {
|
|
|
7
49
|
readonly store: Store;
|
|
8
50
|
readonly policies: IamPolicyStore;
|
|
9
51
|
readonly accounts: AccountsByCaller;
|
|
52
|
+
/** The readers of the kinds units keep themselves (`drivers.resourceRowReaders`), handed to every tuple source. */
|
|
53
|
+
readonly rowReaders?: ReadonlyMap<ApiResourceKind, ResourceRowReader>;
|
|
10
54
|
readonly model?: Model;
|
|
11
55
|
}
|
|
12
56
|
export declare function newBuiltInOrganizationDirectory(deps: BuiltInOrganizationDirectoryDeps): OrganizationDirectory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-directory.d.ts","sourceRoot":"","sources":["../../src/authorization/organization-directory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"organization-directory.d.ts","sourceRoot":"","sources":["../../src/authorization/organization-directory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAEtH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAGrF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,mHAAmH;IACnH,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;IACtE,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;CACxB;AAID,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,gCAAgC,GACrC,qBAAqB,CA8CvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-directory.js","sourceRoot":"","sources":["../../src/authorization/organization-directory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;
|
|
1
|
+
{"version":3,"file":"organization-directory.js","sourceRoot":"","sources":["../../src/authorization/organization-directory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAMtH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAW5C,MAAM,YAAY,GAAG,YAAY,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;AAEhE,MAAM,UAAU,+BAA+B,CAC7C,IAAsC;IAEtC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,YAAY,CAAC;IACzC,OAAO;QACL,kBAAkB,EAAE,IAAI;QAExB,KAAK,CAAC,qBAAqB,CACzB,MAAsB;YAEtB,IAAI,MAAM,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;gBACtC,OAAO,iBAAiB,CAAC;YAC3B,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC1D,MAAM,MAAM,GAAG,qBAAqB,CAClC;gBACE,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,KAAK;aACN,EACD,MAAM,CACP,CAAC;YACF,iEAAiE;YACjE,kEAAkE;YAClE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;YACrC,KAAK,MAAM,KAAK,IAAI,MAAM,MAAM,CAAC,YAAY,EAAE,EAAE,CAAC;gBAChD,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;oBACjE,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBAClC,CAAC;YACH,CAAC;YACD,MAAM,OAAO,GAAa,EAAE,CAAC;YAC7B,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;gBAC5B,IACE,MAAM,aAAa,CACjB,EAAE,KAAK,EAAE,MAAM,EAAE,EACjB,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,EAC1B,UAAU,EACV,MAAM,CACP,EACD,CAAC;oBACD,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACnB,CAAC;YACH,CAAC;YACD,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -4,13 +4,17 @@
|
|
|
4
4
|
* list scope when it lands), so "who is asking" cannot be answered two
|
|
5
5
|
* ways.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* The steps, split so the pure half is testable without a store:
|
|
8
8
|
*
|
|
9
9
|
* `resolvePerson(accounts, caller)` — the I/O: the account the caller
|
|
10
10
|
* stands for through `accountForCaller` (domain/identityaccount/
|
|
11
11
|
* resolve.ts, the domain's one statement of that question — the two
|
|
12
12
|
* reads whoAmI makes), then `personFor`.
|
|
13
13
|
*
|
|
14
|
+
* `personOfAccount(accounts, id)` — the person an account id names
|
|
15
|
+
* when no caller stands for them (an invitation's creator), with the
|
|
16
|
+
* same alias rule.
|
|
17
|
+
*
|
|
14
18
|
* `personFor(caller, account)` — the pure half: the account id the
|
|
15
19
|
* IamPolicy rows name, and every string a creator stamp may carry for
|
|
16
20
|
* the same human. A provisioned caller carries the account id and the
|
|
@@ -33,10 +37,19 @@
|
|
|
33
37
|
*/
|
|
34
38
|
import type { IdentityAccount } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
35
39
|
import type { AccountsByCaller } from "../domain/identityaccount/resolve.js";
|
|
40
|
+
import type { IdentityAccountStore } from "../domain/identityaccount/store.js";
|
|
36
41
|
import type { CallerIdentity } from "../extensions/identity.js";
|
|
37
42
|
import type { Person } from "./tuples.js";
|
|
38
43
|
export type { AccountsByCaller } from "../domain/identityaccount/resolve.js";
|
|
39
44
|
export declare function personFor(caller: CallerIdentity, account: IdentityAccount | undefined): Person;
|
|
45
|
+
/**
|
|
46
|
+
* The person an account id names when no caller stands for them: the
|
|
47
|
+
* creator of an invitation, asked whether they could still grant what it
|
|
48
|
+
* grants. The alias rule is `personFor`'s: the id itself, and the issuer
|
|
49
|
+
* subject when the account is found. An account that is gone is its id
|
|
50
|
+
* alone, and the rows that still name it are what the check reads.
|
|
51
|
+
*/
|
|
52
|
+
export declare function personOfAccount(accounts: Pick<IdentityAccountStore, "findById">, accountId: string): Promise<Person>;
|
|
40
53
|
/** The person a caller is, read through the account port; faults propagate as they are. */
|
|
41
54
|
export declare function resolvePerson(accounts: AccountsByCaller, caller: CallerIdentity): Promise<Person>;
|
|
42
55
|
//# sourceMappingURL=person.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.d.ts","sourceRoot":"","sources":["../../src/authorization/person.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"person.d.ts","sourceRoot":"","sources":["../../src/authorization/person.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAGhG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,YAAY,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,wBAAgB,SAAS,CACvB,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,eAAe,GAAG,SAAS,GACnC,MAAM,CAQR;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,EAChD,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAOjB;AAcD,2FAA2F;AAC3F,wBAAsB,aAAa,CACjC,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,MAAM,CAAC,CAEjB"}
|
|
@@ -5,6 +5,22 @@ export function personFor(caller, account) {
|
|
|
5
5
|
if (!isPersonStamp(accountId)) {
|
|
6
6
|
throw new Error(`caller '${accountId}' names no person — the built-in authorizer evaluates people only`);
|
|
7
7
|
}
|
|
8
|
+
return withAliases(accountId, account);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The person an account id names when no caller stands for them: the
|
|
12
|
+
* creator of an invitation, asked whether they could still grant what it
|
|
13
|
+
* grants. The alias rule is `personFor`'s: the id itself, and the issuer
|
|
14
|
+
* subject when the account is found. An account that is gone is its id
|
|
15
|
+
* alone, and the rows that still name it are what the check reads.
|
|
16
|
+
*/
|
|
17
|
+
export async function personOfAccount(accounts, accountId) {
|
|
18
|
+
if (!isPersonStamp(accountId)) {
|
|
19
|
+
throw new Error(`account '${accountId}' names no person — the built-in authorizer evaluates people only`);
|
|
20
|
+
}
|
|
21
|
+
return withAliases(accountId, await accounts.findById(accountId));
|
|
22
|
+
}
|
|
23
|
+
function withAliases(accountId, account) {
|
|
8
24
|
const aliases = new Set([accountId]);
|
|
9
25
|
const subject = account?.spec?.idpId ?? "";
|
|
10
26
|
if (subject !== "") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.js","sourceRoot":"","sources":["../../src/authorization/person.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"person.js","sourceRoot":"","sources":["../../src/authorization/person.ts"],"names":[],"mappings":"AAuCA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAGlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAMxE,MAAM,UAAU,SAAS,CACvB,MAAsB,EACtB,OAAoC;IAEpC,MAAM,SAAS,GAAG,OAAO,EAAE,QAAQ,EAAE,EAAE,IAAI,MAAM,CAAC,UAAU,CAAC;IAC7D,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACb,WAAW,SAAS,mEAAmE,CACxF,CAAC;IACJ,CAAC;IACD,OAAO,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,QAAgD,EAChD,SAAiB;IAEjB,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACb,YAAY,SAAS,mEAAmE,CACzF,CAAC;IACJ,CAAC;IACD,OAAO,WAAW,CAAC,SAAS,EAAE,MAAM,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,WAAW,CAClB,SAAiB,EACjB,OAAoC;IAEpC,MAAM,OAAO,GAAG,IAAI,GAAG,CAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;IAC3C,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAChC,CAAC;AAED,2FAA2F;AAC3F,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAA0B,EAC1B,MAAsB;IAEtB,OAAO,SAAS,CAAC,MAAM,EAAE,MAAM,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The built-in policy check — the one question of the authorization-query
|
|
3
|
+
* engine (extensions/authorization-queries.ts, `check`) that the built-in
|
|
4
|
+
* posture can answer from its own evaluator: "is this policy effectively
|
|
5
|
+
* held". A unit composed on the built-in posture asks it through the
|
|
6
|
+
* services the composition hands it (extensions/registry.ts,
|
|
7
|
+
* `ComposedServices`), exactly where a composition with its own engine
|
|
8
|
+
* hands that engine's `check`, so the unit asks one question in every
|
|
9
|
+
* edition and the model answers it one way.
|
|
10
|
+
*
|
|
11
|
+
* What it answers, and why no more:
|
|
12
|
+
* - A policy whose principal is a person (`identity_account:<id>`): the
|
|
13
|
+
* person the id names, with `personFor`'s alias rule (person.ts), and
|
|
14
|
+
* the rows they and their teams hold — the same walk a point check
|
|
15
|
+
* makes for a caller.
|
|
16
|
+
* - A policy whose principal is any other object (`organization:<o>`):
|
|
17
|
+
* the structural question a grant to a team asks — does this resource
|
|
18
|
+
* belong to the team's organization — answered by the resource's own
|
|
19
|
+
* derived links (derived-tuples.ts).
|
|
20
|
+
* - Contextual policies are refused as a programming error. No caller
|
|
21
|
+
* asks with them, and the derived source has no notion of a tuple held
|
|
22
|
+
* only for the length of one check; answering without them would be a
|
|
23
|
+
* silent wrong answer, the failure a throw prevents.
|
|
24
|
+
* - A userset principal (`organization:<o>#member`) is refused the same
|
|
25
|
+
* way: the engine contract checks direct principals.
|
|
26
|
+
*
|
|
27
|
+
* The engine's list verbs are not answered here: they enumerate, which the
|
|
28
|
+
* built-in posture does not do, and the tuple-half RPCs that expose them
|
|
29
|
+
* keep refusing in open source without an engine. One source per check,
|
|
30
|
+
* like the Authorizer: its memo is the check's. Faults propagate; the
|
|
31
|
+
* caller's own error mapping decides the wire.
|
|
32
|
+
*/
|
|
33
|
+
import type { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
34
|
+
import type { IamPolicyStore } from "../domain/iampolicy/store.js";
|
|
35
|
+
import type { IdentityAccountStore } from "../domain/identityaccount/store.js";
|
|
36
|
+
import type { AuthorizationQueryEngine } from "../extensions/authorization-queries.js";
|
|
37
|
+
import type { ResourceRowReader } from "../extensions/resource-row-reader.js";
|
|
38
|
+
import type { Store } from "../store/interface.js";
|
|
39
|
+
import type { Model } from "./model/index.js";
|
|
40
|
+
export interface BuiltInPolicyCheckDeps {
|
|
41
|
+
readonly store: Store;
|
|
42
|
+
/** The port the grant path writes through — the principal's rows are read from the same instance. */
|
|
43
|
+
readonly policies: IamPolicyStore;
|
|
44
|
+
/** The account port: a person principal's aliases, and identity_account objects. */
|
|
45
|
+
readonly accounts: Pick<IdentityAccountStore, "findById">;
|
|
46
|
+
/** The readers of the kinds units keep themselves (`drivers.resourceRowReaders`). */
|
|
47
|
+
readonly rowReaders?: ReadonlyMap<ApiResourceKind, ResourceRowReader>;
|
|
48
|
+
/** The declarations to evaluate; the built-in model unless a test says otherwise. */
|
|
49
|
+
readonly model?: Model;
|
|
50
|
+
}
|
|
51
|
+
export declare function newBuiltInPolicyCheck(deps: BuiltInPolicyCheckDeps): Pick<AuthorizationQueryEngine, "check">;
|
|
52
|
+
//# sourceMappingURL=policy-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-check.d.ts","sourceRoot":"","sources":["../../src/authorization/policy-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAE3H,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAM9C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,qGAAqG;IACrG,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;IAC1D,qFAAqF;IACrF,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;IACtE,qFAAqF;IACrF,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;CACxB;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,sBAAsB,GAC3B,IAAI,CAAC,wBAAwB,EAAE,OAAO,CAAC,CA2CzC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { newDerivedTupleSource } from "./derived-tuples.js";
|
|
2
|
+
import { checkRelation } from "./evaluator.js";
|
|
3
|
+
import { builtInModel } from "./model/index.js";
|
|
4
|
+
import { personOfAccount } from "./person.js";
|
|
5
|
+
import { ACCOUNT_TYPE } from "./tuples.js";
|
|
6
|
+
export function newBuiltInPolicyCheck(deps) {
|
|
7
|
+
const model = deps.model ?? builtInModel;
|
|
8
|
+
return {
|
|
9
|
+
async check(policy, contextualPolicies) {
|
|
10
|
+
if (contextualPolicies.length > 0) {
|
|
11
|
+
throw new Error("the built-in policy check evaluates held policies only — contextual policies are not supported");
|
|
12
|
+
}
|
|
13
|
+
const principalRef = policy.principal;
|
|
14
|
+
const resource = policy.resource;
|
|
15
|
+
if (principalRef === undefined || resource === undefined) {
|
|
16
|
+
throw new Error("the built-in policy check needs a principal and a resource");
|
|
17
|
+
}
|
|
18
|
+
if (principalRef.relation !== "") {
|
|
19
|
+
throw new Error(`the built-in policy check takes a direct principal — '${principalRef.kind}:${principalRef.id}#${principalRef.relation}' is a userset`);
|
|
20
|
+
}
|
|
21
|
+
const principal = principalRef.kind === ACCOUNT_TYPE
|
|
22
|
+
? await personOfAccount(deps.accounts, principalRef.id)
|
|
23
|
+
: { object: { type: principalRef.kind, id: principalRef.id } };
|
|
24
|
+
const source = newDerivedTupleSource({
|
|
25
|
+
store: deps.store,
|
|
26
|
+
policies: deps.policies,
|
|
27
|
+
accounts: deps.accounts,
|
|
28
|
+
rowReaders: deps.rowReaders,
|
|
29
|
+
model,
|
|
30
|
+
}, principal);
|
|
31
|
+
return checkRelation({ model, source }, { type: resource.kind, id: resource.id }, policy.relation, principal);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=policy-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-check.js","sourceRoot":"","sources":["../../src/authorization/policy-check.ts"],"names":[],"mappings":"AAuCA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAc3C,MAAM,UAAU,qBAAqB,CACnC,IAA4B;IAE5B,MAAM,KAAK,GAAG,IAAI,CAAC,K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AAE,QAAQ,CAAC,EAAE,EAAE,EACxC,MAAM,CAAC,QAAQ,EACf,SAAS,CACV,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -14,19 +14,31 @@
|
|
|
14
14
|
* posture (the OSS OIDC issuer, or a unit's declaration). Open source
|
|
15
15
|
* composes the built-in Authorizer, the organization directory and
|
|
16
16
|
* the schedule fire caller — the cloud's model evaluated over derived
|
|
17
|
-
* tuples — so the roles 2b records are enforced.
|
|
17
|
+
* tuples — so the roles 2b records are enforced. An edition above
|
|
18
|
+
* open source may run it too, once every kind it serves has rows the
|
|
19
|
+
* derivation can read (`kindsWithoutRows` below).
|
|
18
20
|
* - `trusted-local`: no unit Authorizer and no authentication posture —
|
|
19
|
-
* the laptop. The permissive
|
|
20
|
-
* separate
|
|
21
|
+
* the laptop. The permissive driver (trusted-local-authorizer.ts): one
|
|
22
|
+
* caller, nothing to separate, so every check is allowed except one
|
|
23
|
+
* that names an Organization the server does not hold, which is
|
|
24
|
+
* not-found as under the other two postures (stigmer#1163). The
|
|
25
|
+
* trusted-local identity carries the operator's EMAIL,
|
|
21
26
|
* never an account id, and pre-2a rows are stamped `"system"`, so an
|
|
22
27
|
* enforcing evaluator would refuse the laptop's own history. The roles
|
|
23
28
|
* still exist (the lifecycle and the membership rules run) to feed the
|
|
24
|
-
* Members page truthfully.
|
|
29
|
+
* Members page truthfully. Open source's edition only: a composition
|
|
30
|
+
* serving an edition above it refuses to boot here, since an edition
|
|
31
|
+
* of many organizations with no sign-in would act as the operator for
|
|
32
|
+
* every request that carries no credential.
|
|
25
33
|
*
|
|
26
34
|
* The type lives with the module that gives it meaning (the precedent:
|
|
27
35
|
* `ConsoleSignInPosture` in transport/console/handler.ts); the
|
|
28
36
|
* composition root computes the value once and hands it down.
|
|
29
37
|
*/
|
|
38
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
39
|
+
import { ServerEdition } from "@stigmer/protos/ai/stigmer/platform/v1/server_info_pb";
|
|
40
|
+
import type { ResourceRowReader } from "../extensions/resource-row-reader.js";
|
|
41
|
+
import type { Model } from "./model/index.js";
|
|
30
42
|
export type AuthorizationPosture = "trusted-local" | "built-in" | "unit-authorizer";
|
|
31
43
|
export interface AuthorizationPostureInputs {
|
|
32
44
|
/** A unit registered `authorizer` (ResolvedExtensions.authorizer !== undefined). */
|
|
@@ -35,4 +47,18 @@ export interface AuthorizationPostureInputs {
|
|
|
35
47
|
readonly requireAuthentication: boolean;
|
|
36
48
|
}
|
|
37
49
|
export declare function authorizationPostureOf(inputs: AuthorizationPostureInputs): AuthorizationPosture;
|
|
50
|
+
/**
|
|
51
|
+
* The kinds an edition serves whose rows the built-in authorizer could not
|
|
52
|
+
* read: declared by the model with a row schema, served by the edition,
|
|
53
|
+
* not served by open source (whose kinds are its own store's), and not
|
|
54
|
+
* `identity_account` (read through the account port), with no reader
|
|
55
|
+
* registered for them. Empty means the built-in posture can answer every
|
|
56
|
+
* check the edition's lanes make. The composition root refuses a built-in
|
|
57
|
+
* posture that leaves any, rather than answer from rows that are not there.
|
|
58
|
+
*/
|
|
59
|
+
export declare function kindsWithoutRows(inputs: {
|
|
60
|
+
readonly edition: ServerEdition;
|
|
61
|
+
readonly model: Model;
|
|
62
|
+
readonly readers: ReadonlyMap<ApiResourceKind, ResourceRowReader>;
|
|
63
|
+
}): ReadonlyArray<ApiResourceKind>;
|
|
38
64
|
//# sourceMappingURL=posture.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posture.d.ts","sourceRoot":"","sources":["../../src/authorization/posture.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"posture.d.ts","sourceRoot":"","sources":["../../src/authorization/posture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AACtH,OAAO,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AAEtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,MAAM,oBAAoB,GAC5B,eAAe,GACf,UAAU,GACV,iBAAiB,CAAC;AAEtB,MAAM,WAAW,0BAA0B;IACzC,oFAAoF;IACpF,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,0FAA0F;IAC1F,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;CACzC;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,0BAA0B,GACjC,oBAAoB,CAKtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;CACnE,GAAG,aAAa,CAAC,eAAe,CAAC,CAWjC"}
|
|
@@ -1,7 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The authorization posture — WHICH authorizer a composed server runs,
|
|
3
|
+
* named once so the composition root, the boot log and the tests speak
|
|
4
|
+
* one word for it. Three postures, decided by two facts the registry and
|
|
5
|
+
* the config already hold:
|
|
6
|
+
*
|
|
7
|
+
* - `unit-authorizer`: a unit registered its own Authorizer (the cloud
|
|
8
|
+
* composes OpenFGA). Nothing built in is installed — not the
|
|
9
|
+
* authorizer, not the directory, not the fire caller, and not the
|
|
10
|
+
* role lifecycle or the membership rules either (a composition with
|
|
11
|
+
* its own Authorizer has its own onboarding). The require-
|
|
12
|
+
* authentication posture does not change this.
|
|
13
|
+
* - `built-in`: no unit Authorizer AND the require-authentication
|
|
14
|
+
* posture (the OSS OIDC issuer, or a unit's declaration). Open source
|
|
15
|
+
* composes the built-in Authorizer, the organization directory and
|
|
16
|
+
* the schedule fire caller — the cloud's model evaluated over derived
|
|
17
|
+
* tuples — so the roles 2b records are enforced. An edition above
|
|
18
|
+
* open source may run it too, once every kind it serves has rows the
|
|
19
|
+
* derivation can read (`kindsWithoutRows` below).
|
|
20
|
+
* - `trusted-local`: no unit Authorizer and no authentication posture —
|
|
21
|
+
* the laptop. The permissive driver (trusted-local-authorizer.ts): one
|
|
22
|
+
* caller, nothing to separate, so every check is allowed except one
|
|
23
|
+
* that names an Organization the server does not hold, which is
|
|
24
|
+
* not-found as under the other two postures (stigmer#1163). The
|
|
25
|
+
* trusted-local identity carries the operator's EMAIL,
|
|
26
|
+
* never an account id, and pre-2a rows are stamped `"system"`, so an
|
|
27
|
+
* enforcing evaluator would refuse the laptop's own history. The roles
|
|
28
|
+
* still exist (the lifecycle and the membership rules run) to feed the
|
|
29
|
+
* Members page truthfully. Open source's edition only: a composition
|
|
30
|
+
* serving an edition above it refuses to boot here, since an edition
|
|
31
|
+
* of many organizations with no sign-in would act as the operator for
|
|
32
|
+
* every request that carries no credential.
|
|
33
|
+
*
|
|
34
|
+
* The type lives with the module that gives it meaning (the precedent:
|
|
35
|
+
* `ConsoleSignInPosture` in transport/console/handler.ts); the
|
|
36
|
+
* composition root computes the value once and hands it down.
|
|
37
|
+
*/
|
|
38
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
39
|
+
import { ServerEdition } from "@stigmer/protos/ai/stigmer/platform/v1/server_info_pb";
|
|
40
|
+
import { kindServedByEdition } from "../pipeline/apiresource-meta.js";
|
|
1
41
|
export function authorizationPostureOf(inputs) {
|
|
2
42
|
if (inputs.unitAuthorizer) {
|
|
3
43
|
return "unit-authorizer";
|
|
4
44
|
}
|
|
5
45
|
return inputs.requireAuthentication ? "built-in" : "trusted-local";
|
|
6
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* The kinds an edition serves whose rows the built-in authorizer could not
|
|
49
|
+
* read: declared by the model with a row schema, served by the edition,
|
|
50
|
+
* not served by open source (whose kinds are its own store's), and not
|
|
51
|
+
* `identity_account` (read through the account port), with no reader
|
|
52
|
+
* registered for them. Empty means the built-in posture can answer every
|
|
53
|
+
* check the edition's lanes make. The composition root refuses a built-in
|
|
54
|
+
* posture that leaves any, rather than answer from rows that are not there.
|
|
55
|
+
*/
|
|
56
|
+
export function kindsWithoutRows(inputs) {
|
|
57
|
+
return inputs.model.declarations
|
|
58
|
+
.filter((declaration) => declaration.schema !== undefined &&
|
|
59
|
+
declaration.kind !== ApiResourceKind.identity_account &&
|
|
60
|
+
kindServedByEdition(declaration.kind, inputs.edition) &&
|
|
61
|
+
!kindServedByEdition(declaration.kind, ServerEdition.oss) &&
|
|
62
|
+
!inputs.readers.has(declaration.kind))
|
|
63
|
+
.map((declaration) => declaration.kind);
|
|
64
|
+
}
|
|
7
65
|
//# sourceMappingURL=posture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posture.js","sourceRoot":"","sources":["../../src/authorization/posture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"posture.js","sourceRoot":"","sources":["../../src/authorization/posture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AACtH,OAAO,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AAGtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAetE,MAAM,UAAU,sBAAsB,CACpC,MAAkC;IAElC,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;QAC1B,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IACD,OAAO,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC;AACrE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAIhC;IACC,OAAO,MAAM,CAAC,KAAK,CAAC,YAAY;SAC7B,MAAM,CACL,CAAC,WAAW,EAAE,EAAE,CACd,WAAW,CAAC,MAAM,KAAK,SAAS;QAChC,WAAW,CAAC,IAAI,KAAK,eAAe,CAAC,gBAAgB;QACrD,mBAAmB,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC;QACrD,CAAC,mBAAmB,CAAC,WAAW,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC;QACzD,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CACxC;SACA,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-creators.d.ts","sourceRoot":"","sources":["../../src/authorization/resource-creators.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,gBAAgB,CAuBvE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The removal sweep's one read outside the policy rows: a stored
|
|
3
|
+
* resource's recorded creator (`ResourceCreators`,
|
|
4
|
+
* domain/iampolicy/grant-path.ts). When an account leaves an
|
|
5
|
+
* organization, the grant path keeps the rows that record the account as
|
|
6
|
+
* a resource's author, and only the resource's own row says who that is.
|
|
7
|
+
*
|
|
8
|
+
* The row is read through the generic store with the schema the built-in
|
|
9
|
+
* model binds to its kind, the same read the derived tuple source makes
|
|
10
|
+
* for a check (derived-tuples.ts `loadRow`), and the creator is the stamp
|
|
11
|
+
* that source derives an author's `owner` tuple from (`createdByOf`). A
|
|
12
|
+
* kind the model binds no schema to, or a row the store does not hold (a
|
|
13
|
+
* kind a composition keeps in its own table), has no recorded creator
|
|
14
|
+
* here, so no row of it is kept as authorship.
|
|
15
|
+
*/
|
|
16
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
17
|
+
import { kindByEnumName } from "../pipeline/apiresource-meta.js";
|
|
18
|
+
import { createdByOf } from "../pipeline/steps/authorization-facts.js";
|
|
19
|
+
import { ResourceNotFoundError } from "../store/interface.js";
|
|
20
|
+
import { builtInModel } from "./model/index.js";
|
|
21
|
+
export function newStoreResourceCreators(store) {
|
|
22
|
+
return {
|
|
23
|
+
async creatorOf(kindName, id) {
|
|
24
|
+
const kind = kindByEnumName(kindName);
|
|
25
|
+
const schema = builtInModel.byKind(kind)?.schema;
|
|
26
|
+
if (kind === ApiResourceKind.api_resource_kind_unknown ||
|
|
27
|
+
kind === ApiResourceKind.identity_account ||
|
|
28
|
+
schema === undefined ||
|
|
29
|
+
id === "") {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
return createdByOf(await store.getResource(kind, id, schema));
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
if (error instanceof ResourceNotFoundError) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=resource-creators.js.map
|