@processfocus/cli 0.1.0-next.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/LICENSE.md +28 -0
- package/README.md +736 -0
- package/dist/bundled-db-import.mjs +475 -0
- package/dist/bundled-graphql-schema.mjs +55 -0
- package/dist/main.mjs +1444 -0
- package/dist/prepare-deployment-artifact.mjs +4 -0
- package/dist/resources/cedar/policies.cedar +315 -0
- package/dist/resources/cedar/schema.cedarschema +276 -0
- package/dist/resources/system-migrations/20251230050207_wild_ikaris/migration.sql +1 -0
- package/dist/resources/system-migrations/20251230050207_wild_ikaris/snapshot.json +10 -0
- package/dist/resources/system-migrations/20260215222342_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260217210625_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260225225114_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260304233747_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260313015405_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260317191043_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260401023429_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260401074807_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260407221320_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260409221005_lyrical_slapstick/migration.sql +588 -0
- package/dist/resources/system-migrations/20260409221005_lyrical_slapstick/snapshot.json +5580 -0
- package/dist/resources/system-migrations/20260410054541_updated-at-triggers/migration.sql +259 -0
- package/dist/resources/system-migrations/20260410054541_updated-at-triggers/snapshot.json +5580 -0
- package/dist/resources/system-migrations/20260506185000_external-participants/migration.sql +27 -0
- package/dist/resources/system-migrations/20260525081848_confused_mac_gargan/migration.sql +16 -0
- package/dist/resources/system-migrations/20260525081848_confused_mac_gargan/snapshot.json +5929 -0
- package/dist/resources/system-migrations/20260525211724_ordinary_archangel/migration.sql +1 -0
- package/dist/resources/system-migrations/20260525211724_ordinary_archangel/snapshot.json +5954 -0
- package/dist/resources/system-migrations/20260526022120_cultured_daredevil/migration.sql +1 -0
- package/dist/resources/system-migrations/20260526022120_cultured_daredevil/snapshot.json +5979 -0
- package/dist/resources/system-migrations/20260607222956_blue_maelstrom/migration.sql +26 -0
- package/dist/resources/system-migrations/20260607222956_blue_maelstrom/snapshot.json +6139 -0
- package/dist/resources/system-migrations/20260608074412_productive_guardian/migration.sql +4 -0
- package/dist/resources/system-migrations/20260608074412_productive_guardian/snapshot.json +6179 -0
- package/dist/resources/system-migrations/20260609042621_huge_hellcat/migration.sql +3 -0
- package/dist/resources/system-migrations/20260609042621_huge_hellcat/snapshot.json +6209 -0
- package/dist/resources/system-migrations/20260626224225_glorious_tenebrous/migration.sql +107 -0
- package/dist/resources/system-migrations/20260626224225_glorious_tenebrous/snapshot.json +6221 -0
- package/dist/resources/system-migrations/20260722090215_mighty_colonel_america/migration.sql +26 -0
- package/dist/resources/system-migrations/20260722090215_mighty_colonel_america/snapshot.json +6490 -0
- package/dist/resources/system-migrations/20260722234847_brainy_quasimodo/migration.sql +1 -0
- package/dist/resources/system-migrations/20260722234847_brainy_quasimodo/snapshot.json +6500 -0
- package/dist/resources/system-migrations/20260727044204_nostalgic_lightspeed/migration.sql +51 -0
- package/dist/resources/system-migrations/20260727044204_nostalgic_lightspeed/snapshot.json +6670 -0
- package/dist/resources/system-migrations/20260727044743_green_thaddeus_ross/migration.sql +30 -0
- package/dist/resources/system-migrations/20260727044743_green_thaddeus_ross/snapshot.json +6670 -0
- package/dist/resources/system-migrations/20260727085203_safe_flatman/migration.sql +80 -0
- package/dist/resources/system-migrations/20260727085203_safe_flatman/snapshot.json +6803 -0
- package/dist/resources/system-migrations/20260727192244_natural_franklin_richards/migration.sql +14 -0
- package/dist/resources/system-migrations/20260727192244_natural_franklin_richards/snapshot.json +6947 -0
- package/dist/resources/system-migrations/20260727230751_updated-at-triggers/migration.sql +1 -0
- package/dist/resources/system-migrations/20260727230751_updated-at-triggers/snapshot.json +6947 -0
- package/dist/resources/system-migrations/20260727230758_pale_mother_askani/migration.sql +25 -0
- package/dist/resources/system-migrations/20260727230758_pale_mother_askani/snapshot.json +7121 -0
- package/dist/resources/system-migrations/20260831084613_nostalgic_hannibal_king/migration.sql +4 -0
- package/dist/resources/system-migrations/20260831084613_nostalgic_hannibal_king/snapshot.json +6852 -0
- package/dist/resources/system-migrations/20260906234923_stiff_maria_hill/migration.sql +77 -0
- package/dist/resources/system-migrations/20260906234923_stiff_maria_hill/snapshot.json +7396 -0
- package/dist/resources/system-migrations/20260907104651_delegation-rename-snapshots/migration.sql +2 -0
- package/dist/resources/system-migrations/20260907104651_delegation-rename-snapshots/snapshot.json +7416 -0
- package/dist/resources/system-migrations/20260907113440_abandoned_vertigo/migration.sql +2 -0
- package/dist/resources/system-migrations/20260907113440_abandoned_vertigo/snapshot.json +7466 -0
- package/dist/resources/system-migrations/20260908002610_mute_sharon_ventura/migration.sql +87 -0
- package/dist/resources/system-migrations/20260908002610_mute_sharon_ventura/snapshot.json +7491 -0
- package/dist/resources/system-migrations/20260914100808_slippery_ultragirl/migration.sql +1 -0
- package/dist/resources/system-migrations/20260914100808_slippery_ultragirl/snapshot.json +7501 -0
- package/dist/resources/system-migrations/20260919083020_passkey-name/migration.sql +1 -0
- package/dist/resources/system-migrations/20260919083020_passkey-name/snapshot.json +7511 -0
- package/dist/resources/system-migrations/20260919094049_passkey-last-used/migration.sql +1 -0
- package/dist/resources/system-migrations/20260919094049_passkey-last-used/snapshot.json +7521 -0
- package/package.json +36 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
3
|
+
import{Effect as H}from"effect";import{spawnSync as q}from"child_process";import{cpSync as m,existsSync as S,mkdtempSync as U,rmSync as K,writeFileSync as V}from"fs";import{tmpdir as J}from"os";import*as e from"path";import{DEPLOY_ARTIFACT_FILENAME as A,DEPLOY_ARTIFACT_FORMAT as Y,DEPLOY_ARTIFACT_VERSION as B}from"@processfocus/runtime";import{Effect as i}from"effect";import{Data as t}from"effect";class O extends t.TaggedError("OrgLoadError"){}class T extends t.TaggedError("BuildError"){}class R extends t.TaggedError("GraphqlSchemaError"){}class L extends t.TaggedError("PolicyFileError"){}class D extends t.TaggedError("InitError"){}class k extends t.TaggedError("MigrationError"){constructor(r){super({...r,message:r.statement?`Migration failed: ${r.reason}. Statement: ${r.statement}`:`Migration failed: ${r.reason}`})}}class M extends t.TaggedError("AuthLoginError"){}class d extends t.TaggedError("CliError"){}class N extends t.TaggedError("CustomDomainError"){}import{readFileSync as F}from"fs";import{fileURLToPath as b}from"url";import{Schema as a}from"effect";var j=a.Struct({name:a.String,version:a.String,dependencies:a.Record({key:a.String,value:a.String})}),G=JSON.parse(F(b(new URL("../package.json",import.meta.url)),"utf8")),g=a.decodeUnknownSync(j)(G),l=(r)=>{let o=g.dependencies[r];if(o===void 0)throw Error(`Invalid @processfocus/cli package metadata: missing ${r}`);return o},{name:f,version:y}=g,tr=l("processfocus"),or={"@cedar-policy/cedar-wasm":l("@cedar-policy/cedar-wasm"),"@tursodatabase/database":l("@tursodatabase/database"),"@tursodatabase/serverless":l("@tursodatabase/serverless"),"@tursodatabase/sync":l("@tursodatabase/sync")};var h={name:f,version:y};var W=(r)=>{let o=e.relative(process.cwd(),e.resolve(r));return o&&!o.startsWith("..")?o:r},w=(r,o)=>i.scoped(i.gen(function*(){let p=e.resolve(process.cwd(),r),c=yield*i.acquireRelease(i.sync(()=>U(e.join(J(),"pfcli-deploy-stage-"))),(n)=>i.sync(()=>K(n,{recursive:!0,force:!0}))),z=e.join(c,"dist"),I=e.join(c,A),u=e.join(p,"drizzle.config.ts"),P=e.join(c,"drizzle.config.ts"),E=e.join(p,"drizzle"),_=e.join(c,"drizzle"),v=JSON.stringify({format:Y,version:B,orgPath:W(r),producer:h}),s=yield*i.try({try:()=>{m(e.join(p,"dist"),z,{recursive:!0});let n=["dist",A];if(S(u))m(u,P),n.push("drizzle.config.ts");if(S(E))m(E,_,{recursive:!0}),n.push("drizzle");return V(I,`${v}
|
|
4
|
+
`),q("zip",["-r","-q",o,...n],{cwd:c,encoding:"utf8"})},catch:(n)=>new d({message:"Failed to execute zip command",cause:n})});if(s.error)return yield*new d({message:`Failed to create deployment zip: ${s.error.message}`,cause:s.error});if(s.status!==0)return yield*new d({message:s.stderr?.trim()||`zip command failed with exit code ${String(s.status)}`})}));var x=process.argv[2],C=process.argv[3];if(x===void 0||C===void 0)throw Error("Usage: prepare-deployment-artifact <organisation-path> <artifact-path>");await H.runPromise(w(x,C));
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
// Account recovery is deliberately denied by default. The Cloud Backend's
|
|
2
|
+
// custom policy explicitly grants recoverProviderUser to human Administrators;
|
|
3
|
+
// ordinary user-administration or deployment authority must not imply recovery.
|
|
4
|
+
|
|
5
|
+
// Ordinary work includes humans and their distinct Delegations.
|
|
6
|
+
// Roles are explicit trusted facts, not inherited attributes.
|
|
7
|
+
// Provider users can complete a step if they have the step's role.
|
|
8
|
+
permit (
|
|
9
|
+
principal,
|
|
10
|
+
action == PF::Action::"complete",
|
|
11
|
+
resource is PF::Step
|
|
12
|
+
)
|
|
13
|
+
when {
|
|
14
|
+
(principal is PF::ProviderUser || principal is PF::Delegation) &&
|
|
15
|
+
resource has role &&
|
|
16
|
+
principal.roles.contains(resource.role)
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// Provider users can complete active todos for role-authorized work.
|
|
20
|
+
// Directly assigned todos are narrowed to the assigned provider user by default.
|
|
21
|
+
permit (
|
|
22
|
+
principal,
|
|
23
|
+
action == PF::Action::"complete",
|
|
24
|
+
resource is PF::Todo
|
|
25
|
+
)
|
|
26
|
+
when {
|
|
27
|
+
(principal is PF::ProviderUser || principal is PF::Delegation) &&
|
|
28
|
+
resource has role &&
|
|
29
|
+
principal.roles.contains(resource.role) &&
|
|
30
|
+
(
|
|
31
|
+
!(resource has assignedTo) ||
|
|
32
|
+
principal in resource.assignedTo
|
|
33
|
+
)
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Provider users can correct Public Completion delivery failures through a
|
|
37
|
+
// distinct action. Callers choose the responsible or execution-failure role
|
|
38
|
+
// candidate when constructing the Todo resource.
|
|
39
|
+
permit (
|
|
40
|
+
principal,
|
|
41
|
+
action == PF::Action::"publicCompletionCorrection",
|
|
42
|
+
resource is PF::Todo
|
|
43
|
+
)
|
|
44
|
+
when {
|
|
45
|
+
(principal is PF::ProviderUser || principal is PF::Delegation) &&
|
|
46
|
+
resource has role &&
|
|
47
|
+
principal.roles.contains(resource.role) &&
|
|
48
|
+
(
|
|
49
|
+
!(resource has assignedTo) ||
|
|
50
|
+
principal in resource.assignedTo
|
|
51
|
+
)
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// Service accounts with a requested role can complete unassigned role todos.
|
|
55
|
+
// Directly assigned todos stay provider-user-owned by default.
|
|
56
|
+
permit (
|
|
57
|
+
principal is PF::ServiceAccount,
|
|
58
|
+
action == PF::Action::"complete",
|
|
59
|
+
resource is PF::Todo
|
|
60
|
+
)
|
|
61
|
+
when {
|
|
62
|
+
resource has role &&
|
|
63
|
+
principal.roles.contains(resource.role) &&
|
|
64
|
+
!(resource has assignedTo)
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// Provider users can modify submitted form fields if they have the field's role.
|
|
68
|
+
permit (
|
|
69
|
+
principal,
|
|
70
|
+
action == PF::Action::"modifyField",
|
|
71
|
+
resource is PF::FormField
|
|
72
|
+
)
|
|
73
|
+
when {
|
|
74
|
+
(principal is PF::ProviderUser || principal is PF::Delegation) &&
|
|
75
|
+
resource has role &&
|
|
76
|
+
principal.roles.contains(resource.role)
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// Public todo links can complete only the todo embedded in the encrypted token.
|
|
80
|
+
// This is self-authorizing today, and intentionally keeps public-link scoping
|
|
81
|
+
// in Cedar so future revocation/scoping rules can be policy-owned.
|
|
82
|
+
permit (
|
|
83
|
+
principal is PF::PublicLink,
|
|
84
|
+
action == PF::Action::"complete",
|
|
85
|
+
resource is PF::Todo
|
|
86
|
+
)
|
|
87
|
+
when {
|
|
88
|
+
principal.todo == resource
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// Provider users can login if they have at least one role.
|
|
92
|
+
permit (
|
|
93
|
+
principal,
|
|
94
|
+
action == PF::Action::"login",
|
|
95
|
+
resource is PF::Application
|
|
96
|
+
)
|
|
97
|
+
when {
|
|
98
|
+
(principal is PF::ProviderUser || principal is PF::Delegation) &&
|
|
99
|
+
principal.roles.isEmpty() == false
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// Provider users can request any role they already have.
|
|
103
|
+
// Normally they see / can do anything for all the roles they have,
|
|
104
|
+
// this allows them to limit their view.
|
|
105
|
+
permit (
|
|
106
|
+
principal,
|
|
107
|
+
action == PF::Action::"requestRole",
|
|
108
|
+
resource is PF::Role
|
|
109
|
+
)
|
|
110
|
+
when {
|
|
111
|
+
(principal is PF::ProviderUser || principal is PF::Delegation) &&
|
|
112
|
+
principal.roles.contains(resource)
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
// actOnBehalfOf has no default permit; custom deployment policies may grant it
|
|
116
|
+
// to selected users or service accounts.
|
|
117
|
+
|
|
118
|
+
// Provider users can view executions they started.
|
|
119
|
+
permit (
|
|
120
|
+
principal,
|
|
121
|
+
action == PF::Action::"view",
|
|
122
|
+
resource is PF::Execution
|
|
123
|
+
)
|
|
124
|
+
when {
|
|
125
|
+
(principal is PF::ProviderUser || principal is PF::Delegation) &&
|
|
126
|
+
resource has startedBy &&
|
|
127
|
+
principal in resource.startedBy
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// restart has no default permit; custom deployment policies may grant it.
|
|
131
|
+
|
|
132
|
+
// skipScheduleWaits has no default permit; custom deployment policies must
|
|
133
|
+
// explicitly grant it on the selected Process. Ordinary start permission is
|
|
134
|
+
// still required independently.
|
|
135
|
+
|
|
136
|
+
// Provider users can draft (view/edit draft process executions) for steps they can complete.
|
|
137
|
+
permit (
|
|
138
|
+
principal,
|
|
139
|
+
action == PF::Action::"draft",
|
|
140
|
+
resource is PF::Step
|
|
141
|
+
)
|
|
142
|
+
when {
|
|
143
|
+
(principal is PF::ProviderUser || principal is PF::Delegation) &&
|
|
144
|
+
resource has role &&
|
|
145
|
+
principal.roles.contains(resource.role)
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// Provider users with roles can access untagged GraphQL fields or fields tagged
|
|
149
|
+
// for provider-user or embedded-form use. The embed tag is also used on shared
|
|
150
|
+
// lookup fields that authenticated forms still call directly.
|
|
151
|
+
permit (
|
|
152
|
+
principal,
|
|
153
|
+
action in [PF::Action::"query", PF::Action::"mutation", PF::Action::"subscription"],
|
|
154
|
+
resource is PF::GraphQLField
|
|
155
|
+
)
|
|
156
|
+
when {
|
|
157
|
+
(principal is PF::ProviderUser || principal is PF::Delegation) &&
|
|
158
|
+
principal.roles.isEmpty() == false &&
|
|
159
|
+
(
|
|
160
|
+
!(resource has tag) ||
|
|
161
|
+
resource.tag == "providerUser" ||
|
|
162
|
+
resource.tag == "embed"
|
|
163
|
+
)
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// Frontend service account can read bootstrap organization and Cedar policy data.
|
|
167
|
+
permit (
|
|
168
|
+
principal == PF::ServiceAccount::"frontend",
|
|
169
|
+
action == PF::Action::"query",
|
|
170
|
+
resource == PF::GraphQLField::"Query.org"
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
permit (
|
|
174
|
+
principal == PF::ServiceAccount::"frontend",
|
|
175
|
+
action == PF::Action::"query",
|
|
176
|
+
resource == PF::GraphQLField::"Query.cedarPolicies"
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
permit (
|
|
180
|
+
principal == PF::ServiceAccount::"frontend",
|
|
181
|
+
action in [PF::Action::"query", PF::Action::"mutation"],
|
|
182
|
+
resource is PF::GraphQLField
|
|
183
|
+
)
|
|
184
|
+
when {
|
|
185
|
+
resource has tag && resource.tag == "embed"
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
permit (
|
|
189
|
+
principal == PF::ServiceAccount::"frontend",
|
|
190
|
+
action == PF::Action::"complete",
|
|
191
|
+
resource is PF::Step
|
|
192
|
+
)
|
|
193
|
+
when {
|
|
194
|
+
resource.embedded
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// Scheduler service account can invoke cron-tagged start mutations only.
|
|
198
|
+
permit (
|
|
199
|
+
principal == PF::ServiceAccount::"scheduler",
|
|
200
|
+
action == PF::Action::"mutation",
|
|
201
|
+
resource is PF::GraphQLField
|
|
202
|
+
)
|
|
203
|
+
when {
|
|
204
|
+
resource has tag && resource.tag == "cron"
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// Scheduler starts system-owned cron processes through the normal start-step
|
|
208
|
+
// authorization path, so only role-less start steps are allowed by default.
|
|
209
|
+
permit (
|
|
210
|
+
principal == PF::ServiceAccount::"scheduler",
|
|
211
|
+
action == PF::Action::"complete",
|
|
212
|
+
resource is PF::Step
|
|
213
|
+
)
|
|
214
|
+
when {
|
|
215
|
+
resource.startsProcess &&
|
|
216
|
+
!(resource has role)
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
// Provider users can access a List if they have one of the list's allowed roles.
|
|
220
|
+
permit (
|
|
221
|
+
principal,
|
|
222
|
+
action == PF::Action::"view",
|
|
223
|
+
resource is PF::List
|
|
224
|
+
)
|
|
225
|
+
when {
|
|
226
|
+
(principal is PF::ProviderUser || principal is PF::Delegation) &&
|
|
227
|
+
principal.roles.containsAny(resource.roles)
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
// Provider users can update a List if they have one of the list's allowed roles.
|
|
231
|
+
permit (
|
|
232
|
+
principal,
|
|
233
|
+
action == PF::Action::"update",
|
|
234
|
+
resource is PF::List
|
|
235
|
+
)
|
|
236
|
+
when {
|
|
237
|
+
(principal is PF::ProviderUser || principal is PF::Delegation) &&
|
|
238
|
+
principal.roles.containsAny(resource.roles)
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// File owners can download their own files.
|
|
242
|
+
permit (
|
|
243
|
+
principal,
|
|
244
|
+
action == PF::Action::"download",
|
|
245
|
+
resource is PF::File
|
|
246
|
+
)
|
|
247
|
+
when {
|
|
248
|
+
(principal is PF::ProviderUser || principal is PF::Delegation) &&
|
|
249
|
+
principal in resource.owner
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
// File owners can delete their own files.
|
|
253
|
+
permit (
|
|
254
|
+
principal,
|
|
255
|
+
action == PF::Action::"delete",
|
|
256
|
+
resource is PF::File
|
|
257
|
+
)
|
|
258
|
+
when {
|
|
259
|
+
(principal is PF::ProviderUser || principal is PF::Delegation) &&
|
|
260
|
+
principal in resource.owner
|
|
261
|
+
};
|
|
262
|
+
// Secret ownership is a shared boundary: organisation permits cannot authorize
|
|
263
|
+
// a human or Delegation to mint a generation for another represented user.
|
|
264
|
+
forbid (
|
|
265
|
+
principal is PF::ProviderUser,
|
|
266
|
+
action == PF::Action::"issueDelegationSecret",
|
|
267
|
+
resource is PF::ProviderUser
|
|
268
|
+
)
|
|
269
|
+
unless { principal == resource };
|
|
270
|
+
|
|
271
|
+
forbid (
|
|
272
|
+
principal is PF::Delegation,
|
|
273
|
+
action == PF::Action::"issueDelegationSecret",
|
|
274
|
+
resource is PF::ProviderUser
|
|
275
|
+
)
|
|
276
|
+
unless { principal.owner == resource };
|
|
277
|
+
|
|
278
|
+
forbid (
|
|
279
|
+
principal is PF::ProviderUser,
|
|
280
|
+
action == PF::Action::"replaceDelegation",
|
|
281
|
+
resource is PF::Delegation
|
|
282
|
+
)
|
|
283
|
+
unless { principal == resource.owner };
|
|
284
|
+
|
|
285
|
+
forbid (
|
|
286
|
+
principal is PF::Delegation,
|
|
287
|
+
action == PF::Action::"replaceDelegation",
|
|
288
|
+
resource is PF::Delegation
|
|
289
|
+
)
|
|
290
|
+
unless { principal.owner == resource.owner };
|
|
291
|
+
|
|
292
|
+
permit (
|
|
293
|
+
principal is PF::ProviderUser,
|
|
294
|
+
action in [PF::Action::"renameDelegation", PF::Action::"replaceDelegation", PF::Action::"revokeDelegation"],
|
|
295
|
+
resource is PF::Delegation
|
|
296
|
+
)
|
|
297
|
+
when { principal == resource.owner };
|
|
298
|
+
|
|
299
|
+
// Human administrators can inspect and revoke other owners' delegated access,
|
|
300
|
+
// but do not automatically gain rename, issuance, or replacement authority.
|
|
301
|
+
permit (
|
|
302
|
+
principal is PF::ProviderUser in PF::Role::"/Administrator",
|
|
303
|
+
action == PF::Action::"listDelegationTokens",
|
|
304
|
+
resource is PF::ProviderUser
|
|
305
|
+
)
|
|
306
|
+
when { principal != resource };
|
|
307
|
+
|
|
308
|
+
permit (
|
|
309
|
+
principal is PF::ProviderUser in PF::Role::"/Administrator",
|
|
310
|
+
action == PF::Action::"revokeDelegation",
|
|
311
|
+
resource is PF::Delegation
|
|
312
|
+
);
|
|
313
|
+
|
|
314
|
+
// List creation has no default grant. Organisations explicitly permit
|
|
315
|
+
// PF::Action::"create" on opted-in PF::List resources.
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
namespace PF {
|
|
2
|
+
entity Role in [OrgUnit];
|
|
3
|
+
|
|
4
|
+
entity OrgUnit in [OrgUnit] {
|
|
5
|
+
name: String,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
entity ProviderUser in [OrgUnit, Role] {
|
|
9
|
+
roles?: Set<Role>,
|
|
10
|
+
orgUnit?: OrgUnit,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
entity ServiceAccount {
|
|
14
|
+
roles: Set<Role>,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// Membership does not inherit ProviderUser's type or attributes.
|
|
18
|
+
entity Delegation in [ProviderUser, OrgUnit, Role] {
|
|
19
|
+
owner: ProviderUser,
|
|
20
|
+
name: String,
|
|
21
|
+
roles: Set<Role>,
|
|
22
|
+
orgUnit: OrgUnit,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
entity PublicLink {
|
|
26
|
+
todo: Todo,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
entity Todo in [Step, Process] {
|
|
30
|
+
step?: Step,
|
|
31
|
+
role?: Role,
|
|
32
|
+
assignedTo?: ProviderUser,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
entity Step in [Process] {
|
|
36
|
+
role?: Role,
|
|
37
|
+
startsProcess: Bool,
|
|
38
|
+
embedded: Bool,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
entity FormField in [Step] {
|
|
42
|
+
step: Step,
|
|
43
|
+
process: Process,
|
|
44
|
+
fieldName: String,
|
|
45
|
+
role?: Role,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
entity Process in [OrgUnit] {};
|
|
49
|
+
|
|
50
|
+
action skipScheduleWaits appliesTo {
|
|
51
|
+
principal: [ProviderUser, ServiceAccount, Delegation],
|
|
52
|
+
resource: Process,
|
|
53
|
+
context: { requestTime: datetime, nodeEnv: String }
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
entity List in [OrgUnit] {
|
|
57
|
+
roles: Set<Role>,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
entity Execution in [Process, OrgUnit] {
|
|
61
|
+
startedBy?: ProviderUser,
|
|
62
|
+
startedByRole?: Role,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
entity File in [OrgUnit] {
|
|
66
|
+
owner: ProviderUser,
|
|
67
|
+
documentStore: String,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
entity Application;
|
|
71
|
+
|
|
72
|
+
entity GraphQLField {
|
|
73
|
+
tag?: String,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// Context available for all authorization requests
|
|
77
|
+
type RequestContext = {
|
|
78
|
+
requestTime: datetime,
|
|
79
|
+
nodeEnv: String,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// Complete action for steps
|
|
83
|
+
action complete appliesTo {
|
|
84
|
+
principal: [ProviderUser, Delegation, ServiceAccount, PublicLink],
|
|
85
|
+
resource: [Step, Todo],
|
|
86
|
+
context: RequestContext,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// Provider-user action for correcting Public Completion delivery failures.
|
|
90
|
+
action publicCompletionCorrection appliesTo {
|
|
91
|
+
principal: [ProviderUser, Delegation],
|
|
92
|
+
resource: Todo,
|
|
93
|
+
context: RequestContext,
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// View action for executions and lists
|
|
97
|
+
action view appliesTo {
|
|
98
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
99
|
+
resource: [Execution, List],
|
|
100
|
+
context: RequestContext,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// Restart action for executions (retry failed system steps)
|
|
104
|
+
action restart appliesTo {
|
|
105
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
106
|
+
resource: Execution,
|
|
107
|
+
context: RequestContext,
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// Abandon action for cancelling running executions (checked against active steps)
|
|
111
|
+
action abandon appliesTo {
|
|
112
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
113
|
+
resource: Step,
|
|
114
|
+
context: RequestContext,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// Update action for lists
|
|
118
|
+
action create appliesTo {
|
|
119
|
+
principal: [ProviderUser, Delegation],
|
|
120
|
+
resource: List,
|
|
121
|
+
context: RequestContext,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
action update appliesTo {
|
|
125
|
+
principal: [ProviderUser, Delegation],
|
|
126
|
+
resource: List,
|
|
127
|
+
context: RequestContext,
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
action login appliesTo {
|
|
131
|
+
principal: [ProviderUser, Delegation],
|
|
132
|
+
resource: Application,
|
|
133
|
+
context: RequestContext,
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
action requestRole appliesTo {
|
|
137
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
138
|
+
resource: Role,
|
|
139
|
+
context: RequestContext,
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
action requestProviderUserPermissions appliesTo {
|
|
143
|
+
principal: [Delegation, ServiceAccount],
|
|
144
|
+
resource: ProviderUser,
|
|
145
|
+
context: RequestContext,
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
action actOnBehalfOf appliesTo {
|
|
149
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
150
|
+
resource: ProviderUser,
|
|
151
|
+
context: RequestContext,
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
action issueDelegationSecret appliesTo {
|
|
155
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
156
|
+
resource: ProviderUser,
|
|
157
|
+
context: {
|
|
158
|
+
requestTime: datetime,
|
|
159
|
+
nodeEnv: String,
|
|
160
|
+
ownerProviderUserId: String,
|
|
161
|
+
humanSession: Bool,
|
|
162
|
+
humanAuthentication?: {
|
|
163
|
+
providerUserId: String,
|
|
164
|
+
method: String,
|
|
165
|
+
ageMillis: Long,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
action renameDelegation, replaceDelegation, revokeDelegation appliesTo {
|
|
171
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
172
|
+
resource: Delegation,
|
|
173
|
+
context: RequestContext,
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
action listDelegationTokens appliesTo {
|
|
177
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
178
|
+
resource: ProviderUser,
|
|
179
|
+
context: RequestContext,
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// Draft action for viewing/editing draft process executions
|
|
183
|
+
action draft appliesTo {
|
|
184
|
+
principal: [ProviderUser, Delegation],
|
|
185
|
+
resource: Step,
|
|
186
|
+
context: RequestContext,
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
action modifyField appliesTo {
|
|
190
|
+
principal: [ProviderUser, Delegation],
|
|
191
|
+
resource: FormField,
|
|
192
|
+
context: RequestContext,
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
// GraphQL field authorization actions
|
|
196
|
+
action query appliesTo {
|
|
197
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
198
|
+
resource: GraphQLField,
|
|
199
|
+
context: RequestContext,
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
action mutation appliesTo {
|
|
203
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
204
|
+
resource: GraphQLField,
|
|
205
|
+
context: RequestContext,
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
action subscription appliesTo {
|
|
209
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
210
|
+
resource: GraphQLField,
|
|
211
|
+
context: RequestContext,
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
// Download action for files
|
|
215
|
+
action download appliesTo {
|
|
216
|
+
principal: [ProviderUser, Delegation],
|
|
217
|
+
resource: File,
|
|
218
|
+
context: RequestContext,
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
// Delete action for files and lists
|
|
222
|
+
action delete appliesTo {
|
|
223
|
+
principal: [ProviderUser, Delegation],
|
|
224
|
+
resource: [File, List],
|
|
225
|
+
context: RequestContext,
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
// Feature-level authorization actions targeting Application
|
|
229
|
+
action administerUsers appliesTo {
|
|
230
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
231
|
+
resource: Application,
|
|
232
|
+
context: RequestContext,
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
action administerOAuthProviders appliesTo {
|
|
236
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
237
|
+
resource: Application,
|
|
238
|
+
context: RequestContext,
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
action administerProjectStageConfig appliesTo {
|
|
242
|
+
principal: [ProviderUser, Delegation],
|
|
243
|
+
resource: Application,
|
|
244
|
+
context: RequestContext,
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
action recoverProviderUser appliesTo {
|
|
248
|
+
principal: [ProviderUser],
|
|
249
|
+
resource: Application,
|
|
250
|
+
context: RequestContext,
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
action showProcessState appliesTo {
|
|
254
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
255
|
+
resource: Application,
|
|
256
|
+
context: RequestContext,
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
action viewAuthorization appliesTo {
|
|
260
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
261
|
+
resource: Application,
|
|
262
|
+
context: RequestContext,
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
action databaseShell appliesTo {
|
|
266
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
267
|
+
resource: Application,
|
|
268
|
+
context: RequestContext,
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
action databaseTransfer appliesTo {
|
|
272
|
+
principal: [ProviderUser, Delegation, ServiceAccount],
|
|
273
|
+
resource: Application,
|
|
274
|
+
context: RequestContext,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SELECT 1; -- no-op placeholder
|
package/dist/resources/system-migrations/20260215222342_legacy_deploy_placeholder/migration.sql
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SELECT 1;
|
package/dist/resources/system-migrations/20260217210625_legacy_deploy_placeholder/migration.sql
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SELECT 1;
|
package/dist/resources/system-migrations/20260225225114_legacy_deploy_placeholder/migration.sql
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SELECT 1;
|
package/dist/resources/system-migrations/20260304233747_legacy_deploy_placeholder/migration.sql
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SELECT 1;
|
package/dist/resources/system-migrations/20260313015405_legacy_deploy_placeholder/migration.sql
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SELECT 1;
|
package/dist/resources/system-migrations/20260317191043_legacy_deploy_placeholder/migration.sql
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SELECT 1;
|
package/dist/resources/system-migrations/20260401023429_legacy_deploy_placeholder/migration.sql
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SELECT 1;
|
package/dist/resources/system-migrations/20260401074807_legacy_deploy_placeholder/migration.sql
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SELECT 1;
|
package/dist/resources/system-migrations/20260407221320_legacy_deploy_placeholder/migration.sql
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SELECT 1;
|