@stigmer/server 3.15.3-dev.20260914100347 → 3.15.3-dev.20260916211208
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/README.md +3 -3
- package/dist/archive/content-store.d.ts +35 -0
- package/dist/archive/content-store.d.ts.map +1 -0
- package/dist/archive/content-store.js +98 -0
- package/dist/archive/content-store.js.map +1 -0
- package/dist/archive/inflate.d.ts +22 -0
- package/dist/archive/inflate.d.ts.map +1 -0
- package/dist/archive/inflate.js +75 -0
- package/dist/archive/inflate.js.map +1 -0
- package/dist/archive/limits.d.ts +33 -0
- package/dist/archive/limits.d.ts.map +1 -0
- package/dist/archive/limits.js +31 -0
- package/dist/archive/limits.js.map +1 -0
- package/dist/archive/open.d.ts +24 -0
- package/dist/archive/open.d.ts.map +1 -0
- package/dist/archive/open.js +93 -0
- package/dist/archive/open.js.map +1 -0
- package/dist/{domain/skill/storage → archive}/prefilter.d.ts +5 -0
- package/dist/archive/prefilter.d.ts.map +1 -0
- package/dist/archive/prefilter.js.map +1 -0
- package/dist/archive/write.d.ts +8 -0
- package/dist/archive/write.d.ts.map +1 -0
- package/dist/archive/write.js +44 -0
- package/dist/archive/write.js.map +1 -0
- package/dist/authorization/authorizer.d.ts +98 -0
- package/dist/authorization/authorizer.d.ts.map +1 -0
- package/dist/authorization/authorizer.js +156 -0
- package/dist/authorization/authorizer.js.map +1 -0
- package/dist/authorization/derived-tuples.d.ts +42 -0
- package/dist/authorization/derived-tuples.d.ts.map +1 -0
- package/dist/authorization/derived-tuples.js +240 -0
- package/dist/authorization/derived-tuples.js.map +1 -0
- package/dist/authorization/evaluator.d.ts +66 -0
- package/dist/authorization/evaluator.d.ts.map +1 -0
- package/dist/authorization/evaluator.js +153 -0
- package/dist/authorization/evaluator.js.map +1 -0
- package/dist/authorization/facts.d.ts +29 -0
- package/dist/authorization/facts.d.ts.map +1 -0
- package/dist/authorization/facts.js +17 -0
- package/dist/authorization/facts.js.map +1 -0
- package/dist/authorization/list-read-scope.d.ts +18 -0
- package/dist/authorization/list-read-scope.d.ts.map +1 -0
- package/dist/authorization/list-read-scope.js +155 -0
- package/dist/authorization/list-read-scope.js.map +1 -0
- package/dist/authorization/model/agent.d.ts +2 -0
- package/dist/authorization/model/agent.d.ts.map +1 -0
- package/dist/authorization/model/agent.js +42 -0
- package/dist/authorization/model/agent.js.map +1 -0
- package/dist/authorization/model/agent_channel.d.ts +2 -0
- package/dist/authorization/model/agent_channel.d.ts.map +1 -0
- package/dist/authorization/model/agent_channel.js +38 -0
- package/dist/authorization/model/agent_channel.js.map +1 -0
- package/dist/authorization/model/agent_execution.d.ts +2 -0
- package/dist/authorization/model/agent_execution.d.ts.map +1 -0
- package/dist/authorization/model/agent_execution.js +25 -0
- package/dist/authorization/model/agent_execution.js.map +1 -0
- package/dist/authorization/model/agent_instance.d.ts +2 -0
- package/dist/authorization/model/agent_instance.d.ts.map +1 -0
- package/dist/authorization/model/agent_instance.js +47 -0
- package/dist/authorization/model/agent_instance.js.map +1 -0
- package/dist/authorization/model/agent_share.d.ts +2 -0
- package/dist/authorization/model/agent_share.d.ts.map +1 -0
- package/dist/authorization/model/agent_share.js +29 -0
- package/dist/authorization/model/agent_share.js.map +1 -0
- package/dist/authorization/model/api_key.d.ts +2 -0
- package/dist/authorization/model/api_key.d.ts.map +1 -0
- package/dist/authorization/model/api_key.js +27 -0
- package/dist/authorization/model/api_key.js.map +1 -0
- package/dist/authorization/model/artifact.d.ts +2 -0
- package/dist/authorization/model/artifact.d.ts.map +1 -0
- package/dist/authorization/model/artifact.js +27 -0
- package/dist/authorization/model/artifact.js.map +1 -0
- package/dist/authorization/model/channel_app.d.ts +2 -0
- package/dist/authorization/model/channel_app.d.ts.map +1 -0
- package/dist/authorization/model/channel_app.js +28 -0
- package/dist/authorization/model/channel_app.js.map +1 -0
- package/dist/authorization/model/default-of.d.ts +38 -0
- package/dist/authorization/model/default-of.d.ts.map +1 -0
- package/dist/authorization/model/default-of.js +39 -0
- package/dist/authorization/model/default-of.js.map +1 -0
- package/dist/authorization/model/environment.d.ts +2 -0
- package/dist/authorization/model/environment.d.ts.map +1 -0
- package/dist/authorization/model/environment.js +33 -0
- package/dist/authorization/model/environment.js.map +1 -0
- package/dist/authorization/model/execution_context.d.ts +2 -0
- package/dist/authorization/model/execution_context.d.ts.map +1 -0
- package/dist/authorization/model/execution_context.js +19 -0
- package/dist/authorization/model/execution_context.js.map +1 -0
- package/dist/authorization/model/iam_policy.d.ts +2 -0
- package/dist/authorization/model/iam_policy.d.ts.map +1 -0
- package/dist/authorization/model/iam_policy.js +31 -0
- package/dist/authorization/model/iam_policy.js.map +1 -0
- package/dist/authorization/model/identity_account.d.ts +2 -0
- package/dist/authorization/model/identity_account.d.ts.map +1 -0
- package/dist/authorization/model/identity_account.js +25 -0
- package/dist/authorization/model/identity_account.js.map +1 -0
- package/dist/authorization/model/index.d.ts +36 -0
- package/dist/authorization/model/index.d.ts.map +1 -0
- package/dist/authorization/model/index.js +72 -0
- package/dist/authorization/model/index.js.map +1 -0
- package/dist/authorization/model/mcp_server.d.ts +2 -0
- package/dist/authorization/model/mcp_server.d.ts.map +1 -0
- package/dist/authorization/model/mcp_server.js +37 -0
- package/dist/authorization/model/mcp_server.js.map +1 -0
- package/dist/authorization/model/memory.d.ts +2 -0
- package/dist/authorization/model/memory.d.ts.map +1 -0
- package/dist/authorization/model/memory.js +26 -0
- package/dist/authorization/model/memory.js.map +1 -0
- package/dist/authorization/model/oauth_app.d.ts +2 -0
- package/dist/authorization/model/oauth_app.d.ts.map +1 -0
- package/dist/authorization/model/oauth_app.js +30 -0
- package/dist/authorization/model/oauth_app.js.map +1 -0
- package/dist/authorization/model/organization.d.ts +2 -0
- package/dist/authorization/model/organization.d.ts.map +1 -0
- package/dist/authorization/model/organization.js +54 -0
- package/dist/authorization/model/organization.js.map +1 -0
- package/dist/authorization/model/plugin.d.ts +2 -0
- package/dist/authorization/model/plugin.d.ts.map +1 -0
- package/dist/authorization/model/plugin.js +44 -0
- package/dist/authorization/model/plugin.js.map +1 -0
- package/dist/authorization/model/project.d.ts +2 -0
- package/dist/authorization/model/project.d.ts.map +1 -0
- package/dist/authorization/model/project.js +32 -0
- package/dist/authorization/model/project.js.map +1 -0
- package/dist/authorization/model/rewrite.d.ts +127 -0
- package/dist/authorization/model/rewrite.d.ts.map +1 -0
- package/dist/authorization/model/rewrite.js +82 -0
- package/dist/authorization/model/rewrite.js.map +1 -0
- package/dist/authorization/model/schedule.d.ts +2 -0
- package/dist/authorization/model/schedule.d.ts.map +1 -0
- package/dist/authorization/model/schedule.js +29 -0
- package/dist/authorization/model/schedule.js.map +1 -0
- package/dist/authorization/model/session.d.ts +2 -0
- package/dist/authorization/model/session.d.ts.map +1 -0
- package/dist/authorization/model/session.js +38 -0
- package/dist/authorization/model/session.js.map +1 -0
- package/dist/authorization/model/skill.d.ts +2 -0
- package/dist/authorization/model/skill.d.ts.map +1 -0
- package/dist/authorization/model/skill.js +38 -0
- package/dist/authorization/model/skill.js.map +1 -0
- package/dist/authorization/model/workflow.d.ts +2 -0
- package/dist/authorization/model/workflow.d.ts.map +1 -0
- package/dist/authorization/model/workflow.js +38 -0
- package/dist/authorization/model/workflow.js.map +1 -0
- package/dist/authorization/model/workflow_execution.d.ts +2 -0
- package/dist/authorization/model/workflow_execution.d.ts.map +1 -0
- package/dist/authorization/model/workflow_execution.js +32 -0
- package/dist/authorization/model/workflow_execution.js.map +1 -0
- package/dist/authorization/model/workflow_instance.d.ts +2 -0
- package/dist/authorization/model/workflow_instance.d.ts.map +1 -0
- package/dist/authorization/model/workflow_instance.js +92 -0
- package/dist/authorization/model/workflow_instance.js.map +1 -0
- package/dist/authorization/organization-directory.d.ts +13 -0
- package/dist/authorization/organization-directory.d.ts.map +1 -0
- package/dist/authorization/organization-directory.js +83 -0
- package/dist/authorization/organization-directory.js.map +1 -0
- package/dist/authorization/person.d.ts +42 -0
- package/dist/authorization/person.d.ts.map +1 -0
- package/dist/authorization/person.js +19 -0
- package/dist/authorization/person.js.map +1 -0
- package/dist/authorization/posture.d.ts +38 -0
- package/dist/authorization/posture.d.ts.map +1 -0
- package/dist/authorization/posture.js +7 -0
- package/dist/authorization/posture.js.map +1 -0
- package/dist/authorization/schedule-fire-caller.d.ts +12 -0
- package/dist/authorization/schedule-fire-caller.d.ts.map +1 -0
- package/dist/authorization/schedule-fire-caller.js +67 -0
- package/dist/authorization/schedule-fire-caller.js.map +1 -0
- package/dist/authorization/store-test-kit.d.ts +68 -0
- package/dist/authorization/store-test-kit.d.ts.map +1 -0
- package/dist/authorization/store-test-kit.js +311 -0
- package/dist/authorization/store-test-kit.js.map +1 -0
- package/dist/authorization/tuples.d.ts +115 -0
- package/dist/authorization/tuples.d.ts.map +1 -0
- package/dist/authorization/tuples.js +83 -0
- package/dist/authorization/tuples.js.map +1 -0
- package/dist/boot/compose.d.ts.map +1 -1
- package/dist/boot/compose.js +157 -32
- package/dist/boot/compose.js.map +1 -1
- package/dist/boot/inprocess.d.ts +12 -0
- package/dist/boot/inprocess.d.ts.map +1 -1
- package/dist/boot/inprocess.js +62 -20
- package/dist/boot/inprocess.js.map +1 -1
- package/dist/domain/agent/controller.d.ts.map +1 -1
- package/dist/domain/agent/controller.js +9 -0
- package/dist/domain/agent/controller.js.map +1 -1
- package/dist/domain/iampolicy/constants.d.ts +11 -0
- package/dist/domain/iampolicy/constants.d.ts.map +1 -1
- package/dist/domain/iampolicy/constants.js +11 -0
- package/dist/domain/iampolicy/constants.js.map +1 -1
- package/dist/domain/iampolicy/membership.d.ts +72 -1
- package/dist/domain/iampolicy/membership.d.ts.map +1 -1
- package/dist/domain/iampolicy/membership.js +141 -56
- package/dist/domain/iampolicy/membership.js.map +1 -1
- package/dist/domain/identityaccount/actor.d.ts +26 -0
- package/dist/domain/identityaccount/actor.d.ts.map +1 -0
- package/dist/domain/identityaccount/actor.js +17 -0
- package/dist/domain/identityaccount/actor.js.map +1 -0
- package/dist/domain/mcpserver/controller.d.ts.map +1 -1
- package/dist/domain/mcpserver/controller.js +9 -0
- package/dist/domain/mcpserver/controller.js.map +1 -1
- package/dist/domain/plugin/archive.d.ts +37 -0
- package/dist/domain/plugin/archive.d.ts.map +1 -0
- package/dist/domain/plugin/archive.js +50 -0
- package/dist/domain/plugin/archive.js.map +1 -0
- package/dist/domain/plugin/constants.d.ts +38 -0
- package/dist/domain/plugin/constants.d.ts.map +1 -0
- package/dist/domain/plugin/constants.js +46 -0
- package/dist/domain/plugin/constants.js.map +1 -0
- package/dist/domain/plugin/controller.d.ts +25 -0
- package/dist/domain/plugin/controller.d.ts.map +1 -0
- package/dist/domain/plugin/controller.js +493 -0
- package/dist/domain/plugin/controller.js.map +1 -0
- package/dist/domain/plugin/materialize/agent.d.ts +13 -0
- package/dist/domain/plugin/materialize/agent.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/agent.js +128 -0
- package/dist/domain/plugin/materialize/agent.js.map +1 -0
- package/dist/domain/plugin/materialize/default-agent-instructions.d.ts +22 -0
- package/dist/domain/plugin/materialize/default-agent-instructions.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/default-agent-instructions.js +31 -0
- package/dist/domain/plugin/materialize/default-agent-instructions.js.map +1 -0
- package/dist/domain/plugin/materialize/identity.d.ts +28 -0
- package/dist/domain/plugin/materialize/identity.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/identity.js +40 -0
- package/dist/domain/plugin/materialize/identity.js.map +1 -0
- package/dist/domain/plugin/materialize/mcp-servers.d.ts +15 -0
- package/dist/domain/plugin/materialize/mcp-servers.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/mcp-servers.js +131 -0
- package/dist/domain/plugin/materialize/mcp-servers.js.map +1 -0
- package/dist/domain/plugin/materialize/plan.d.ts +24 -0
- package/dist/domain/plugin/materialize/plan.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/plan.js +77 -0
- package/dist/domain/plugin/materialize/plan.js.map +1 -0
- package/dist/domain/plugin/materialize/ports.d.ts +42 -0
- package/dist/domain/plugin/materialize/ports.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/ports.js +2 -0
- package/dist/domain/plugin/materialize/ports.js.map +1 -0
- package/dist/domain/plugin/materialize/skills.d.ts +12 -0
- package/dist/domain/plugin/materialize/skills.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/skills.js +44 -0
- package/dist/domain/plugin/materialize/skills.js.map +1 -0
- package/dist/domain/plugin/materialize/workflows.d.ts +15 -0
- package/dist/domain/plugin/materialize/workflows.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/workflows.js +31 -0
- package/dist/domain/plugin/materialize/workflows.js.map +1 -0
- package/dist/domain/plugin/members.d.ts +42 -0
- package/dist/domain/plugin/members.d.ts.map +1 -0
- package/dist/domain/plugin/members.js +97 -0
- package/dist/domain/plugin/members.js.map +1 -0
- package/dist/domain/plugin/overlay/documents.d.ts +31 -0
- package/dist/domain/plugin/overlay/documents.d.ts.map +1 -0
- package/dist/domain/plugin/overlay/documents.js +38 -0
- package/dist/domain/plugin/overlay/documents.js.map +1 -0
- package/dist/domain/plugin/overlay/parse.d.ts +16 -0
- package/dist/domain/plugin/overlay/parse.d.ts.map +1 -0
- package/dist/domain/plugin/overlay/parse.js +79 -0
- package/dist/domain/plugin/overlay/parse.js.map +1 -0
- package/dist/domain/plugin/overlay/sanitize.d.ts +10 -0
- package/dist/domain/plugin/overlay/sanitize.d.ts.map +1 -0
- package/dist/domain/plugin/overlay/sanitize.js +101 -0
- package/dist/domain/plugin/overlay/sanitize.js.map +1 -0
- package/dist/domain/plugin/push.d.ts +133 -0
- package/dist/domain/plugin/push.d.ts.map +1 -0
- package/dist/domain/plugin/push.js +800 -0
- package/dist/domain/plugin/push.js.map +1 -0
- package/dist/domain/plugin/search-extractor.d.ts +3 -0
- package/dist/domain/plugin/search-extractor.d.ts.map +1 -0
- package/dist/domain/plugin/search-extractor.js +41 -0
- package/dist/domain/plugin/search-extractor.js.map +1 -0
- package/dist/domain/skill/constants.d.ts +6 -11
- package/dist/domain/skill/constants.d.ts.map +1 -1
- package/dist/domain/skill/constants.js +6 -11
- package/dist/domain/skill/constants.js.map +1 -1
- package/dist/domain/skill/controller.d.ts.map +1 -1
- package/dist/domain/skill/controller.js +33 -30
- package/dist/domain/skill/controller.js.map +1 -1
- package/dist/domain/skill/push.d.ts +9 -10
- package/dist/domain/skill/push.d.ts.map +1 -1
- package/dist/domain/skill/push.js +53 -122
- package/dist/domain/skill/push.js.map +1 -1
- package/dist/domain/skill/search-extractor.d.ts.map +1 -1
- package/dist/domain/skill/search-extractor.js.map +1 -1
- package/dist/domain/skill/storage/artifact-storage.d.ts +26 -29
- package/dist/domain/skill/storage/artifact-storage.d.ts.map +1 -1
- package/dist/domain/skill/storage/artifact-storage.js +6 -103
- package/dist/domain/skill/storage/artifact-storage.js.map +1 -1
- package/dist/domain/skill/storage/zip-gate.d.ts +1 -2
- package/dist/domain/skill/storage/zip-gate.d.ts.map +1 -1
- package/dist/domain/skill/storage/zip-gate.js +56 -126
- package/dist/domain/skill/storage/zip-gate.js.map +1 -1
- package/dist/domain/skill/version-resolution.d.ts +5 -5
- package/dist/domain/skill/version-resolution.d.ts.map +1 -1
- package/dist/domain/skill/version-resolution.js +34 -216
- package/dist/domain/skill/version-resolution.js.map +1 -1
- package/dist/domain/workflow/controller.d.ts.map +1 -1
- package/dist/domain/workflow/controller.js +30 -3
- package/dist/domain/workflow/controller.js.map +1 -1
- package/dist/domain/workflow/registry/data/task-kind-registry.json +1 -0
- package/dist/extensions/authorizer.d.ts +10 -5
- package/dist/extensions/authorizer.d.ts.map +1 -1
- package/dist/extensions/drivers.d.ts +4 -1
- package/dist/extensions/drivers.d.ts.map +1 -1
- package/dist/extensions/list-read-scope.d.ts +75 -11
- package/dist/extensions/list-read-scope.d.ts.map +1 -1
- package/dist/extensions/list-read-scope.js +40 -7
- package/dist/extensions/list-read-scope.js.map +1 -1
- package/dist/extensions/organization-directory.d.ts +13 -9
- package/dist/extensions/organization-directory.d.ts.map +1 -1
- package/dist/extensions/organization-directory.js.map +1 -1
- package/dist/extensions/resource-authorization.d.ts +33 -0
- package/dist/extensions/resource-authorization.d.ts.map +1 -1
- package/dist/extensions/schedule-fire-caller.d.ts +45 -18
- package/dist/extensions/schedule-fire-caller.d.ts.map +1 -1
- package/dist/extensions/schedule-fire-caller.js +12 -1
- package/dist/extensions/schedule-fire-caller.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/pipeline/apiresource-labels.d.ts +23 -3
- package/dist/pipeline/apiresource-labels.d.ts.map +1 -1
- package/dist/pipeline/apiresource-labels.js +20 -0
- package/dist/pipeline/apiresource-labels.js.map +1 -1
- package/dist/pipeline/apiresource-meta.d.ts +21 -0
- package/dist/pipeline/apiresource-meta.d.ts.map +1 -1
- package/dist/pipeline/apiresource-meta.js +28 -0
- package/dist/pipeline/apiresource-meta.js.map +1 -1
- package/dist/pipeline/errors.d.ts.map +1 -1
- package/dist/pipeline/errors.js.map +1 -1
- package/dist/pipeline/steps/authorization-facts.d.ts +12 -0
- package/dist/pipeline/steps/authorization-facts.d.ts.map +1 -0
- package/dist/pipeline/steps/authorization-facts.js +100 -0
- package/dist/pipeline/steps/authorization-facts.js.map +1 -0
- package/dist/pipeline/steps/authorization-tuples.d.ts.map +1 -1
- package/dist/pipeline/steps/authorization-tuples.js +7 -26
- package/dist/pipeline/steps/authorization-tuples.js.map +1 -1
- package/dist/pipeline/steps/delete.d.ts.map +1 -1
- package/dist/pipeline/steps/delete.js +1 -1
- package/dist/pipeline/steps/delete.js.map +1 -1
- package/dist/pipeline/steps/duplicate.d.ts.map +1 -1
- package/dist/pipeline/steps/duplicate.js.map +1 -1
- package/dist/pipeline/steps/guard-plugin-managed.d.ts +12 -0
- package/dist/pipeline/steps/guard-plugin-managed.d.ts.map +1 -0
- package/dist/pipeline/steps/guard-plugin-managed.js +96 -0
- package/dist/pipeline/steps/guard-plugin-managed.js.map +1 -0
- package/dist/pipeline/steps/guard-reserved-labels.d.ts +16 -2
- package/dist/pipeline/steps/guard-reserved-labels.d.ts.map +1 -1
- package/dist/pipeline/steps/guard-reserved-labels.js +11 -7
- package/dist/pipeline/steps/guard-reserved-labels.js.map +1 -1
- package/dist/pipeline/steps/helpers.d.ts.map +1 -1
- package/dist/pipeline/steps/helpers.js.map +1 -1
- package/dist/pipeline/steps/index-search.d.ts.map +1 -1
- package/dist/pipeline/steps/index-search.js.map +1 -1
- package/dist/pipeline/steps/load-existing.d.ts.map +1 -1
- package/dist/pipeline/steps/load-existing.js +1 -1
- package/dist/pipeline/steps/load-existing.js.map +1 -1
- package/dist/pipeline/steps/references.d.ts +16 -0
- package/dist/pipeline/steps/references.d.ts.map +1 -1
- package/dist/pipeline/steps/references.js +18 -0
- package/dist/pipeline/steps/references.js.map +1 -1
- package/dist/pipeline/steps/resolve-artifact-source.d.ts +35 -0
- package/dist/pipeline/steps/resolve-artifact-source.d.ts.map +1 -0
- package/dist/pipeline/steps/resolve-artifact-source.js +27 -0
- package/dist/pipeline/steps/resolve-artifact-source.js.map +1 -0
- package/dist/pipeline/steps/server-stamped-reserved-labels.d.ts.map +1 -1
- package/dist/pipeline/steps/server-stamped-reserved-labels.js.map +1 -1
- package/dist/pipeline/steps/shapes.d.ts +18 -0
- package/dist/pipeline/steps/shapes.d.ts.map +1 -1
- package/dist/pipeline/steps/shapes.js +29 -0
- package/dist/pipeline/steps/shapes.js.map +1 -1
- package/dist/pipeline/steps/slug.d.ts.map +1 -1
- package/dist/pipeline/steps/slug.js.map +1 -1
- package/dist/pipeline/steps/validate-visibility.d.ts +9 -0
- package/dist/pipeline/steps/validate-visibility.d.ts.map +1 -1
- package/dist/pipeline/steps/validate-visibility.js +6 -1
- package/dist/pipeline/steps/validate-visibility.js.map +1 -1
- package/dist/pipeline/steps/validation.d.ts.map +1 -1
- package/dist/pipeline/steps/validation.js.map +1 -1
- package/dist/pipeline/steps/version-archive.d.ts +63 -0
- package/dist/pipeline/steps/version-archive.d.ts.map +1 -0
- package/dist/pipeline/steps/version-archive.js +129 -0
- package/dist/pipeline/steps/version-archive.js.map +1 -0
- package/dist/pipeline/steps/version-history.d.ts +49 -0
- package/dist/pipeline/steps/version-history.d.ts.map +1 -0
- package/dist/pipeline/steps/version-history.js +229 -0
- package/dist/pipeline/steps/version-history.js.map +1 -0
- package/dist/pipeline/steps/visibility-gates.d.ts +8 -0
- package/dist/pipeline/steps/visibility-gates.d.ts.map +1 -1
- package/dist/pipeline/steps/visibility-gates.js +7 -2
- package/dist/pipeline/steps/visibility-gates.js.map +1 -1
- package/dist/query/search/registry.d.ts.map +1 -1
- package/dist/query/search/registry.js +2 -0
- package/dist/query/search/registry.js.map +1 -1
- package/dist/temporal/schedule/run-starter.d.ts +1 -1
- package/dist/temporal/schedule/run-starter.d.ts.map +1 -1
- package/dist/temporal/schedule/run-starter.js +14 -1
- package/dist/temporal/schedule/run-starter.js.map +1 -1
- package/package.json +5 -4
- package/src/archive/__tests__/archive.test.ts +233 -0
- package/src/{domain/skill → archive}/__tests__/prefilter.test.ts +1 -1
- package/src/archive/content-store.ts +132 -0
- package/src/archive/inflate.ts +107 -0
- package/src/archive/limits.ts +42 -0
- package/src/archive/open.ts +131 -0
- package/src/{domain/skill/storage → archive}/prefilter.ts +5 -0
- package/src/archive/write.ts +54 -0
- package/src/authorization/README.md +124 -0
- package/src/authorization/__tests__/authorizer.test.ts +719 -0
- package/src/authorization/__tests__/derived-tuples.test.ts +802 -0
- package/src/authorization/__tests__/drivers.ts +70 -0
- package/src/authorization/__tests__/evaluator.test.ts +359 -0
- package/src/authorization/__tests__/facts.test.ts +155 -0
- package/src/authorization/__tests__/fixtures/fga/agent-channel-owner.fga.yaml +112 -0
- package/src/authorization/__tests__/fixtures/fga/agent-share-owner.fga.yaml +109 -0
- package/src/authorization/__tests__/fixtures/fga/artifact-org-and-owner.fga.yaml +128 -0
- package/src/authorization/__tests__/fixtures/fga/blueprint-private-visibility.fga.yaml +410 -0
- package/src/authorization/__tests__/fixtures/fga/channel-app-owner.fga.yaml +125 -0
- package/src/authorization/__tests__/fixtures/fga/channel-participation.fga.yaml +201 -0
- package/src/authorization/__tests__/fixtures/fga/channel-session-visibility.fga.yaml +187 -0
- package/src/authorization/__tests__/fixtures/fga/cross-org-share-creation.fga.yaml +98 -0
- package/src/authorization/__tests__/fixtures/fga/default-instance-inheritance.fga.yaml +271 -0
- package/src/authorization/__tests__/fixtures/fga/memory-subject-only.fga.yaml +72 -0
- package/src/authorization/__tests__/fixtures/fga/org-admin-owner-inheritance.fga.yaml +328 -0
- package/src/authorization/__tests__/fixtures/fga/org-shared-environment.fga.yaml +144 -0
- package/src/authorization/__tests__/fixtures/fga/platform-visibility.fga.yaml +223 -0
- package/src/authorization/__tests__/fixtures/fga/provider-standing-viewer.fga.yaml +40 -0
- package/src/authorization/__tests__/fixtures/fga/public-visibility-setter.fga.yaml +52 -0
- package/src/authorization/__tests__/fixtures/fga/reserved-label-writer.fga.yaml +41 -0
- package/src/authorization/__tests__/fixtures/fga/schedule-owner.fga.yaml +113 -0
- package/src/authorization/__tests__/fixtures/fga/schedule-session-visibility.fga.yaml +214 -0
- package/src/authorization/__tests__/fixtures/fga/session-personal-resource.fga.yaml +117 -0
- package/src/authorization/__tests__/fixtures/fga/workflow-execution-sharing.fga.yaml +192 -0
- package/src/authorization/__tests__/list-read-scope.measure.test.ts +317 -0
- package/src/authorization/__tests__/list-read-scope.test.ts +796 -0
- package/src/authorization/__tests__/organization-directory.test.ts +236 -0
- package/src/authorization/__tests__/person.test.ts +114 -0
- package/src/authorization/__tests__/posture.test.ts +25 -0
- package/src/authorization/__tests__/schedule-fire-caller.test.ts +134 -0
- package/src/authorization/__tests__/store-tests.test.ts +306 -0
- package/src/authorization/__tests__/support.ts +101 -0
- package/src/authorization/__tests__/tuples.test.ts +62 -0
- package/src/authorization/__tests__/wire-permissions.test.ts +154 -0
- package/src/authorization/authorizer.ts +208 -0
- package/src/authorization/derived-tuples.ts +384 -0
- package/src/authorization/evaluator.ts +283 -0
- package/src/authorization/facts.ts +47 -0
- package/src/authorization/list-read-scope.ts +216 -0
- package/src/authorization/model/__tests__/registry.test.ts +317 -0
- package/src/authorization/model/agent.ts +64 -0
- package/src/authorization/model/agent_channel.ts +49 -0
- package/src/authorization/model/agent_execution.ts +33 -0
- package/src/authorization/model/agent_instance.ts +66 -0
- package/src/authorization/model/agent_share.ts +40 -0
- package/src/authorization/model/api_key.ts +28 -0
- package/src/authorization/model/artifact.ts +38 -0
- package/src/authorization/model/channel_app.ts +39 -0
- package/src/authorization/model/default-of.ts +99 -0
- package/src/authorization/model/environment.ts +48 -0
- package/src/authorization/model/execution_context.ts +20 -0
- package/src/authorization/model/iam_policy.ts +42 -0
- package/src/authorization/model/identity_account.ts +26 -0
- package/src/authorization/model/index.ts +108 -0
- package/src/authorization/model/mcp_server.ts +59 -0
- package/src/authorization/model/memory.ts +27 -0
- package/src/authorization/model/oauth_app.ts +42 -0
- package/src/authorization/model/organization.ts +55 -0
- package/src/authorization/model/plugin.ts +66 -0
- package/src/authorization/model/project.ts +47 -0
- package/src/authorization/model/rewrite.ts +213 -0
- package/src/authorization/model/schedule.ts +40 -0
- package/src/authorization/model/session.ts +50 -0
- package/src/authorization/model/skill.ts +60 -0
- package/src/authorization/model/workflow.ts +60 -0
- package/src/authorization/model/workflow_execution.ts +44 -0
- package/src/authorization/model/workflow_instance.ts +122 -0
- package/src/authorization/organization-directory.ts +114 -0
- package/src/authorization/person.ts +68 -0
- package/src/authorization/posture.ts +49 -0
- package/src/authorization/schedule-fire-caller.ts +91 -0
- package/src/authorization/store-test-kit.ts +454 -0
- package/src/authorization/tuples.ts +190 -0
- package/src/boot/compose.ts +175 -38
- package/src/boot/inprocess.ts +108 -30
- package/src/domain/agent/controller.ts +11 -0
- package/src/domain/iampolicy/__tests__/membership.test.ts +357 -3
- package/src/domain/iampolicy/constants.ts +12 -0
- package/src/domain/iampolicy/membership.ts +221 -66
- package/src/domain/identityaccount/actor.ts +44 -0
- package/src/domain/mcpserver/controller.ts +11 -0
- package/src/domain/plugin/__tests__/materialize.test.ts +303 -0
- package/src/domain/plugin/__tests__/overlay-parse.test.ts +85 -0
- package/src/domain/plugin/__tests__/plugin.test.ts +681 -0
- package/src/domain/plugin/__tests__/sanitize.test.ts +174 -0
- package/src/domain/plugin/archive.ts +89 -0
- package/src/domain/plugin/constants.ts +53 -0
- package/src/domain/plugin/controller.ts +913 -0
- package/src/domain/plugin/materialize/agent.ts +186 -0
- package/src/domain/plugin/materialize/default-agent-instructions.ts +59 -0
- package/src/domain/plugin/materialize/identity.ts +67 -0
- package/src/domain/plugin/materialize/mcp-servers.ts +175 -0
- package/src/domain/plugin/materialize/plan.ts +124 -0
- package/src/domain/plugin/materialize/ports.ts +53 -0
- package/src/domain/plugin/materialize/skills.ts +68 -0
- package/src/domain/plugin/materialize/workflows.ts +51 -0
- package/src/domain/plugin/members.ts +180 -0
- package/src/domain/plugin/overlay/documents.ts +78 -0
- package/src/domain/plugin/overlay/parse.ts +115 -0
- package/src/domain/plugin/overlay/sanitize.ts +149 -0
- package/src/domain/plugin/push.ts +1062 -0
- package/src/domain/plugin/search-extractor.ts +60 -0
- package/src/domain/skill/constants.ts +11 -14
- package/src/domain/skill/controller.ts +44 -36
- package/src/domain/skill/push.ts +61 -156
- package/src/domain/skill/search-extractor.ts +3 -1
- package/src/domain/skill/storage/artifact-storage.ts +23 -124
- package/src/domain/skill/storage/zip-gate.ts +58 -154
- package/src/domain/skill/version-resolution.ts +67 -269
- package/src/domain/workflow/controller.ts +38 -4
- package/src/domain/workflow/registry/data/task-kind-registry.json +1 -0
- package/src/extensions/__tests__/built-in-authorization-composed.test.ts +835 -0
- package/src/extensions/__tests__/composed-support.ts +32 -1
- package/src/extensions/__tests__/extension-composition.test.ts +35 -0
- package/src/extensions/__tests__/list-read-scope.test.ts +245 -3
- package/src/extensions/__tests__/role-reconciliation-composed.test.ts +209 -0
- package/src/extensions/__tests__/tier-truthfulness.test.ts +6 -14
- package/src/extensions/authorizer.ts +10 -5
- package/src/extensions/drivers.ts +4 -1
- package/src/extensions/list-read-scope.ts +116 -16
- package/src/extensions/organization-directory.ts +13 -9
- package/src/extensions/resource-authorization.ts +34 -0
- package/src/extensions/schedule-fire-caller.ts +49 -18
- package/src/index.ts +51 -1
- package/src/pipeline/__tests__/inherited-authorization-parent.test.ts +51 -0
- package/src/pipeline/__tests__/router-transport.test.ts +1 -3
- package/src/pipeline/apiresource-labels.ts +31 -3
- package/src/pipeline/apiresource-meta.ts +37 -0
- package/src/pipeline/errors.ts +5 -5
- package/src/pipeline/steps/__tests__/authorize-annotation-completeness.test.ts +1 -20
- package/src/pipeline/steps/__tests__/guard-memory-capture.test.ts +3 -9
- package/src/pipeline/steps/__tests__/guard-plugin-managed.test.ts +151 -0
- package/src/pipeline/steps/__tests__/guard-reserved-labels.test.ts +83 -8
- package/src/pipeline/steps/authorization-facts.ts +131 -0
- package/src/pipeline/steps/authorization-tuples.ts +7 -28
- package/src/pipeline/steps/delete.ts +11 -3
- package/src/pipeline/steps/duplicate.ts +8 -2
- package/src/pipeline/steps/guard-plugin-managed.ts +133 -0
- package/src/pipeline/steps/guard-reserved-labels.ts +29 -8
- package/src/pipeline/steps/helpers.ts +4 -1
- package/src/pipeline/steps/index-search.ts +28 -15
- package/src/pipeline/steps/load-existing.ts +12 -3
- package/src/pipeline/steps/references.ts +36 -2
- package/src/pipeline/steps/resolve-artifact-source.ts +66 -0
- package/src/pipeline/steps/server-stamped-reserved-labels.ts +2 -1
- package/src/pipeline/steps/shapes.ts +31 -0
- package/src/pipeline/steps/slug.ts +7 -2
- package/src/pipeline/steps/validate-visibility.ts +9 -2
- package/src/pipeline/steps/validation.ts +3 -1
- package/src/pipeline/steps/version-archive.ts +225 -0
- package/src/pipeline/steps/version-history.ts +362 -0
- package/src/pipeline/steps/visibility-gates.ts +12 -9
- package/src/query/README.md +1 -1
- package/src/query/search/__tests__/criteria.test.ts +6 -7
- package/src/query/search/__tests__/query-store.test.ts +9 -2
- package/src/query/search/__tests__/registry.test.ts +6 -4
- package/src/query/search/registry.ts +6 -1
- package/src/temporal/schedule/__tests__/run-starter.test.ts +86 -24
- package/src/temporal/schedule/run-starter.ts +31 -8
- package/dist/domain/skill/storage/prefilter.d.ts.map +0 -1
- package/dist/domain/skill/storage/prefilter.js.map +0 -1
- /package/dist/{domain/skill/storage → archive}/prefilter.js +0 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pins the built-in organization directory on both store drivers as the
|
|
3
|
+
* twin of the cloud's `listObjectIds(identity_account, can_view,
|
|
4
|
+
* organization)`: the organizations a person holds a row in and can
|
|
5
|
+
* view — one of two, both, none; a grant on something other than an
|
|
6
|
+
* organization is not one; a role whose organization row is gone is
|
|
7
|
+
* still answered (the controller skips it — the division of labour
|
|
8
|
+
* pinned); an unprovisioned subject is `[]` and never a fault (the
|
|
9
|
+
* conformance sibling's readiness probe is this RPC with a fresh
|
|
10
|
+
* subject); the `internal` class is ALL_ORGANIZATIONS — the in-process
|
|
11
|
+
* authorization skip, applied to a directory answer; enumeration is
|
|
12
|
+
* refused, the cloud's posture; the person's rows are read once for
|
|
13
|
+
* candidates and evaluation together.
|
|
14
|
+
*/
|
|
15
|
+
import { create } from "@bufbuild/protobuf";
|
|
16
|
+
import { afterAll, afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
17
|
+
|
|
18
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
19
|
+
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
20
|
+
import { IamPolicySchema } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/api_pb";
|
|
21
|
+
import { IdentityAccountSchema } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
22
|
+
import { IdentityAccountProvisioningMode } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/enum_pb";
|
|
23
|
+
|
|
24
|
+
import {
|
|
25
|
+
IAM_POLICY_API_VERSION,
|
|
26
|
+
IAM_POLICY_KIND,
|
|
27
|
+
policyIdFor,
|
|
28
|
+
} from "../../domain/iampolicy/constants.js";
|
|
29
|
+
import { newResourceIamPolicyStore } from "../../domain/iampolicy/resource-store.js";
|
|
30
|
+
import type { IamPolicyStore } from "../../domain/iampolicy/store.js";
|
|
31
|
+
import { orgRole, triple } from "../../domain/iampolicy/__tests__/support.js";
|
|
32
|
+
import { accountIdFor } from "../../domain/identityaccount/constants.js";
|
|
33
|
+
import { newResourceIdentityAccountStore } from "../../domain/identityaccount/resource-store.js";
|
|
34
|
+
import type { IdentityAccountStore } from "../../domain/identityaccount/store.js";
|
|
35
|
+
import type { CallerIdentity } from "../../extensions/identity.js";
|
|
36
|
+
import { ALL_ORGANIZATIONS } from "../../extensions/organization-directory.js";
|
|
37
|
+
import { builtInModel } from "../model/index.js";
|
|
38
|
+
import { newBuiltInOrganizationDirectory } from "../organization-directory.js";
|
|
39
|
+
import { driverFixtures, dropPostgresFixture } from "./drivers.js";
|
|
40
|
+
import type { OpenedStore } from "./drivers.js";
|
|
41
|
+
import { fixtureRow } from "./support.js";
|
|
42
|
+
|
|
43
|
+
const FOUNDER = accountIdFor("auth0|founder");
|
|
44
|
+
const MEMBER = accountIdFor("auth0|member");
|
|
45
|
+
|
|
46
|
+
function resolved(accountId: string): CallerIdentity {
|
|
47
|
+
return {
|
|
48
|
+
identityId: accountId,
|
|
49
|
+
callerClass: "user",
|
|
50
|
+
issuer: "https://issuer.example",
|
|
51
|
+
rawToken: "opaque",
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function idpShaped(subject: string): CallerIdentity {
|
|
56
|
+
const payload = Buffer.from(JSON.stringify({ sub: subject })).toString(
|
|
57
|
+
"base64url",
|
|
58
|
+
);
|
|
59
|
+
return {
|
|
60
|
+
identityId: subject,
|
|
61
|
+
callerClass: "user",
|
|
62
|
+
issuer: "https://issuer.example",
|
|
63
|
+
rawToken: `h.${payload}.unsigned`,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
afterAll(dropPostgresFixture);
|
|
68
|
+
|
|
69
|
+
describe.each(
|
|
70
|
+
driverFixtures([
|
|
71
|
+
ApiResourceKind.iam_policy,
|
|
72
|
+
ApiResourceKind.identity_account,
|
|
73
|
+
ApiResourceKind.organization,
|
|
74
|
+
ApiResourceKind.agent,
|
|
75
|
+
]),
|
|
76
|
+
)("the built-in organization directory on $name", (fixture) => {
|
|
77
|
+
describe.skipIf(fixture.skip)("listMyOrganizationIds", () => {
|
|
78
|
+
let opened: OpenedStore;
|
|
79
|
+
let policies: IamPolicyStore;
|
|
80
|
+
let accounts: IdentityAccountStore;
|
|
81
|
+
let principalReads: number;
|
|
82
|
+
|
|
83
|
+
async function organization(id: string) {
|
|
84
|
+
const declaration = builtInModel.byType("organization")!;
|
|
85
|
+
await opened.store.saveResource(
|
|
86
|
+
ApiResourceKind.organization,
|
|
87
|
+
id,
|
|
88
|
+
declaration.schema,
|
|
89
|
+
fixtureRow(declaration, {
|
|
90
|
+
id,
|
|
91
|
+
org: "",
|
|
92
|
+
visibility: ApiResourceVisibility.visibility_private,
|
|
93
|
+
createdBy: FOUNDER,
|
|
94
|
+
}),
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async function grant(spec: ReturnType<typeof orgRole>) {
|
|
99
|
+
await policies.save(
|
|
100
|
+
create(IamPolicySchema, {
|
|
101
|
+
apiVersion: IAM_POLICY_API_VERSION,
|
|
102
|
+
kind: IAM_POLICY_KIND,
|
|
103
|
+
metadata: { id: policyIdFor(spec) },
|
|
104
|
+
spec,
|
|
105
|
+
}),
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function directory() {
|
|
110
|
+
return newBuiltInOrganizationDirectory({
|
|
111
|
+
store: opened.store,
|
|
112
|
+
policies: {
|
|
113
|
+
...policies,
|
|
114
|
+
findByPrincipal(principalKind, principalId) {
|
|
115
|
+
principalReads += 1;
|
|
116
|
+
return policies.findByPrincipal(principalKind, principalId);
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
accounts,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
beforeEach(async () => {
|
|
124
|
+
opened = await fixture.open();
|
|
125
|
+
principalReads = 0;
|
|
126
|
+
policies = newResourceIamPolicyStore(opened.store);
|
|
127
|
+
accounts = newResourceIdentityAccountStore(opened.store);
|
|
128
|
+
for (const [id, subject] of [
|
|
129
|
+
[FOUNDER, "auth0|founder"],
|
|
130
|
+
[MEMBER, "auth0|member"],
|
|
131
|
+
] as const) {
|
|
132
|
+
await accounts.save(
|
|
133
|
+
create(IdentityAccountSchema, {
|
|
134
|
+
metadata: { id, name: subject },
|
|
135
|
+
spec: {
|
|
136
|
+
idpId: subject,
|
|
137
|
+
provisioningMode: IdentityAccountProvisioningMode.direct,
|
|
138
|
+
},
|
|
139
|
+
}),
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
await organization("alpha");
|
|
143
|
+
await organization("beta");
|
|
144
|
+
await grant(orgRole(FOUNDER, "owner", "alpha"));
|
|
145
|
+
await grant(orgRole(FOUNDER, "owner", "beta"));
|
|
146
|
+
await grant(orgRole(MEMBER, "member", "alpha"));
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
afterEach(async () => {
|
|
150
|
+
await opened.close();
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it("refuses enumeration — the cloud's posture; `find` would otherwise hand every member every organization", () => {
|
|
154
|
+
expect(directory().refusesEnumeration).toBe(true);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it("the internal class — the server acting as itself — is ALL_ORGANIZATIONS, the in-process authorization skip; no account is even asked for", async () => {
|
|
158
|
+
let accountReads = 0;
|
|
159
|
+
const dir = newBuiltInOrganizationDirectory({
|
|
160
|
+
store: opened.store,
|
|
161
|
+
policies,
|
|
162
|
+
accounts: {
|
|
163
|
+
findById: (id) => {
|
|
164
|
+
accountReads += 1;
|
|
165
|
+
return accounts.findById(id);
|
|
166
|
+
},
|
|
167
|
+
findDirectByIdpId: (idpId) => {
|
|
168
|
+
accountReads += 1;
|
|
169
|
+
return accounts.findDirectByIdpId(idpId);
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
expect(
|
|
174
|
+
await dir.listMyOrganizationIds({
|
|
175
|
+
identityId: "system",
|
|
176
|
+
callerClass: "internal",
|
|
177
|
+
issuer: "",
|
|
178
|
+
rawToken: "",
|
|
179
|
+
origin: "in-process",
|
|
180
|
+
}),
|
|
181
|
+
).toBe(ALL_ORGANIZATIONS);
|
|
182
|
+
expect(accountReads).toBe(0);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it("a member of one of two organizations sees that one; the owner of both sees both; never ALL_ORGANIZATIONS for a person", async () => {
|
|
186
|
+
const dir = directory();
|
|
187
|
+
expect(await dir.listMyOrganizationIds(resolved(MEMBER))).toEqual([
|
|
188
|
+
"alpha",
|
|
189
|
+
]);
|
|
190
|
+
const founders = await dir.listMyOrganizationIds(resolved(FOUNDER));
|
|
191
|
+
expect(founders).not.toBe(ALL_ORGANIZATIONS);
|
|
192
|
+
expect([...(founders as ReadonlyArray<string>)].sort()).toEqual([
|
|
193
|
+
"alpha",
|
|
194
|
+
"beta",
|
|
195
|
+
]);
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
it("an unprovisioned subject holds nothing and is answered [], never a fault (the sibling's readiness probe)", async () => {
|
|
199
|
+
expect(
|
|
200
|
+
await directory().listMyOrganizationIds(idpShaped("auth0|fresh")),
|
|
201
|
+
).toEqual([]);
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it("a grant on an agent is not an organization, and a role whose organization row is gone is still answered — the controller skips it", async () => {
|
|
205
|
+
await grant(
|
|
206
|
+
triple({ kind: "identity_account", id: MEMBER }, "viewer", {
|
|
207
|
+
kind: "agent",
|
|
208
|
+
id: "agt_1",
|
|
209
|
+
}),
|
|
210
|
+
);
|
|
211
|
+
await grant(orgRole(MEMBER, "viewer", "gamma")); // no `gamma` row
|
|
212
|
+
const mine = await directory().listMyOrganizationIds(resolved(MEMBER));
|
|
213
|
+
expect([...(mine as ReadonlyArray<string>)].sort()).toEqual([
|
|
214
|
+
"alpha",
|
|
215
|
+
"gamma",
|
|
216
|
+
]);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it("reads the person's rows ONCE — the candidates and the evaluation share the source's read", async () => {
|
|
220
|
+
await directory().listMyOrganizationIds(resolved(FOUNDER));
|
|
221
|
+
expect(principalReads).toBe(1);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it("a store fault propagates as the fault it is — the controller maps it, never this driver", async () => {
|
|
225
|
+
const fault = new Error("connection reset");
|
|
226
|
+
const dir = newBuiltInOrganizationDirectory({
|
|
227
|
+
store: opened.store,
|
|
228
|
+
policies: { ...policies, findByPrincipal: () => Promise.reject(fault) },
|
|
229
|
+
accounts,
|
|
230
|
+
});
|
|
231
|
+
await expect(dir.listMyOrganizationIds(resolved(FOUNDER))).rejects.toBe(
|
|
232
|
+
fault,
|
|
233
|
+
);
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
});
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pins the one construction of the person the built-in drivers evaluate
|
|
3
|
+
* for: `personFor` builds the aliases — the account id and the account's
|
|
4
|
+
* issuer subject for a provisioned caller, the bare identity for an
|
|
5
|
+
* unprovisioned one — and refuses an identity that names no person
|
|
6
|
+
* through the same predicate that keeps such stamps out of tuples;
|
|
7
|
+
* `resolvePerson` reads the account through the port the way whoAmI does
|
|
8
|
+
* (by id, then by the token's subject) so a caller a verifier re-stamped
|
|
9
|
+
* and a caller a composition verifier left idp-shaped both land on the
|
|
10
|
+
* same person, and a store fault propagates as the fault it is.
|
|
11
|
+
*/
|
|
12
|
+
import { create } from "@bufbuild/protobuf";
|
|
13
|
+
import { describe, expect, it } from "vitest";
|
|
14
|
+
|
|
15
|
+
import { IdentityAccountSchema } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
16
|
+
import { IdentityAccountProvisioningMode } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/enum_pb";
|
|
17
|
+
|
|
18
|
+
import { fakeIdentityAccountStore } from "../../domain/identityaccount/__tests__/support.js";
|
|
19
|
+
import { accountIdFor } from "../../domain/identityaccount/constants.js";
|
|
20
|
+
import type { CallerIdentity } from "../../extensions/identity.js";
|
|
21
|
+
import { personFor, resolvePerson } from "../person.js";
|
|
22
|
+
|
|
23
|
+
function caller(identityId: string): CallerIdentity {
|
|
24
|
+
return {
|
|
25
|
+
identityId,
|
|
26
|
+
callerClass: "user",
|
|
27
|
+
issuer: "https://issuer.example",
|
|
28
|
+
rawToken: "opaque",
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** A caller whose raw token carries `sub` — what a composition verifier that stamps the raw subject produces. */
|
|
33
|
+
function jwtCaller(sub: string, identityId: string = sub): CallerIdentity {
|
|
34
|
+
const payload = Buffer.from(JSON.stringify({ sub })).toString("base64url");
|
|
35
|
+
return {
|
|
36
|
+
identityId,
|
|
37
|
+
callerClass: "user",
|
|
38
|
+
issuer: "https://issuer.example",
|
|
39
|
+
rawToken: `h.${payload}.unsigned`,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function seeded(sub: string) {
|
|
44
|
+
const accounts = fakeIdentityAccountStore();
|
|
45
|
+
const id = accountIdFor(sub);
|
|
46
|
+
accounts.rows.set(
|
|
47
|
+
id,
|
|
48
|
+
create(IdentityAccountSchema, {
|
|
49
|
+
metadata: { id, name: sub },
|
|
50
|
+
spec: {
|
|
51
|
+
idpId: sub,
|
|
52
|
+
provisioningMode: IdentityAccountProvisioningMode.direct,
|
|
53
|
+
},
|
|
54
|
+
}),
|
|
55
|
+
);
|
|
56
|
+
return { accounts, id };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
describe("personFor", () => {
|
|
60
|
+
it("a provisioned caller is their account id and the account's issuer subject", () => {
|
|
61
|
+
const account = create(IdentityAccountSchema, {
|
|
62
|
+
metadata: { id: "ida_carol" },
|
|
63
|
+
spec: { idpId: "auth0|carol" },
|
|
64
|
+
});
|
|
65
|
+
const person = personFor(caller("ida_carol"), account);
|
|
66
|
+
expect(person.accountId).toBe("ida_carol");
|
|
67
|
+
expect([...person.aliases].sort()).toEqual(["auth0|carol", "ida_carol"]);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("an unprovisioned caller is their identity id alone", () => {
|
|
71
|
+
const person = personFor(caller("auth0|newcomer"), undefined);
|
|
72
|
+
expect(person.accountId).toBe("auth0|newcomer");
|
|
73
|
+
expect([...person.aliases]).toEqual(["auth0|newcomer"]);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("refuses an identity that names no person — the empty id and the laptop's placeholder", () => {
|
|
77
|
+
expect(() => personFor(caller(""), undefined)).toThrow("names no person");
|
|
78
|
+
expect(() => personFor(caller("system"), undefined)).toThrow(
|
|
79
|
+
"names no person",
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
describe("resolvePerson", () => {
|
|
85
|
+
it("a caller stamped with the account id resolves by id — one read, the subject never consulted", async () => {
|
|
86
|
+
const { accounts, id } = seeded("auth0|carol");
|
|
87
|
+
const person = await resolvePerson(accounts, caller(id));
|
|
88
|
+
expect(person.accountId).toBe(id);
|
|
89
|
+
expect([...person.aliases].sort()).toEqual(["auth0|carol", id].sort());
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it("a caller a verifier left idp-shaped resolves through the token's subject to the same person", async () => {
|
|
93
|
+
const { accounts, id } = seeded("auth0|carol");
|
|
94
|
+
const person = await resolvePerson(accounts, jwtCaller("auth0|carol"));
|
|
95
|
+
expect(person.accountId).toBe(id);
|
|
96
|
+
expect(person.aliases.has("auth0|carol")).toBe(true);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it("an unprovisioned subject is themselves alone and holds nothing", async () => {
|
|
100
|
+
const person = await resolvePerson(
|
|
101
|
+
fakeIdentityAccountStore(),
|
|
102
|
+
jwtCaller("auth0|stranger"),
|
|
103
|
+
);
|
|
104
|
+
expect(person.accountId).toBe("auth0|stranger");
|
|
105
|
+
expect([...person.aliases]).toEqual(["auth0|stranger"]);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("a store fault propagates as the fault it is — the driver above folds it, never this function", async () => {
|
|
109
|
+
const accounts = fakeIdentityAccountStore();
|
|
110
|
+
const fault = new Error("connection reset");
|
|
111
|
+
accounts.findById = () => Promise.reject(fault);
|
|
112
|
+
await expect(resolvePerson(accounts, caller("ida_x"))).rejects.toBe(fault);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pins the three authorization postures over the four input
|
|
3
|
+
* combinations: a unit's Authorizer wins whatever the authentication
|
|
4
|
+
* posture; without one, the require-authentication posture selects the
|
|
5
|
+
* built-in drivers and its absence keeps the trusted-local default.
|
|
6
|
+
*/
|
|
7
|
+
import { describe, expect, it } from "vitest";
|
|
8
|
+
|
|
9
|
+
import { authorizationPostureOf } from "../posture.js";
|
|
10
|
+
|
|
11
|
+
describe("authorizationPostureOf", () => {
|
|
12
|
+
it.each([
|
|
13
|
+
[false, false, "trusted-local"],
|
|
14
|
+
[false, true, "built-in"],
|
|
15
|
+
[true, false, "unit-authorizer"],
|
|
16
|
+
[true, true, "unit-authorizer"],
|
|
17
|
+
] as const)(
|
|
18
|
+
"unitAuthorizer=%s requireAuthentication=%s → %s",
|
|
19
|
+
(unitAuthorizer, requireAuthentication, want) => {
|
|
20
|
+
expect(
|
|
21
|
+
authorizationPostureOf({ unitAuthorizer, requireAuthentication }),
|
|
22
|
+
).toBe(want);
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pins the built-in schedule fire caller on both store drivers: a fire
|
|
3
|
+
* acts as the schedule's creator — resolved from the row's stamp as an
|
|
4
|
+
* account id (3.15+) or as the raw issuer subject (the 3.14.x stamp) —
|
|
5
|
+
* in the exact identity shape `accountAsCaller` builds; a schedule whose
|
|
6
|
+
* stamp names no person this server knows (`""`, `"system"`, a
|
|
7
|
+
* trusted-local email, a deleted account) is the seam's DETERMINISTIC
|
|
8
|
+
* refusal with the copy the schedule's status will carry; a missing
|
|
9
|
+
* schedule row and a store fault stay infrastructure throws.
|
|
10
|
+
*/
|
|
11
|
+
import { create } from "@bufbuild/protobuf";
|
|
12
|
+
import { afterAll, afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
13
|
+
|
|
14
|
+
import { ScheduleSchema } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/api_pb";
|
|
15
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
16
|
+
import { IdentityAccountSchema } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
17
|
+
import { IdentityAccountProvisioningMode } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/enum_pb";
|
|
18
|
+
|
|
19
|
+
import { accountIdFor } from "../../domain/identityaccount/constants.js";
|
|
20
|
+
import { newResourceIdentityAccountStore } from "../../domain/identityaccount/resource-store.js";
|
|
21
|
+
import type { IdentityAccountStore } from "../../domain/identityaccount/store.js";
|
|
22
|
+
import { ScheduleFireCallerRefusedError } from "../../extensions/schedule-fire-caller.js";
|
|
23
|
+
import { ResourceNotFoundError } from "../../store/interface.js";
|
|
24
|
+
import {
|
|
25
|
+
newBuiltInScheduleFireCaller,
|
|
26
|
+
scheduleHasNoPersonMessage,
|
|
27
|
+
} from "../schedule-fire-caller.js";
|
|
28
|
+
import { driverFixtures, dropPostgresFixture } from "./drivers.js";
|
|
29
|
+
import type { OpenedStore } from "./drivers.js";
|
|
30
|
+
|
|
31
|
+
const SUBJECT = "auth0|carol";
|
|
32
|
+
const CAROL = accountIdFor(SUBJECT);
|
|
33
|
+
|
|
34
|
+
afterAll(dropPostgresFixture);
|
|
35
|
+
|
|
36
|
+
describe.each(
|
|
37
|
+
driverFixtures([ApiResourceKind.schedule, ApiResourceKind.identity_account]),
|
|
38
|
+
)("the built-in schedule fire caller on $name", (fixture) => {
|
|
39
|
+
describe.skipIf(fixture.skip)("mintFireCaller", () => {
|
|
40
|
+
let opened: OpenedStore;
|
|
41
|
+
let accounts: IdentityAccountStore;
|
|
42
|
+
|
|
43
|
+
beforeEach(async () => {
|
|
44
|
+
opened = await fixture.open();
|
|
45
|
+
accounts = newResourceIdentityAccountStore(opened.store);
|
|
46
|
+
await accounts.save(
|
|
47
|
+
create(IdentityAccountSchema, {
|
|
48
|
+
metadata: { id: CAROL, name: "Carol Danvers" },
|
|
49
|
+
spec: {
|
|
50
|
+
idpId: SUBJECT,
|
|
51
|
+
email: "carol@example.com",
|
|
52
|
+
provisioningMode: IdentityAccountProvisioningMode.direct,
|
|
53
|
+
},
|
|
54
|
+
}),
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
afterEach(async () => {
|
|
59
|
+
await opened.close();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
async function schedule(id: string, createdBy: string): Promise<void> {
|
|
63
|
+
await opened.store.saveResource(
|
|
64
|
+
ApiResourceKind.schedule,
|
|
65
|
+
id,
|
|
66
|
+
ScheduleSchema,
|
|
67
|
+
create(ScheduleSchema, {
|
|
68
|
+
metadata: { id, name: id, org: "acme" },
|
|
69
|
+
status: { audit: { specAudit: { createdBy: { id: createdBy } } } },
|
|
70
|
+
}),
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function mint() {
|
|
75
|
+
return newBuiltInScheduleFireCaller({ store: opened.store, accounts });
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
it("a schedule stamped with the creator's account id fires as that account, in the in-process identity shape", async () => {
|
|
79
|
+
await schedule("sch_by_id", CAROL);
|
|
80
|
+
expect(await mint().mintFireCaller("acme", "sch_by_id")).toEqual({
|
|
81
|
+
identityId: CAROL,
|
|
82
|
+
callerClass: "user",
|
|
83
|
+
issuer: "",
|
|
84
|
+
rawToken: "",
|
|
85
|
+
email: "carol@example.com",
|
|
86
|
+
displayName: "Carol Danvers",
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("a schedule stamped with the raw issuer subject (the 3.14.x shape) resolves to the same account", async () => {
|
|
91
|
+
await schedule("sch_by_sub", SUBJECT);
|
|
92
|
+
expect(
|
|
93
|
+
(await mint().mintFireCaller("acme", "sch_by_sub")).identityId,
|
|
94
|
+
).toBe(CAROL);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it.each([
|
|
98
|
+
["the empty stamp", ""],
|
|
99
|
+
["the laptop's placeholder", "system"],
|
|
100
|
+
["a trusted-local email stamp", "operator@example.com"],
|
|
101
|
+
["a deleted account", accountIdFor("auth0|gone")],
|
|
102
|
+
])(
|
|
103
|
+
"%s is the seam's deterministic refusal, with the copy the schedule's status carries",
|
|
104
|
+
async (_label, stamp) => {
|
|
105
|
+
await schedule("sch_nobody", stamp);
|
|
106
|
+
const failure = await mint()
|
|
107
|
+
.mintFireCaller("acme", "sch_nobody")
|
|
108
|
+
.catch((error: unknown) => error);
|
|
109
|
+
expect(failure).toBeInstanceOf(ScheduleFireCallerRefusedError);
|
|
110
|
+
expect((failure as Error).message).toBe(
|
|
111
|
+
scheduleHasNoPersonMessage("sch_nobody"),
|
|
112
|
+
);
|
|
113
|
+
},
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
it("a schedule that no longer exists is an infrastructure throw, never a refusal", async () => {
|
|
117
|
+
const failure = await mint()
|
|
118
|
+
.mintFireCaller("acme", "sch_missing")
|
|
119
|
+
.catch((error: unknown) => error);
|
|
120
|
+
expect(failure).toBeInstanceOf(ResourceNotFoundError);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it("a store fault reading the schedule propagates as the fault it is", async () => {
|
|
124
|
+
const fault = new Error("connection reset");
|
|
125
|
+
const failing = newBuiltInScheduleFireCaller({
|
|
126
|
+
store: { ...opened.store, getResource: () => Promise.reject(fault) },
|
|
127
|
+
accounts,
|
|
128
|
+
});
|
|
129
|
+
await expect(failing.mintFireCaller("acme", "sch_by_id")).rejects.toBe(
|
|
130
|
+
fault,
|
|
131
|
+
);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
});
|