@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,719 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pins the built-in Authorizer arm by arm, on both store drivers, against
|
|
3
|
+
* the cloud's driver it mirrors (stigmer-cloud src/authorizer/
|
|
4
|
+
* fga-authorizer.ts): the four pre-check denials with the Java copy; the
|
|
5
|
+
* unserved-kind denial (the server-side half of "nobody sets public
|
|
6
|
+
visibility on a self-host"); not-found for a
|
|
7
|
+
* missing target and a DENIAL for a missing row of an exempt kind (the
|
|
8
|
+
* cloud's probe scope, so account ids cannot be enumerated); allow and
|
|
9
|
+
* deny from the model over a seeded organization — the owner, an admin, a
|
|
10
|
+
* member, an outsider, an unprovisioned subject; the alias rule (a row
|
|
11
|
+
* stamped with the raw subject, read by the caller the verifier resolved
|
|
12
|
+
* to the account); an empty reason on a model denial so the annotation's
|
|
13
|
+
* copy wins; and every fault — a store outage, a person that names
|
|
14
|
+
* nobody, a broken model — as `unavailable` with its cause, never a
|
|
15
|
+
* denial and never a throw. The read count of one blueprint check is
|
|
16
|
+
* pinned as the cost the plan states.
|
|
17
|
+
*/
|
|
18
|
+
import { create } from "@bufbuild/protobuf";
|
|
19
|
+
import { afterAll, afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
20
|
+
|
|
21
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
22
|
+
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
23
|
+
import { IamPolicySchema } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/api_pb";
|
|
24
|
+
import { IdentityAccountSchema } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
25
|
+
import { IdentityAccountProvisioningMode } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/enum_pb";
|
|
26
|
+
import { IamPermission } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
|
|
27
|
+
import { ServerEdition } from "@stigmer/protos/ai/stigmer/platform/v1/server_info_pb";
|
|
28
|
+
|
|
29
|
+
import { createLogger } from "../../boot/logger.js";
|
|
30
|
+
import {
|
|
31
|
+
IAM_POLICY_API_VERSION,
|
|
32
|
+
IAM_POLICY_KIND,
|
|
33
|
+
policyIdFor,
|
|
34
|
+
} from "../../domain/iampolicy/constants.js";
|
|
35
|
+
import { newResourceIamPolicyStore } from "../../domain/iampolicy/resource-store.js";
|
|
36
|
+
import type { IamPolicyStore } from "../../domain/iampolicy/store.js";
|
|
37
|
+
import { orgRole } from "../../domain/iampolicy/__tests__/support.js";
|
|
38
|
+
import { accountIdFor } from "../../domain/identityaccount/constants.js";
|
|
39
|
+
import { newResourceIdentityAccountStore } from "../../domain/identityaccount/resource-store.js";
|
|
40
|
+
import type { IdentityAccountStore } from "../../domain/identityaccount/store.js";
|
|
41
|
+
import type { AuthzCheck, AuthzDecision } from "../../extensions/authorizer.js";
|
|
42
|
+
import type { CallerIdentity } from "../../extensions/identity.js";
|
|
43
|
+
import type { Store } from "../../store/interface.js";
|
|
44
|
+
import {
|
|
45
|
+
EMPTY_IDENTITY_DENY_REASON,
|
|
46
|
+
EMPTY_RESOURCE_ID_DENY_REASON,
|
|
47
|
+
NOT_FOUND_EXEMPT_KINDS,
|
|
48
|
+
UNKNOWN_KIND_DENY_REASON,
|
|
49
|
+
UNKNOWN_PERMISSION_DENY_REASON,
|
|
50
|
+
UNSERVED_KIND_DENY_REASON,
|
|
51
|
+
newBuiltInAuthorizer,
|
|
52
|
+
} from "../authorizer.js";
|
|
53
|
+
import { builtInModel, newModel } from "../model/index.js";
|
|
54
|
+
import type { KindDeclaration } from "../model/rewrite.js";
|
|
55
|
+
import { computed, declareKind } from "../model/rewrite.js";
|
|
56
|
+
import { driverFixtures, dropPostgresFixture } from "./drivers.js";
|
|
57
|
+
import type { OpenedStore } from "./drivers.js";
|
|
58
|
+
import { fixtureRow } from "./support.js";
|
|
59
|
+
|
|
60
|
+
const silentLogger = createLogger({
|
|
61
|
+
level: "error",
|
|
62
|
+
pretty: false,
|
|
63
|
+
write: () => {},
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// The people. Each has a subject and the account the subject derives.
|
|
67
|
+
const FOUNDER = person("auth0|founder");
|
|
68
|
+
const ADMIN = person("auth0|admin");
|
|
69
|
+
const MEMBER = person("auth0|member");
|
|
70
|
+
const OUTSIDER = person("auth0|outsider");
|
|
71
|
+
const STRANGER = person("auth0|stranger"); // never provisioned
|
|
72
|
+
|
|
73
|
+
function person(subject: string) {
|
|
74
|
+
return { subject, accountId: accountIdFor(subject) };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** A caller a verifier resolved to the account (the OSS verifiers' shape). */
|
|
78
|
+
function resolved(who: { accountId: string }): CallerIdentity {
|
|
79
|
+
return {
|
|
80
|
+
identityId: who.accountId,
|
|
81
|
+
callerClass: "user",
|
|
82
|
+
issuer: "https://issuer.example",
|
|
83
|
+
rawToken: "opaque",
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** A caller left idp-shaped, carrying `sub` in a decodable token (a composition verifier's shape; an unprovisioned subject). */
|
|
88
|
+
function idpShaped(who: { subject: string }): CallerIdentity {
|
|
89
|
+
const payload = Buffer.from(JSON.stringify({ sub: who.subject })).toString(
|
|
90
|
+
"base64url",
|
|
91
|
+
);
|
|
92
|
+
return {
|
|
93
|
+
identityId: who.subject,
|
|
94
|
+
callerClass: "user",
|
|
95
|
+
issuer: "https://issuer.example",
|
|
96
|
+
rawToken: `h.${payload}.unsigned`,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function check(
|
|
101
|
+
permission: IamPermission,
|
|
102
|
+
resourceKind: ApiResourceKind,
|
|
103
|
+
resourceId: string,
|
|
104
|
+
): AuthzCheck {
|
|
105
|
+
return { permission, resourceKind, resourceId };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function declared(type: string): KindDeclaration {
|
|
109
|
+
const declaration = builtInModel.byType(type);
|
|
110
|
+
if (declaration === undefined) {
|
|
111
|
+
throw new Error(`${type} is declared`);
|
|
112
|
+
}
|
|
113
|
+
return declaration;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const SEEDED_KINDS: ReadonlyArray<ApiResourceKind> = [
|
|
117
|
+
ApiResourceKind.iam_policy,
|
|
118
|
+
ApiResourceKind.identity_account,
|
|
119
|
+
ApiResourceKind.organization,
|
|
120
|
+
ApiResourceKind.agent,
|
|
121
|
+
ApiResourceKind.session,
|
|
122
|
+
ApiResourceKind.oauth_app,
|
|
123
|
+
];
|
|
124
|
+
|
|
125
|
+
afterAll(dropPostgresFixture);
|
|
126
|
+
|
|
127
|
+
describe("NOT_FOUND_EXEMPT_KINDS", () => {
|
|
128
|
+
it("is the cloud's probe exemption restricted to the kinds this edition serves — identity_account and iam_policy", () => {
|
|
129
|
+
expect([...NOT_FOUND_EXEMPT_KINDS].sort()).toEqual(
|
|
130
|
+
[ApiResourceKind.identity_account, ApiResourceKind.iam_policy].sort(),
|
|
131
|
+
);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
describe.each(driverFixtures(SEEDED_KINDS))(
|
|
136
|
+
"the built-in Authorizer on $name",
|
|
137
|
+
(fixture) => {
|
|
138
|
+
describe.skipIf(fixture.skip)("authorize", () => {
|
|
139
|
+
let opened: OpenedStore;
|
|
140
|
+
let policies: IamPolicyStore;
|
|
141
|
+
let accounts: IdentityAccountStore;
|
|
142
|
+
let storeReads: number;
|
|
143
|
+
|
|
144
|
+
/** The generic store with its reads counted (the cost pin). */
|
|
145
|
+
function countingStore(inner: Store): Store {
|
|
146
|
+
return {
|
|
147
|
+
...inner,
|
|
148
|
+
getResource(kind, id, schema) {
|
|
149
|
+
storeReads += 1;
|
|
150
|
+
return inner.getResource(kind, id, schema);
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function authorizer(
|
|
156
|
+
overrides: { store?: Store; edition?: ServerEdition } = {},
|
|
157
|
+
) {
|
|
158
|
+
return newBuiltInAuthorizer({
|
|
159
|
+
store: overrides.store ?? countingStore(opened.store),
|
|
160
|
+
policies,
|
|
161
|
+
accounts,
|
|
162
|
+
edition: overrides.edition ?? ServerEdition.oss,
|
|
163
|
+
logger: silentLogger,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
async function provision(who: { subject: string; accountId: string }) {
|
|
168
|
+
await accounts.save(
|
|
169
|
+
create(IdentityAccountSchema, {
|
|
170
|
+
metadata: { id: who.accountId, name: who.subject },
|
|
171
|
+
spec: {
|
|
172
|
+
idpId: who.subject,
|
|
173
|
+
provisioningMode: IdentityAccountProvisioningMode.direct,
|
|
174
|
+
},
|
|
175
|
+
}),
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
async function grant(spec: ReturnType<typeof orgRole>) {
|
|
180
|
+
await policies.save(
|
|
181
|
+
create(IamPolicySchema, {
|
|
182
|
+
apiVersion: IAM_POLICY_API_VERSION,
|
|
183
|
+
kind: IAM_POLICY_KIND,
|
|
184
|
+
metadata: { id: policyIdFor(spec) },
|
|
185
|
+
spec,
|
|
186
|
+
}),
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
async function seed(
|
|
191
|
+
type: string,
|
|
192
|
+
id: string,
|
|
193
|
+
facts: {
|
|
194
|
+
org: string;
|
|
195
|
+
visibility: ApiResourceVisibility;
|
|
196
|
+
createdBy: string;
|
|
197
|
+
spec?: Record<string, unknown>;
|
|
198
|
+
},
|
|
199
|
+
) {
|
|
200
|
+
const declaration = declared(type);
|
|
201
|
+
await opened.store.saveResource(
|
|
202
|
+
declaration.kind,
|
|
203
|
+
id,
|
|
204
|
+
declaration.schema,
|
|
205
|
+
fixtureRow(declaration, { id, ...facts }),
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
beforeEach(async () => {
|
|
210
|
+
opened = await fixture.open();
|
|
211
|
+
storeReads = 0;
|
|
212
|
+
policies = newResourceIamPolicyStore(opened.store);
|
|
213
|
+
accounts = newResourceIdentityAccountStore(opened.store);
|
|
214
|
+
for (const who of [FOUNDER, ADMIN, MEMBER, OUTSIDER]) {
|
|
215
|
+
await provision(who);
|
|
216
|
+
}
|
|
217
|
+
await seed("organization", "acme", {
|
|
218
|
+
org: "",
|
|
219
|
+
visibility: ApiResourceVisibility.visibility_private,
|
|
220
|
+
createdBy: FOUNDER.accountId,
|
|
221
|
+
});
|
|
222
|
+
await grant(orgRole(FOUNDER.accountId, "owner", "acme"));
|
|
223
|
+
await grant(orgRole(ADMIN.accountId, "admin", "acme"));
|
|
224
|
+
await grant(orgRole(MEMBER.accountId, "member", "acme"));
|
|
225
|
+
// The founder's blueprints: one private, one org-visible, one
|
|
226
|
+
// public; the org-visible one stamped with the founder's RAW
|
|
227
|
+
// subject (a row a 3.14.x verifier wrote), the others with the id.
|
|
228
|
+
await seed("agent", "agt_private", {
|
|
229
|
+
org: "acme",
|
|
230
|
+
visibility: ApiResourceVisibility.visibility_private,
|
|
231
|
+
createdBy: FOUNDER.accountId,
|
|
232
|
+
});
|
|
233
|
+
await seed("agent", "agt_org", {
|
|
234
|
+
org: "acme",
|
|
235
|
+
visibility: ApiResourceVisibility.visibility_org,
|
|
236
|
+
createdBy: FOUNDER.subject,
|
|
237
|
+
});
|
|
238
|
+
await seed("agent", "agt_public", {
|
|
239
|
+
org: "acme",
|
|
240
|
+
visibility: ApiResourceVisibility.visibility_public,
|
|
241
|
+
createdBy: FOUNDER.accountId,
|
|
242
|
+
});
|
|
243
|
+
// The member's own session — personal: nobody else reads it.
|
|
244
|
+
await seed("session", "ses_member", {
|
|
245
|
+
org: "acme",
|
|
246
|
+
visibility: ApiResourceVisibility.api_resource_visibility_unspecified,
|
|
247
|
+
createdBy: MEMBER.accountId,
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
afterEach(async () => {
|
|
252
|
+
await opened.close();
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
describe("the pre-check arms, in the cloud's order and copy", () => {
|
|
256
|
+
it.each([
|
|
257
|
+
[
|
|
258
|
+
"an unspecified permission",
|
|
259
|
+
resolved(FOUNDER),
|
|
260
|
+
check(
|
|
261
|
+
IamPermission.unspecified,
|
|
262
|
+
ApiResourceKind.agent,
|
|
263
|
+
"agt_private",
|
|
264
|
+
),
|
|
265
|
+
UNKNOWN_PERMISSION_DENY_REASON,
|
|
266
|
+
],
|
|
267
|
+
[
|
|
268
|
+
"an empty identity",
|
|
269
|
+
{ ...resolved(FOUNDER), identityId: "" },
|
|
270
|
+
check(IamPermission.can_view, ApiResourceKind.agent, "agt_private"),
|
|
271
|
+
EMPTY_IDENTITY_DENY_REASON,
|
|
272
|
+
],
|
|
273
|
+
[
|
|
274
|
+
"an empty resource id",
|
|
275
|
+
resolved(FOUNDER),
|
|
276
|
+
check(IamPermission.can_view, ApiResourceKind.agent, ""),
|
|
277
|
+
EMPTY_RESOURCE_ID_DENY_REASON,
|
|
278
|
+
],
|
|
279
|
+
[
|
|
280
|
+
"the unknown kind",
|
|
281
|
+
resolved(FOUNDER),
|
|
282
|
+
check(
|
|
283
|
+
IamPermission.can_view,
|
|
284
|
+
ApiResourceKind.api_resource_kind_unknown,
|
|
285
|
+
"x",
|
|
286
|
+
),
|
|
287
|
+
UNKNOWN_KIND_DENY_REASON,
|
|
288
|
+
],
|
|
289
|
+
[
|
|
290
|
+
"a kind this edition does not serve (platform — nobody sets public visibility)",
|
|
291
|
+
resolved(FOUNDER),
|
|
292
|
+
check(
|
|
293
|
+
IamPermission.can_set_public_visibility,
|
|
294
|
+
ApiResourceKind.platform,
|
|
295
|
+
"stigmer",
|
|
296
|
+
),
|
|
297
|
+
UNSERVED_KIND_DENY_REASON,
|
|
298
|
+
],
|
|
299
|
+
])(
|
|
300
|
+
"%s is a deny with the reason",
|
|
301
|
+
async (_label, caller, c, reason) => {
|
|
302
|
+
expect(await authorizer().authorize(caller, c)).toEqual({
|
|
303
|
+
kind: "deny",
|
|
304
|
+
reason,
|
|
305
|
+
});
|
|
306
|
+
expect(storeReads, "no row was read").toBe(0);
|
|
307
|
+
},
|
|
308
|
+
);
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
describe("the model's answers", () => {
|
|
312
|
+
it("the owner reads and edits their private agent; an admin reads and edits it; a member reads neither way", async () => {
|
|
313
|
+
const view = check(
|
|
314
|
+
IamPermission.can_view,
|
|
315
|
+
ApiResourceKind.agent,
|
|
316
|
+
"agt_private",
|
|
317
|
+
);
|
|
318
|
+
const edit = check(
|
|
319
|
+
IamPermission.can_edit,
|
|
320
|
+
ApiResourceKind.agent,
|
|
321
|
+
"agt_private",
|
|
322
|
+
);
|
|
323
|
+
const auth = authorizer();
|
|
324
|
+
expect(await auth.authorize(resolved(FOUNDER), view)).toEqual({
|
|
325
|
+
kind: "allow",
|
|
326
|
+
});
|
|
327
|
+
expect(await auth.authorize(resolved(FOUNDER), edit)).toEqual({
|
|
328
|
+
kind: "allow",
|
|
329
|
+
});
|
|
330
|
+
expect(await auth.authorize(resolved(ADMIN), view)).toEqual({
|
|
331
|
+
kind: "allow",
|
|
332
|
+
});
|
|
333
|
+
expect(await auth.authorize(resolved(ADMIN), edit)).toEqual({
|
|
334
|
+
kind: "allow",
|
|
335
|
+
});
|
|
336
|
+
expect(await auth.authorize(resolved(MEMBER), view)).toEqual({
|
|
337
|
+
kind: "deny",
|
|
338
|
+
reason: "",
|
|
339
|
+
});
|
|
340
|
+
expect(await auth.authorize(resolved(MEMBER), edit)).toEqual({
|
|
341
|
+
kind: "deny",
|
|
342
|
+
reason: "",
|
|
343
|
+
});
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
it("a member reads an org-visible agent and may not edit it; the alias rule lets its raw-subject-stamped owner edit", async () => {
|
|
347
|
+
const view = check(
|
|
348
|
+
IamPermission.can_view,
|
|
349
|
+
ApiResourceKind.agent,
|
|
350
|
+
"agt_org",
|
|
351
|
+
);
|
|
352
|
+
const edit = check(
|
|
353
|
+
IamPermission.can_edit,
|
|
354
|
+
ApiResourceKind.agent,
|
|
355
|
+
"agt_org",
|
|
356
|
+
);
|
|
357
|
+
const auth = authorizer();
|
|
358
|
+
expect(await auth.authorize(resolved(MEMBER), view)).toEqual({
|
|
359
|
+
kind: "allow",
|
|
360
|
+
});
|
|
361
|
+
expect(await auth.authorize(resolved(MEMBER), edit)).toEqual({
|
|
362
|
+
kind: "deny",
|
|
363
|
+
reason: "",
|
|
364
|
+
});
|
|
365
|
+
// The row is stamped `auth0|founder`; the caller is `ida_...`.
|
|
366
|
+
// The account's subject is the alias that matches.
|
|
367
|
+
expect(await auth.authorize(resolved(FOUNDER), edit)).toEqual({
|
|
368
|
+
kind: "allow",
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
it("an OAuth app is read by its creator and the organization's admins, and changed by its creator alone — the one org-scoped kind whose owner has no admin arm", async () => {
|
|
373
|
+
// No pinned store document covers oauth_app (the security read's
|
|
374
|
+
// fact 11), so its distinctive line is pinned here: `viewer` has
|
|
375
|
+
// `admin from organization`, `can_edit` and `can_delete` do not.
|
|
376
|
+
await seed("oauth_app", "oap_vendor", {
|
|
377
|
+
org: "acme",
|
|
378
|
+
visibility:
|
|
379
|
+
ApiResourceVisibility.api_resource_visibility_unspecified,
|
|
380
|
+
createdBy: MEMBER.accountId,
|
|
381
|
+
});
|
|
382
|
+
const view = check(
|
|
383
|
+
IamPermission.can_view,
|
|
384
|
+
ApiResourceKind.oauth_app,
|
|
385
|
+
"oap_vendor",
|
|
386
|
+
);
|
|
387
|
+
const edit = check(
|
|
388
|
+
IamPermission.can_edit,
|
|
389
|
+
ApiResourceKind.oauth_app,
|
|
390
|
+
"oap_vendor",
|
|
391
|
+
);
|
|
392
|
+
const remove = check(
|
|
393
|
+
IamPermission.can_delete,
|
|
394
|
+
ApiResourceKind.oauth_app,
|
|
395
|
+
"oap_vendor",
|
|
396
|
+
);
|
|
397
|
+
const auth = authorizer();
|
|
398
|
+
for (const c of [view, edit, remove]) {
|
|
399
|
+
expect(await auth.authorize(resolved(MEMBER), c)).toEqual({
|
|
400
|
+
kind: "allow",
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
expect(await auth.authorize(resolved(ADMIN), view)).toEqual({
|
|
404
|
+
kind: "allow",
|
|
405
|
+
});
|
|
406
|
+
expect(await auth.authorize(resolved(ADMIN), edit)).toEqual({
|
|
407
|
+
kind: "deny",
|
|
408
|
+
reason: "",
|
|
409
|
+
});
|
|
410
|
+
expect(await auth.authorize(resolved(ADMIN), remove)).toEqual({
|
|
411
|
+
kind: "deny",
|
|
412
|
+
reason: "",
|
|
413
|
+
});
|
|
414
|
+
// The organization's OWNER is an admin by the ladder: reads, does not change.
|
|
415
|
+
expect(await auth.authorize(resolved(FOUNDER), view)).toEqual({
|
|
416
|
+
kind: "allow",
|
|
417
|
+
});
|
|
418
|
+
expect(await auth.authorize(resolved(FOUNDER), edit)).toEqual({
|
|
419
|
+
kind: "deny",
|
|
420
|
+
reason: "",
|
|
421
|
+
});
|
|
422
|
+
expect(await auth.authorize(resolved(OUTSIDER), view)).toEqual({
|
|
423
|
+
kind: "deny",
|
|
424
|
+
reason: "",
|
|
425
|
+
});
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
it("an outsider on an EXISTING resource is DENIED, never not-found — the cloud's answer (finding 20 closed)", async () => {
|
|
429
|
+
const auth = authorizer();
|
|
430
|
+
expect(
|
|
431
|
+
await auth.authorize(
|
|
432
|
+
resolved(OUTSIDER),
|
|
433
|
+
check(IamPermission.can_view, ApiResourceKind.agent, "agt_org"),
|
|
434
|
+
),
|
|
435
|
+
).toEqual({ kind: "deny", reason: "" });
|
|
436
|
+
expect(
|
|
437
|
+
await auth.authorize(
|
|
438
|
+
resolved(OUTSIDER),
|
|
439
|
+
check(
|
|
440
|
+
IamPermission.can_view,
|
|
441
|
+
ApiResourceKind.organization,
|
|
442
|
+
"acme",
|
|
443
|
+
),
|
|
444
|
+
),
|
|
445
|
+
).toEqual({ kind: "deny", reason: "" });
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
it("a member's session is theirs alone: the admin and the owner of the organization are denied", async () => {
|
|
449
|
+
const view = check(
|
|
450
|
+
IamPermission.can_view,
|
|
451
|
+
ApiResourceKind.session,
|
|
452
|
+
"ses_member",
|
|
453
|
+
);
|
|
454
|
+
const auth = authorizer();
|
|
455
|
+
expect(await auth.authorize(resolved(MEMBER), view)).toEqual({
|
|
456
|
+
kind: "allow",
|
|
457
|
+
});
|
|
458
|
+
expect(await auth.authorize(resolved(ADMIN), view)).toEqual({
|
|
459
|
+
kind: "deny",
|
|
460
|
+
reason: "",
|
|
461
|
+
});
|
|
462
|
+
expect(await auth.authorize(resolved(FOUNDER), view)).toEqual({
|
|
463
|
+
kind: "deny",
|
|
464
|
+
reason: "",
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
it("an unprovisioned subject reads a PUBLIC agent (the point-check context honours the wildcard) and nothing private", async () => {
|
|
469
|
+
const auth = authorizer();
|
|
470
|
+
expect(
|
|
471
|
+
await auth.authorize(
|
|
472
|
+
idpShaped(STRANGER),
|
|
473
|
+
check(
|
|
474
|
+
IamPermission.can_view,
|
|
475
|
+
ApiResourceKind.agent,
|
|
476
|
+
"agt_public",
|
|
477
|
+
),
|
|
478
|
+
),
|
|
479
|
+
).toEqual({ kind: "allow" });
|
|
480
|
+
expect(
|
|
481
|
+
await auth.authorize(
|
|
482
|
+
idpShaped(STRANGER),
|
|
483
|
+
check(
|
|
484
|
+
IamPermission.can_view,
|
|
485
|
+
ApiResourceKind.agent,
|
|
486
|
+
"agt_private",
|
|
487
|
+
),
|
|
488
|
+
),
|
|
489
|
+
).toEqual({ kind: "deny", reason: "" });
|
|
490
|
+
expect(
|
|
491
|
+
await auth.authorize(
|
|
492
|
+
idpShaped(STRANGER),
|
|
493
|
+
check(
|
|
494
|
+
IamPermission.can_create_agent,
|
|
495
|
+
ApiResourceKind.organization,
|
|
496
|
+
"acme",
|
|
497
|
+
),
|
|
498
|
+
),
|
|
499
|
+
).toEqual({ kind: "deny", reason: "" });
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
it("a member may not create an agent (`admin`) and may create a session (`member`); an admin may create an agent", async () => {
|
|
503
|
+
const auth = authorizer();
|
|
504
|
+
expect(
|
|
505
|
+
await auth.authorize(
|
|
506
|
+
resolved(MEMBER),
|
|
507
|
+
check(
|
|
508
|
+
IamPermission.can_create_agent,
|
|
509
|
+
ApiResourceKind.organization,
|
|
510
|
+
"acme",
|
|
511
|
+
),
|
|
512
|
+
),
|
|
513
|
+
).toEqual({ kind: "deny", reason: "" });
|
|
514
|
+
expect(
|
|
515
|
+
await auth.authorize(
|
|
516
|
+
resolved(MEMBER),
|
|
517
|
+
check(
|
|
518
|
+
IamPermission.can_create_session,
|
|
519
|
+
ApiResourceKind.organization,
|
|
520
|
+
"acme",
|
|
521
|
+
),
|
|
522
|
+
),
|
|
523
|
+
).toEqual({ kind: "allow" });
|
|
524
|
+
expect(
|
|
525
|
+
await auth.authorize(
|
|
526
|
+
resolved(ADMIN),
|
|
527
|
+
check(
|
|
528
|
+
IamPermission.can_create_agent,
|
|
529
|
+
ApiResourceKind.organization,
|
|
530
|
+
"acme",
|
|
531
|
+
),
|
|
532
|
+
),
|
|
533
|
+
).toEqual({ kind: "allow" });
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
it("a person reads their own account and nobody else's (`owner` is self)", async () => {
|
|
537
|
+
const auth = authorizer();
|
|
538
|
+
expect(
|
|
539
|
+
await auth.authorize(
|
|
540
|
+
resolved(MEMBER),
|
|
541
|
+
check(
|
|
542
|
+
IamPermission.can_view,
|
|
543
|
+
ApiResourceKind.identity_account,
|
|
544
|
+
MEMBER.accountId,
|
|
545
|
+
),
|
|
546
|
+
),
|
|
547
|
+
).toEqual({ kind: "allow" });
|
|
548
|
+
expect(
|
|
549
|
+
await auth.authorize(
|
|
550
|
+
resolved(ADMIN),
|
|
551
|
+
check(
|
|
552
|
+
IamPermission.can_view,
|
|
553
|
+
ApiResourceKind.identity_account,
|
|
554
|
+
MEMBER.accountId,
|
|
555
|
+
),
|
|
556
|
+
),
|
|
557
|
+
).toEqual({ kind: "deny", reason: "" });
|
|
558
|
+
});
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
describe("the not-found arm", () => {
|
|
562
|
+
it("a target that does not exist is not-found, for a member and for an outsider alike", async () => {
|
|
563
|
+
const missing = check(
|
|
564
|
+
IamPermission.can_view,
|
|
565
|
+
ApiResourceKind.agent,
|
|
566
|
+
"agt_missing",
|
|
567
|
+
);
|
|
568
|
+
const auth = authorizer();
|
|
569
|
+
expect(await auth.authorize(resolved(MEMBER), missing)).toEqual({
|
|
570
|
+
kind: "not-found",
|
|
571
|
+
});
|
|
572
|
+
expect(await auth.authorize(resolved(OUTSIDER), missing)).toEqual({
|
|
573
|
+
kind: "not-found",
|
|
574
|
+
});
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
it("an organization named by a row but no longer held is not-found — you cannot create in an organization that does not exist", async () => {
|
|
578
|
+
expect(
|
|
579
|
+
await authorizer().authorize(
|
|
580
|
+
resolved(FOUNDER),
|
|
581
|
+
check(
|
|
582
|
+
IamPermission.can_create_agent,
|
|
583
|
+
ApiResourceKind.organization,
|
|
584
|
+
"ghost",
|
|
585
|
+
),
|
|
586
|
+
),
|
|
587
|
+
).toEqual({ kind: "not-found" });
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
it("a missing row of an EXEMPT kind is a denial, so an authenticated caller cannot enumerate account ids (the cloud's probe scope)", async () => {
|
|
591
|
+
expect(
|
|
592
|
+
await authorizer().authorize(
|
|
593
|
+
resolved(MEMBER),
|
|
594
|
+
check(
|
|
595
|
+
IamPermission.can_view,
|
|
596
|
+
ApiResourceKind.identity_account,
|
|
597
|
+
accountIdFor("auth0|nobody"),
|
|
598
|
+
),
|
|
599
|
+
),
|
|
600
|
+
).toEqual({ kind: "deny", reason: "" });
|
|
601
|
+
expect(
|
|
602
|
+
await authorizer().authorize(
|
|
603
|
+
resolved(MEMBER),
|
|
604
|
+
check(
|
|
605
|
+
IamPermission.can_view,
|
|
606
|
+
ApiResourceKind.iam_policy,
|
|
607
|
+
"pol_missing",
|
|
608
|
+
),
|
|
609
|
+
),
|
|
610
|
+
).toEqual({ kind: "deny", reason: "" });
|
|
611
|
+
});
|
|
612
|
+
});
|
|
613
|
+
|
|
614
|
+
describe("faults are `unavailable`, never a denial and never a throw", () => {
|
|
615
|
+
it("a store fault reading the target carries its cause", async () => {
|
|
616
|
+
const fault = new Error("connection reset");
|
|
617
|
+
const decision = await authorizer({
|
|
618
|
+
store: {
|
|
619
|
+
...opened.store,
|
|
620
|
+
getResource: () => Promise.reject(fault),
|
|
621
|
+
},
|
|
622
|
+
}).authorize(
|
|
623
|
+
resolved(FOUNDER),
|
|
624
|
+
check(IamPermission.can_view, ApiResourceKind.agent, "agt_private"),
|
|
625
|
+
);
|
|
626
|
+
expect(decision.kind).toBe("unavailable");
|
|
627
|
+
expect((decision as { cause: Error }).cause).toBe(fault);
|
|
628
|
+
});
|
|
629
|
+
|
|
630
|
+
it("a caller who names no person (the laptop's placeholder) is a fault, not a denial", async () => {
|
|
631
|
+
const decision = await authorizer().authorize(
|
|
632
|
+
{
|
|
633
|
+
...resolved(FOUNDER),
|
|
634
|
+
identityId: "system",
|
|
635
|
+
rawToken: "",
|
|
636
|
+
issuer: "",
|
|
637
|
+
},
|
|
638
|
+
check(IamPermission.can_view, ApiResourceKind.agent, "agt_private"),
|
|
639
|
+
);
|
|
640
|
+
expect(decision.kind).toBe("unavailable");
|
|
641
|
+
expect((decision as { cause: Error }).cause.message).toContain(
|
|
642
|
+
"names no person",
|
|
643
|
+
);
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
it("a broken model (a relation cycle) is a fault, not a lockout", async () => {
|
|
647
|
+
const cyclic = declareKind({
|
|
648
|
+
kind: ApiResourceKind.agent,
|
|
649
|
+
schema: declared("agent").schema,
|
|
650
|
+
source: "test",
|
|
651
|
+
relations: [
|
|
652
|
+
["a", computed("b")],
|
|
653
|
+
["b", computed("a")],
|
|
654
|
+
["can_view", computed("a")],
|
|
655
|
+
],
|
|
656
|
+
});
|
|
657
|
+
const decision = await newBuiltInAuthorizer({
|
|
658
|
+
store: opened.store,
|
|
659
|
+
policies,
|
|
660
|
+
accounts,
|
|
661
|
+
edition: ServerEdition.oss,
|
|
662
|
+
logger: silentLogger,
|
|
663
|
+
model: newModel([cyclic]),
|
|
664
|
+
}).authorize(
|
|
665
|
+
resolved(FOUNDER),
|
|
666
|
+
check(IamPermission.can_view, ApiResourceKind.agent, "agt_private"),
|
|
667
|
+
);
|
|
668
|
+
expect(decision.kind).toBe("unavailable");
|
|
669
|
+
expect((decision as { cause: Error }).cause.name).toBe(
|
|
670
|
+
"AuthorizationEvaluationError",
|
|
671
|
+
);
|
|
672
|
+
});
|
|
673
|
+
});
|
|
674
|
+
|
|
675
|
+
describe("cost", () => {
|
|
676
|
+
it("one blueprint point check reads the target once and the account once — three reads through the port and the store in all", async () => {
|
|
677
|
+
const reads = { store: 0, accounts: 0, policies: 0 };
|
|
678
|
+
const auth = newBuiltInAuthorizer({
|
|
679
|
+
store: {
|
|
680
|
+
...opened.store,
|
|
681
|
+
getResource(kind, id, schema) {
|
|
682
|
+
reads.store += 1;
|
|
683
|
+
return opened.store.getResource(kind, id, schema);
|
|
684
|
+
},
|
|
685
|
+
},
|
|
686
|
+
policies: {
|
|
687
|
+
...policies,
|
|
688
|
+
findByPrincipal(principalKind, principalId) {
|
|
689
|
+
reads.policies += 1;
|
|
690
|
+
return policies.findByPrincipal(principalKind, principalId);
|
|
691
|
+
},
|
|
692
|
+
},
|
|
693
|
+
accounts: {
|
|
694
|
+
findById(id) {
|
|
695
|
+
reads.accounts += 1;
|
|
696
|
+
return accounts.findById(id);
|
|
697
|
+
},
|
|
698
|
+
findDirectByIdpId(idpId) {
|
|
699
|
+
reads.accounts += 1;
|
|
700
|
+
return accounts.findDirectByIdpId(idpId);
|
|
701
|
+
},
|
|
702
|
+
},
|
|
703
|
+
edition: ServerEdition.oss,
|
|
704
|
+
logger: silentLogger,
|
|
705
|
+
});
|
|
706
|
+
const decision: AuthzDecision = await auth.authorize(
|
|
707
|
+
resolved(MEMBER),
|
|
708
|
+
check(IamPermission.can_view, ApiResourceKind.agent, "agt_org"),
|
|
709
|
+
);
|
|
710
|
+
expect(decision).toEqual({ kind: "allow" });
|
|
711
|
+
// The agent row once (the loader's memo serves the derivation
|
|
712
|
+
// and the walk); the organization row once (the `viewer`
|
|
713
|
+
// userset hop); the member's account once (resolved by id).
|
|
714
|
+
expect(reads).toEqual({ store: 2, accounts: 1, policies: 1 });
|
|
715
|
+
});
|
|
716
|
+
});
|
|
717
|
+
});
|
|
718
|
+
},
|
|
719
|
+
);
|