@stigmer/server 3.27.1 → 3.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/authorization/authorizer.d.ts +7 -5
- package/dist/authorization/authorizer.d.ts.map +1 -1
- package/dist/authorization/authorizer.js +7 -5
- package/dist/authorization/authorizer.js.map +1 -1
- package/dist/authorization/derived-tuples.d.ts +3 -1
- package/dist/authorization/derived-tuples.d.ts.map +1 -1
- package/dist/authorization/derived-tuples.js +52 -2
- package/dist/authorization/derived-tuples.js.map +1 -1
- package/dist/authorization/evaluator.d.ts +9 -10
- package/dist/authorization/evaluator.d.ts.map +1 -1
- package/dist/authorization/evaluator.js.map +1 -1
- package/dist/authorization/list-read-scope.d.ts.map +1 -1
- package/dist/authorization/list-read-scope.js +29 -18
- package/dist/authorization/list-read-scope.js.map +1 -1
- package/dist/authorization/model/bindings.d.ts +41 -0
- package/dist/authorization/model/bindings.d.ts.map +1 -0
- package/dist/authorization/model/bindings.js +89 -0
- package/dist/authorization/model/bindings.js.map +1 -0
- package/dist/authorization/model/data/authorization-model.json +3114 -0
- package/dist/authorization/model/default-of.d.ts +2 -2
- package/dist/authorization/model/execution-viewer.d.ts +3 -0
- package/dist/authorization/model/execution-viewer.d.ts.map +1 -0
- package/dist/authorization/model/execution-viewer.js +50 -0
- package/dist/authorization/model/execution-viewer.js.map +1 -0
- package/dist/authorization/model/index.d.ts +33 -21
- package/dist/authorization/model/index.d.ts.map +1 -1
- package/dist/authorization/model/index.js +74 -52
- package/dist/authorization/model/index.js.map +1 -1
- package/dist/authorization/model/openfga-json.d.ts +18 -0
- package/dist/authorization/model/openfga-json.d.ts.map +1 -0
- package/dist/authorization/model/openfga-json.js +266 -0
- package/dist/authorization/model/openfga-json.js.map +1 -0
- package/dist/authorization/model/rewrite.d.ts +39 -67
- package/dist/authorization/model/rewrite.d.ts.map +1 -1
- package/dist/authorization/model/rewrite.js +1 -117
- package/dist/authorization/model/rewrite.js.map +1 -1
- package/dist/authorization/strict-json.d.ts +20 -0
- package/dist/authorization/strict-json.d.ts.map +1 -0
- package/dist/authorization/strict-json.js +45 -0
- package/dist/authorization/strict-json.js.map +1 -0
- package/dist/boot/compose.d.ts.map +1 -1
- package/dist/boot/compose.js +9 -7
- package/dist/boot/compose.js.map +1 -1
- package/dist/boot/list-indexes.d.ts.map +1 -1
- package/dist/boot/list-indexes.js +6 -0
- package/dist/boot/list-indexes.js.map +1 -1
- package/dist/domain/iampolicy/list-index.d.ts +2 -0
- package/dist/domain/iampolicy/list-index.d.ts.map +1 -0
- package/dist/domain/iampolicy/list-index.js +32 -0
- package/dist/domain/iampolicy/list-index.js.map +1 -0
- package/dist/domain/iampolicy/resource-store.d.ts.map +1 -1
- package/dist/domain/iampolicy/resource-store.js +24 -11
- package/dist/domain/iampolicy/resource-store.js.map +1 -1
- package/dist/domain/workflowexecution/list-index.d.ts +1 -1
- package/dist/extensions/list-read-scope.d.ts +20 -3
- package/dist/extensions/list-read-scope.d.ts.map +1 -1
- package/dist/extensions/list-read-scope.js +22 -2
- package/dist/extensions/list-read-scope.js.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- package/src/authorization/README.md +48 -39
- package/src/authorization/__tests__/authorizer.test.ts +5 -14
- package/src/authorization/__tests__/derived-tuples.test.ts +192 -17
- package/src/authorization/__tests__/evaluator.test.ts +53 -160
- package/src/authorization/__tests__/facts.test.ts +5 -11
- package/src/authorization/__tests__/list-read-scope.measure.test.ts +424 -62
- package/src/authorization/__tests__/list-read-scope.test.ts +15 -14
- package/src/authorization/__tests__/organization-directory.test.ts +2 -2
- package/src/authorization/__tests__/store-test-kit.ts +246 -0
- package/src/authorization/__tests__/store-tests.test.ts +91 -223
- package/src/authorization/__tests__/support.ts +30 -2
- package/src/authorization/__tests__/throwaway-model.ts +75 -0
- package/src/authorization/__tests__/wire-permissions.test.ts +141 -107
- package/src/authorization/authorizer.ts +7 -5
- package/src/authorization/derived-tuples.ts +105 -16
- package/src/authorization/evaluator.ts +8 -10
- package/src/authorization/list-read-scope.ts +37 -22
- package/src/authorization/model/__tests__/openfga-json.test.ts +353 -0
- package/src/authorization/model/__tests__/registry.test.ts +102 -276
- package/src/authorization/model/bindings.ts +131 -0
- package/src/authorization/model/data/authorization-model.json +3114 -0
- package/src/authorization/model/default-of.ts +2 -2
- package/src/authorization/model/execution-viewer.ts +56 -0
- package/src/authorization/model/index.ts +81 -72
- package/src/authorization/model/openfga-json.ts +310 -0
- package/src/authorization/model/rewrite.ts +39 -188
- package/src/authorization/strict-json.ts +52 -0
- package/src/boot/__tests__/list-indexes.test.ts +4 -0
- package/src/boot/compose.ts +9 -7
- package/src/boot/list-indexes.ts +6 -0
- package/src/domain/iampolicy/__tests__/resource-store.test.ts +65 -5
- package/src/domain/iampolicy/list-index.ts +33 -0
- package/src/domain/iampolicy/resource-store.ts +24 -11
- package/src/extensions/__tests__/built-in-authorization-composed.test.ts +3 -6
- package/src/extensions/list-read-scope.ts +32 -4
- package/src/index.ts +20 -44
- package/dist/authorization/model/agent.d.ts +0 -2
- package/dist/authorization/model/agent.d.ts.map +0 -1
- package/dist/authorization/model/agent.js +0 -43
- package/dist/authorization/model/agent.js.map +0 -1
- package/dist/authorization/model/agent_channel.d.ts +0 -2
- package/dist/authorization/model/agent_channel.d.ts.map +0 -1
- package/dist/authorization/model/agent_channel.js +0 -39
- package/dist/authorization/model/agent_channel.js.map +0 -1
- package/dist/authorization/model/agent_execution.d.ts +0 -2
- package/dist/authorization/model/agent_execution.d.ts.map +0 -1
- package/dist/authorization/model/agent_execution.js +0 -25
- package/dist/authorization/model/agent_execution.js.map +0 -1
- package/dist/authorization/model/agent_instance.d.ts +0 -2
- package/dist/authorization/model/agent_instance.d.ts.map +0 -1
- package/dist/authorization/model/agent_instance.js +0 -48
- package/dist/authorization/model/agent_instance.js.map +0 -1
- package/dist/authorization/model/agent_share.d.ts +0 -2
- package/dist/authorization/model/agent_share.d.ts.map +0 -1
- package/dist/authorization/model/agent_share.js +0 -29
- package/dist/authorization/model/agent_share.js.map +0 -1
- package/dist/authorization/model/api_key.d.ts +0 -2
- package/dist/authorization/model/api_key.d.ts.map +0 -1
- package/dist/authorization/model/api_key.js +0 -27
- package/dist/authorization/model/api_key.js.map +0 -1
- package/dist/authorization/model/artifact.d.ts +0 -2
- package/dist/authorization/model/artifact.d.ts.map +0 -1
- package/dist/authorization/model/artifact.js +0 -27
- package/dist/authorization/model/artifact.js.map +0 -1
- package/dist/authorization/model/channel_app.d.ts +0 -2
- package/dist/authorization/model/channel_app.d.ts.map +0 -1
- package/dist/authorization/model/channel_app.js +0 -28
- package/dist/authorization/model/channel_app.js.map +0 -1
- package/dist/authorization/model/environment.d.ts +0 -2
- package/dist/authorization/model/environment.d.ts.map +0 -1
- package/dist/authorization/model/environment.js +0 -33
- package/dist/authorization/model/environment.js.map +0 -1
- package/dist/authorization/model/execution_context.d.ts +0 -2
- package/dist/authorization/model/execution_context.d.ts.map +0 -1
- package/dist/authorization/model/execution_context.js +0 -19
- package/dist/authorization/model/execution_context.js.map +0 -1
- package/dist/authorization/model/iam_policy.d.ts +0 -2
- package/dist/authorization/model/iam_policy.d.ts.map +0 -1
- package/dist/authorization/model/iam_policy.js +0 -31
- package/dist/authorization/model/iam_policy.js.map +0 -1
- package/dist/authorization/model/identity_account.d.ts +0 -2
- package/dist/authorization/model/identity_account.d.ts.map +0 -1
- package/dist/authorization/model/identity_account.js +0 -25
- package/dist/authorization/model/identity_account.js.map +0 -1
- package/dist/authorization/model/mcp_server.d.ts +0 -2
- package/dist/authorization/model/mcp_server.d.ts.map +0 -1
- package/dist/authorization/model/mcp_server.js +0 -38
- package/dist/authorization/model/mcp_server.js.map +0 -1
- package/dist/authorization/model/memory.d.ts +0 -2
- package/dist/authorization/model/memory.d.ts.map +0 -1
- package/dist/authorization/model/memory.js +0 -26
- package/dist/authorization/model/memory.js.map +0 -1
- package/dist/authorization/model/oauth_app.d.ts +0 -2
- package/dist/authorization/model/oauth_app.d.ts.map +0 -1
- package/dist/authorization/model/oauth_app.js +0 -31
- package/dist/authorization/model/oauth_app.js.map +0 -1
- package/dist/authorization/model/organization.d.ts +0 -2
- package/dist/authorization/model/organization.d.ts.map +0 -1
- package/dist/authorization/model/organization.js +0 -58
- package/dist/authorization/model/organization.js.map +0 -1
- package/dist/authorization/model/platform_client.d.ts +0 -2
- package/dist/authorization/model/platform_client.d.ts.map +0 -1
- package/dist/authorization/model/platform_client.js +0 -31
- package/dist/authorization/model/platform_client.js.map +0 -1
- package/dist/authorization/model/plugin.d.ts +0 -2
- package/dist/authorization/model/plugin.d.ts.map +0 -1
- package/dist/authorization/model/plugin.js +0 -45
- package/dist/authorization/model/plugin.js.map +0 -1
- package/dist/authorization/model/schedule.d.ts +0 -2
- package/dist/authorization/model/schedule.d.ts.map +0 -1
- package/dist/authorization/model/schedule.js +0 -34
- package/dist/authorization/model/schedule.js.map +0 -1
- package/dist/authorization/model/session.d.ts +0 -2
- package/dist/authorization/model/session.d.ts.map +0 -1
- package/dist/authorization/model/session.js +0 -38
- package/dist/authorization/model/session.js.map +0 -1
- package/dist/authorization/model/skill.d.ts +0 -2
- package/dist/authorization/model/skill.d.ts.map +0 -1
- package/dist/authorization/model/skill.js +0 -39
- package/dist/authorization/model/skill.js.map +0 -1
- package/dist/authorization/model/workflow.d.ts +0 -2
- package/dist/authorization/model/workflow.d.ts.map +0 -1
- package/dist/authorization/model/workflow.js +0 -39
- package/dist/authorization/model/workflow.js.map +0 -1
- package/dist/authorization/model/workflow_execution.d.ts +0 -2
- package/dist/authorization/model/workflow_execution.d.ts.map +0 -1
- package/dist/authorization/model/workflow_execution.js +0 -33
- package/dist/authorization/model/workflow_execution.js.map +0 -1
- package/dist/authorization/model/workflow_instance.d.ts +0 -2
- package/dist/authorization/model/workflow_instance.d.ts.map +0 -1
- package/dist/authorization/model/workflow_instance.js +0 -96
- package/dist/authorization/model/workflow_instance.js.map +0 -1
- package/dist/authorization/store-test-kit.d.ts +0 -62
- package/dist/authorization/store-test-kit.d.ts.map +0 -1
- package/dist/authorization/store-test-kit.js +0 -265
- package/dist/authorization/store-test-kit.js.map +0 -1
- package/src/authorization/__tests__/fixtures/fga/agent-channel-owner.fga.yaml +0 -112
- package/src/authorization/__tests__/fixtures/fga/agent-instance-creation.fga.yaml +0 -177
- package/src/authorization/__tests__/fixtures/fga/agent-share-owner.fga.yaml +0 -109
- package/src/authorization/__tests__/fixtures/fga/artifact-org-and-owner.fga.yaml +0 -128
- package/src/authorization/__tests__/fixtures/fga/blueprint-private-visibility.fga.yaml +0 -318
- package/src/authorization/__tests__/fixtures/fga/channel-app-owner.fga.yaml +0 -125
- package/src/authorization/__tests__/fixtures/fga/channel-participation.fga.yaml +0 -201
- package/src/authorization/__tests__/fixtures/fga/channel-session-visibility.fga.yaml +0 -187
- package/src/authorization/__tests__/fixtures/fga/default-instance-inheritance.fga.yaml +0 -214
- package/src/authorization/__tests__/fixtures/fga/mcp-server-authoring.fga.yaml +0 -129
- package/src/authorization/__tests__/fixtures/fga/memory-subject-only.fga.yaml +0 -72
- package/src/authorization/__tests__/fixtures/fga/org-admin-owner-inheritance.fga.yaml +0 -308
- package/src/authorization/__tests__/fixtures/fga/org-shared-environment.fga.yaml +0 -144
- package/src/authorization/__tests__/fixtures/fga/platform-visibility.fga.yaml +0 -199
- package/src/authorization/__tests__/fixtures/fga/provider-standing-viewer.fga.yaml +0 -40
- package/src/authorization/__tests__/fixtures/fga/reserved-label-writer.fga.yaml +0 -41
- package/src/authorization/__tests__/fixtures/fga/schedule-owner.fga.yaml +0 -113
- package/src/authorization/__tests__/fixtures/fga/schedule-session-visibility.fga.yaml +0 -214
- package/src/authorization/__tests__/fixtures/fga/session-personal-resource.fga.yaml +0 -117
- package/src/authorization/__tests__/fixtures/fga/workflow-execution-sharing.fga.yaml +0 -190
- package/src/authorization/model/agent.ts +0 -64
- package/src/authorization/model/agent_channel.ts +0 -57
- package/src/authorization/model/agent_execution.ts +0 -33
- package/src/authorization/model/agent_instance.ts +0 -66
- package/src/authorization/model/agent_share.ts +0 -40
- package/src/authorization/model/api_key.ts +0 -28
- package/src/authorization/model/artifact.ts +0 -38
- package/src/authorization/model/channel_app.ts +0 -39
- package/src/authorization/model/environment.ts +0 -48
- package/src/authorization/model/execution_context.ts +0 -20
- package/src/authorization/model/iam_policy.ts +0 -42
- package/src/authorization/model/identity_account.ts +0 -26
- package/src/authorization/model/mcp_server.ts +0 -59
- package/src/authorization/model/memory.ts +0 -27
- package/src/authorization/model/oauth_app.ts +0 -43
- package/src/authorization/model/organization.ts +0 -59
- package/src/authorization/model/platform_client.ts +0 -43
- package/src/authorization/model/plugin.ts +0 -66
- package/src/authorization/model/schedule.ts +0 -49
- package/src/authorization/model/session.ts +0 -50
- package/src/authorization/model/skill.ts +0 -60
- package/src/authorization/model/workflow.ts +0 -60
- package/src/authorization/model/workflow_execution.ts +0 -46
- package/src/authorization/model/workflow_instance.ts +0 -125
- package/src/authorization/store-test-kit.ts +0 -395
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
# Pinned copy of stigmer-cloud backend/services/stigmer-server/fga/tests/blueprint-private-visibility.fga.yaml
|
|
2
|
-
# as changed by stigmer-cloud#765 (the OpenFGA store test the cloud runs against its live model).
|
|
3
|
-
# The body below is byte-identical to the source; the cloud re-runs the LIVE
|
|
4
|
-
# file against this evaluator at the re-pin, so a stale copy is caught there.
|
|
5
|
-
# Store tests for real blueprint privacy (Phase 3 of the visibility model).
|
|
6
|
-
#
|
|
7
|
-
# Blueprint viewer relations no longer include the unconditional
|
|
8
|
-
# `viewer from organization` grant: a PRIVATE blueprint is invisible to the
|
|
9
|
-
# rest of its own org. Every broader level is an explicit tuple written by
|
|
10
|
-
# VisibilityTupleReconciler:
|
|
11
|
-
#
|
|
12
|
-
# ORG viewer@organization:<org>#viewer (the org's FULL read audience —
|
|
13
|
-
# every role satisfies organization#viewer, including read-only
|
|
14
|
-
# viewers; pre-cloud#257 tuples carried #member, which excluded
|
|
15
|
-
# viewer-role users — still honored until backfilled, see the
|
|
16
|
-
# legacy-bot fixture)
|
|
17
|
-
# PLATFORM platform_viewer@identity_provider:<idp>#platform_user + the ORG tuple
|
|
18
|
-
#
|
|
19
|
-
# Read vs spend: an org viewer-role user READS org-visible blueprints (and, at
|
|
20
|
-
# the model level, satisfies can_execute — run-what-you-can-read), but every
|
|
21
|
-
# spend path is gated in Java on the org-level can_create_session /
|
|
22
|
-
# can_create_execution_in permissions, which require member-or-guest. The
|
|
23
|
-
# vera assertions pin both halves of that contract.
|
|
24
|
-
#
|
|
25
|
-
# The ORG tuple rides along on PLATFORM (the "org floor") so a shared
|
|
26
|
-
# blueprint stays listable in its own org.
|
|
27
|
-
#
|
|
28
|
-
# T08 exception: org ADMINS (and org owners, via the role hierarchy) are
|
|
29
|
-
# composed into blueprint `owner` and therefore see, list, and manage
|
|
30
|
-
# PRIVATE blueprints — the GitHub-org-admin model. "Private is real" now
|
|
31
|
-
# means: invisible to plain members, never to org admins. Pinned by the
|
|
32
|
-
# oscar (org admin) assertions below.
|
|
33
|
-
#
|
|
34
|
-
# Run with:
|
|
35
|
-
# fga model test --tests blueprint-private-visibility.fga.yaml
|
|
36
|
-
#
|
|
37
|
-
# Scenario: org "acme" has owner-creator carol, org admin oscar, plain
|
|
38
|
-
# member dave, and read-only viewer vera (the role SSO auto-provisioning
|
|
39
|
-
# grants by default); mallory belongs to an unrelated org. Carol authors one
|
|
40
|
-
# blueprint of each kind at PRIVATE, plus an ORG agent and a legacy ORG
|
|
41
|
-
# agent whose tuple still carries the pre-cloud#257 shape.
|
|
42
|
-
name: blueprint-private-visibility
|
|
43
|
-
model_file: ../model/fga.mod
|
|
44
|
-
|
|
45
|
-
tuples:
|
|
46
|
-
# --- Org memberships ---
|
|
47
|
-
- user: identity_account:carol
|
|
48
|
-
relation: owner
|
|
49
|
-
object: organization:acme
|
|
50
|
-
- user: identity_account:oscar
|
|
51
|
-
relation: admin
|
|
52
|
-
object: organization:acme
|
|
53
|
-
- user: identity_account:dave
|
|
54
|
-
relation: member
|
|
55
|
-
object: organization:acme
|
|
56
|
-
- user: identity_account:vera
|
|
57
|
-
relation: viewer
|
|
58
|
-
object: organization:acme
|
|
59
|
-
- user: identity_account:mallory
|
|
60
|
-
relation: member
|
|
61
|
-
object: organization:outsider
|
|
62
|
-
|
|
63
|
-
# --- PRIVATE blueprints (no visibility tuples at all) ---
|
|
64
|
-
- user: organization:acme
|
|
65
|
-
relation: organization
|
|
66
|
-
object: agent:secret-bot
|
|
67
|
-
- user: identity_account:carol
|
|
68
|
-
relation: owner
|
|
69
|
-
object: agent:secret-bot
|
|
70
|
-
- user: organization:acme
|
|
71
|
-
relation: organization
|
|
72
|
-
object: skill:secret-notes
|
|
73
|
-
- user: identity_account:carol
|
|
74
|
-
relation: owner
|
|
75
|
-
object: skill:secret-notes
|
|
76
|
-
- user: organization:acme
|
|
77
|
-
relation: organization
|
|
78
|
-
object: workflow:secret-flow
|
|
79
|
-
- user: identity_account:carol
|
|
80
|
-
relation: owner
|
|
81
|
-
object: workflow:secret-flow
|
|
82
|
-
- user: organization:acme
|
|
83
|
-
relation: organization
|
|
84
|
-
object: mcp_server:secret-tools
|
|
85
|
-
- user: identity_account:carol
|
|
86
|
-
relation: owner
|
|
87
|
-
object: mcp_server:secret-tools
|
|
88
|
-
|
|
89
|
-
# --- ORG-visible agent (explicit org viewer tuple, cloud#257 shape) ---
|
|
90
|
-
- user: organization:acme
|
|
91
|
-
relation: organization
|
|
92
|
-
object: agent:team-bot
|
|
93
|
-
- user: identity_account:carol
|
|
94
|
-
relation: owner
|
|
95
|
-
object: agent:team-bot
|
|
96
|
-
- user: organization:acme#viewer
|
|
97
|
-
relation: viewer
|
|
98
|
-
object: agent:team-bot
|
|
99
|
-
|
|
100
|
-
# --- ORG-visible agent with the LEGACY pre-cloud#257 tuple shape ---
|
|
101
|
-
# Pins two transition facts until the boot backfill converges prod tuples:
|
|
102
|
-
# members must keep their access through the old shape, and viewer-role
|
|
103
|
-
# users are still refused by it (the cloud#257 defect, alive on legacy
|
|
104
|
-
# tuples only).
|
|
105
|
-
- user: organization:acme
|
|
106
|
-
relation: organization
|
|
107
|
-
object: agent:legacy-bot
|
|
108
|
-
- user: identity_account:carol
|
|
109
|
-
relation: owner
|
|
110
|
-
object: agent:legacy-bot
|
|
111
|
-
- user: organization:acme#member
|
|
112
|
-
relation: viewer
|
|
113
|
-
object: agent:legacy-bot
|
|
114
|
-
|
|
115
|
-
# --- PRIVATE agent with an explicit individual viewer grant ---
|
|
116
|
-
- user: organization:acme
|
|
117
|
-
relation: organization
|
|
118
|
-
object: agent:shared-secret
|
|
119
|
-
- user: identity_account:carol
|
|
120
|
-
relation: owner
|
|
121
|
-
object: agent:shared-secret
|
|
122
|
-
- user: identity_account:dave
|
|
123
|
-
relation: viewer
|
|
124
|
-
object: agent:shared-secret
|
|
125
|
-
|
|
126
|
-
tests:
|
|
127
|
-
- name: private blueprints are invisible to fellow org members (all four kinds)
|
|
128
|
-
check:
|
|
129
|
-
- user: identity_account:dave
|
|
130
|
-
object: agent:secret-bot
|
|
131
|
-
assertions:
|
|
132
|
-
can_view: false
|
|
133
|
-
can_execute: false
|
|
134
|
-
can_create_instance: false
|
|
135
|
-
can_clone: false
|
|
136
|
-
- user: identity_account:dave
|
|
137
|
-
object: skill:secret-notes
|
|
138
|
-
assertions:
|
|
139
|
-
can_view: false
|
|
140
|
-
can_use: false
|
|
141
|
-
- user: identity_account:dave
|
|
142
|
-
object: workflow:secret-flow
|
|
143
|
-
assertions:
|
|
144
|
-
can_view: false
|
|
145
|
-
can_execute: false
|
|
146
|
-
- user: identity_account:dave
|
|
147
|
-
object: mcp_server:secret-tools
|
|
148
|
-
assertions:
|
|
149
|
-
can_view: false
|
|
150
|
-
can_use: false
|
|
151
|
-
can_connect: false
|
|
152
|
-
|
|
153
|
-
- name: org admin sees and manages private blueprints of every kind (T08)
|
|
154
|
-
check:
|
|
155
|
-
- user: identity_account:oscar
|
|
156
|
-
object: agent:secret-bot
|
|
157
|
-
assertions:
|
|
158
|
-
can_view: true
|
|
159
|
-
can_edit: true
|
|
160
|
-
can_delete: true
|
|
161
|
-
can_execute: true
|
|
162
|
-
- user: identity_account:oscar
|
|
163
|
-
object: skill:secret-notes
|
|
164
|
-
assertions:
|
|
165
|
-
can_view: true
|
|
166
|
-
can_edit: true
|
|
167
|
-
- user: identity_account:oscar
|
|
168
|
-
object: workflow:secret-flow
|
|
169
|
-
assertions:
|
|
170
|
-
can_view: true
|
|
171
|
-
can_edit: true
|
|
172
|
-
# mcp_server had admin inheritance before T08 — asserted here so all
|
|
173
|
-
# four private-blueprint kinds are pinned to the same rule.
|
|
174
|
-
- user: identity_account:oscar
|
|
175
|
-
object: mcp_server:secret-tools
|
|
176
|
-
assertions:
|
|
177
|
-
can_view: true
|
|
178
|
-
can_edit: true
|
|
179
|
-
|
|
180
|
-
- name: org admin's listable agents include private ones (T08)
|
|
181
|
-
list_objects:
|
|
182
|
-
- user: identity_account:oscar
|
|
183
|
-
type: agent
|
|
184
|
-
assertions:
|
|
185
|
-
can_view:
|
|
186
|
-
- agent:secret-bot
|
|
187
|
-
- agent:team-bot
|
|
188
|
-
- agent:legacy-bot
|
|
189
|
-
- agent:shared-secret
|
|
190
|
-
|
|
191
|
-
- name: owner retains full access to private blueprints
|
|
192
|
-
check:
|
|
193
|
-
- user: identity_account:carol
|
|
194
|
-
object: agent:secret-bot
|
|
195
|
-
assertions:
|
|
196
|
-
can_view: true
|
|
197
|
-
can_execute: true
|
|
198
|
-
can_create_instance: true
|
|
199
|
-
can_edit: true
|
|
200
|
-
can_delete: true
|
|
201
|
-
- user: identity_account:carol
|
|
202
|
-
object: workflow:secret-flow
|
|
203
|
-
assertions:
|
|
204
|
-
can_view: true
|
|
205
|
-
can_execute: true
|
|
206
|
-
can_edit: true
|
|
207
|
-
|
|
208
|
-
- name: org-visible agent is viewable and runnable by org members, not outsiders
|
|
209
|
-
check:
|
|
210
|
-
- user: identity_account:dave
|
|
211
|
-
object: agent:team-bot
|
|
212
|
-
assertions:
|
|
213
|
-
can_view: true
|
|
214
|
-
can_execute: true
|
|
215
|
-
can_create_instance: true
|
|
216
|
-
can_edit: false
|
|
217
|
-
can_delete: false
|
|
218
|
-
- user: identity_account:mallory
|
|
219
|
-
object: agent:team-bot
|
|
220
|
-
assertions:
|
|
221
|
-
can_view: false
|
|
222
|
-
can_execute: false
|
|
223
|
-
|
|
224
|
-
- name: explicit individual viewer grant on a private agent conveys view and run
|
|
225
|
-
check:
|
|
226
|
-
# Run-what-you-can-read: can_execute derives from viewer, so an
|
|
227
|
-
# explicit viewer grant is enough to run (matches the execution gate,
|
|
228
|
-
# which checks can_view).
|
|
229
|
-
- user: identity_account:dave
|
|
230
|
-
object: agent:shared-secret
|
|
231
|
-
assertions:
|
|
232
|
-
can_view: true
|
|
233
|
-
can_execute: true
|
|
234
|
-
can_edit: false
|
|
235
|
-
|
|
236
|
-
- name: org member's listable agents exclude private ones
|
|
237
|
-
list_objects:
|
|
238
|
-
- user: identity_account:dave
|
|
239
|
-
type: agent
|
|
240
|
-
assertions:
|
|
241
|
-
can_view:
|
|
242
|
-
- agent:team-bot
|
|
243
|
-
- agent:legacy-bot
|
|
244
|
-
- agent:shared-secret
|
|
245
|
-
|
|
246
|
-
- name: owner's listable agents include everything they authored
|
|
247
|
-
list_objects:
|
|
248
|
-
- user: identity_account:carol
|
|
249
|
-
type: agent
|
|
250
|
-
assertions:
|
|
251
|
-
can_view:
|
|
252
|
-
- agent:secret-bot
|
|
253
|
-
- agent:team-bot
|
|
254
|
-
- agent:legacy-bot
|
|
255
|
-
- agent:shared-secret
|
|
256
|
-
|
|
257
|
-
# ── cloud#257: the viewer-role cell (previously untested) ──────────────
|
|
258
|
-
|
|
259
|
-
- name: org viewer reads org-visible blueprints — the cloud#257 contract
|
|
260
|
-
check:
|
|
261
|
-
# View, clone and (model-level) execute all derive from viewer; the
|
|
262
|
-
# spend refusal is pinned separately on the org permissions below.
|
|
263
|
-
- user: identity_account:vera
|
|
264
|
-
object: agent:team-bot
|
|
265
|
-
assertions:
|
|
266
|
-
can_view: true
|
|
267
|
-
can_clone: true
|
|
268
|
-
can_execute: true
|
|
269
|
-
can_edit: false
|
|
270
|
-
can_delete: false
|
|
271
|
-
# Private stays private — the viewer role grants nothing beyond the
|
|
272
|
-
# explicit visibility tuples.
|
|
273
|
-
- user: identity_account:vera
|
|
274
|
-
object: agent:secret-bot
|
|
275
|
-
assertions:
|
|
276
|
-
can_view: false
|
|
277
|
-
can_execute: false
|
|
278
|
-
|
|
279
|
-
- name: org viewer holds no spend authority on the org (the cost gate)
|
|
280
|
-
check:
|
|
281
|
-
# Java execution lanes (session create, agent-execution create,
|
|
282
|
-
# workflow-execution create, EC create) all check these org-level
|
|
283
|
-
# permissions — this is why widening read to viewers exposes no cost.
|
|
284
|
-
- user: identity_account:vera
|
|
285
|
-
object: organization:acme
|
|
286
|
-
assertions:
|
|
287
|
-
can_view: true
|
|
288
|
-
can_create_session: false
|
|
289
|
-
can_create_execution_in: false
|
|
290
|
-
- user: identity_account:dave
|
|
291
|
-
object: organization:acme
|
|
292
|
-
assertions:
|
|
293
|
-
can_create_session: true
|
|
294
|
-
can_create_execution_in: true
|
|
295
|
-
|
|
296
|
-
- name: legacy member-shaped tuple keeps members but still excludes viewers (until backfilled)
|
|
297
|
-
check:
|
|
298
|
-
- user: identity_account:dave
|
|
299
|
-
object: agent:legacy-bot
|
|
300
|
-
assertions:
|
|
301
|
-
can_view: true
|
|
302
|
-
can_execute: true
|
|
303
|
-
# The original cloud#257 defect, pinned on the legacy shape: the org
|
|
304
|
-
# role hierarchy flows downward, so a viewer-role user never satisfies
|
|
305
|
-
# organization#member. The boot backfill converges these tuples.
|
|
306
|
-
- user: identity_account:vera
|
|
307
|
-
object: agent:legacy-bot
|
|
308
|
-
assertions:
|
|
309
|
-
can_view: false
|
|
310
|
-
can_execute: false
|
|
311
|
-
|
|
312
|
-
- name: org viewer's listable agents are exactly the viewer-shaped org-visible ones
|
|
313
|
-
list_objects:
|
|
314
|
-
- user: identity_account:vera
|
|
315
|
-
type: agent
|
|
316
|
-
assertions:
|
|
317
|
-
can_view:
|
|
318
|
-
- agent:team-bot
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
# Pinned copy of stigmer-cloud backend/services/stigmer-server/fga/tests/channel-app-owner.fga.yaml
|
|
2
|
-
# at commit b87dd1170 (the OpenFGA store test the cloud runs against its live model).
|
|
3
|
-
# The body below is byte-identical to the source; the cloud re-runs the LIVE
|
|
4
|
-
# file against this evaluator at the re-pin, so a stale copy is caught there.
|
|
5
|
-
# Channel apps are owner-scoped provider credentials (T04 item 2, the
|
|
6
|
-
# oauth_app RESTRICTED posture with T08 admin inheritance): the creator
|
|
7
|
-
# owns the app; view/edit/delete require ownership or an explicit grant.
|
|
8
|
-
# Plain org members get NO implicit access — the resource carries the
|
|
9
|
-
# org's webhook signing secret and OAuth client secret.
|
|
10
|
-
#
|
|
11
|
-
# Org ADMINS inherit owner (T08): a credential holder needs an operator
|
|
12
|
-
# of last resort more than any blueprint does — an ex-employee owner must
|
|
13
|
-
# never strand secret rotation. The narrowness these tests pin: owner +
|
|
14
|
-
# admins have control, granted viewers read, plain members have nothing,
|
|
15
|
-
# and only admins can create.
|
|
16
|
-
#
|
|
17
|
-
# Run: fga model test --tests channel-app-owner.fga.yaml
|
|
18
|
-
|
|
19
|
-
name: channel-app-owner
|
|
20
|
-
model_file: ../model/fga.mod
|
|
21
|
-
|
|
22
|
-
tuples:
|
|
23
|
-
# Org membership for both accounts — proving membership grants nothing.
|
|
24
|
-
# alice created the app while she was an admin and was later demoted to
|
|
25
|
-
# member (creation is admin-gated; the owner tuple survives demotion) —
|
|
26
|
-
# this keeps the direct-owner path distinct from admin inheritance.
|
|
27
|
-
- user: identity_account:alice
|
|
28
|
-
relation: member
|
|
29
|
-
object: organization:acme
|
|
30
|
-
- user: identity_account:mallory
|
|
31
|
-
relation: member
|
|
32
|
-
object: organization:acme
|
|
33
|
-
|
|
34
|
-
# Org admin — proving T08 inheritance reaches channel apps.
|
|
35
|
-
- user: identity_account:ana
|
|
36
|
-
relation: admin
|
|
37
|
-
object: organization:acme
|
|
38
|
-
|
|
39
|
-
# The channel app, created by alice (the config-driven create tuples).
|
|
40
|
-
- user: organization:acme
|
|
41
|
-
relation: organization
|
|
42
|
-
object: channel_app:acme-support-bot
|
|
43
|
-
- user: identity_account:alice
|
|
44
|
-
relation: owner
|
|
45
|
-
object: channel_app:acme-support-bot
|
|
46
|
-
|
|
47
|
-
# An explicit viewer grant to carol (not even an org member).
|
|
48
|
-
- user: identity_account:carol
|
|
49
|
-
relation: viewer
|
|
50
|
-
object: channel_app:acme-support-bot
|
|
51
|
-
|
|
52
|
-
tests:
|
|
53
|
-
- name: owner has full control including grant management
|
|
54
|
-
check:
|
|
55
|
-
- user: identity_account:alice
|
|
56
|
-
object: channel_app:acme-support-bot
|
|
57
|
-
assertions:
|
|
58
|
-
can_view: true
|
|
59
|
-
can_edit: true
|
|
60
|
-
can_delete: true
|
|
61
|
-
can_grant_access: true
|
|
62
|
-
can_view_access: true
|
|
63
|
-
|
|
64
|
-
- name: explicitly granted viewer can read but not mutate
|
|
65
|
-
check:
|
|
66
|
-
- user: identity_account:carol
|
|
67
|
-
object: channel_app:acme-support-bot
|
|
68
|
-
assertions:
|
|
69
|
-
can_view: true
|
|
70
|
-
can_edit: false
|
|
71
|
-
can_delete: false
|
|
72
|
-
can_grant_access: false
|
|
73
|
-
can_view_access: true
|
|
74
|
-
|
|
75
|
-
- name: fellow org member has no implicit access
|
|
76
|
-
check:
|
|
77
|
-
- user: identity_account:mallory
|
|
78
|
-
object: channel_app:acme-support-bot
|
|
79
|
-
assertions:
|
|
80
|
-
can_view: false
|
|
81
|
-
can_edit: false
|
|
82
|
-
can_delete: false
|
|
83
|
-
can_grant_access: false
|
|
84
|
-
can_view_access: false
|
|
85
|
-
|
|
86
|
-
- name: org admin inherits channel app management (T08)
|
|
87
|
-
check:
|
|
88
|
-
- user: identity_account:ana
|
|
89
|
-
object: channel_app:acme-support-bot
|
|
90
|
-
assertions:
|
|
91
|
-
can_view: true
|
|
92
|
-
can_edit: true
|
|
93
|
-
can_delete: true
|
|
94
|
-
can_grant_access: true
|
|
95
|
-
|
|
96
|
-
- name: creation is admin-gated on the organization
|
|
97
|
-
check:
|
|
98
|
-
- user: identity_account:ana
|
|
99
|
-
object: organization:acme
|
|
100
|
-
assertions:
|
|
101
|
-
can_create_channel_app: true
|
|
102
|
-
- user: identity_account:mallory
|
|
103
|
-
object: organization:acme
|
|
104
|
-
assertions:
|
|
105
|
-
can_create_channel_app: false
|
|
106
|
-
|
|
107
|
-
- name: listing channel apps reflects ownership and grants, not membership
|
|
108
|
-
list_objects:
|
|
109
|
-
- user: identity_account:alice
|
|
110
|
-
type: channel_app
|
|
111
|
-
assertions:
|
|
112
|
-
can_view:
|
|
113
|
-
- channel_app:acme-support-bot
|
|
114
|
-
can_edit:
|
|
115
|
-
- channel_app:acme-support-bot
|
|
116
|
-
- user: identity_account:carol
|
|
117
|
-
type: channel_app
|
|
118
|
-
assertions:
|
|
119
|
-
can_view:
|
|
120
|
-
- channel_app:acme-support-bot
|
|
121
|
-
can_edit: []
|
|
122
|
-
- user: identity_account:mallory
|
|
123
|
-
type: channel_app
|
|
124
|
-
assertions:
|
|
125
|
-
can_view: []
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
# Pinned copy of stigmer-cloud backend/services/stigmer-server/fga/tests/channel-participation.fga.yaml
|
|
2
|
-
# at commit b87dd1170 (the OpenFGA store test the cloud runs against its live model).
|
|
3
|
-
# The body below is byte-identical to the source; the cloud re-runs the LIVE
|
|
4
|
-
# file against this evaluator at the re-pin, so a stale copy is caught there.
|
|
5
|
-
# Store tests for conversation participation on agent channels (the
|
|
6
|
-
# `participant` relation and `can_participate` permission,
|
|
7
|
-
# channel-conversations DD-010).
|
|
8
|
-
#
|
|
9
|
-
# The model change under test, in one line each:
|
|
10
|
-
# participant: [identity_account] or owner (owner participates free)
|
|
11
|
-
# viewer: [identity_account] or participant (widened from `or owner`)
|
|
12
|
-
# can_participate: participant (the reply/takeover bar)
|
|
13
|
-
#
|
|
14
|
-
# The invariants this suite pins:
|
|
15
|
-
# 1. Read and speak are DIFFERENT powers: a granted viewer can see
|
|
16
|
-
# conversations but cannot participate (the DD-010 rejected
|
|
17
|
-
# alternative "widen viewer alone" stays rejected).
|
|
18
|
-
# 2. Participation is NOT configuration: a participant can never
|
|
19
|
-
# edit/delete/grant on the channel.
|
|
20
|
-
# 3. The viewer widening is behavior-preserving for existing grants:
|
|
21
|
-
# owner ⊆ participant ⊆ viewer, so every pre-DD-010 owner/admin
|
|
22
|
-
# read keeps working (asserted below, byte-identical semantics).
|
|
23
|
-
# 4. Conversation READ rides the existing session.can_view composition
|
|
24
|
-
# (`viewer from channel`) unchanged, still read-only — participants
|
|
25
|
-
# inherit view on channel sessions but never
|
|
26
|
-
# can_create_execution_in (DD-012's read-only-by-construction).
|
|
27
|
-
# 5. The personal-session invariant is untouched: a participant sees
|
|
28
|
-
# nothing of anyone's console sessions.
|
|
29
|
-
#
|
|
30
|
-
# Run with:
|
|
31
|
-
# fga model test --tests channel-participation.fga.yaml
|
|
32
|
-
#
|
|
33
|
-
# Scenario: org "acme" has admin alice, member bob (who connected the
|
|
34
|
-
# WhatsApp channel and owns it), member trina (an ISC trainer granted
|
|
35
|
-
# participant — the DD-010 launch persona), member carol (granted plain
|
|
36
|
-
# viewer), and member dave (no relation to the channel). "rival" is
|
|
37
|
-
# another org whose admin eve must see nothing. The channel session is
|
|
38
|
-
# owned by acme's system-channel account; bob also has a personal
|
|
39
|
-
# console session to prove invariant 5.
|
|
40
|
-
name: channel-participation
|
|
41
|
-
model_file: ../model/fga.mod
|
|
42
|
-
|
|
43
|
-
tuples:
|
|
44
|
-
# --- Org roles ---
|
|
45
|
-
- user: identity_account:alice
|
|
46
|
-
relation: admin
|
|
47
|
-
object: organization:acme
|
|
48
|
-
- user: identity_account:bob
|
|
49
|
-
relation: member
|
|
50
|
-
object: organization:acme
|
|
51
|
-
- user: identity_account:trina
|
|
52
|
-
relation: member
|
|
53
|
-
object: organization:acme
|
|
54
|
-
- user: identity_account:carol
|
|
55
|
-
relation: member
|
|
56
|
-
object: organization:acme
|
|
57
|
-
- user: identity_account:dave
|
|
58
|
-
relation: member
|
|
59
|
-
object: organization:acme
|
|
60
|
-
- user: identity_account:eve
|
|
61
|
-
relation: admin
|
|
62
|
-
object: organization:rival
|
|
63
|
-
|
|
64
|
-
# --- The AgentChannel (tuples written on create: org link + creator owner) ---
|
|
65
|
-
- user: organization:acme
|
|
66
|
-
relation: organization
|
|
67
|
-
object: agent_channel:wa-line
|
|
68
|
-
- user: identity_account:bob
|
|
69
|
-
relation: owner
|
|
70
|
-
object: agent_channel:wa-line
|
|
71
|
-
|
|
72
|
-
# --- The DD-010 grants (IamPolicy-written: participant vs plain viewer) ---
|
|
73
|
-
- user: identity_account:trina
|
|
74
|
-
relation: participant
|
|
75
|
-
object: agent_channel:wa-line
|
|
76
|
-
- user: identity_account:carol
|
|
77
|
-
relation: viewer
|
|
78
|
-
object: agent_channel:wa-line
|
|
79
|
-
|
|
80
|
-
# --- A channel session (owned by the org's system-channel account) ---
|
|
81
|
-
- user: organization:acme
|
|
82
|
-
relation: organization
|
|
83
|
-
object: session:member-chat
|
|
84
|
-
- user: identity_account:sys-channel-acme
|
|
85
|
-
relation: owner
|
|
86
|
-
object: session:member-chat
|
|
87
|
-
# The structural link written by ChannelSessionLinkStep:
|
|
88
|
-
- user: agent_channel:wa-line
|
|
89
|
-
relation: channel
|
|
90
|
-
object: session:member-chat
|
|
91
|
-
|
|
92
|
-
# --- Bob's personal console session (invariant 5's control subject) ---
|
|
93
|
-
- user: organization:acme
|
|
94
|
-
relation: organization
|
|
95
|
-
object: session:bobs-chat
|
|
96
|
-
- user: identity_account:bob
|
|
97
|
-
relation: owner
|
|
98
|
-
object: session:bobs-chat
|
|
99
|
-
|
|
100
|
-
tests:
|
|
101
|
-
- name: a granted participant may read and speak but never configure
|
|
102
|
-
check:
|
|
103
|
-
- user: identity_account:trina
|
|
104
|
-
object: agent_channel:wa-line
|
|
105
|
-
assertions:
|
|
106
|
-
can_view: true
|
|
107
|
-
can_participate: true
|
|
108
|
-
can_edit: false
|
|
109
|
-
can_delete: false
|
|
110
|
-
can_grant_access: false
|
|
111
|
-
can_view_access: true
|
|
112
|
-
|
|
113
|
-
- name: a granted viewer may read but never speak — read and speak are different powers
|
|
114
|
-
check:
|
|
115
|
-
- user: identity_account:carol
|
|
116
|
-
object: agent_channel:wa-line
|
|
117
|
-
assertions:
|
|
118
|
-
can_view: true
|
|
119
|
-
can_participate: false
|
|
120
|
-
can_edit: false
|
|
121
|
-
|
|
122
|
-
- name: the channel owner participates without an explicit tuple
|
|
123
|
-
check:
|
|
124
|
-
- user: identity_account:bob
|
|
125
|
-
object: agent_channel:wa-line
|
|
126
|
-
assertions:
|
|
127
|
-
can_view: true
|
|
128
|
-
can_participate: true
|
|
129
|
-
can_edit: true
|
|
130
|
-
can_delete: true
|
|
131
|
-
can_grant_access: true
|
|
132
|
-
|
|
133
|
-
- name: an org admin participates through owner inheritance, no tuple needed
|
|
134
|
-
check:
|
|
135
|
-
- user: identity_account:alice
|
|
136
|
-
object: agent_channel:wa-line
|
|
137
|
-
assertions:
|
|
138
|
-
can_view: true
|
|
139
|
-
can_participate: true
|
|
140
|
-
can_edit: true
|
|
141
|
-
|
|
142
|
-
- name: a plain org member has no access of any kind
|
|
143
|
-
check:
|
|
144
|
-
- user: identity_account:dave
|
|
145
|
-
object: agent_channel:wa-line
|
|
146
|
-
assertions:
|
|
147
|
-
can_view: false
|
|
148
|
-
can_participate: false
|
|
149
|
-
can_edit: false
|
|
150
|
-
can_delete: false
|
|
151
|
-
can_grant_access: false
|
|
152
|
-
can_view_access: false
|
|
153
|
-
|
|
154
|
-
- name: a foreign org admin has no access of any kind
|
|
155
|
-
check:
|
|
156
|
-
- user: identity_account:eve
|
|
157
|
-
object: agent_channel:wa-line
|
|
158
|
-
assertions:
|
|
159
|
-
can_view: false
|
|
160
|
-
can_participate: false
|
|
161
|
-
can_edit: false
|
|
162
|
-
|
|
163
|
-
- name: participants inherit channel-session read through the existing composition, read-only
|
|
164
|
-
check:
|
|
165
|
-
- user: identity_account:trina
|
|
166
|
-
object: session:member-chat
|
|
167
|
-
assertions:
|
|
168
|
-
can_view: true
|
|
169
|
-
can_create_execution_in: false
|
|
170
|
-
can_edit: false
|
|
171
|
-
can_delete: false
|
|
172
|
-
can_grant_access: false
|
|
173
|
-
|
|
174
|
-
- name: the personal-session invariant is untouched — a participant sees no console sessions
|
|
175
|
-
check:
|
|
176
|
-
- user: identity_account:trina
|
|
177
|
-
object: session:bobs-chat
|
|
178
|
-
assertions:
|
|
179
|
-
can_view: false
|
|
180
|
-
can_create_execution_in: false
|
|
181
|
-
|
|
182
|
-
- name: list viewable and participable channels resolve per grant (drives listConversations)
|
|
183
|
-
list_objects:
|
|
184
|
-
- user: identity_account:trina
|
|
185
|
-
type: agent_channel
|
|
186
|
-
assertions:
|
|
187
|
-
can_view:
|
|
188
|
-
- agent_channel:wa-line
|
|
189
|
-
can_participate:
|
|
190
|
-
- agent_channel:wa-line
|
|
191
|
-
- user: identity_account:carol
|
|
192
|
-
type: agent_channel
|
|
193
|
-
assertions:
|
|
194
|
-
can_view:
|
|
195
|
-
- agent_channel:wa-line
|
|
196
|
-
can_participate: []
|
|
197
|
-
- user: identity_account:dave
|
|
198
|
-
type: agent_channel
|
|
199
|
-
assertions:
|
|
200
|
-
can_view: []
|
|
201
|
-
can_participate: []
|