@openvtc/trust-tasks 0.23.2 → 0.23.4
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/CHANGELOG.md +49 -0
- package/dist/git-ns/bridge/event/0.4/payload.d.ts +1898 -0
- package/dist/git-ns/bridge/event/0.4/payload.d.ts.map +1 -0
- package/dist/git-ns/bridge/event/0.4/payload.js +1085 -0
- package/dist/git-ns/bridge/event/0.4/payload.js.map +1 -0
- package/dist/git-ns/bridge/job/0.5/payload.d.ts +1106 -0
- package/dist/git-ns/bridge/job/0.5/payload.d.ts.map +1 -0
- package/dist/git-ns/bridge/job/0.5/payload.js +594 -0
- package/dist/git-ns/bridge/job/0.5/payload.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/git-ns/bridge/event/0.4/payload.ts +1283 -0
- package/src/git-ns/bridge/job/0.5/payload.ts +728 -0
- package/src/index.ts +2 -0
|
@@ -0,0 +1,1085 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/git-ns/bridge/event/0.4/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
/** Trust Task type URI. */
|
|
6
|
+
export const TYPE_URI = "https://trusttasks.org/spec/git-ns/bridge/event/0.4";
|
|
7
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
8
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/git-ns/bridge/event/0.4#response";
|
|
9
|
+
/**
|
|
10
|
+
* This specification's payload schema, as a value.
|
|
11
|
+
*
|
|
12
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
13
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
14
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
15
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
16
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
17
|
+
*/
|
|
18
|
+
export const PAYLOAD_SCHEMA = {
|
|
19
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
20
|
+
"$id": "https://trusttasks.org/spec/git-ns/bridge/event/0.4",
|
|
21
|
+
"title": "Git Namespaces — Bridge Event — payload",
|
|
22
|
+
"description": "The bridge tells the VTC something happened on the forge — translated from the forge's webhook or found by an inspection sweep — together with any drift it now sees; or reports the role map it projects with, or a pull request opened or reopened on a governed repository.",
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": [
|
|
26
|
+
"namespace",
|
|
27
|
+
"event"
|
|
28
|
+
],
|
|
29
|
+
"properties": {
|
|
30
|
+
"namespace": {
|
|
31
|
+
"$ref": "#/$defs/NamespaceId",
|
|
32
|
+
"description": "The namespace the event happened in."
|
|
33
|
+
},
|
|
34
|
+
"event": {
|
|
35
|
+
"$ref": "#/$defs/ForgeEvent"
|
|
36
|
+
},
|
|
37
|
+
"drift": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"$ref": "#/$defs/DriftItem"
|
|
41
|
+
},
|
|
42
|
+
"description": "The complete outstanding drift for each repository the event concerns, replacing what the VTC held for those repositories. Absent: the event changes no repository's drift."
|
|
43
|
+
},
|
|
44
|
+
"ext": {
|
|
45
|
+
"$ref": "#/$defs/Ext"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"$defs": {
|
|
49
|
+
"JobId": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"minLength": 1,
|
|
52
|
+
"maxLength": 128,
|
|
53
|
+
"description": "The VTC's identifier for a job, unique across the VTC's jobs."
|
|
54
|
+
},
|
|
55
|
+
"ForgeRole": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"minLength": 1,
|
|
58
|
+
"maxLength": 64,
|
|
59
|
+
"description": "A role in the forge's own vocabulary (`maintain`, `write`)."
|
|
60
|
+
},
|
|
61
|
+
"ForgeEvent": {
|
|
62
|
+
"title": "ForgeEvent",
|
|
63
|
+
"description": "One forge-neutral event, discriminated by `type`. The specification's event table says what each type means and what the VTC does with it.",
|
|
64
|
+
"type": "object",
|
|
65
|
+
"oneOf": [
|
|
66
|
+
{
|
|
67
|
+
"title": "RepoRenamed",
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": [
|
|
71
|
+
"type",
|
|
72
|
+
"forgeId",
|
|
73
|
+
"from",
|
|
74
|
+
"to"
|
|
75
|
+
],
|
|
76
|
+
"properties": {
|
|
77
|
+
"type": {
|
|
78
|
+
"const": "repoRenamed"
|
|
79
|
+
},
|
|
80
|
+
"forgeId": {
|
|
81
|
+
"$ref": "#/$defs/ForgeId"
|
|
82
|
+
},
|
|
83
|
+
"from": {
|
|
84
|
+
"$ref": "#/$defs/RepoResource"
|
|
85
|
+
},
|
|
86
|
+
"to": {
|
|
87
|
+
"$ref": "#/$defs/RepoResource"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"title": "RepoTransferred",
|
|
93
|
+
"type": "object",
|
|
94
|
+
"additionalProperties": false,
|
|
95
|
+
"required": [
|
|
96
|
+
"type",
|
|
97
|
+
"forgeId",
|
|
98
|
+
"from",
|
|
99
|
+
"to"
|
|
100
|
+
],
|
|
101
|
+
"properties": {
|
|
102
|
+
"type": {
|
|
103
|
+
"const": "repoTransferred"
|
|
104
|
+
},
|
|
105
|
+
"forgeId": {
|
|
106
|
+
"$ref": "#/$defs/ForgeId"
|
|
107
|
+
},
|
|
108
|
+
"from": {
|
|
109
|
+
"$ref": "#/$defs/RepoResource"
|
|
110
|
+
},
|
|
111
|
+
"to": {
|
|
112
|
+
"$ref": "#/$defs/RepoResource"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"title": "RepoCreatedUnmanaged",
|
|
118
|
+
"type": "object",
|
|
119
|
+
"additionalProperties": false,
|
|
120
|
+
"required": [
|
|
121
|
+
"type",
|
|
122
|
+
"forgeId",
|
|
123
|
+
"resource"
|
|
124
|
+
],
|
|
125
|
+
"properties": {
|
|
126
|
+
"type": {
|
|
127
|
+
"const": "repoCreatedUnmanaged"
|
|
128
|
+
},
|
|
129
|
+
"forgeId": {
|
|
130
|
+
"$ref": "#/$defs/ForgeId"
|
|
131
|
+
},
|
|
132
|
+
"resource": {
|
|
133
|
+
"$ref": "#/$defs/RepoResource"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"title": "RepoDeleted",
|
|
139
|
+
"type": "object",
|
|
140
|
+
"additionalProperties": false,
|
|
141
|
+
"required": [
|
|
142
|
+
"type",
|
|
143
|
+
"forgeId",
|
|
144
|
+
"resource"
|
|
145
|
+
],
|
|
146
|
+
"properties": {
|
|
147
|
+
"type": {
|
|
148
|
+
"const": "repoDeleted"
|
|
149
|
+
},
|
|
150
|
+
"forgeId": {
|
|
151
|
+
"$ref": "#/$defs/ForgeId"
|
|
152
|
+
},
|
|
153
|
+
"resource": {
|
|
154
|
+
"$ref": "#/$defs/RepoResource"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"title": "RoleChanged",
|
|
160
|
+
"type": "object",
|
|
161
|
+
"additionalProperties": false,
|
|
162
|
+
"required": [
|
|
163
|
+
"type",
|
|
164
|
+
"forgeId",
|
|
165
|
+
"resource",
|
|
166
|
+
"account"
|
|
167
|
+
],
|
|
168
|
+
"properties": {
|
|
169
|
+
"type": {
|
|
170
|
+
"const": "roleChanged"
|
|
171
|
+
},
|
|
172
|
+
"forgeId": {
|
|
173
|
+
"$ref": "#/$defs/ForgeId"
|
|
174
|
+
},
|
|
175
|
+
"resource": {
|
|
176
|
+
"$ref": "#/$defs/RepoResource"
|
|
177
|
+
},
|
|
178
|
+
"account": {
|
|
179
|
+
"$ref": "#/$defs/ForgeAccount"
|
|
180
|
+
},
|
|
181
|
+
"role": {
|
|
182
|
+
"$ref": "#/$defs/ForgeRole",
|
|
183
|
+
"description": "The role the account now holds. Absent: the account holds no role now."
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"title": "ProtectionChanged",
|
|
189
|
+
"type": "object",
|
|
190
|
+
"additionalProperties": false,
|
|
191
|
+
"required": [
|
|
192
|
+
"type",
|
|
193
|
+
"forgeId",
|
|
194
|
+
"resource",
|
|
195
|
+
"requiredCheck"
|
|
196
|
+
],
|
|
197
|
+
"properties": {
|
|
198
|
+
"type": {
|
|
199
|
+
"const": "protectionChanged"
|
|
200
|
+
},
|
|
201
|
+
"forgeId": {
|
|
202
|
+
"$ref": "#/$defs/ForgeId"
|
|
203
|
+
},
|
|
204
|
+
"resource": {
|
|
205
|
+
"$ref": "#/$defs/RepoResource"
|
|
206
|
+
},
|
|
207
|
+
"requiredCheck": {
|
|
208
|
+
"type": "boolean",
|
|
209
|
+
"description": "Whether the forge still refuses merges without a passing verify-trust check, with no bypass."
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"title": "InstallationRemoved",
|
|
215
|
+
"type": "object",
|
|
216
|
+
"additionalProperties": false,
|
|
217
|
+
"required": [
|
|
218
|
+
"type"
|
|
219
|
+
],
|
|
220
|
+
"properties": {
|
|
221
|
+
"type": {
|
|
222
|
+
"const": "installationRemoved"
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"title": "AccountLinked",
|
|
228
|
+
"type": "object",
|
|
229
|
+
"additionalProperties": false,
|
|
230
|
+
"required": [
|
|
231
|
+
"type",
|
|
232
|
+
"jobId",
|
|
233
|
+
"account"
|
|
234
|
+
],
|
|
235
|
+
"properties": {
|
|
236
|
+
"type": {
|
|
237
|
+
"const": "accountLinked"
|
|
238
|
+
},
|
|
239
|
+
"jobId": {
|
|
240
|
+
"$ref": "#/$defs/JobId",
|
|
241
|
+
"description": "The beginAccountLink job."
|
|
242
|
+
},
|
|
243
|
+
"account": {
|
|
244
|
+
"$ref": "#/$defs/ForgeAccount"
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"title": "BindCompleted",
|
|
250
|
+
"type": "object",
|
|
251
|
+
"additionalProperties": false,
|
|
252
|
+
"required": [
|
|
253
|
+
"type",
|
|
254
|
+
"jobId",
|
|
255
|
+
"ownerId",
|
|
256
|
+
"kind"
|
|
257
|
+
],
|
|
258
|
+
"properties": {
|
|
259
|
+
"type": {
|
|
260
|
+
"const": "bindCompleted"
|
|
261
|
+
},
|
|
262
|
+
"jobId": {
|
|
263
|
+
"$ref": "#/$defs/JobId",
|
|
264
|
+
"description": "The beginBind job."
|
|
265
|
+
},
|
|
266
|
+
"ownerId": {
|
|
267
|
+
"$ref": "#/$defs/ForgeId",
|
|
268
|
+
"description": "The forge's id for the owner, which survives renames."
|
|
269
|
+
},
|
|
270
|
+
"kind": {
|
|
271
|
+
"type": "string",
|
|
272
|
+
"enum": [
|
|
273
|
+
"organization",
|
|
274
|
+
"user"
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"title": "RoleMapReported",
|
|
281
|
+
"type": "object",
|
|
282
|
+
"additionalProperties": false,
|
|
283
|
+
"required": [
|
|
284
|
+
"type",
|
|
285
|
+
"roleMap",
|
|
286
|
+
"ladder"
|
|
287
|
+
],
|
|
288
|
+
"properties": {
|
|
289
|
+
"type": {
|
|
290
|
+
"const": "roleMapReported"
|
|
291
|
+
},
|
|
292
|
+
"roleMap": {
|
|
293
|
+
"$ref": "#/$defs/RoleMap"
|
|
294
|
+
},
|
|
295
|
+
"ladder": {
|
|
296
|
+
"type": "array",
|
|
297
|
+
"minItems": 1,
|
|
298
|
+
"maxItems": 5,
|
|
299
|
+
"uniqueItems": true,
|
|
300
|
+
"description": "The levels the forge offers as a direct role on a repository in the namespace, lowest first, without `none` (which every forge has). Every role in `roleMap` and in each `repos[].roleMap` is `none` or one of these.",
|
|
301
|
+
"items": {
|
|
302
|
+
"$ref": "#/$defs/MappedRole"
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
"repos": {
|
|
306
|
+
"type": "array",
|
|
307
|
+
"maxItems": 1000,
|
|
308
|
+
"description": "Repositories whose own map differs from `roleMap`, each at most once. Absent or empty: every repository uses `roleMap`.",
|
|
309
|
+
"items": {
|
|
310
|
+
"type": "object",
|
|
311
|
+
"additionalProperties": false,
|
|
312
|
+
"required": [
|
|
313
|
+
"resource",
|
|
314
|
+
"roleMap"
|
|
315
|
+
],
|
|
316
|
+
"properties": {
|
|
317
|
+
"resource": {
|
|
318
|
+
"$ref": "#/$defs/RepoResource"
|
|
319
|
+
},
|
|
320
|
+
"roleMap": {
|
|
321
|
+
"$ref": "#/$defs/RoleMap"
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"stale": {
|
|
327
|
+
"type": "array",
|
|
328
|
+
"maxItems": 10000,
|
|
329
|
+
"uniqueItems": true,
|
|
330
|
+
"description": "Repositories whose forge roles the bridge last projected under a different map from the one it now applies to them. Absent or empty: none.",
|
|
331
|
+
"items": {
|
|
332
|
+
"$ref": "#/$defs/RepoResource"
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"title": "PullRequestOpened",
|
|
339
|
+
"type": "object",
|
|
340
|
+
"additionalProperties": false,
|
|
341
|
+
"required": [
|
|
342
|
+
"type",
|
|
343
|
+
"forgeId",
|
|
344
|
+
"resource",
|
|
345
|
+
"number",
|
|
346
|
+
"action",
|
|
347
|
+
"author",
|
|
348
|
+
"actor"
|
|
349
|
+
],
|
|
350
|
+
"properties": {
|
|
351
|
+
"type": {
|
|
352
|
+
"const": "pullRequestOpened"
|
|
353
|
+
},
|
|
354
|
+
"forgeId": {
|
|
355
|
+
"$ref": "#/$defs/ForgeId",
|
|
356
|
+
"description": "The forge's id for the repository the pull request targets."
|
|
357
|
+
},
|
|
358
|
+
"resource": {
|
|
359
|
+
"$ref": "#/$defs/RepoResource",
|
|
360
|
+
"description": "The repository the pull request targets (its base repository)."
|
|
361
|
+
},
|
|
362
|
+
"number": {
|
|
363
|
+
"type": "integer",
|
|
364
|
+
"minimum": 1,
|
|
365
|
+
"description": "The pull request's number in `resource`."
|
|
366
|
+
},
|
|
367
|
+
"action": {
|
|
368
|
+
"title": "PullRequestAction",
|
|
369
|
+
"type": "string",
|
|
370
|
+
"enum": [
|
|
371
|
+
"opened",
|
|
372
|
+
"reopened"
|
|
373
|
+
],
|
|
374
|
+
"description": "`opened` — the pull request was just opened. `reopened` — a closed, unmerged pull request was reopened."
|
|
375
|
+
},
|
|
376
|
+
"author": {
|
|
377
|
+
"$ref": "#/$defs/ForgeAccount",
|
|
378
|
+
"description": "The account that opened the pull request."
|
|
379
|
+
},
|
|
380
|
+
"actor": {
|
|
381
|
+
"$ref": "#/$defs/ForgeAccount",
|
|
382
|
+
"description": "The account that performed this action: the author for `opened`, whoever reopened the pull request for `reopened`."
|
|
383
|
+
},
|
|
384
|
+
"draft": {
|
|
385
|
+
"type": "boolean",
|
|
386
|
+
"description": "Whether the pull request is a draft. Absent: the bridge does not know, or the forge has no drafts."
|
|
387
|
+
},
|
|
388
|
+
"fromFork": {
|
|
389
|
+
"type": "boolean",
|
|
390
|
+
"description": "Whether the pull request's head branch lives in another repository (a fork). Absent: the bridge does not know."
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
]
|
|
395
|
+
},
|
|
396
|
+
"Response": {
|
|
397
|
+
"$anchor": "response",
|
|
398
|
+
"title": "Git Namespaces — Bridge Event — response payload",
|
|
399
|
+
"description": "The VTC has recorded the event. Nothing else is returned.",
|
|
400
|
+
"type": "object",
|
|
401
|
+
"additionalProperties": false,
|
|
402
|
+
"required": [],
|
|
403
|
+
"properties": {
|
|
404
|
+
"ext": {
|
|
405
|
+
"$ref": "#/$defs/Ext"
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
"MappedRole": {
|
|
410
|
+
"title": "MappedRole",
|
|
411
|
+
"type": "string",
|
|
412
|
+
"enum": [
|
|
413
|
+
"none",
|
|
414
|
+
"read",
|
|
415
|
+
"triage",
|
|
416
|
+
"write",
|
|
417
|
+
"maintain",
|
|
418
|
+
"admin"
|
|
419
|
+
],
|
|
420
|
+
"description": "A level of the bridge's forge-neutral role ladder, lowest first: the vocabulary role drift's `observed` and `expected` are reported in. `none` is no direct role on the repository."
|
|
421
|
+
},
|
|
422
|
+
"RoleMap": {
|
|
423
|
+
"title": "RoleMap",
|
|
424
|
+
"description": "The forge role each repository right is given, as the forge applies it: after the forge's own ladder has rounded it down. `own` is the role `git.repo.own` projects to, `maintain` that of `git.repo.maintain`, `commit` that of `git.commit.sign` (`none` is fork-based contribution). There is no member for `git.ns.admin` or `git.repo.create`, which project to no forge role whatever a bridge is configured with. Ordered: `own` is at least `maintain`, which is at least `commit`, and `commit` is at most `write`.",
|
|
425
|
+
"type": "object",
|
|
426
|
+
"additionalProperties": false,
|
|
427
|
+
"required": [
|
|
428
|
+
"own",
|
|
429
|
+
"maintain",
|
|
430
|
+
"commit"
|
|
431
|
+
],
|
|
432
|
+
"properties": {
|
|
433
|
+
"own": {
|
|
434
|
+
"$ref": "#/$defs/MappedRole"
|
|
435
|
+
},
|
|
436
|
+
"maintain": {
|
|
437
|
+
"$ref": "#/$defs/MappedRole"
|
|
438
|
+
},
|
|
439
|
+
"commit": {
|
|
440
|
+
"$ref": "#/$defs/MappedRole"
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
"Ext": {
|
|
445
|
+
"title": "Ext",
|
|
446
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
447
|
+
"type": "object",
|
|
448
|
+
"minProperties": 1,
|
|
449
|
+
"additionalProperties": true,
|
|
450
|
+
"propertyNames": {
|
|
451
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
"ForgeAccount": {
|
|
455
|
+
"title": "ForgeAccount",
|
|
456
|
+
"description": "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.",
|
|
457
|
+
"type": "object",
|
|
458
|
+
"additionalProperties": false,
|
|
459
|
+
"required": [
|
|
460
|
+
"forge",
|
|
461
|
+
"id",
|
|
462
|
+
"login"
|
|
463
|
+
],
|
|
464
|
+
"properties": {
|
|
465
|
+
"forge": {
|
|
466
|
+
"$ref": "#/$defs/ForgeHost"
|
|
467
|
+
},
|
|
468
|
+
"id": {
|
|
469
|
+
"$ref": "#/$defs/ForgeId"
|
|
470
|
+
},
|
|
471
|
+
"login": {
|
|
472
|
+
"type": "string",
|
|
473
|
+
"minLength": 1,
|
|
474
|
+
"maxLength": 100,
|
|
475
|
+
"description": "The account's current login, as the forge reported it when last seen. Display only."
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
"ForgeId": {
|
|
480
|
+
"title": "ForgeId",
|
|
481
|
+
"description": "An identifier the forge itself assigns — a repository id, a user or organisation id — carried as a string so a forge whose ids are not numbers needs no new version. GitHub and Forgejo ids are decimal integers written as strings (`\"812736451\"`). Unlike a name, it survives renames and transfers, which is why rights and bindings are keyed by it.",
|
|
482
|
+
"type": "string",
|
|
483
|
+
"minLength": 1,
|
|
484
|
+
"maxLength": 64
|
|
485
|
+
},
|
|
486
|
+
"ForgeHost": {
|
|
487
|
+
"title": "ForgeHost",
|
|
488
|
+
"description": "The lowercased DNS host of a forge: `github.com`, a GitHub Enterprise Server host, `codeberg.org`, or a self-hosted Forgejo instance such as `git.example.org`. No scheme, no port, no path. The host is a segment of every resource, so a right never crosses forges.",
|
|
489
|
+
"type": "string",
|
|
490
|
+
"minLength": 3,
|
|
491
|
+
"maxLength": 253,
|
|
492
|
+
"pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
|
|
493
|
+
},
|
|
494
|
+
"RepoResource": {
|
|
495
|
+
"title": "RepoResource",
|
|
496
|
+
"description": "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.",
|
|
497
|
+
"type": "string",
|
|
498
|
+
"maxLength": 455,
|
|
499
|
+
"pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+/[a-z0-9_-][a-z0-9._-]{0,99}/[a-z0-9_-][a-z0-9._-]{0,99}$"
|
|
500
|
+
},
|
|
501
|
+
"DriftItem": {
|
|
502
|
+
"title": "DriftItem",
|
|
503
|
+
"description": "One difference between the forge's observed state and the VTC's projection of a repository.",
|
|
504
|
+
"type": "object",
|
|
505
|
+
"additionalProperties": false,
|
|
506
|
+
"required": [
|
|
507
|
+
"type",
|
|
508
|
+
"resource"
|
|
509
|
+
],
|
|
510
|
+
"properties": {
|
|
511
|
+
"type": {
|
|
512
|
+
"type": "string",
|
|
513
|
+
"enum": [
|
|
514
|
+
"roleAdded",
|
|
515
|
+
"roleRemoved",
|
|
516
|
+
"roleChanged",
|
|
517
|
+
"requiredCheckMissing",
|
|
518
|
+
"protectionWeakened",
|
|
519
|
+
"bootstrapMissing"
|
|
520
|
+
],
|
|
521
|
+
"description": "`roleAdded` — someone holds a forge role the projection does not give them. `roleRemoved` — a projected role is missing. `roleChanged` — a projected role is present at another level. `requiredCheckMissing` — the verify-trust check is no longer required. `protectionWeakened` — branch protection or a ruleset is weaker than the projection in another way (force-push allowed, bypass actors added). `bootstrapMissing` — a bootstrap file or variable is gone."
|
|
522
|
+
},
|
|
523
|
+
"resource": {
|
|
524
|
+
"$ref": "#/$defs/RepoResource"
|
|
525
|
+
},
|
|
526
|
+
"account": {
|
|
527
|
+
"$ref": "#/$defs/ForgeAccount",
|
|
528
|
+
"description": "Whose role differs, for the three role types."
|
|
529
|
+
},
|
|
530
|
+
"observed": {
|
|
531
|
+
"type": "string",
|
|
532
|
+
"maxLength": 256,
|
|
533
|
+
"description": "What the forge shows, in the forge's own vocabulary (a role name such as `maintain`, a setting name). Absent when nothing is there."
|
|
534
|
+
},
|
|
535
|
+
"expected": {
|
|
536
|
+
"type": "string",
|
|
537
|
+
"maxLength": 256,
|
|
538
|
+
"description": "What the projection calls for, in the forge's own vocabulary. Absent when the projection calls for nothing."
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
"NamespaceId": {
|
|
543
|
+
"title": "NamespaceId",
|
|
544
|
+
"description": "The VTC's opaque identifier for a namespace, assigned when it is bound. Stable for the life of the binding; never reused for another binding.",
|
|
545
|
+
"type": "string",
|
|
546
|
+
"minLength": 1,
|
|
547
|
+
"maxLength": 128
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
552
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
553
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
554
|
+
"$ref": "#/$defs/Response",
|
|
555
|
+
"$defs": {
|
|
556
|
+
"JobId": {
|
|
557
|
+
"type": "string",
|
|
558
|
+
"minLength": 1,
|
|
559
|
+
"maxLength": 128,
|
|
560
|
+
"description": "The VTC's identifier for a job, unique across the VTC's jobs."
|
|
561
|
+
},
|
|
562
|
+
"ForgeRole": {
|
|
563
|
+
"type": "string",
|
|
564
|
+
"minLength": 1,
|
|
565
|
+
"maxLength": 64,
|
|
566
|
+
"description": "A role in the forge's own vocabulary (`maintain`, `write`)."
|
|
567
|
+
},
|
|
568
|
+
"ForgeEvent": {
|
|
569
|
+
"title": "ForgeEvent",
|
|
570
|
+
"description": "One forge-neutral event, discriminated by `type`. The specification's event table says what each type means and what the VTC does with it.",
|
|
571
|
+
"type": "object",
|
|
572
|
+
"oneOf": [
|
|
573
|
+
{
|
|
574
|
+
"title": "RepoRenamed",
|
|
575
|
+
"type": "object",
|
|
576
|
+
"additionalProperties": false,
|
|
577
|
+
"required": [
|
|
578
|
+
"type",
|
|
579
|
+
"forgeId",
|
|
580
|
+
"from",
|
|
581
|
+
"to"
|
|
582
|
+
],
|
|
583
|
+
"properties": {
|
|
584
|
+
"type": {
|
|
585
|
+
"const": "repoRenamed"
|
|
586
|
+
},
|
|
587
|
+
"forgeId": {
|
|
588
|
+
"$ref": "#/$defs/ForgeId"
|
|
589
|
+
},
|
|
590
|
+
"from": {
|
|
591
|
+
"$ref": "#/$defs/RepoResource"
|
|
592
|
+
},
|
|
593
|
+
"to": {
|
|
594
|
+
"$ref": "#/$defs/RepoResource"
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"title": "RepoTransferred",
|
|
600
|
+
"type": "object",
|
|
601
|
+
"additionalProperties": false,
|
|
602
|
+
"required": [
|
|
603
|
+
"type",
|
|
604
|
+
"forgeId",
|
|
605
|
+
"from",
|
|
606
|
+
"to"
|
|
607
|
+
],
|
|
608
|
+
"properties": {
|
|
609
|
+
"type": {
|
|
610
|
+
"const": "repoTransferred"
|
|
611
|
+
},
|
|
612
|
+
"forgeId": {
|
|
613
|
+
"$ref": "#/$defs/ForgeId"
|
|
614
|
+
},
|
|
615
|
+
"from": {
|
|
616
|
+
"$ref": "#/$defs/RepoResource"
|
|
617
|
+
},
|
|
618
|
+
"to": {
|
|
619
|
+
"$ref": "#/$defs/RepoResource"
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"title": "RepoCreatedUnmanaged",
|
|
625
|
+
"type": "object",
|
|
626
|
+
"additionalProperties": false,
|
|
627
|
+
"required": [
|
|
628
|
+
"type",
|
|
629
|
+
"forgeId",
|
|
630
|
+
"resource"
|
|
631
|
+
],
|
|
632
|
+
"properties": {
|
|
633
|
+
"type": {
|
|
634
|
+
"const": "repoCreatedUnmanaged"
|
|
635
|
+
},
|
|
636
|
+
"forgeId": {
|
|
637
|
+
"$ref": "#/$defs/ForgeId"
|
|
638
|
+
},
|
|
639
|
+
"resource": {
|
|
640
|
+
"$ref": "#/$defs/RepoResource"
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
"title": "RepoDeleted",
|
|
646
|
+
"type": "object",
|
|
647
|
+
"additionalProperties": false,
|
|
648
|
+
"required": [
|
|
649
|
+
"type",
|
|
650
|
+
"forgeId",
|
|
651
|
+
"resource"
|
|
652
|
+
],
|
|
653
|
+
"properties": {
|
|
654
|
+
"type": {
|
|
655
|
+
"const": "repoDeleted"
|
|
656
|
+
},
|
|
657
|
+
"forgeId": {
|
|
658
|
+
"$ref": "#/$defs/ForgeId"
|
|
659
|
+
},
|
|
660
|
+
"resource": {
|
|
661
|
+
"$ref": "#/$defs/RepoResource"
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"title": "RoleChanged",
|
|
667
|
+
"type": "object",
|
|
668
|
+
"additionalProperties": false,
|
|
669
|
+
"required": [
|
|
670
|
+
"type",
|
|
671
|
+
"forgeId",
|
|
672
|
+
"resource",
|
|
673
|
+
"account"
|
|
674
|
+
],
|
|
675
|
+
"properties": {
|
|
676
|
+
"type": {
|
|
677
|
+
"const": "roleChanged"
|
|
678
|
+
},
|
|
679
|
+
"forgeId": {
|
|
680
|
+
"$ref": "#/$defs/ForgeId"
|
|
681
|
+
},
|
|
682
|
+
"resource": {
|
|
683
|
+
"$ref": "#/$defs/RepoResource"
|
|
684
|
+
},
|
|
685
|
+
"account": {
|
|
686
|
+
"$ref": "#/$defs/ForgeAccount"
|
|
687
|
+
},
|
|
688
|
+
"role": {
|
|
689
|
+
"$ref": "#/$defs/ForgeRole",
|
|
690
|
+
"description": "The role the account now holds. Absent: the account holds no role now."
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"title": "ProtectionChanged",
|
|
696
|
+
"type": "object",
|
|
697
|
+
"additionalProperties": false,
|
|
698
|
+
"required": [
|
|
699
|
+
"type",
|
|
700
|
+
"forgeId",
|
|
701
|
+
"resource",
|
|
702
|
+
"requiredCheck"
|
|
703
|
+
],
|
|
704
|
+
"properties": {
|
|
705
|
+
"type": {
|
|
706
|
+
"const": "protectionChanged"
|
|
707
|
+
},
|
|
708
|
+
"forgeId": {
|
|
709
|
+
"$ref": "#/$defs/ForgeId"
|
|
710
|
+
},
|
|
711
|
+
"resource": {
|
|
712
|
+
"$ref": "#/$defs/RepoResource"
|
|
713
|
+
},
|
|
714
|
+
"requiredCheck": {
|
|
715
|
+
"type": "boolean",
|
|
716
|
+
"description": "Whether the forge still refuses merges without a passing verify-trust check, with no bypass."
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
"title": "InstallationRemoved",
|
|
722
|
+
"type": "object",
|
|
723
|
+
"additionalProperties": false,
|
|
724
|
+
"required": [
|
|
725
|
+
"type"
|
|
726
|
+
],
|
|
727
|
+
"properties": {
|
|
728
|
+
"type": {
|
|
729
|
+
"const": "installationRemoved"
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"title": "AccountLinked",
|
|
735
|
+
"type": "object",
|
|
736
|
+
"additionalProperties": false,
|
|
737
|
+
"required": [
|
|
738
|
+
"type",
|
|
739
|
+
"jobId",
|
|
740
|
+
"account"
|
|
741
|
+
],
|
|
742
|
+
"properties": {
|
|
743
|
+
"type": {
|
|
744
|
+
"const": "accountLinked"
|
|
745
|
+
},
|
|
746
|
+
"jobId": {
|
|
747
|
+
"$ref": "#/$defs/JobId",
|
|
748
|
+
"description": "The beginAccountLink job."
|
|
749
|
+
},
|
|
750
|
+
"account": {
|
|
751
|
+
"$ref": "#/$defs/ForgeAccount"
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
"title": "BindCompleted",
|
|
757
|
+
"type": "object",
|
|
758
|
+
"additionalProperties": false,
|
|
759
|
+
"required": [
|
|
760
|
+
"type",
|
|
761
|
+
"jobId",
|
|
762
|
+
"ownerId",
|
|
763
|
+
"kind"
|
|
764
|
+
],
|
|
765
|
+
"properties": {
|
|
766
|
+
"type": {
|
|
767
|
+
"const": "bindCompleted"
|
|
768
|
+
},
|
|
769
|
+
"jobId": {
|
|
770
|
+
"$ref": "#/$defs/JobId",
|
|
771
|
+
"description": "The beginBind job."
|
|
772
|
+
},
|
|
773
|
+
"ownerId": {
|
|
774
|
+
"$ref": "#/$defs/ForgeId",
|
|
775
|
+
"description": "The forge's id for the owner, which survives renames."
|
|
776
|
+
},
|
|
777
|
+
"kind": {
|
|
778
|
+
"type": "string",
|
|
779
|
+
"enum": [
|
|
780
|
+
"organization",
|
|
781
|
+
"user"
|
|
782
|
+
]
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
"title": "RoleMapReported",
|
|
788
|
+
"type": "object",
|
|
789
|
+
"additionalProperties": false,
|
|
790
|
+
"required": [
|
|
791
|
+
"type",
|
|
792
|
+
"roleMap",
|
|
793
|
+
"ladder"
|
|
794
|
+
],
|
|
795
|
+
"properties": {
|
|
796
|
+
"type": {
|
|
797
|
+
"const": "roleMapReported"
|
|
798
|
+
},
|
|
799
|
+
"roleMap": {
|
|
800
|
+
"$ref": "#/$defs/RoleMap"
|
|
801
|
+
},
|
|
802
|
+
"ladder": {
|
|
803
|
+
"type": "array",
|
|
804
|
+
"minItems": 1,
|
|
805
|
+
"maxItems": 5,
|
|
806
|
+
"uniqueItems": true,
|
|
807
|
+
"description": "The levels the forge offers as a direct role on a repository in the namespace, lowest first, without `none` (which every forge has). Every role in `roleMap` and in each `repos[].roleMap` is `none` or one of these.",
|
|
808
|
+
"items": {
|
|
809
|
+
"$ref": "#/$defs/MappedRole"
|
|
810
|
+
}
|
|
811
|
+
},
|
|
812
|
+
"repos": {
|
|
813
|
+
"type": "array",
|
|
814
|
+
"maxItems": 1000,
|
|
815
|
+
"description": "Repositories whose own map differs from `roleMap`, each at most once. Absent or empty: every repository uses `roleMap`.",
|
|
816
|
+
"items": {
|
|
817
|
+
"type": "object",
|
|
818
|
+
"additionalProperties": false,
|
|
819
|
+
"required": [
|
|
820
|
+
"resource",
|
|
821
|
+
"roleMap"
|
|
822
|
+
],
|
|
823
|
+
"properties": {
|
|
824
|
+
"resource": {
|
|
825
|
+
"$ref": "#/$defs/RepoResource"
|
|
826
|
+
},
|
|
827
|
+
"roleMap": {
|
|
828
|
+
"$ref": "#/$defs/RoleMap"
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
"stale": {
|
|
834
|
+
"type": "array",
|
|
835
|
+
"maxItems": 10000,
|
|
836
|
+
"uniqueItems": true,
|
|
837
|
+
"description": "Repositories whose forge roles the bridge last projected under a different map from the one it now applies to them. Absent or empty: none.",
|
|
838
|
+
"items": {
|
|
839
|
+
"$ref": "#/$defs/RepoResource"
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
"title": "PullRequestOpened",
|
|
846
|
+
"type": "object",
|
|
847
|
+
"additionalProperties": false,
|
|
848
|
+
"required": [
|
|
849
|
+
"type",
|
|
850
|
+
"forgeId",
|
|
851
|
+
"resource",
|
|
852
|
+
"number",
|
|
853
|
+
"action",
|
|
854
|
+
"author",
|
|
855
|
+
"actor"
|
|
856
|
+
],
|
|
857
|
+
"properties": {
|
|
858
|
+
"type": {
|
|
859
|
+
"const": "pullRequestOpened"
|
|
860
|
+
},
|
|
861
|
+
"forgeId": {
|
|
862
|
+
"$ref": "#/$defs/ForgeId",
|
|
863
|
+
"description": "The forge's id for the repository the pull request targets."
|
|
864
|
+
},
|
|
865
|
+
"resource": {
|
|
866
|
+
"$ref": "#/$defs/RepoResource",
|
|
867
|
+
"description": "The repository the pull request targets (its base repository)."
|
|
868
|
+
},
|
|
869
|
+
"number": {
|
|
870
|
+
"type": "integer",
|
|
871
|
+
"minimum": 1,
|
|
872
|
+
"description": "The pull request's number in `resource`."
|
|
873
|
+
},
|
|
874
|
+
"action": {
|
|
875
|
+
"title": "PullRequestAction",
|
|
876
|
+
"type": "string",
|
|
877
|
+
"enum": [
|
|
878
|
+
"opened",
|
|
879
|
+
"reopened"
|
|
880
|
+
],
|
|
881
|
+
"description": "`opened` — the pull request was just opened. `reopened` — a closed, unmerged pull request was reopened."
|
|
882
|
+
},
|
|
883
|
+
"author": {
|
|
884
|
+
"$ref": "#/$defs/ForgeAccount",
|
|
885
|
+
"description": "The account that opened the pull request."
|
|
886
|
+
},
|
|
887
|
+
"actor": {
|
|
888
|
+
"$ref": "#/$defs/ForgeAccount",
|
|
889
|
+
"description": "The account that performed this action: the author for `opened`, whoever reopened the pull request for `reopened`."
|
|
890
|
+
},
|
|
891
|
+
"draft": {
|
|
892
|
+
"type": "boolean",
|
|
893
|
+
"description": "Whether the pull request is a draft. Absent: the bridge does not know, or the forge has no drafts."
|
|
894
|
+
},
|
|
895
|
+
"fromFork": {
|
|
896
|
+
"type": "boolean",
|
|
897
|
+
"description": "Whether the pull request's head branch lives in another repository (a fork). Absent: the bridge does not know."
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
]
|
|
902
|
+
},
|
|
903
|
+
"Response": {
|
|
904
|
+
"$anchor": "response",
|
|
905
|
+
"title": "Git Namespaces — Bridge Event — response payload",
|
|
906
|
+
"description": "The VTC has recorded the event. Nothing else is returned.",
|
|
907
|
+
"type": "object",
|
|
908
|
+
"additionalProperties": false,
|
|
909
|
+
"required": [],
|
|
910
|
+
"properties": {
|
|
911
|
+
"ext": {
|
|
912
|
+
"$ref": "#/$defs/Ext"
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
},
|
|
916
|
+
"MappedRole": {
|
|
917
|
+
"title": "MappedRole",
|
|
918
|
+
"type": "string",
|
|
919
|
+
"enum": [
|
|
920
|
+
"none",
|
|
921
|
+
"read",
|
|
922
|
+
"triage",
|
|
923
|
+
"write",
|
|
924
|
+
"maintain",
|
|
925
|
+
"admin"
|
|
926
|
+
],
|
|
927
|
+
"description": "A level of the bridge's forge-neutral role ladder, lowest first: the vocabulary role drift's `observed` and `expected` are reported in. `none` is no direct role on the repository."
|
|
928
|
+
},
|
|
929
|
+
"RoleMap": {
|
|
930
|
+
"title": "RoleMap",
|
|
931
|
+
"description": "The forge role each repository right is given, as the forge applies it: after the forge's own ladder has rounded it down. `own` is the role `git.repo.own` projects to, `maintain` that of `git.repo.maintain`, `commit` that of `git.commit.sign` (`none` is fork-based contribution). There is no member for `git.ns.admin` or `git.repo.create`, which project to no forge role whatever a bridge is configured with. Ordered: `own` is at least `maintain`, which is at least `commit`, and `commit` is at most `write`.",
|
|
932
|
+
"type": "object",
|
|
933
|
+
"additionalProperties": false,
|
|
934
|
+
"required": [
|
|
935
|
+
"own",
|
|
936
|
+
"maintain",
|
|
937
|
+
"commit"
|
|
938
|
+
],
|
|
939
|
+
"properties": {
|
|
940
|
+
"own": {
|
|
941
|
+
"$ref": "#/$defs/MappedRole"
|
|
942
|
+
},
|
|
943
|
+
"maintain": {
|
|
944
|
+
"$ref": "#/$defs/MappedRole"
|
|
945
|
+
},
|
|
946
|
+
"commit": {
|
|
947
|
+
"$ref": "#/$defs/MappedRole"
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
"Ext": {
|
|
952
|
+
"title": "Ext",
|
|
953
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
954
|
+
"type": "object",
|
|
955
|
+
"minProperties": 1,
|
|
956
|
+
"additionalProperties": true,
|
|
957
|
+
"propertyNames": {
|
|
958
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
959
|
+
}
|
|
960
|
+
},
|
|
961
|
+
"ForgeAccount": {
|
|
962
|
+
"title": "ForgeAccount",
|
|
963
|
+
"description": "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.",
|
|
964
|
+
"type": "object",
|
|
965
|
+
"additionalProperties": false,
|
|
966
|
+
"required": [
|
|
967
|
+
"forge",
|
|
968
|
+
"id",
|
|
969
|
+
"login"
|
|
970
|
+
],
|
|
971
|
+
"properties": {
|
|
972
|
+
"forge": {
|
|
973
|
+
"$ref": "#/$defs/ForgeHost"
|
|
974
|
+
},
|
|
975
|
+
"id": {
|
|
976
|
+
"$ref": "#/$defs/ForgeId"
|
|
977
|
+
},
|
|
978
|
+
"login": {
|
|
979
|
+
"type": "string",
|
|
980
|
+
"minLength": 1,
|
|
981
|
+
"maxLength": 100,
|
|
982
|
+
"description": "The account's current login, as the forge reported it when last seen. Display only."
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
},
|
|
986
|
+
"ForgeId": {
|
|
987
|
+
"title": "ForgeId",
|
|
988
|
+
"description": "An identifier the forge itself assigns — a repository id, a user or organisation id — carried as a string so a forge whose ids are not numbers needs no new version. GitHub and Forgejo ids are decimal integers written as strings (`\"812736451\"`). Unlike a name, it survives renames and transfers, which is why rights and bindings are keyed by it.",
|
|
989
|
+
"type": "string",
|
|
990
|
+
"minLength": 1,
|
|
991
|
+
"maxLength": 64
|
|
992
|
+
},
|
|
993
|
+
"ForgeHost": {
|
|
994
|
+
"title": "ForgeHost",
|
|
995
|
+
"description": "The lowercased DNS host of a forge: `github.com`, a GitHub Enterprise Server host, `codeberg.org`, or a self-hosted Forgejo instance such as `git.example.org`. No scheme, no port, no path. The host is a segment of every resource, so a right never crosses forges.",
|
|
996
|
+
"type": "string",
|
|
997
|
+
"minLength": 3,
|
|
998
|
+
"maxLength": 253,
|
|
999
|
+
"pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
|
|
1000
|
+
},
|
|
1001
|
+
"RepoResource": {
|
|
1002
|
+
"title": "RepoResource",
|
|
1003
|
+
"description": "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.",
|
|
1004
|
+
"type": "string",
|
|
1005
|
+
"maxLength": 455,
|
|
1006
|
+
"pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+/[a-z0-9_-][a-z0-9._-]{0,99}/[a-z0-9_-][a-z0-9._-]{0,99}$"
|
|
1007
|
+
},
|
|
1008
|
+
"DriftItem": {
|
|
1009
|
+
"title": "DriftItem",
|
|
1010
|
+
"description": "One difference between the forge's observed state and the VTC's projection of a repository.",
|
|
1011
|
+
"type": "object",
|
|
1012
|
+
"additionalProperties": false,
|
|
1013
|
+
"required": [
|
|
1014
|
+
"type",
|
|
1015
|
+
"resource"
|
|
1016
|
+
],
|
|
1017
|
+
"properties": {
|
|
1018
|
+
"type": {
|
|
1019
|
+
"type": "string",
|
|
1020
|
+
"enum": [
|
|
1021
|
+
"roleAdded",
|
|
1022
|
+
"roleRemoved",
|
|
1023
|
+
"roleChanged",
|
|
1024
|
+
"requiredCheckMissing",
|
|
1025
|
+
"protectionWeakened",
|
|
1026
|
+
"bootstrapMissing"
|
|
1027
|
+
],
|
|
1028
|
+
"description": "`roleAdded` — someone holds a forge role the projection does not give them. `roleRemoved` — a projected role is missing. `roleChanged` — a projected role is present at another level. `requiredCheckMissing` — the verify-trust check is no longer required. `protectionWeakened` — branch protection or a ruleset is weaker than the projection in another way (force-push allowed, bypass actors added). `bootstrapMissing` — a bootstrap file or variable is gone."
|
|
1029
|
+
},
|
|
1030
|
+
"resource": {
|
|
1031
|
+
"$ref": "#/$defs/RepoResource"
|
|
1032
|
+
},
|
|
1033
|
+
"account": {
|
|
1034
|
+
"$ref": "#/$defs/ForgeAccount",
|
|
1035
|
+
"description": "Whose role differs, for the three role types."
|
|
1036
|
+
},
|
|
1037
|
+
"observed": {
|
|
1038
|
+
"type": "string",
|
|
1039
|
+
"maxLength": 256,
|
|
1040
|
+
"description": "What the forge shows, in the forge's own vocabulary (a role name such as `maintain`, a setting name). Absent when nothing is there."
|
|
1041
|
+
},
|
|
1042
|
+
"expected": {
|
|
1043
|
+
"type": "string",
|
|
1044
|
+
"maxLength": 256,
|
|
1045
|
+
"description": "What the projection calls for, in the forge's own vocabulary. Absent when the projection calls for nothing."
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
},
|
|
1049
|
+
"NamespaceId": {
|
|
1050
|
+
"title": "NamespaceId",
|
|
1051
|
+
"description": "The VTC's opaque identifier for a namespace, assigned when it is bound. Stable for the life of the binding; never reused for another binding.",
|
|
1052
|
+
"type": "string",
|
|
1053
|
+
"minLength": 1,
|
|
1054
|
+
"maxLength": 128
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
1058
|
+
/**
|
|
1059
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
1060
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
1061
|
+
* per-specification and cannot be derived from the document alone, and
|
|
1062
|
+
* item 2 needs the schema this carries.
|
|
1063
|
+
*/
|
|
1064
|
+
export const SPEC = {
|
|
1065
|
+
typeUri: TYPE_URI,
|
|
1066
|
+
isBearer: false,
|
|
1067
|
+
isProofRequired: true,
|
|
1068
|
+
isRecipientRequired: true,
|
|
1069
|
+
isIssuedAtRequired: true,
|
|
1070
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
1071
|
+
};
|
|
1072
|
+
/**
|
|
1073
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
1074
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
1075
|
+
* parties (§7.3 item 5).
|
|
1076
|
+
*/
|
|
1077
|
+
export const RESPONSE_SPEC = {
|
|
1078
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
1079
|
+
isBearer: false,
|
|
1080
|
+
isProofRequired: true,
|
|
1081
|
+
isRecipientRequired: true,
|
|
1082
|
+
isIssuedAtRequired: true,
|
|
1083
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
1084
|
+
};
|
|
1085
|
+
//# sourceMappingURL=payload.js.map
|