@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,177 +0,0 @@
|
|
|
1
|
-
# Pinned copy of stigmer-cloud backend/services/stigmer-server/fga/tests/agent-instance-creation.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 agent-instance creation: two halves, asked together by
|
|
6
|
-
# the create since stigmer#1209 (v3.22.0). The agent half is the agent's
|
|
7
|
-
# can_create_instance (can_execute, so the viewer set: whoever may run the
|
|
8
|
-
# agent may instantiate it). The organization half is
|
|
9
|
-
# can_create_agent_instance: member on the organization the instance is
|
|
10
|
-
# created IN, which is the caller's own, not the agent's: a personal
|
|
11
|
-
# instance of another organization's platform-visible agent lives in the
|
|
12
|
-
# caller's organization (the tenant-family case), so the agent's permission
|
|
13
|
-
# alone would let a row be planted in any organization named on the request.
|
|
14
|
-
#
|
|
15
|
-
# What these pin: owners, admins and members hold the organization half;
|
|
16
|
-
# a viewer-role account may run an org-visible agent (the agent half) and
|
|
17
|
-
# still lacks the organization half; a guest holds neither; an outsider
|
|
18
|
-
# holds neither; and the tenant-family case passes on the caller's own
|
|
19
|
-
# organization while the agent half comes from the platform_viewer grant.
|
|
20
|
-
#
|
|
21
|
-
# Run: fga model test --tests agent-instance-creation.fga.yaml
|
|
22
|
-
|
|
23
|
-
name: agent-instance-creation
|
|
24
|
-
model_file: ../model/fga.mod
|
|
25
|
-
|
|
26
|
-
tuples:
|
|
27
|
-
# Org acme: olivia owns it, oscar administers, dave is a plain member,
|
|
28
|
-
# vera a read-only viewer, greta the share-link guest account.
|
|
29
|
-
- user: identity_account:olivia
|
|
30
|
-
relation: owner
|
|
31
|
-
object: organization:acme
|
|
32
|
-
- user: identity_account:oscar
|
|
33
|
-
relation: admin
|
|
34
|
-
object: organization:acme
|
|
35
|
-
- user: identity_account:dave
|
|
36
|
-
relation: member
|
|
37
|
-
object: organization:acme
|
|
38
|
-
- user: identity_account:vera
|
|
39
|
-
relation: viewer
|
|
40
|
-
object: organization:acme
|
|
41
|
-
- user: identity_account:greta
|
|
42
|
-
relation: guest
|
|
43
|
-
object: organization:acme
|
|
44
|
-
|
|
45
|
-
# Org consumer: mia is a plain member there and holds no role in acme.
|
|
46
|
-
- user: identity_account:mia
|
|
47
|
-
relation: member
|
|
48
|
-
object: organization:consumer
|
|
49
|
-
|
|
50
|
-
# acme owns identity_provider:idp1, which manages consumer: the two are
|
|
51
|
-
# one tenant family, the audience a platform-visible agent reaches.
|
|
52
|
-
- user: organization:acme
|
|
53
|
-
relation: organization
|
|
54
|
-
object: identity_provider:idp1
|
|
55
|
-
- user: organization:consumer
|
|
56
|
-
relation: managed_org
|
|
57
|
-
object: identity_provider:idp1
|
|
58
|
-
|
|
59
|
-
# An ORG-visible agent in acme, authored by oscar.
|
|
60
|
-
- user: organization:acme
|
|
61
|
-
relation: organization
|
|
62
|
-
object: agent:team-bot
|
|
63
|
-
- user: identity_account:oscar
|
|
64
|
-
relation: owner
|
|
65
|
-
object: agent:team-bot
|
|
66
|
-
- user: organization:acme#viewer
|
|
67
|
-
relation: viewer
|
|
68
|
-
object: agent:team-bot
|
|
69
|
-
|
|
70
|
-
# A PRIVATE agent in acme, authored by oscar (no visibility tuple).
|
|
71
|
-
- user: organization:acme
|
|
72
|
-
relation: organization
|
|
73
|
-
object: agent:secret-bot
|
|
74
|
-
- user: identity_account:oscar
|
|
75
|
-
relation: owner
|
|
76
|
-
object: agent:secret-bot
|
|
77
|
-
|
|
78
|
-
# A PLATFORM-visible agent in acme (the platform_viewer grant plus the
|
|
79
|
-
# org floor tuple the visibility writer emits).
|
|
80
|
-
- user: organization:acme
|
|
81
|
-
relation: organization
|
|
82
|
-
object: agent:open-bot
|
|
83
|
-
- user: identity_account:oscar
|
|
84
|
-
relation: owner
|
|
85
|
-
object: agent:open-bot
|
|
86
|
-
- user: identity_provider:idp1#platform_user
|
|
87
|
-
relation: platform_viewer
|
|
88
|
-
object: agent:open-bot
|
|
89
|
-
- user: organization:acme#viewer
|
|
90
|
-
relation: viewer
|
|
91
|
-
object: agent:open-bot
|
|
92
|
-
|
|
93
|
-
tests:
|
|
94
|
-
- name: owners, admins and members hold the organization half
|
|
95
|
-
check:
|
|
96
|
-
- user: identity_account:olivia
|
|
97
|
-
object: organization:acme
|
|
98
|
-
assertions:
|
|
99
|
-
can_create_agent_instance: true
|
|
100
|
-
- user: identity_account:oscar
|
|
101
|
-
object: organization:acme
|
|
102
|
-
assertions:
|
|
103
|
-
can_create_agent_instance: true
|
|
104
|
-
- user: identity_account:dave
|
|
105
|
-
object: organization:acme
|
|
106
|
-
assertions:
|
|
107
|
-
can_create_agent_instance: true
|
|
108
|
-
|
|
109
|
-
- name: a viewer, a guest and an outsider do not
|
|
110
|
-
check:
|
|
111
|
-
- user: identity_account:vera
|
|
112
|
-
object: organization:acme
|
|
113
|
-
assertions:
|
|
114
|
-
can_create_agent_instance: false
|
|
115
|
-
can_create_session: false
|
|
116
|
-
- user: identity_account:greta
|
|
117
|
-
object: organization:acme
|
|
118
|
-
assertions:
|
|
119
|
-
can_create_agent_instance: false
|
|
120
|
-
can_create_session: true
|
|
121
|
-
- user: identity_account:mia
|
|
122
|
-
object: organization:acme
|
|
123
|
-
assertions:
|
|
124
|
-
can_create_agent_instance: false
|
|
125
|
-
|
|
126
|
-
- name: a member instantiates an org-visible agent, both halves held
|
|
127
|
-
check:
|
|
128
|
-
- user: identity_account:dave
|
|
129
|
-
object: agent:team-bot
|
|
130
|
-
assertions:
|
|
131
|
-
can_create_instance: true
|
|
132
|
-
can_execute: true
|
|
133
|
-
|
|
134
|
-
- name: a viewer may run the org-visible agent and still cannot instantiate it here
|
|
135
|
-
check:
|
|
136
|
-
- user: identity_account:vera
|
|
137
|
-
object: agent:team-bot
|
|
138
|
-
assertions:
|
|
139
|
-
can_create_instance: true
|
|
140
|
-
- user: identity_account:vera
|
|
141
|
-
object: organization:acme
|
|
142
|
-
assertions:
|
|
143
|
-
can_create_agent_instance: false
|
|
144
|
-
|
|
145
|
-
- name: a private agent gives the agent half to its author and the admins only
|
|
146
|
-
check:
|
|
147
|
-
- user: identity_account:oscar
|
|
148
|
-
object: agent:secret-bot
|
|
149
|
-
assertions:
|
|
150
|
-
can_create_instance: true
|
|
151
|
-
- user: identity_account:olivia
|
|
152
|
-
object: agent:secret-bot
|
|
153
|
-
assertions:
|
|
154
|
-
can_create_instance: true
|
|
155
|
-
- user: identity_account:dave
|
|
156
|
-
object: agent:secret-bot
|
|
157
|
-
assertions:
|
|
158
|
-
can_create_instance: false
|
|
159
|
-
- user: identity_account:mia
|
|
160
|
-
object: agent:secret-bot
|
|
161
|
-
assertions:
|
|
162
|
-
can_create_instance: false
|
|
163
|
-
|
|
164
|
-
- name: the tenant-family case, the agent half from platform_viewer and the organization half at home
|
|
165
|
-
check:
|
|
166
|
-
- user: identity_account:mia
|
|
167
|
-
object: agent:open-bot
|
|
168
|
-
assertions:
|
|
169
|
-
can_create_instance: true
|
|
170
|
-
- user: identity_account:mia
|
|
171
|
-
object: organization:consumer
|
|
172
|
-
assertions:
|
|
173
|
-
can_create_agent_instance: true
|
|
174
|
-
- user: identity_account:mia
|
|
175
|
-
object: organization:acme
|
|
176
|
-
assertions:
|
|
177
|
-
can_create_agent_instance: false
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
# Pinned copy of stigmer-cloud backend/services/stigmer-server/fga/tests/agent-share-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
|
-
# Agent shares are owner-scoped channel config (decision 011, D1):
|
|
6
|
-
# the creator owns the share; view/edit/delete/rotate require ownership or
|
|
7
|
-
# an explicit grant. Plain org members get NO implicit access, and —
|
|
8
|
-
# critically — no visitor-facing tuples exist at all: guest/member
|
|
9
|
-
# admission to the hosted chat is app-level (shared-profile, mint, and
|
|
10
|
-
# create-time gates), never FGA.
|
|
11
|
-
#
|
|
12
|
-
# T08: org ADMINS inherit owner (consistent with agents — an admin who can
|
|
13
|
-
# edit the agent can manage its channels). The narrowness these tests pin
|
|
14
|
-
# is now: owner + admins have control, granted viewers read, plain members
|
|
15
|
-
# have nothing.
|
|
16
|
-
|
|
17
|
-
name: agent-share-owner
|
|
18
|
-
model_file: ../model/fga.mod
|
|
19
|
-
|
|
20
|
-
tuples:
|
|
21
|
-
# Org membership for both accounts — proving membership grants nothing.
|
|
22
|
-
- user: identity_account:alice
|
|
23
|
-
relation: member
|
|
24
|
-
object: organization:acme
|
|
25
|
-
- user: identity_account:mallory
|
|
26
|
-
relation: member
|
|
27
|
-
object: organization:acme
|
|
28
|
-
|
|
29
|
-
# Org admin — proving T08 inheritance reaches shares.
|
|
30
|
-
- user: identity_account:ana
|
|
31
|
-
relation: admin
|
|
32
|
-
object: organization:acme
|
|
33
|
-
|
|
34
|
-
# The share, created by alice (the config-driven create tuples).
|
|
35
|
-
- user: organization:acme
|
|
36
|
-
relation: organization
|
|
37
|
-
object: agent_share:support-bot-share
|
|
38
|
-
- user: identity_account:alice
|
|
39
|
-
relation: owner
|
|
40
|
-
object: agent_share:support-bot-share
|
|
41
|
-
|
|
42
|
-
# An explicit viewer grant to carol (not even an org member).
|
|
43
|
-
- user: identity_account:carol
|
|
44
|
-
relation: viewer
|
|
45
|
-
object: agent_share:support-bot-share
|
|
46
|
-
|
|
47
|
-
tests:
|
|
48
|
-
- name: owner has full control including grant management
|
|
49
|
-
check:
|
|
50
|
-
- user: identity_account:alice
|
|
51
|
-
object: agent_share:support-bot-share
|
|
52
|
-
assertions:
|
|
53
|
-
can_view: true
|
|
54
|
-
can_edit: true
|
|
55
|
-
can_delete: true
|
|
56
|
-
can_grant_access: true
|
|
57
|
-
can_view_access: true
|
|
58
|
-
|
|
59
|
-
- name: explicitly granted viewer can read but not mutate
|
|
60
|
-
check:
|
|
61
|
-
- user: identity_account:carol
|
|
62
|
-
object: agent_share:support-bot-share
|
|
63
|
-
assertions:
|
|
64
|
-
can_view: true
|
|
65
|
-
can_edit: false
|
|
66
|
-
can_delete: false
|
|
67
|
-
can_grant_access: false
|
|
68
|
-
can_view_access: true
|
|
69
|
-
|
|
70
|
-
- name: fellow org member has no implicit access
|
|
71
|
-
check:
|
|
72
|
-
- user: identity_account:mallory
|
|
73
|
-
object: agent_share:support-bot-share
|
|
74
|
-
assertions:
|
|
75
|
-
can_view: false
|
|
76
|
-
can_edit: false
|
|
77
|
-
can_delete: false
|
|
78
|
-
can_grant_access: false
|
|
79
|
-
can_view_access: false
|
|
80
|
-
|
|
81
|
-
- name: org admin inherits share management (T08)
|
|
82
|
-
check:
|
|
83
|
-
- user: identity_account:ana
|
|
84
|
-
object: agent_share:support-bot-share
|
|
85
|
-
assertions:
|
|
86
|
-
can_view: true
|
|
87
|
-
can_edit: true
|
|
88
|
-
can_delete: true
|
|
89
|
-
can_grant_access: true
|
|
90
|
-
|
|
91
|
-
- name: listing shares reflects ownership and grants, not membership
|
|
92
|
-
list_objects:
|
|
93
|
-
- user: identity_account:alice
|
|
94
|
-
type: agent_share
|
|
95
|
-
assertions:
|
|
96
|
-
can_view:
|
|
97
|
-
- agent_share:support-bot-share
|
|
98
|
-
can_edit:
|
|
99
|
-
- agent_share:support-bot-share
|
|
100
|
-
- user: identity_account:carol
|
|
101
|
-
type: agent_share
|
|
102
|
-
assertions:
|
|
103
|
-
can_view:
|
|
104
|
-
- agent_share:support-bot-share
|
|
105
|
-
can_edit: []
|
|
106
|
-
- user: identity_account:mallory
|
|
107
|
-
type: agent_share
|
|
108
|
-
assertions:
|
|
109
|
-
can_view: []
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
# Pinned copy of stigmer-cloud backend/services/stigmer-server/fga/tests/artifact-org-and-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
|
-
# Artifacts are org-scoped execution outputs with creator ownership on
|
|
6
|
-
# top (cloud#216). The two access arms these tests pin:
|
|
7
|
-
#
|
|
8
|
-
# 1. Org inheritance — anyone who is at least a viewer of the owning org
|
|
9
|
-
# can view its artifacts ("if you can view resources in the org, you
|
|
10
|
-
# can view its artifacts"). Editing stays org-admin-only.
|
|
11
|
-
# 2. Creator ownership — the identity whose execution produced the
|
|
12
|
-
# artifact can view it WITHOUT any org role. This is the guest-share /
|
|
13
|
-
# embedded-user case: org guests are not org viewers, but their
|
|
14
|
-
# sessions render artifact-backed review payloads and artifact tabs.
|
|
15
|
-
#
|
|
16
|
-
# The narrowness pinned: creator-owners read but never edit (all guests
|
|
17
|
-
# of an org share one guest identity account — owner-edit would let one
|
|
18
|
-
# guest soft-delete another's artifacts), and no arm crosses org
|
|
19
|
-
# boundaries.
|
|
20
|
-
#
|
|
21
|
-
# Run: fga model test --tests artifact-org-and-owner.fga.yaml
|
|
22
|
-
|
|
23
|
-
name: artifact-org-and-owner
|
|
24
|
-
model_file: ../model/fga.mod
|
|
25
|
-
|
|
26
|
-
tuples:
|
|
27
|
-
# Org roles: victor views, ana administers acme. Rival org for the
|
|
28
|
-
# cross-org boundary.
|
|
29
|
-
- user: identity_account:victor
|
|
30
|
-
relation: viewer
|
|
31
|
-
object: organization:acme
|
|
32
|
-
- user: identity_account:ana
|
|
33
|
-
relation: admin
|
|
34
|
-
object: organization:acme
|
|
35
|
-
- user: identity_account:eve
|
|
36
|
-
relation: member
|
|
37
|
-
object: organization:rival
|
|
38
|
-
|
|
39
|
-
# Guest identity: an org GUEST, deliberately not an org viewer.
|
|
40
|
-
- user: identity_account:acme-guest
|
|
41
|
-
relation: guest
|
|
42
|
-
object: organization:acme
|
|
43
|
-
|
|
44
|
-
# Artifact produced by a signed-in member's execution.
|
|
45
|
-
- user: organization:acme
|
|
46
|
-
relation: organization
|
|
47
|
-
object: artifact:art_report
|
|
48
|
-
- user: identity_account:victor
|
|
49
|
-
relation: owner
|
|
50
|
-
object: artifact:art_report
|
|
51
|
-
|
|
52
|
-
# Artifact produced by a guest-share execution: creator is the guest
|
|
53
|
-
# identity account (runner tokens carry the acting identity as sub).
|
|
54
|
-
- user: organization:acme
|
|
55
|
-
relation: organization
|
|
56
|
-
object: artifact:art_guest_plan
|
|
57
|
-
- user: identity_account:acme-guest
|
|
58
|
-
relation: owner
|
|
59
|
-
object: artifact:art_guest_plan
|
|
60
|
-
|
|
61
|
-
tests:
|
|
62
|
-
- name: org viewer reads any org artifact but cannot edit
|
|
63
|
-
check:
|
|
64
|
-
- user: identity_account:victor
|
|
65
|
-
object: artifact:art_report
|
|
66
|
-
assertions:
|
|
67
|
-
can_view: true
|
|
68
|
-
can_edit: false
|
|
69
|
-
- user: identity_account:victor
|
|
70
|
-
object: artifact:art_guest_plan
|
|
71
|
-
assertions:
|
|
72
|
-
can_view: true
|
|
73
|
-
can_edit: false
|
|
74
|
-
|
|
75
|
-
- name: org admin views and edits org artifacts
|
|
76
|
-
check:
|
|
77
|
-
- user: identity_account:ana
|
|
78
|
-
object: artifact:art_report
|
|
79
|
-
assertions:
|
|
80
|
-
can_view: true
|
|
81
|
-
can_edit: true
|
|
82
|
-
|
|
83
|
-
- name: guest creator reads own execution's artifact via ownership, never edits
|
|
84
|
-
check:
|
|
85
|
-
- user: identity_account:acme-guest
|
|
86
|
-
object: artifact:art_guest_plan
|
|
87
|
-
assertions:
|
|
88
|
-
can_view: true
|
|
89
|
-
can_edit: false
|
|
90
|
-
|
|
91
|
-
- name: guest role alone grants nothing on other artifacts in the org
|
|
92
|
-
check:
|
|
93
|
-
- user: identity_account:acme-guest
|
|
94
|
-
object: artifact:art_report
|
|
95
|
-
assertions:
|
|
96
|
-
can_view: false
|
|
97
|
-
can_edit: false
|
|
98
|
-
|
|
99
|
-
- name: cross-org caller is denied everything
|
|
100
|
-
check:
|
|
101
|
-
- user: identity_account:eve
|
|
102
|
-
object: artifact:art_report
|
|
103
|
-
assertions:
|
|
104
|
-
can_view: false
|
|
105
|
-
can_edit: false
|
|
106
|
-
- user: identity_account:eve
|
|
107
|
-
object: artifact:art_guest_plan
|
|
108
|
-
assertions:
|
|
109
|
-
can_view: false
|
|
110
|
-
can_edit: false
|
|
111
|
-
|
|
112
|
-
- name: listing reflects org inheritance plus creator ownership
|
|
113
|
-
list_objects:
|
|
114
|
-
- user: identity_account:victor
|
|
115
|
-
type: artifact
|
|
116
|
-
assertions:
|
|
117
|
-
can_view:
|
|
118
|
-
- artifact:art_report
|
|
119
|
-
- artifact:art_guest_plan
|
|
120
|
-
- user: identity_account:acme-guest
|
|
121
|
-
type: artifact
|
|
122
|
-
assertions:
|
|
123
|
-
can_view:
|
|
124
|
-
- artifact:art_guest_plan
|
|
125
|
-
- user: identity_account:eve
|
|
126
|
-
type: artifact
|
|
127
|
-
assertions:
|
|
128
|
-
can_view: []
|