@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,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/agent.fga — a blueprint: owned by its
|
|
3
|
-
* creator and by the organization's admins (`admin from organization`),
|
|
4
|
-
* read by whoever the visibility axis lets in. The `organization#member`
|
|
5
|
-
* and `organization#viewer` usersets on `viewer` are the org-visibility
|
|
6
|
-
* tuple's two shapes (the cloud writes `#viewer` since cloud#257; `#member`
|
|
7
|
-
* is the legacy shape it still honours), and `platform_viewer` is an
|
|
8
|
-
* identity-provider userset no open-source tuple ever names. `team#member`
|
|
9
|
-
* is the Enterprise team grant; open source serves no team, so no tuple
|
|
10
|
-
* here ever names one.
|
|
11
|
-
*/
|
|
12
|
-
import { AgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
13
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
computed,
|
|
17
|
-
declareKind,
|
|
18
|
-
direct,
|
|
19
|
-
from,
|
|
20
|
-
objectOf,
|
|
21
|
-
union,
|
|
22
|
-
usersetOf,
|
|
23
|
-
} from "./rewrite.js";
|
|
24
|
-
|
|
25
|
-
export const agentDeclaration = declareKind({
|
|
26
|
-
kind: ApiResourceKind.agent,
|
|
27
|
-
schema: AgentSchema,
|
|
28
|
-
source: "fga/model/agentic/agent.fga",
|
|
29
|
-
relations: [
|
|
30
|
-
["organization", direct(objectOf("organization"))],
|
|
31
|
-
[
|
|
32
|
-
"owner",
|
|
33
|
-
union(
|
|
34
|
-
direct(objectOf("identity_account")),
|
|
35
|
-
from("admin", "organization"),
|
|
36
|
-
),
|
|
37
|
-
],
|
|
38
|
-
[
|
|
39
|
-
"platform_viewer",
|
|
40
|
-
direct(usersetOf("identity_provider", "platform_user")),
|
|
41
|
-
],
|
|
42
|
-
[
|
|
43
|
-
"viewer",
|
|
44
|
-
union(
|
|
45
|
-
direct(
|
|
46
|
-
objectOf("identity_account"),
|
|
47
|
-
usersetOf("organization", "member"),
|
|
48
|
-
usersetOf("organization", "viewer"),
|
|
49
|
-
usersetOf("team", "member"),
|
|
50
|
-
),
|
|
51
|
-
computed("owner"),
|
|
52
|
-
computed("platform_viewer"),
|
|
53
|
-
),
|
|
54
|
-
],
|
|
55
|
-
["can_view", computed("viewer")],
|
|
56
|
-
["can_edit", computed("owner")],
|
|
57
|
-
["can_delete", computed("owner")],
|
|
58
|
-
["can_execute", computed("viewer")],
|
|
59
|
-
["can_create_instance", computed("can_execute")],
|
|
60
|
-
["can_clone", computed("viewer")],
|
|
61
|
-
["can_grant_access", computed("owner")],
|
|
62
|
-
["can_view_access", computed("viewer")],
|
|
63
|
-
],
|
|
64
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/agent_channel.fga — a channel binding,
|
|
3
|
-
* admin-owned like a blueprint, with `participant` as the one relation
|
|
4
|
-
* between owner and viewer: the conversation-participation role
|
|
5
|
-
* (reply and takeover without configuration authority), grantable as a
|
|
6
|
-
* role on this kind alone. Every owner participates; every participant
|
|
7
|
-
* views. Both grantable relations may name an Enterprise team
|
|
8
|
-
* (`team#member`), which no open-source tuple ever does.
|
|
9
|
-
*/
|
|
10
|
-
import { AgentChannelSchema } from "@stigmer/protos/ai/stigmer/agentic/agentchannel/v1/api_pb";
|
|
11
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
computed,
|
|
15
|
-
declareKind,
|
|
16
|
-
direct,
|
|
17
|
-
from,
|
|
18
|
-
objectOf,
|
|
19
|
-
union,
|
|
20
|
-
usersetOf,
|
|
21
|
-
} from "./rewrite.js";
|
|
22
|
-
|
|
23
|
-
export const agentChannelDeclaration = declareKind({
|
|
24
|
-
kind: ApiResourceKind.agent_channel,
|
|
25
|
-
schema: AgentChannelSchema,
|
|
26
|
-
source: "fga/model/agentic/agent_channel.fga",
|
|
27
|
-
relations: [
|
|
28
|
-
["organization", direct(objectOf("organization"))],
|
|
29
|
-
[
|
|
30
|
-
"owner",
|
|
31
|
-
union(
|
|
32
|
-
direct(objectOf("identity_account")),
|
|
33
|
-
from("admin", "organization"),
|
|
34
|
-
),
|
|
35
|
-
],
|
|
36
|
-
[
|
|
37
|
-
"participant",
|
|
38
|
-
union(
|
|
39
|
-
direct(objectOf("identity_account"), usersetOf("team", "member")),
|
|
40
|
-
computed("owner"),
|
|
41
|
-
),
|
|
42
|
-
],
|
|
43
|
-
[
|
|
44
|
-
"viewer",
|
|
45
|
-
union(
|
|
46
|
-
direct(objectOf("identity_account"), usersetOf("team", "member")),
|
|
47
|
-
computed("participant"),
|
|
48
|
-
),
|
|
49
|
-
],
|
|
50
|
-
["can_view", computed("viewer")],
|
|
51
|
-
["can_edit", computed("owner")],
|
|
52
|
-
["can_delete", computed("owner")],
|
|
53
|
-
["can_participate", computed("participant")],
|
|
54
|
-
["can_grant_access", computed("owner")],
|
|
55
|
-
["can_view_access", computed("viewer")],
|
|
56
|
-
],
|
|
57
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/agent_execution.fga — a run is its
|
|
3
|
-
* session's: no owner tuple of its own (`kind_meta` attribution
|
|
4
|
-
* INHERITED), every relation a hop through `session`, which the
|
|
5
|
-
* derivation writes from `spec.session_id`. `can_view: viewer or
|
|
6
|
-
* can_view from session` walks a parent PERMISSION whose own arms include
|
|
7
|
-
* the session's channel and schedule hops; the evaluator resolves those
|
|
8
|
-
* on the session's declaration, so this file needs no knowledge of them.
|
|
9
|
-
*/
|
|
10
|
-
import { AgentExecutionSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
11
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
computed,
|
|
15
|
-
declareKind,
|
|
16
|
-
direct,
|
|
17
|
-
from,
|
|
18
|
-
objectOf,
|
|
19
|
-
union,
|
|
20
|
-
} from "./rewrite.js";
|
|
21
|
-
|
|
22
|
-
export const agentExecutionDeclaration = declareKind({
|
|
23
|
-
kind: ApiResourceKind.agent_execution,
|
|
24
|
-
schema: AgentExecutionSchema,
|
|
25
|
-
source: "fga/model/agentic/agent_execution.fga",
|
|
26
|
-
relations: [
|
|
27
|
-
["session", direct(objectOf("session"))],
|
|
28
|
-
["owner", from("owner", "session")],
|
|
29
|
-
["viewer", union(from("viewer", "session"), computed("owner"))],
|
|
30
|
-
["can_view", union(computed("viewer"), from("can_view", "session"))],
|
|
31
|
-
["can_edit", computed("owner")],
|
|
32
|
-
],
|
|
33
|
-
});
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/agent_instance.fga — a person's
|
|
3
|
-
* configuration of an agent: owner-only in every write (no admin arm,
|
|
4
|
-
* unlike the blueprint), readable through its own visibility axis or, for
|
|
5
|
-
* the system-managed default instance, through the blueprint's whole
|
|
6
|
-
* viewer set (`viewer from default_of`; default-of.ts). `agent` is the
|
|
7
|
-
* parent link written on every instance for tracking and walked by
|
|
8
|
-
* nothing; `default_of` is the derived link written on the default
|
|
9
|
-
* instance alone. `team#member` on `viewer` is the Enterprise team grant,
|
|
10
|
-
* which no open-source tuple ever names.
|
|
11
|
-
*/
|
|
12
|
-
import { AgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
13
|
-
import { AgentInstanceSchema } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/api_pb";
|
|
14
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
15
|
-
|
|
16
|
-
import { defaultOfBlueprint } from "./default-of.js";
|
|
17
|
-
import {
|
|
18
|
-
computed,
|
|
19
|
-
declareKind,
|
|
20
|
-
direct,
|
|
21
|
-
from,
|
|
22
|
-
objectOf,
|
|
23
|
-
union,
|
|
24
|
-
usersetOf,
|
|
25
|
-
} from "./rewrite.js";
|
|
26
|
-
|
|
27
|
-
export const agentInstanceDeclaration = declareKind({
|
|
28
|
-
kind: ApiResourceKind.agent_instance,
|
|
29
|
-
schema: AgentInstanceSchema,
|
|
30
|
-
source: "fga/model/agentic/agent_instance.fga",
|
|
31
|
-
relations: [
|
|
32
|
-
["organization", direct(objectOf("organization"))],
|
|
33
|
-
["agent", direct(objectOf("agent"))],
|
|
34
|
-
["default_of", direct(objectOf("agent"))],
|
|
35
|
-
["owner", direct(objectOf("identity_account"))],
|
|
36
|
-
[
|
|
37
|
-
"viewer",
|
|
38
|
-
union(
|
|
39
|
-
direct(
|
|
40
|
-
objectOf("identity_account"),
|
|
41
|
-
usersetOf("organization", "member"),
|
|
42
|
-
usersetOf("organization", "viewer"),
|
|
43
|
-
usersetOf("team", "member"),
|
|
44
|
-
),
|
|
45
|
-
computed("owner"),
|
|
46
|
-
from("viewer", "default_of"),
|
|
47
|
-
),
|
|
48
|
-
],
|
|
49
|
-
["can_view", computed("viewer")],
|
|
50
|
-
["can_execute", computed("can_view")],
|
|
51
|
-
["can_edit", computed("owner")],
|
|
52
|
-
["can_delete", computed("owner")],
|
|
53
|
-
["can_grant_access", computed("owner")],
|
|
54
|
-
["can_view_access", computed("viewer")],
|
|
55
|
-
],
|
|
56
|
-
derived: [
|
|
57
|
-
[
|
|
58
|
-
"default_of",
|
|
59
|
-
defaultOfBlueprint({
|
|
60
|
-
kind: ApiResourceKind.agent,
|
|
61
|
-
schema: AgentSchema,
|
|
62
|
-
defaultInstanceIdOf: (agent) => agent.status?.defaultInstanceId ?? "",
|
|
63
|
-
}),
|
|
64
|
-
],
|
|
65
|
-
],
|
|
66
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/agent_share.fga — a share link's
|
|
3
|
-
* configuration row, admin-owned; its anonymous visitors are the cloud's
|
|
4
|
-
* `guest` credential on the organization, a class no open-source lane
|
|
5
|
-
* mints, so on this edition a share is visible to its owners and explicit
|
|
6
|
-
* grantees only.
|
|
7
|
-
*/
|
|
8
|
-
import { AgentShareSchema } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/api_pb";
|
|
9
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
computed,
|
|
13
|
-
declareKind,
|
|
14
|
-
direct,
|
|
15
|
-
from,
|
|
16
|
-
objectOf,
|
|
17
|
-
union,
|
|
18
|
-
} from "./rewrite.js";
|
|
19
|
-
|
|
20
|
-
export const agentShareDeclaration = declareKind({
|
|
21
|
-
kind: ApiResourceKind.agent_share,
|
|
22
|
-
schema: AgentShareSchema,
|
|
23
|
-
source: "fga/model/agentic/agent_share.fga",
|
|
24
|
-
relations: [
|
|
25
|
-
["organization", direct(objectOf("organization"))],
|
|
26
|
-
[
|
|
27
|
-
"owner",
|
|
28
|
-
union(
|
|
29
|
-
direct(objectOf("identity_account")),
|
|
30
|
-
from("admin", "organization"),
|
|
31
|
-
),
|
|
32
|
-
],
|
|
33
|
-
["viewer", union(direct(objectOf("identity_account")), computed("owner"))],
|
|
34
|
-
["can_view", computed("viewer")],
|
|
35
|
-
["can_edit", computed("owner")],
|
|
36
|
-
["can_delete", computed("owner")],
|
|
37
|
-
["can_grant_access", computed("owner")],
|
|
38
|
-
["can_view_access", computed("viewer")],
|
|
39
|
-
],
|
|
40
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/iam/api_key.fga — a credential, owner-only in
|
|
3
|
-
* every verb: no organization link (`kind_meta` scope OWNER_ONLY) and no
|
|
4
|
-
* admin arm, so the key a person minted is theirs to view, rotate, revoke
|
|
5
|
-
* and use, and nobody else's. `can_rotate`, `can_revoke` and `can_use` are
|
|
6
|
-
* the file's own verbs; the wire vocabulary names only the first three.
|
|
7
|
-
*/
|
|
8
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
9
|
-
import { ApiKeySchema } from "@stigmer/protos/ai/stigmer/iam/apikey/v1/api_pb";
|
|
10
|
-
|
|
11
|
-
import { computed, declareKind, direct, objectOf } from "./rewrite.js";
|
|
12
|
-
|
|
13
|
-
export const apiKeyDeclaration = declareKind({
|
|
14
|
-
kind: ApiResourceKind.api_key,
|
|
15
|
-
schema: ApiKeySchema,
|
|
16
|
-
source: "fga/model/iam/api_key.fga",
|
|
17
|
-
relations: [
|
|
18
|
-
["owner", direct(objectOf("identity_account"))],
|
|
19
|
-
["can_view", computed("owner")],
|
|
20
|
-
["can_edit", computed("owner")],
|
|
21
|
-
["can_delete", computed("owner")],
|
|
22
|
-
["can_rotate", computed("owner")],
|
|
23
|
-
["can_revoke", computed("owner")],
|
|
24
|
-
["can_use", computed("owner")],
|
|
25
|
-
["can_grant_access", computed("owner")],
|
|
26
|
-
["can_view_access", computed("owner")],
|
|
27
|
-
],
|
|
28
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/artifact.fga — an organization's shared
|
|
3
|
-
* output: read by its creator and by every organization viewer (`viewer
|
|
4
|
-
* from organization`, no visibility tuple involved — the kind has no
|
|
5
|
-
* visibility axis), edited by the organization's admins alone (the
|
|
6
|
-
* creator does NOT edit through `owner`), and with no `can_delete` line
|
|
7
|
-
* at all. The wire annotates only `can_view` and `can_edit` on it.
|
|
8
|
-
*/
|
|
9
|
-
import { ArtifactSchema } from "@stigmer/protos/ai/stigmer/agentic/artifact/v1/api_pb";
|
|
10
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
computed,
|
|
14
|
-
declareKind,
|
|
15
|
-
direct,
|
|
16
|
-
from,
|
|
17
|
-
objectOf,
|
|
18
|
-
union,
|
|
19
|
-
} from "./rewrite.js";
|
|
20
|
-
|
|
21
|
-
export const artifactDeclaration = declareKind({
|
|
22
|
-
kind: ApiResourceKind.artifact,
|
|
23
|
-
schema: ArtifactSchema,
|
|
24
|
-
source: "fga/model/agentic/artifact.fga",
|
|
25
|
-
relations: [
|
|
26
|
-
["organization", direct(objectOf("organization"))],
|
|
27
|
-
["owner", direct(objectOf("identity_account"))],
|
|
28
|
-
[
|
|
29
|
-
"viewer",
|
|
30
|
-
union(
|
|
31
|
-
direct(objectOf("identity_account")),
|
|
32
|
-
from("viewer", "organization"),
|
|
33
|
-
),
|
|
34
|
-
],
|
|
35
|
-
["can_view", union(computed("owner"), computed("viewer"))],
|
|
36
|
-
["can_edit", from("admin", "organization")],
|
|
37
|
-
],
|
|
38
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/channel_app.fga — a messaging-platform
|
|
3
|
-
* app registration, admin-owned, viewable by its owners and explicit
|
|
4
|
-
* grantees: the same shape as agent_share, kept as its own file so the
|
|
5
|
-
* drift compare reads this file's lines.
|
|
6
|
-
*/
|
|
7
|
-
import { ChannelAppSchema } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/api_pb";
|
|
8
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
computed,
|
|
12
|
-
declareKind,
|
|
13
|
-
direct,
|
|
14
|
-
from,
|
|
15
|
-
objectOf,
|
|
16
|
-
union,
|
|
17
|
-
} from "./rewrite.js";
|
|
18
|
-
|
|
19
|
-
export const channelAppDeclaration = declareKind({
|
|
20
|
-
kind: ApiResourceKind.channel_app,
|
|
21
|
-
schema: ChannelAppSchema,
|
|
22
|
-
source: "fga/model/agentic/channel_app.fga",
|
|
23
|
-
relations: [
|
|
24
|
-
["organization", direct(objectOf("organization"))],
|
|
25
|
-
[
|
|
26
|
-
"owner",
|
|
27
|
-
union(
|
|
28
|
-
direct(objectOf("identity_account")),
|
|
29
|
-
from("admin", "organization"),
|
|
30
|
-
),
|
|
31
|
-
],
|
|
32
|
-
["viewer", union(direct(objectOf("identity_account")), computed("owner"))],
|
|
33
|
-
["can_view", computed("viewer")],
|
|
34
|
-
["can_edit", computed("owner")],
|
|
35
|
-
["can_delete", computed("owner")],
|
|
36
|
-
["can_grant_access", computed("owner")],
|
|
37
|
-
["can_view_access", computed("viewer")],
|
|
38
|
-
],
|
|
39
|
-
});
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/environment.fga — a member's credential
|
|
3
|
-
* store: owner-only writes (no admin arm), an org-visibility axis capped
|
|
4
|
-
* at the organization (`kind_meta` supports_org only — no public
|
|
5
|
-
* wildcard on the viewer line, and the evaluator would ignore one), and
|
|
6
|
-
* `can_read_secrets: creator`, the one verb that stays with the person
|
|
7
|
-
* who typed the values whatever the visibility, standing on the creator
|
|
8
|
-
* tuple `kind_meta` flags with requires_creator_tuple.
|
|
9
|
-
*/
|
|
10
|
-
import { EnvironmentSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/api_pb";
|
|
11
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
computed,
|
|
15
|
-
declareKind,
|
|
16
|
-
direct,
|
|
17
|
-
objectOf,
|
|
18
|
-
union,
|
|
19
|
-
usersetOf,
|
|
20
|
-
} from "./rewrite.js";
|
|
21
|
-
|
|
22
|
-
export const environmentDeclaration = declareKind({
|
|
23
|
-
kind: ApiResourceKind.environment,
|
|
24
|
-
schema: EnvironmentSchema,
|
|
25
|
-
source: "fga/model/agentic/environment.fga",
|
|
26
|
-
relations: [
|
|
27
|
-
["organization", direct(objectOf("organization"))],
|
|
28
|
-
["creator", direct(objectOf("identity_account"))],
|
|
29
|
-
["owner", direct(objectOf("identity_account"))],
|
|
30
|
-
[
|
|
31
|
-
"viewer",
|
|
32
|
-
union(
|
|
33
|
-
direct(
|
|
34
|
-
objectOf("identity_account"),
|
|
35
|
-
usersetOf("organization", "member"),
|
|
36
|
-
usersetOf("organization", "viewer"),
|
|
37
|
-
),
|
|
38
|
-
computed("owner"),
|
|
39
|
-
),
|
|
40
|
-
],
|
|
41
|
-
["can_view", computed("viewer")],
|
|
42
|
-
["can_edit", computed("owner")],
|
|
43
|
-
["can_delete", computed("owner")],
|
|
44
|
-
["can_read_secrets", computed("creator")],
|
|
45
|
-
["can_grant_access", computed("owner")],
|
|
46
|
-
["can_view_access", computed("viewer")],
|
|
47
|
-
],
|
|
48
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/execution_context.fga — a run's working
|
|
3
|
-
* state, owner-only and unscoped (`kind_meta` OWNER_ONLY): two verbs,
|
|
4
|
-
* both `owner`, and no access list to grant on.
|
|
5
|
-
*/
|
|
6
|
-
import { ExecutionContextSchema } from "@stigmer/protos/ai/stigmer/agentic/executioncontext/v1/api_pb";
|
|
7
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
8
|
-
|
|
9
|
-
import { computed, declareKind, direct, objectOf } from "./rewrite.js";
|
|
10
|
-
|
|
11
|
-
export const executionContextDeclaration = declareKind({
|
|
12
|
-
kind: ApiResourceKind.execution_context,
|
|
13
|
-
schema: ExecutionContextSchema,
|
|
14
|
-
source: "fga/model/agentic/execution_context.fga",
|
|
15
|
-
relations: [
|
|
16
|
-
["owner", direct(objectOf("identity_account"))],
|
|
17
|
-
["can_view", computed("owner")],
|
|
18
|
-
["can_edit", computed("owner")],
|
|
19
|
-
],
|
|
20
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/iam/iam_policy.fga — the access-list row as an
|
|
3
|
-
* object of the model: its organization's admins own and view it. Declared
|
|
4
|
-
* for completeness of the transcript set (the drift compare reads every
|
|
5
|
-
* open-source file); no wire check targets it — the IamPolicy RPCs
|
|
6
|
-
* authorize against the policy's RESOURCE (`can_grant_access` on the
|
|
7
|
-
* organization; `get` loads the row and asks about what it names), and the
|
|
8
|
-
* tuple lifecycle writes nothing for it.
|
|
9
|
-
*/
|
|
10
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
11
|
-
import { IamPolicySchema } from "@stigmer/protos/ai/stigmer/iam/iampolicy/v1/api_pb";
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
computed,
|
|
15
|
-
declareKind,
|
|
16
|
-
direct,
|
|
17
|
-
from,
|
|
18
|
-
objectOf,
|
|
19
|
-
union,
|
|
20
|
-
} from "./rewrite.js";
|
|
21
|
-
|
|
22
|
-
export const iamPolicyDeclaration = declareKind({
|
|
23
|
-
kind: ApiResourceKind.iam_policy,
|
|
24
|
-
schema: IamPolicySchema,
|
|
25
|
-
source: "fga/model/iam/iam_policy.fga",
|
|
26
|
-
relations: [
|
|
27
|
-
["organization", direct(objectOf("organization"))],
|
|
28
|
-
[
|
|
29
|
-
"owner",
|
|
30
|
-
union(
|
|
31
|
-
direct(objectOf("identity_account")),
|
|
32
|
-
from("admin", "organization"),
|
|
33
|
-
),
|
|
34
|
-
],
|
|
35
|
-
["viewer", from("admin", "organization")],
|
|
36
|
-
["can_view", computed("viewer")],
|
|
37
|
-
["can_edit", computed("owner")],
|
|
38
|
-
["can_delete", computed("owner")],
|
|
39
|
-
["can_grant_access", computed("owner")],
|
|
40
|
-
["can_view_access", computed("viewer")],
|
|
41
|
-
],
|
|
42
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/iam/identity_account.fga — a person's own
|
|
3
|
-
* record: every verb is `owner`, and the owner is the account itself
|
|
4
|
-
* (`kind_meta` attribution SELF, so the derivation writes
|
|
5
|
-
* `identity_account:<id>#owner@identity_account:<id>`). No organization
|
|
6
|
-
* link and no admin arm: an admin manages members through IamPolicy rows
|
|
7
|
-
* on the organization, never through the account row.
|
|
8
|
-
*/
|
|
9
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
10
|
-
import { IdentityAccountSchema } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
11
|
-
|
|
12
|
-
import { computed, declareKind, direct, objectOf } from "./rewrite.js";
|
|
13
|
-
|
|
14
|
-
export const identityAccountDeclaration = declareKind({
|
|
15
|
-
kind: ApiResourceKind.identity_account,
|
|
16
|
-
schema: IdentityAccountSchema,
|
|
17
|
-
source: "fga/model/iam/identity_account.fga",
|
|
18
|
-
relations: [
|
|
19
|
-
["owner", direct(objectOf("identity_account"))],
|
|
20
|
-
["can_view", computed("owner")],
|
|
21
|
-
["can_edit", computed("owner")],
|
|
22
|
-
["can_delete", computed("owner")],
|
|
23
|
-
["can_grant_access", computed("owner")],
|
|
24
|
-
["can_view_access", computed("owner")],
|
|
25
|
-
],
|
|
26
|
-
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/mcp_server.fga — a blueprint with three
|
|
3
|
-
* read-side verbs: `can_use`, `can_clone` and `can_connect` (the OAuth
|
|
4
|
-
* connect lane's gate), all `viewer`. `team#member` on `viewer` is the
|
|
5
|
-
* Enterprise team grant, which no open-source tuple ever names.
|
|
6
|
-
*/
|
|
7
|
-
import { McpServerSchema } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
8
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
computed,
|
|
12
|
-
declareKind,
|
|
13
|
-
direct,
|
|
14
|
-
from,
|
|
15
|
-
objectOf,
|
|
16
|
-
union,
|
|
17
|
-
usersetOf,
|
|
18
|
-
} from "./rewrite.js";
|
|
19
|
-
|
|
20
|
-
export const mcpServerDeclaration = declareKind({
|
|
21
|
-
kind: ApiResourceKind.mcp_server,
|
|
22
|
-
schema: McpServerSchema,
|
|
23
|
-
source: "fga/model/agentic/mcp_server.fga",
|
|
24
|
-
relations: [
|
|
25
|
-
["organization", direct(objectOf("organization"))],
|
|
26
|
-
[
|
|
27
|
-
"owner",
|
|
28
|
-
union(
|
|
29
|
-
direct(objectOf("identity_account")),
|
|
30
|
-
from("admin", "organization"),
|
|
31
|
-
),
|
|
32
|
-
],
|
|
33
|
-
[
|
|
34
|
-
"platform_viewer",
|
|
35
|
-
direct(usersetOf("identity_provider", "platform_user")),
|
|
36
|
-
],
|
|
37
|
-
[
|
|
38
|
-
"viewer",
|
|
39
|
-
union(
|
|
40
|
-
direct(
|
|
41
|
-
objectOf("identity_account"),
|
|
42
|
-
usersetOf("organization", "member"),
|
|
43
|
-
usersetOf("organization", "viewer"),
|
|
44
|
-
usersetOf("team", "member"),
|
|
45
|
-
),
|
|
46
|
-
computed("owner"),
|
|
47
|
-
computed("platform_viewer"),
|
|
48
|
-
),
|
|
49
|
-
],
|
|
50
|
-
["can_view", computed("viewer")],
|
|
51
|
-
["can_edit", computed("owner")],
|
|
52
|
-
["can_delete", computed("owner")],
|
|
53
|
-
["can_use", computed("viewer")],
|
|
54
|
-
["can_clone", computed("viewer")],
|
|
55
|
-
["can_connect", computed("viewer")],
|
|
56
|
-
["can_grant_access", computed("owner")],
|
|
57
|
-
["can_view_access", computed("viewer")],
|
|
58
|
-
],
|
|
59
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/agentic/memory.fga — subject-only: the person a
|
|
3
|
-
* memory is ABOUT is its one principal (no owner, no creator, no
|
|
4
|
-
* visibility, nothing grantable; `kind_meta` attribution NONE with
|
|
5
|
-
* `subject` as an additional parent on `spec.subject_identity_account_id`).
|
|
6
|
-
* Organization admins govern the organization's memory switch and never
|
|
7
|
-
* read content, in the contract's own words. A row whose subject field is
|
|
8
|
-
* empty derives no principal at all — the derivation's rule for an
|
|
9
|
-
* absent parent — and is then nobody's under this evaluator.
|
|
10
|
-
*/
|
|
11
|
-
import { MemorySchema } from "@stigmer/protos/ai/stigmer/agentic/memory/v1/api_pb";
|
|
12
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
13
|
-
|
|
14
|
-
import { computed, declareKind, direct, objectOf } from "./rewrite.js";
|
|
15
|
-
|
|
16
|
-
export const memoryDeclaration = declareKind({
|
|
17
|
-
kind: ApiResourceKind.memory,
|
|
18
|
-
schema: MemorySchema,
|
|
19
|
-
source: "fga/model/agentic/memory.fga",
|
|
20
|
-
relations: [
|
|
21
|
-
["organization", direct(objectOf("organization"))],
|
|
22
|
-
["subject", direct(objectOf("identity_account"))],
|
|
23
|
-
["can_view", computed("subject")],
|
|
24
|
-
["can_edit", computed("subject")],
|
|
25
|
-
["can_delete", computed("subject")],
|
|
26
|
-
],
|
|
27
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transcript of fga/model/iam/oauth_app.fga — an organization-scoped kind
|
|
3
|
-
* whose `owner` has NO admin arm while its `viewer` does (platform_client
|
|
4
|
-
* shares the shape, for the same reason): the file's
|
|
5
|
-
* "administrative visibility" for the organization's admins over a
|
|
6
|
-
* registration that holds vendor client credentials, with change and
|
|
7
|
-
* deletion the creator's (or an explicit grant's) alone, and no public
|
|
8
|
-
* level at all.
|
|
9
|
-
*/
|
|
10
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
11
|
-
import { OAuthAppSchema } from "@stigmer/protos/ai/stigmer/iam/oauthapp/v1/api_pb";
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
computed,
|
|
15
|
-
declareKind,
|
|
16
|
-
direct,
|
|
17
|
-
from,
|
|
18
|
-
objectOf,
|
|
19
|
-
union,
|
|
20
|
-
} from "./rewrite.js";
|
|
21
|
-
|
|
22
|
-
export const oauthAppDeclaration = declareKind({
|
|
23
|
-
kind: ApiResourceKind.oauth_app,
|
|
24
|
-
schema: OAuthAppSchema,
|
|
25
|
-
source: "fga/model/iam/oauth_app.fga",
|
|
26
|
-
relations: [
|
|
27
|
-
["organization", direct(objectOf("organization"))],
|
|
28
|
-
["owner", direct(objectOf("identity_account"))],
|
|
29
|
-
[
|
|
30
|
-
"viewer",
|
|
31
|
-
union(
|
|
32
|
-
direct(objectOf("identity_account")),
|
|
33
|
-
computed("owner"),
|
|
34
|
-
from("admin", "organization"),
|
|
35
|
-
),
|
|
36
|
-
],
|
|
37
|
-
["can_view", computed("viewer")],
|
|
38
|
-
["can_edit", computed("owner")],
|
|
39
|
-
["can_delete", computed("owner")],
|
|
40
|
-
["can_grant_access", computed("owner")],
|
|
41
|
-
["can_view_access", computed("viewer")],
|
|
42
|
-
],
|
|
43
|
-
});
|