@openvtc/trust-tasks 0.20.3 → 0.20.5
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 +68 -0
- package/dist/_shared/components.d.ts +4 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/git-ns/_shared/0.2/git-ns.d.ts +16 -0
- package/dist/git-ns/_shared/0.2/git-ns.d.ts.map +1 -0
- package/dist/git-ns/_shared/0.2/git-ns.js +6 -0
- package/dist/git-ns/_shared/0.2/git-ns.js.map +1 -0
- package/dist/git-ns/bridge/job/0.2/payload.d.ts +1068 -0
- package/dist/git-ns/bridge/job/0.2/payload.d.ts.map +1 -0
- package/dist/git-ns/bridge/job/0.2/payload.js +573 -0
- package/dist/git-ns/bridge/job/0.2/payload.js.map +1 -0
- package/dist/git-ns/drift/resolve/0.1/payload.d.ts +1060 -0
- package/dist/git-ns/drift/resolve/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/drift/resolve/0.1/payload.js +630 -0
- package/dist/git-ns/drift/resolve/0.1/payload.js.map +1 -0
- package/dist/git-ns/namespace/reseat/0.1/payload.d.ts +515 -0
- package/dist/git-ns/namespace/reseat/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/namespace/reseat/0.1/payload.js +296 -0
- package/dist/git-ns/namespace/reseat/0.1/payload.js.map +1 -0
- package/dist/git-ns/view/0.2/payload.d.ts +1524 -0
- package/dist/git-ns/view/0.2/payload.d.ts.map +1 -0
- package/dist/git-ns/view/0.2/payload.js +918 -0
- package/dist/git-ns/view/0.2/payload.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/_shared/components.ts +10 -0
- package/src/git-ns/_shared/0.2/git-ns.ts +17 -0
- package/src/git-ns/bridge/job/0.2/payload.ts +691 -0
- package/src/git-ns/drift/resolve/0.1/payload.ts +699 -0
- package/src/git-ns/namespace/reseat/0.1/payload.ts +342 -0
- package/src/git-ns/view/0.2/payload.ts +981 -0
- package/src/index.ts +5 -0
|
@@ -0,0 +1,1068 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/git-ns/bridge/job/0.2/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
import type { Did, Ext, ForgeAccount, ForgeHost, ForgeId, NamespaceId, RepoResource, RepoVisibility, Right, Segment } from "../../../../_shared/components.js";
|
|
6
|
+
/**
|
|
7
|
+
* One step of a forge adapter's plan. Forge-neutral names: `create`, `workflow`, `keyring`, `variables`, `requiredCheck`, `roles`, `archive`. An adapter MAY add its own (`mergeStyle`, `runner`), which a VTC displays but need not understand.
|
|
8
|
+
*/
|
|
9
|
+
export type StepName = string;
|
|
10
|
+
/**
|
|
11
|
+
* The VTC's identifier for a job, unique across the VTC's jobs.
|
|
12
|
+
*/
|
|
13
|
+
export type JobId = string;
|
|
14
|
+
/**
|
|
15
|
+
* The VTC asks its bridge to do one piece of forge work in a namespace. The job names what to do (`kind`) and carries the desired state, never forge credentials — the bridge holds those. Which optional members a job carries is fixed by its `kind` (see the specification's kind table); a bridge refuses a job that carries a member its kind does not use, or lacks one its kind requires.
|
|
16
|
+
*/
|
|
17
|
+
export interface GitNamespacesBridgeJobPayload {
|
|
18
|
+
/**
|
|
19
|
+
* The VTC's identifier for this job. The bridge reports on it with git-ns/bridge/result.
|
|
20
|
+
*/
|
|
21
|
+
jobId: string;
|
|
22
|
+
/**
|
|
23
|
+
* The namespace the job acts in. It also selects the bridge's forge credentials for it.
|
|
24
|
+
*/
|
|
25
|
+
namespace: NamespaceId;
|
|
26
|
+
/**
|
|
27
|
+
* What to do. `projectRoles` — converge forge roles to `desiredRoles`, and remove whatever role each of `removeAccounts` holds on `repo`. `createRepo` — create `repo`, run the bootstrap plan, and project `desiredRoles`. `bootstrap` — run the bootstrap plan, or the listed `steps` of it, on an existing `repo`. `archive` — archive `repo`. `inspect` — compare the forge with the projection for `repo`, or for the whole namespace. `beginBind` — start the proof that the binding admin controls `target`. `beginAccountLink` — start linking `subject`'s account on this namespace's forge.
|
|
28
|
+
*/
|
|
29
|
+
kind: "projectRoles" | "createRepo" | "bootstrap" | "archive" | "inspect" | "beginBind" | "beginAccountLink";
|
|
30
|
+
/**
|
|
31
|
+
* The repository. Required for `createRepo`, `bootstrap` and `archive`. For `projectRoles`, absent means the namespace-level roles (organisation owners), where only `git.ns.admin` is projected. For `inspect`, absent means a sweep of every repository in the namespace.
|
|
32
|
+
*/
|
|
33
|
+
repo?: RepoResource;
|
|
34
|
+
spec?: RepoSpec;
|
|
35
|
+
/**
|
|
36
|
+
* The complete set of people who should hold a forge role on the target. The bridge converges to exactly this set among the roles it manages: it adds or changes roles to match and removes managed roles not listed. `projectRoles` and `createRepo` only.
|
|
37
|
+
*/
|
|
38
|
+
desiredRoles?: DesiredRole[];
|
|
39
|
+
/**
|
|
40
|
+
* Accounts whose direct role on `repo` the bridge removes, whatever that role is — including a role the bridge does not manage and would otherwise only report as drift. Matched by `forge` and `id`; `login` is display only. No account listed here may also appear in `desiredRoles`. `projectRoles` with `repo` only.
|
|
41
|
+
*
|
|
42
|
+
* @minItems 1
|
|
43
|
+
*/
|
|
44
|
+
removeAccounts?: [ForgeAccount, ...ForgeAccount[]];
|
|
45
|
+
/**
|
|
46
|
+
* Run only these steps of the adapter's bootstrap plan, in the plan's order. Absent: the whole plan. `bootstrap` only.
|
|
47
|
+
*
|
|
48
|
+
* @minItems 1
|
|
49
|
+
*/
|
|
50
|
+
steps?: [StepName, ...StepName[]];
|
|
51
|
+
target?: BindTarget;
|
|
52
|
+
/**
|
|
53
|
+
* The member whose forge account is being linked. `beginAccountLink` only.
|
|
54
|
+
*/
|
|
55
|
+
subject?: Did;
|
|
56
|
+
ext?: Ext;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* How to create the repository. `createRepo` only.
|
|
60
|
+
*/
|
|
61
|
+
export interface RepoSpec {
|
|
62
|
+
visibility: RepoVisibility;
|
|
63
|
+
description?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface DesiredRole {
|
|
66
|
+
subject: Did;
|
|
67
|
+
/**
|
|
68
|
+
* The subject's linked account on this namespace's forge.
|
|
69
|
+
*/
|
|
70
|
+
account: ForgeAccount;
|
|
71
|
+
/**
|
|
72
|
+
* The subject's highest effective right on the target, which the forge adapter maps to one of its roles.
|
|
73
|
+
*/
|
|
74
|
+
right: Right;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* `beginBind` only.
|
|
78
|
+
*/
|
|
79
|
+
export interface BindTarget {
|
|
80
|
+
forge: ForgeHost;
|
|
81
|
+
owner: Segment;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Whether the bridge took the job.
|
|
85
|
+
*/
|
|
86
|
+
export interface GitNamespacesBridgeJobResponsePayload {
|
|
87
|
+
jobId: JobId;
|
|
88
|
+
/**
|
|
89
|
+
* `true` — the job is durably queued, or was already queued or running under this `jobId`; a git-ns/bridge/result follows. `false` — the bridge already finished this `jobId`; it does not run it again, and sends its git-ns/bridge/result again.
|
|
90
|
+
*/
|
|
91
|
+
accepted: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* For `beginBind` and `beginAccountLink` when `accepted` is `true`: where the VTC sends the person.
|
|
94
|
+
*/
|
|
95
|
+
next?: {
|
|
96
|
+
url: string;
|
|
97
|
+
/**
|
|
98
|
+
* The device-flow code, for a forge that uses one.
|
|
99
|
+
*/
|
|
100
|
+
userCode?: string;
|
|
101
|
+
expiresAt: string;
|
|
102
|
+
};
|
|
103
|
+
ext?: Ext;
|
|
104
|
+
}
|
|
105
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
106
|
+
export type { Did, Ext, ForgeAccount, ForgeHost, ForgeId, NamespaceId, RepoResource, RepoVisibility, Right, Segment };
|
|
107
|
+
/** Trust Task type URI. */
|
|
108
|
+
export declare const TYPE_URI: "https://trusttasks.org/spec/git-ns/bridge/job/0.2";
|
|
109
|
+
/** Stable alias for this specification's request payload shape. */
|
|
110
|
+
export type Payload = GitNamespacesBridgeJobPayload;
|
|
111
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
112
|
+
export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/git-ns/bridge/job/0.2#response";
|
|
113
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
114
|
+
export type Response = GitNamespacesBridgeJobResponsePayload;
|
|
115
|
+
/**
|
|
116
|
+
* This specification's payload schema, as a value.
|
|
117
|
+
*
|
|
118
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
119
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
120
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
121
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
122
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
123
|
+
*/
|
|
124
|
+
export declare const PAYLOAD_SCHEMA: {
|
|
125
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
126
|
+
readonly $id: "https://trusttasks.org/spec/git-ns/bridge/job/0.2";
|
|
127
|
+
readonly title: "Git Namespaces — Bridge Job — payload";
|
|
128
|
+
readonly description: "The VTC asks its bridge to do one piece of forge work in a namespace. The job names what to do (`kind`) and carries the desired state, never forge credentials — the bridge holds those. Which optional members a job carries is fixed by its `kind` (see the specification's kind table); a bridge refuses a job that carries a member its kind does not use, or lacks one its kind requires.";
|
|
129
|
+
readonly type: "object";
|
|
130
|
+
readonly additionalProperties: false;
|
|
131
|
+
readonly required: readonly ["jobId", "namespace", "kind"];
|
|
132
|
+
readonly properties: {
|
|
133
|
+
readonly jobId: {
|
|
134
|
+
readonly $ref: "#/$defs/JobId";
|
|
135
|
+
readonly description: "The VTC's identifier for this job. The bridge reports on it with git-ns/bridge/result.";
|
|
136
|
+
};
|
|
137
|
+
readonly namespace: {
|
|
138
|
+
readonly $ref: "#/$defs/NamespaceId";
|
|
139
|
+
readonly description: "The namespace the job acts in. It also selects the bridge's forge credentials for it.";
|
|
140
|
+
};
|
|
141
|
+
readonly kind: {
|
|
142
|
+
readonly type: "string";
|
|
143
|
+
readonly enum: readonly ["projectRoles", "createRepo", "bootstrap", "archive", "inspect", "beginBind", "beginAccountLink"];
|
|
144
|
+
readonly description: "What to do. `projectRoles` — converge forge roles to `desiredRoles`, and remove whatever role each of `removeAccounts` holds on `repo`. `createRepo` — create `repo`, run the bootstrap plan, and project `desiredRoles`. `bootstrap` — run the bootstrap plan, or the listed `steps` of it, on an existing `repo`. `archive` — archive `repo`. `inspect` — compare the forge with the projection for `repo`, or for the whole namespace. `beginBind` — start the proof that the binding admin controls `target`. `beginAccountLink` — start linking `subject`'s account on this namespace's forge.";
|
|
145
|
+
};
|
|
146
|
+
readonly repo: {
|
|
147
|
+
readonly $ref: "#/$defs/RepoResource";
|
|
148
|
+
readonly description: "The repository. Required for `createRepo`, `bootstrap` and `archive`. For `projectRoles`, absent means the namespace-level roles (organisation owners), where only `git.ns.admin` is projected. For `inspect`, absent means a sweep of every repository in the namespace.";
|
|
149
|
+
};
|
|
150
|
+
readonly spec: {
|
|
151
|
+
readonly $ref: "#/$defs/RepoSpec";
|
|
152
|
+
readonly description: "How to create the repository. `createRepo` only.";
|
|
153
|
+
};
|
|
154
|
+
readonly desiredRoles: {
|
|
155
|
+
readonly type: "array";
|
|
156
|
+
readonly uniqueItems: true;
|
|
157
|
+
readonly items: {
|
|
158
|
+
readonly $ref: "#/$defs/DesiredRole";
|
|
159
|
+
};
|
|
160
|
+
readonly description: "The complete set of people who should hold a forge role on the target. The bridge converges to exactly this set among the roles it manages: it adds or changes roles to match and removes managed roles not listed. `projectRoles` and `createRepo` only.";
|
|
161
|
+
};
|
|
162
|
+
readonly removeAccounts: {
|
|
163
|
+
readonly type: "array";
|
|
164
|
+
readonly minItems: 1;
|
|
165
|
+
readonly uniqueItems: true;
|
|
166
|
+
readonly items: {
|
|
167
|
+
readonly $ref: "#/$defs/ForgeAccount";
|
|
168
|
+
};
|
|
169
|
+
readonly description: "Accounts whose direct role on `repo` the bridge removes, whatever that role is — including a role the bridge does not manage and would otherwise only report as drift. Matched by `forge` and `id`; `login` is display only. No account listed here may also appear in `desiredRoles`. `projectRoles` with `repo` only.";
|
|
170
|
+
};
|
|
171
|
+
readonly steps: {
|
|
172
|
+
readonly type: "array";
|
|
173
|
+
readonly minItems: 1;
|
|
174
|
+
readonly uniqueItems: true;
|
|
175
|
+
readonly items: {
|
|
176
|
+
readonly $ref: "#/$defs/StepName";
|
|
177
|
+
};
|
|
178
|
+
readonly description: "Run only these steps of the adapter's bootstrap plan, in the plan's order. Absent: the whole plan. `bootstrap` only.";
|
|
179
|
+
};
|
|
180
|
+
readonly target: {
|
|
181
|
+
readonly $ref: "#/$defs/BindTarget";
|
|
182
|
+
readonly description: "`beginBind` only.";
|
|
183
|
+
};
|
|
184
|
+
readonly subject: {
|
|
185
|
+
readonly $ref: "#/$defs/Did";
|
|
186
|
+
readonly description: "The member whose forge account is being linked. `beginAccountLink` only.";
|
|
187
|
+
};
|
|
188
|
+
readonly ext: {
|
|
189
|
+
readonly $ref: "#/$defs/Ext";
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
readonly $defs: {
|
|
193
|
+
readonly JobId: {
|
|
194
|
+
readonly type: "string";
|
|
195
|
+
readonly minLength: 1;
|
|
196
|
+
readonly maxLength: 128;
|
|
197
|
+
readonly description: "The VTC's identifier for a job, unique across the VTC's jobs.";
|
|
198
|
+
};
|
|
199
|
+
readonly StepName: {
|
|
200
|
+
readonly type: "string";
|
|
201
|
+
readonly minLength: 1;
|
|
202
|
+
readonly maxLength: 64;
|
|
203
|
+
readonly pattern: "^[a-z][A-Za-z0-9]*$";
|
|
204
|
+
readonly description: "One step of a forge adapter's plan. Forge-neutral names: `create`, `workflow`, `keyring`, `variables`, `requiredCheck`, `roles`, `archive`. An adapter MAY add its own (`mergeStyle`, `runner`), which a VTC displays but need not understand.";
|
|
205
|
+
};
|
|
206
|
+
readonly DesiredRole: {
|
|
207
|
+
readonly type: "object";
|
|
208
|
+
readonly additionalProperties: false;
|
|
209
|
+
readonly required: readonly ["subject", "account", "right"];
|
|
210
|
+
readonly properties: {
|
|
211
|
+
readonly subject: {
|
|
212
|
+
readonly $ref: "#/$defs/Did";
|
|
213
|
+
};
|
|
214
|
+
readonly account: {
|
|
215
|
+
readonly $ref: "#/$defs/ForgeAccount";
|
|
216
|
+
readonly description: "The subject's linked account on this namespace's forge.";
|
|
217
|
+
};
|
|
218
|
+
readonly right: {
|
|
219
|
+
readonly $ref: "#/$defs/Right";
|
|
220
|
+
readonly description: "The subject's highest effective right on the target, which the forge adapter maps to one of its roles.";
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
readonly RepoSpec: {
|
|
225
|
+
readonly type: "object";
|
|
226
|
+
readonly additionalProperties: false;
|
|
227
|
+
readonly required: readonly ["visibility"];
|
|
228
|
+
readonly properties: {
|
|
229
|
+
readonly visibility: {
|
|
230
|
+
readonly $ref: "#/$defs/RepoVisibility";
|
|
231
|
+
};
|
|
232
|
+
readonly description: {
|
|
233
|
+
readonly type: "string";
|
|
234
|
+
readonly maxLength: 350;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
readonly BindTarget: {
|
|
239
|
+
readonly title: "BindTarget";
|
|
240
|
+
readonly description: "The forge owner whose control the binding admin is to prove.";
|
|
241
|
+
readonly type: "object";
|
|
242
|
+
readonly additionalProperties: false;
|
|
243
|
+
readonly required: readonly ["forge", "owner"];
|
|
244
|
+
readonly properties: {
|
|
245
|
+
readonly forge: {
|
|
246
|
+
readonly $ref: "#/$defs/ForgeHost";
|
|
247
|
+
};
|
|
248
|
+
readonly owner: {
|
|
249
|
+
readonly $ref: "#/$defs/Segment";
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
readonly Response: {
|
|
254
|
+
readonly $anchor: "response";
|
|
255
|
+
readonly title: "Git Namespaces — Bridge Job — response payload";
|
|
256
|
+
readonly description: "Whether the bridge took the job.";
|
|
257
|
+
readonly type: "object";
|
|
258
|
+
readonly additionalProperties: false;
|
|
259
|
+
readonly required: readonly ["jobId", "accepted"];
|
|
260
|
+
readonly properties: {
|
|
261
|
+
readonly jobId: {
|
|
262
|
+
readonly $ref: "#/$defs/JobId";
|
|
263
|
+
};
|
|
264
|
+
readonly accepted: {
|
|
265
|
+
readonly type: "boolean";
|
|
266
|
+
readonly description: "`true` — the job is durably queued, or was already queued or running under this `jobId`; a git-ns/bridge/result follows. `false` — the bridge already finished this `jobId`; it does not run it again, and sends its git-ns/bridge/result again.";
|
|
267
|
+
};
|
|
268
|
+
readonly next: {
|
|
269
|
+
readonly type: "object";
|
|
270
|
+
readonly additionalProperties: false;
|
|
271
|
+
readonly required: readonly ["url", "expiresAt"];
|
|
272
|
+
readonly description: "For `beginBind` and `beginAccountLink` when `accepted` is `true`: where the VTC sends the person.";
|
|
273
|
+
readonly properties: {
|
|
274
|
+
readonly url: {
|
|
275
|
+
readonly type: "string";
|
|
276
|
+
readonly format: "uri";
|
|
277
|
+
readonly maxLength: 2048;
|
|
278
|
+
readonly pattern: "^https://";
|
|
279
|
+
};
|
|
280
|
+
readonly userCode: {
|
|
281
|
+
readonly type: "string";
|
|
282
|
+
readonly minLength: 1;
|
|
283
|
+
readonly maxLength: 64;
|
|
284
|
+
readonly description: "The device-flow code, for a forge that uses one.";
|
|
285
|
+
};
|
|
286
|
+
readonly expiresAt: {
|
|
287
|
+
readonly type: "string";
|
|
288
|
+
readonly format: "date-time";
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
readonly ext: {
|
|
293
|
+
readonly $ref: "#/$defs/Ext";
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
readonly Ext: {
|
|
298
|
+
readonly title: "Ext";
|
|
299
|
+
readonly 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.";
|
|
300
|
+
readonly type: "object";
|
|
301
|
+
readonly minProperties: 1;
|
|
302
|
+
readonly additionalProperties: true;
|
|
303
|
+
readonly propertyNames: {
|
|
304
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
readonly Segment: {
|
|
308
|
+
readonly title: "Segment";
|
|
309
|
+
readonly description: "One lowercased owner or repository name. Forges compare these case-insensitively, so the wire form is always lowercase and a producer lowercases before sending. A leading `.` is refused, which rules out `.` and `..`.";
|
|
310
|
+
readonly type: "string";
|
|
311
|
+
readonly minLength: 1;
|
|
312
|
+
readonly maxLength: 100;
|
|
313
|
+
readonly pattern: "^[a-z0-9_-][a-z0-9._-]*$";
|
|
314
|
+
};
|
|
315
|
+
readonly ForgeHost: {
|
|
316
|
+
readonly title: "ForgeHost";
|
|
317
|
+
readonly 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.";
|
|
318
|
+
readonly type: "string";
|
|
319
|
+
readonly minLength: 3;
|
|
320
|
+
readonly maxLength: 253;
|
|
321
|
+
readonly pattern: "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$";
|
|
322
|
+
};
|
|
323
|
+
readonly RepoVisibility: {
|
|
324
|
+
readonly title: "RepoVisibility";
|
|
325
|
+
readonly type: "string";
|
|
326
|
+
readonly enum: readonly ["public", "private"];
|
|
327
|
+
readonly description: "Repository visibility on the forge.";
|
|
328
|
+
};
|
|
329
|
+
readonly Right: {
|
|
330
|
+
readonly title: "Right";
|
|
331
|
+
readonly description: "One of the five git rights. Each string is also the TRQP `action` the VTC publishes the right under in its Trust Registry, so it is carried verbatim. `git.ns.admin` and `git.repo.create` apply to a namespace resource; `git.repo.own` and `git.repo.maintain` to a repository resource; `git.commit.sign` to either.";
|
|
332
|
+
readonly type: "string";
|
|
333
|
+
readonly enum: readonly ["git.ns.admin", "git.repo.create", "git.repo.own", "git.repo.maintain", "git.commit.sign"];
|
|
334
|
+
};
|
|
335
|
+
readonly ForgeAccount: {
|
|
336
|
+
readonly title: "ForgeAccount";
|
|
337
|
+
readonly description: "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.";
|
|
338
|
+
readonly type: "object";
|
|
339
|
+
readonly additionalProperties: false;
|
|
340
|
+
readonly required: readonly ["forge", "id", "login"];
|
|
341
|
+
readonly properties: {
|
|
342
|
+
readonly forge: {
|
|
343
|
+
readonly $ref: "#/$defs/ForgeHost";
|
|
344
|
+
};
|
|
345
|
+
readonly id: {
|
|
346
|
+
readonly $ref: "#/$defs/ForgeId";
|
|
347
|
+
};
|
|
348
|
+
readonly login: {
|
|
349
|
+
readonly type: "string";
|
|
350
|
+
readonly minLength: 1;
|
|
351
|
+
readonly maxLength: 100;
|
|
352
|
+
readonly description: "The account's current login, as the forge reported it when last seen. Display only.";
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
readonly ForgeId: {
|
|
357
|
+
readonly title: "ForgeId";
|
|
358
|
+
readonly 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.";
|
|
359
|
+
readonly type: "string";
|
|
360
|
+
readonly minLength: 1;
|
|
361
|
+
readonly maxLength: 64;
|
|
362
|
+
};
|
|
363
|
+
readonly Did: {
|
|
364
|
+
readonly title: "Did";
|
|
365
|
+
readonly description: "A DID, compared by exact string equality.";
|
|
366
|
+
readonly type: "string";
|
|
367
|
+
readonly maxLength: 2048;
|
|
368
|
+
readonly pattern: "^did:[a-z0-9]+:\\S+$";
|
|
369
|
+
};
|
|
370
|
+
readonly RepoResource: {
|
|
371
|
+
readonly title: "RepoResource";
|
|
372
|
+
readonly description: "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.";
|
|
373
|
+
readonly type: "string";
|
|
374
|
+
readonly maxLength: 455;
|
|
375
|
+
readonly 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}$";
|
|
376
|
+
};
|
|
377
|
+
readonly NamespaceId: {
|
|
378
|
+
readonly title: "NamespaceId";
|
|
379
|
+
readonly 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.";
|
|
380
|
+
readonly type: "string";
|
|
381
|
+
readonly minLength: 1;
|
|
382
|
+
readonly maxLength: 128;
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
387
|
+
export declare const RESPONSE_PAYLOAD_SCHEMA: {
|
|
388
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
389
|
+
readonly $ref: "#/$defs/Response";
|
|
390
|
+
readonly $defs: {
|
|
391
|
+
readonly JobId: {
|
|
392
|
+
readonly type: "string";
|
|
393
|
+
readonly minLength: 1;
|
|
394
|
+
readonly maxLength: 128;
|
|
395
|
+
readonly description: "The VTC's identifier for a job, unique across the VTC's jobs.";
|
|
396
|
+
};
|
|
397
|
+
readonly StepName: {
|
|
398
|
+
readonly type: "string";
|
|
399
|
+
readonly minLength: 1;
|
|
400
|
+
readonly maxLength: 64;
|
|
401
|
+
readonly pattern: "^[a-z][A-Za-z0-9]*$";
|
|
402
|
+
readonly description: "One step of a forge adapter's plan. Forge-neutral names: `create`, `workflow`, `keyring`, `variables`, `requiredCheck`, `roles`, `archive`. An adapter MAY add its own (`mergeStyle`, `runner`), which a VTC displays but need not understand.";
|
|
403
|
+
};
|
|
404
|
+
readonly DesiredRole: {
|
|
405
|
+
readonly type: "object";
|
|
406
|
+
readonly additionalProperties: false;
|
|
407
|
+
readonly required: readonly ["subject", "account", "right"];
|
|
408
|
+
readonly properties: {
|
|
409
|
+
readonly subject: {
|
|
410
|
+
readonly $ref: "#/$defs/Did";
|
|
411
|
+
};
|
|
412
|
+
readonly account: {
|
|
413
|
+
readonly $ref: "#/$defs/ForgeAccount";
|
|
414
|
+
readonly description: "The subject's linked account on this namespace's forge.";
|
|
415
|
+
};
|
|
416
|
+
readonly right: {
|
|
417
|
+
readonly $ref: "#/$defs/Right";
|
|
418
|
+
readonly description: "The subject's highest effective right on the target, which the forge adapter maps to one of its roles.";
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
readonly RepoSpec: {
|
|
423
|
+
readonly type: "object";
|
|
424
|
+
readonly additionalProperties: false;
|
|
425
|
+
readonly required: readonly ["visibility"];
|
|
426
|
+
readonly properties: {
|
|
427
|
+
readonly visibility: {
|
|
428
|
+
readonly $ref: "#/$defs/RepoVisibility";
|
|
429
|
+
};
|
|
430
|
+
readonly description: {
|
|
431
|
+
readonly type: "string";
|
|
432
|
+
readonly maxLength: 350;
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
readonly BindTarget: {
|
|
437
|
+
readonly title: "BindTarget";
|
|
438
|
+
readonly description: "The forge owner whose control the binding admin is to prove.";
|
|
439
|
+
readonly type: "object";
|
|
440
|
+
readonly additionalProperties: false;
|
|
441
|
+
readonly required: readonly ["forge", "owner"];
|
|
442
|
+
readonly properties: {
|
|
443
|
+
readonly forge: {
|
|
444
|
+
readonly $ref: "#/$defs/ForgeHost";
|
|
445
|
+
};
|
|
446
|
+
readonly owner: {
|
|
447
|
+
readonly $ref: "#/$defs/Segment";
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
readonly Response: {
|
|
452
|
+
readonly $anchor: "response";
|
|
453
|
+
readonly title: "Git Namespaces — Bridge Job — response payload";
|
|
454
|
+
readonly description: "Whether the bridge took the job.";
|
|
455
|
+
readonly type: "object";
|
|
456
|
+
readonly additionalProperties: false;
|
|
457
|
+
readonly required: readonly ["jobId", "accepted"];
|
|
458
|
+
readonly properties: {
|
|
459
|
+
readonly jobId: {
|
|
460
|
+
readonly $ref: "#/$defs/JobId";
|
|
461
|
+
};
|
|
462
|
+
readonly accepted: {
|
|
463
|
+
readonly type: "boolean";
|
|
464
|
+
readonly description: "`true` — the job is durably queued, or was already queued or running under this `jobId`; a git-ns/bridge/result follows. `false` — the bridge already finished this `jobId`; it does not run it again, and sends its git-ns/bridge/result again.";
|
|
465
|
+
};
|
|
466
|
+
readonly next: {
|
|
467
|
+
readonly type: "object";
|
|
468
|
+
readonly additionalProperties: false;
|
|
469
|
+
readonly required: readonly ["url", "expiresAt"];
|
|
470
|
+
readonly description: "For `beginBind` and `beginAccountLink` when `accepted` is `true`: where the VTC sends the person.";
|
|
471
|
+
readonly properties: {
|
|
472
|
+
readonly url: {
|
|
473
|
+
readonly type: "string";
|
|
474
|
+
readonly format: "uri";
|
|
475
|
+
readonly maxLength: 2048;
|
|
476
|
+
readonly pattern: "^https://";
|
|
477
|
+
};
|
|
478
|
+
readonly userCode: {
|
|
479
|
+
readonly type: "string";
|
|
480
|
+
readonly minLength: 1;
|
|
481
|
+
readonly maxLength: 64;
|
|
482
|
+
readonly description: "The device-flow code, for a forge that uses one.";
|
|
483
|
+
};
|
|
484
|
+
readonly expiresAt: {
|
|
485
|
+
readonly type: "string";
|
|
486
|
+
readonly format: "date-time";
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
readonly ext: {
|
|
491
|
+
readonly $ref: "#/$defs/Ext";
|
|
492
|
+
};
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
readonly Ext: {
|
|
496
|
+
readonly title: "Ext";
|
|
497
|
+
readonly 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.";
|
|
498
|
+
readonly type: "object";
|
|
499
|
+
readonly minProperties: 1;
|
|
500
|
+
readonly additionalProperties: true;
|
|
501
|
+
readonly propertyNames: {
|
|
502
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
503
|
+
};
|
|
504
|
+
};
|
|
505
|
+
readonly Segment: {
|
|
506
|
+
readonly title: "Segment";
|
|
507
|
+
readonly description: "One lowercased owner or repository name. Forges compare these case-insensitively, so the wire form is always lowercase and a producer lowercases before sending. A leading `.` is refused, which rules out `.` and `..`.";
|
|
508
|
+
readonly type: "string";
|
|
509
|
+
readonly minLength: 1;
|
|
510
|
+
readonly maxLength: 100;
|
|
511
|
+
readonly pattern: "^[a-z0-9_-][a-z0-9._-]*$";
|
|
512
|
+
};
|
|
513
|
+
readonly ForgeHost: {
|
|
514
|
+
readonly title: "ForgeHost";
|
|
515
|
+
readonly 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.";
|
|
516
|
+
readonly type: "string";
|
|
517
|
+
readonly minLength: 3;
|
|
518
|
+
readonly maxLength: 253;
|
|
519
|
+
readonly pattern: "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$";
|
|
520
|
+
};
|
|
521
|
+
readonly RepoVisibility: {
|
|
522
|
+
readonly title: "RepoVisibility";
|
|
523
|
+
readonly type: "string";
|
|
524
|
+
readonly enum: readonly ["public", "private"];
|
|
525
|
+
readonly description: "Repository visibility on the forge.";
|
|
526
|
+
};
|
|
527
|
+
readonly Right: {
|
|
528
|
+
readonly title: "Right";
|
|
529
|
+
readonly description: "One of the five git rights. Each string is also the TRQP `action` the VTC publishes the right under in its Trust Registry, so it is carried verbatim. `git.ns.admin` and `git.repo.create` apply to a namespace resource; `git.repo.own` and `git.repo.maintain` to a repository resource; `git.commit.sign` to either.";
|
|
530
|
+
readonly type: "string";
|
|
531
|
+
readonly enum: readonly ["git.ns.admin", "git.repo.create", "git.repo.own", "git.repo.maintain", "git.commit.sign"];
|
|
532
|
+
};
|
|
533
|
+
readonly ForgeAccount: {
|
|
534
|
+
readonly title: "ForgeAccount";
|
|
535
|
+
readonly description: "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.";
|
|
536
|
+
readonly type: "object";
|
|
537
|
+
readonly additionalProperties: false;
|
|
538
|
+
readonly required: readonly ["forge", "id", "login"];
|
|
539
|
+
readonly properties: {
|
|
540
|
+
readonly forge: {
|
|
541
|
+
readonly $ref: "#/$defs/ForgeHost";
|
|
542
|
+
};
|
|
543
|
+
readonly id: {
|
|
544
|
+
readonly $ref: "#/$defs/ForgeId";
|
|
545
|
+
};
|
|
546
|
+
readonly login: {
|
|
547
|
+
readonly type: "string";
|
|
548
|
+
readonly minLength: 1;
|
|
549
|
+
readonly maxLength: 100;
|
|
550
|
+
readonly description: "The account's current login, as the forge reported it when last seen. Display only.";
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
};
|
|
554
|
+
readonly ForgeId: {
|
|
555
|
+
readonly title: "ForgeId";
|
|
556
|
+
readonly 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.";
|
|
557
|
+
readonly type: "string";
|
|
558
|
+
readonly minLength: 1;
|
|
559
|
+
readonly maxLength: 64;
|
|
560
|
+
};
|
|
561
|
+
readonly Did: {
|
|
562
|
+
readonly title: "Did";
|
|
563
|
+
readonly description: "A DID, compared by exact string equality.";
|
|
564
|
+
readonly type: "string";
|
|
565
|
+
readonly maxLength: 2048;
|
|
566
|
+
readonly pattern: "^did:[a-z0-9]+:\\S+$";
|
|
567
|
+
};
|
|
568
|
+
readonly RepoResource: {
|
|
569
|
+
readonly title: "RepoResource";
|
|
570
|
+
readonly description: "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.";
|
|
571
|
+
readonly type: "string";
|
|
572
|
+
readonly maxLength: 455;
|
|
573
|
+
readonly 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}$";
|
|
574
|
+
};
|
|
575
|
+
readonly NamespaceId: {
|
|
576
|
+
readonly title: "NamespaceId";
|
|
577
|
+
readonly 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.";
|
|
578
|
+
readonly type: "string";
|
|
579
|
+
readonly minLength: 1;
|
|
580
|
+
readonly maxLength: 128;
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
};
|
|
584
|
+
/**
|
|
585
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
586
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
587
|
+
* per-specification and cannot be derived from the document alone, and
|
|
588
|
+
* item 2 needs the schema this carries.
|
|
589
|
+
*/
|
|
590
|
+
export declare const SPEC: {
|
|
591
|
+
readonly typeUri: "https://trusttasks.org/spec/git-ns/bridge/job/0.2";
|
|
592
|
+
readonly isBearer: false;
|
|
593
|
+
readonly isProofRequired: true;
|
|
594
|
+
readonly isRecipientRequired: true;
|
|
595
|
+
readonly isIssuedAtRequired: true;
|
|
596
|
+
readonly payloadSchema: {
|
|
597
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
598
|
+
readonly $id: "https://trusttasks.org/spec/git-ns/bridge/job/0.2";
|
|
599
|
+
readonly title: "Git Namespaces — Bridge Job — payload";
|
|
600
|
+
readonly description: "The VTC asks its bridge to do one piece of forge work in a namespace. The job names what to do (`kind`) and carries the desired state, never forge credentials — the bridge holds those. Which optional members a job carries is fixed by its `kind` (see the specification's kind table); a bridge refuses a job that carries a member its kind does not use, or lacks one its kind requires.";
|
|
601
|
+
readonly type: "object";
|
|
602
|
+
readonly additionalProperties: false;
|
|
603
|
+
readonly required: readonly ["jobId", "namespace", "kind"];
|
|
604
|
+
readonly properties: {
|
|
605
|
+
readonly jobId: {
|
|
606
|
+
readonly $ref: "#/$defs/JobId";
|
|
607
|
+
readonly description: "The VTC's identifier for this job. The bridge reports on it with git-ns/bridge/result.";
|
|
608
|
+
};
|
|
609
|
+
readonly namespace: {
|
|
610
|
+
readonly $ref: "#/$defs/NamespaceId";
|
|
611
|
+
readonly description: "The namespace the job acts in. It also selects the bridge's forge credentials for it.";
|
|
612
|
+
};
|
|
613
|
+
readonly kind: {
|
|
614
|
+
readonly type: "string";
|
|
615
|
+
readonly enum: readonly ["projectRoles", "createRepo", "bootstrap", "archive", "inspect", "beginBind", "beginAccountLink"];
|
|
616
|
+
readonly description: "What to do. `projectRoles` — converge forge roles to `desiredRoles`, and remove whatever role each of `removeAccounts` holds on `repo`. `createRepo` — create `repo`, run the bootstrap plan, and project `desiredRoles`. `bootstrap` — run the bootstrap plan, or the listed `steps` of it, on an existing `repo`. `archive` — archive `repo`. `inspect` — compare the forge with the projection for `repo`, or for the whole namespace. `beginBind` — start the proof that the binding admin controls `target`. `beginAccountLink` — start linking `subject`'s account on this namespace's forge.";
|
|
617
|
+
};
|
|
618
|
+
readonly repo: {
|
|
619
|
+
readonly $ref: "#/$defs/RepoResource";
|
|
620
|
+
readonly description: "The repository. Required for `createRepo`, `bootstrap` and `archive`. For `projectRoles`, absent means the namespace-level roles (organisation owners), where only `git.ns.admin` is projected. For `inspect`, absent means a sweep of every repository in the namespace.";
|
|
621
|
+
};
|
|
622
|
+
readonly spec: {
|
|
623
|
+
readonly $ref: "#/$defs/RepoSpec";
|
|
624
|
+
readonly description: "How to create the repository. `createRepo` only.";
|
|
625
|
+
};
|
|
626
|
+
readonly desiredRoles: {
|
|
627
|
+
readonly type: "array";
|
|
628
|
+
readonly uniqueItems: true;
|
|
629
|
+
readonly items: {
|
|
630
|
+
readonly $ref: "#/$defs/DesiredRole";
|
|
631
|
+
};
|
|
632
|
+
readonly description: "The complete set of people who should hold a forge role on the target. The bridge converges to exactly this set among the roles it manages: it adds or changes roles to match and removes managed roles not listed. `projectRoles` and `createRepo` only.";
|
|
633
|
+
};
|
|
634
|
+
readonly removeAccounts: {
|
|
635
|
+
readonly type: "array";
|
|
636
|
+
readonly minItems: 1;
|
|
637
|
+
readonly uniqueItems: true;
|
|
638
|
+
readonly items: {
|
|
639
|
+
readonly $ref: "#/$defs/ForgeAccount";
|
|
640
|
+
};
|
|
641
|
+
readonly description: "Accounts whose direct role on `repo` the bridge removes, whatever that role is — including a role the bridge does not manage and would otherwise only report as drift. Matched by `forge` and `id`; `login` is display only. No account listed here may also appear in `desiredRoles`. `projectRoles` with `repo` only.";
|
|
642
|
+
};
|
|
643
|
+
readonly steps: {
|
|
644
|
+
readonly type: "array";
|
|
645
|
+
readonly minItems: 1;
|
|
646
|
+
readonly uniqueItems: true;
|
|
647
|
+
readonly items: {
|
|
648
|
+
readonly $ref: "#/$defs/StepName";
|
|
649
|
+
};
|
|
650
|
+
readonly description: "Run only these steps of the adapter's bootstrap plan, in the plan's order. Absent: the whole plan. `bootstrap` only.";
|
|
651
|
+
};
|
|
652
|
+
readonly target: {
|
|
653
|
+
readonly $ref: "#/$defs/BindTarget";
|
|
654
|
+
readonly description: "`beginBind` only.";
|
|
655
|
+
};
|
|
656
|
+
readonly subject: {
|
|
657
|
+
readonly $ref: "#/$defs/Did";
|
|
658
|
+
readonly description: "The member whose forge account is being linked. `beginAccountLink` only.";
|
|
659
|
+
};
|
|
660
|
+
readonly ext: {
|
|
661
|
+
readonly $ref: "#/$defs/Ext";
|
|
662
|
+
};
|
|
663
|
+
};
|
|
664
|
+
readonly $defs: {
|
|
665
|
+
readonly JobId: {
|
|
666
|
+
readonly type: "string";
|
|
667
|
+
readonly minLength: 1;
|
|
668
|
+
readonly maxLength: 128;
|
|
669
|
+
readonly description: "The VTC's identifier for a job, unique across the VTC's jobs.";
|
|
670
|
+
};
|
|
671
|
+
readonly StepName: {
|
|
672
|
+
readonly type: "string";
|
|
673
|
+
readonly minLength: 1;
|
|
674
|
+
readonly maxLength: 64;
|
|
675
|
+
readonly pattern: "^[a-z][A-Za-z0-9]*$";
|
|
676
|
+
readonly description: "One step of a forge adapter's plan. Forge-neutral names: `create`, `workflow`, `keyring`, `variables`, `requiredCheck`, `roles`, `archive`. An adapter MAY add its own (`mergeStyle`, `runner`), which a VTC displays but need not understand.";
|
|
677
|
+
};
|
|
678
|
+
readonly DesiredRole: {
|
|
679
|
+
readonly type: "object";
|
|
680
|
+
readonly additionalProperties: false;
|
|
681
|
+
readonly required: readonly ["subject", "account", "right"];
|
|
682
|
+
readonly properties: {
|
|
683
|
+
readonly subject: {
|
|
684
|
+
readonly $ref: "#/$defs/Did";
|
|
685
|
+
};
|
|
686
|
+
readonly account: {
|
|
687
|
+
readonly $ref: "#/$defs/ForgeAccount";
|
|
688
|
+
readonly description: "The subject's linked account on this namespace's forge.";
|
|
689
|
+
};
|
|
690
|
+
readonly right: {
|
|
691
|
+
readonly $ref: "#/$defs/Right";
|
|
692
|
+
readonly description: "The subject's highest effective right on the target, which the forge adapter maps to one of its roles.";
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
};
|
|
696
|
+
readonly RepoSpec: {
|
|
697
|
+
readonly type: "object";
|
|
698
|
+
readonly additionalProperties: false;
|
|
699
|
+
readonly required: readonly ["visibility"];
|
|
700
|
+
readonly properties: {
|
|
701
|
+
readonly visibility: {
|
|
702
|
+
readonly $ref: "#/$defs/RepoVisibility";
|
|
703
|
+
};
|
|
704
|
+
readonly description: {
|
|
705
|
+
readonly type: "string";
|
|
706
|
+
readonly maxLength: 350;
|
|
707
|
+
};
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
readonly BindTarget: {
|
|
711
|
+
readonly title: "BindTarget";
|
|
712
|
+
readonly description: "The forge owner whose control the binding admin is to prove.";
|
|
713
|
+
readonly type: "object";
|
|
714
|
+
readonly additionalProperties: false;
|
|
715
|
+
readonly required: readonly ["forge", "owner"];
|
|
716
|
+
readonly properties: {
|
|
717
|
+
readonly forge: {
|
|
718
|
+
readonly $ref: "#/$defs/ForgeHost";
|
|
719
|
+
};
|
|
720
|
+
readonly owner: {
|
|
721
|
+
readonly $ref: "#/$defs/Segment";
|
|
722
|
+
};
|
|
723
|
+
};
|
|
724
|
+
};
|
|
725
|
+
readonly Response: {
|
|
726
|
+
readonly $anchor: "response";
|
|
727
|
+
readonly title: "Git Namespaces — Bridge Job — response payload";
|
|
728
|
+
readonly description: "Whether the bridge took the job.";
|
|
729
|
+
readonly type: "object";
|
|
730
|
+
readonly additionalProperties: false;
|
|
731
|
+
readonly required: readonly ["jobId", "accepted"];
|
|
732
|
+
readonly properties: {
|
|
733
|
+
readonly jobId: {
|
|
734
|
+
readonly $ref: "#/$defs/JobId";
|
|
735
|
+
};
|
|
736
|
+
readonly accepted: {
|
|
737
|
+
readonly type: "boolean";
|
|
738
|
+
readonly description: "`true` — the job is durably queued, or was already queued or running under this `jobId`; a git-ns/bridge/result follows. `false` — the bridge already finished this `jobId`; it does not run it again, and sends its git-ns/bridge/result again.";
|
|
739
|
+
};
|
|
740
|
+
readonly next: {
|
|
741
|
+
readonly type: "object";
|
|
742
|
+
readonly additionalProperties: false;
|
|
743
|
+
readonly required: readonly ["url", "expiresAt"];
|
|
744
|
+
readonly description: "For `beginBind` and `beginAccountLink` when `accepted` is `true`: where the VTC sends the person.";
|
|
745
|
+
readonly properties: {
|
|
746
|
+
readonly url: {
|
|
747
|
+
readonly type: "string";
|
|
748
|
+
readonly format: "uri";
|
|
749
|
+
readonly maxLength: 2048;
|
|
750
|
+
readonly pattern: "^https://";
|
|
751
|
+
};
|
|
752
|
+
readonly userCode: {
|
|
753
|
+
readonly type: "string";
|
|
754
|
+
readonly minLength: 1;
|
|
755
|
+
readonly maxLength: 64;
|
|
756
|
+
readonly description: "The device-flow code, for a forge that uses one.";
|
|
757
|
+
};
|
|
758
|
+
readonly expiresAt: {
|
|
759
|
+
readonly type: "string";
|
|
760
|
+
readonly format: "date-time";
|
|
761
|
+
};
|
|
762
|
+
};
|
|
763
|
+
};
|
|
764
|
+
readonly ext: {
|
|
765
|
+
readonly $ref: "#/$defs/Ext";
|
|
766
|
+
};
|
|
767
|
+
};
|
|
768
|
+
};
|
|
769
|
+
readonly Ext: {
|
|
770
|
+
readonly title: "Ext";
|
|
771
|
+
readonly 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.";
|
|
772
|
+
readonly type: "object";
|
|
773
|
+
readonly minProperties: 1;
|
|
774
|
+
readonly additionalProperties: true;
|
|
775
|
+
readonly propertyNames: {
|
|
776
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
777
|
+
};
|
|
778
|
+
};
|
|
779
|
+
readonly Segment: {
|
|
780
|
+
readonly title: "Segment";
|
|
781
|
+
readonly description: "One lowercased owner or repository name. Forges compare these case-insensitively, so the wire form is always lowercase and a producer lowercases before sending. A leading `.` is refused, which rules out `.` and `..`.";
|
|
782
|
+
readonly type: "string";
|
|
783
|
+
readonly minLength: 1;
|
|
784
|
+
readonly maxLength: 100;
|
|
785
|
+
readonly pattern: "^[a-z0-9_-][a-z0-9._-]*$";
|
|
786
|
+
};
|
|
787
|
+
readonly ForgeHost: {
|
|
788
|
+
readonly title: "ForgeHost";
|
|
789
|
+
readonly 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.";
|
|
790
|
+
readonly type: "string";
|
|
791
|
+
readonly minLength: 3;
|
|
792
|
+
readonly maxLength: 253;
|
|
793
|
+
readonly pattern: "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$";
|
|
794
|
+
};
|
|
795
|
+
readonly RepoVisibility: {
|
|
796
|
+
readonly title: "RepoVisibility";
|
|
797
|
+
readonly type: "string";
|
|
798
|
+
readonly enum: readonly ["public", "private"];
|
|
799
|
+
readonly description: "Repository visibility on the forge.";
|
|
800
|
+
};
|
|
801
|
+
readonly Right: {
|
|
802
|
+
readonly title: "Right";
|
|
803
|
+
readonly description: "One of the five git rights. Each string is also the TRQP `action` the VTC publishes the right under in its Trust Registry, so it is carried verbatim. `git.ns.admin` and `git.repo.create` apply to a namespace resource; `git.repo.own` and `git.repo.maintain` to a repository resource; `git.commit.sign` to either.";
|
|
804
|
+
readonly type: "string";
|
|
805
|
+
readonly enum: readonly ["git.ns.admin", "git.repo.create", "git.repo.own", "git.repo.maintain", "git.commit.sign"];
|
|
806
|
+
};
|
|
807
|
+
readonly ForgeAccount: {
|
|
808
|
+
readonly title: "ForgeAccount";
|
|
809
|
+
readonly description: "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.";
|
|
810
|
+
readonly type: "object";
|
|
811
|
+
readonly additionalProperties: false;
|
|
812
|
+
readonly required: readonly ["forge", "id", "login"];
|
|
813
|
+
readonly properties: {
|
|
814
|
+
readonly forge: {
|
|
815
|
+
readonly $ref: "#/$defs/ForgeHost";
|
|
816
|
+
};
|
|
817
|
+
readonly id: {
|
|
818
|
+
readonly $ref: "#/$defs/ForgeId";
|
|
819
|
+
};
|
|
820
|
+
readonly login: {
|
|
821
|
+
readonly type: "string";
|
|
822
|
+
readonly minLength: 1;
|
|
823
|
+
readonly maxLength: 100;
|
|
824
|
+
readonly description: "The account's current login, as the forge reported it when last seen. Display only.";
|
|
825
|
+
};
|
|
826
|
+
};
|
|
827
|
+
};
|
|
828
|
+
readonly ForgeId: {
|
|
829
|
+
readonly title: "ForgeId";
|
|
830
|
+
readonly 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.";
|
|
831
|
+
readonly type: "string";
|
|
832
|
+
readonly minLength: 1;
|
|
833
|
+
readonly maxLength: 64;
|
|
834
|
+
};
|
|
835
|
+
readonly Did: {
|
|
836
|
+
readonly title: "Did";
|
|
837
|
+
readonly description: "A DID, compared by exact string equality.";
|
|
838
|
+
readonly type: "string";
|
|
839
|
+
readonly maxLength: 2048;
|
|
840
|
+
readonly pattern: "^did:[a-z0-9]+:\\S+$";
|
|
841
|
+
};
|
|
842
|
+
readonly RepoResource: {
|
|
843
|
+
readonly title: "RepoResource";
|
|
844
|
+
readonly description: "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.";
|
|
845
|
+
readonly type: "string";
|
|
846
|
+
readonly maxLength: 455;
|
|
847
|
+
readonly 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}$";
|
|
848
|
+
};
|
|
849
|
+
readonly NamespaceId: {
|
|
850
|
+
readonly title: "NamespaceId";
|
|
851
|
+
readonly 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.";
|
|
852
|
+
readonly type: "string";
|
|
853
|
+
readonly minLength: 1;
|
|
854
|
+
readonly maxLength: 128;
|
|
855
|
+
};
|
|
856
|
+
};
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
/**
|
|
860
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
861
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
862
|
+
* parties (§7.3 item 5).
|
|
863
|
+
*/
|
|
864
|
+
export declare const RESPONSE_SPEC: {
|
|
865
|
+
readonly typeUri: "https://trusttasks.org/spec/git-ns/bridge/job/0.2#response";
|
|
866
|
+
readonly isBearer: false;
|
|
867
|
+
readonly isProofRequired: true;
|
|
868
|
+
readonly isRecipientRequired: true;
|
|
869
|
+
readonly isIssuedAtRequired: true;
|
|
870
|
+
readonly payloadSchema: {
|
|
871
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
872
|
+
readonly $ref: "#/$defs/Response";
|
|
873
|
+
readonly $defs: {
|
|
874
|
+
readonly JobId: {
|
|
875
|
+
readonly type: "string";
|
|
876
|
+
readonly minLength: 1;
|
|
877
|
+
readonly maxLength: 128;
|
|
878
|
+
readonly description: "The VTC's identifier for a job, unique across the VTC's jobs.";
|
|
879
|
+
};
|
|
880
|
+
readonly StepName: {
|
|
881
|
+
readonly type: "string";
|
|
882
|
+
readonly minLength: 1;
|
|
883
|
+
readonly maxLength: 64;
|
|
884
|
+
readonly pattern: "^[a-z][A-Za-z0-9]*$";
|
|
885
|
+
readonly description: "One step of a forge adapter's plan. Forge-neutral names: `create`, `workflow`, `keyring`, `variables`, `requiredCheck`, `roles`, `archive`. An adapter MAY add its own (`mergeStyle`, `runner`), which a VTC displays but need not understand.";
|
|
886
|
+
};
|
|
887
|
+
readonly DesiredRole: {
|
|
888
|
+
readonly type: "object";
|
|
889
|
+
readonly additionalProperties: false;
|
|
890
|
+
readonly required: readonly ["subject", "account", "right"];
|
|
891
|
+
readonly properties: {
|
|
892
|
+
readonly subject: {
|
|
893
|
+
readonly $ref: "#/$defs/Did";
|
|
894
|
+
};
|
|
895
|
+
readonly account: {
|
|
896
|
+
readonly $ref: "#/$defs/ForgeAccount";
|
|
897
|
+
readonly description: "The subject's linked account on this namespace's forge.";
|
|
898
|
+
};
|
|
899
|
+
readonly right: {
|
|
900
|
+
readonly $ref: "#/$defs/Right";
|
|
901
|
+
readonly description: "The subject's highest effective right on the target, which the forge adapter maps to one of its roles.";
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
};
|
|
905
|
+
readonly RepoSpec: {
|
|
906
|
+
readonly type: "object";
|
|
907
|
+
readonly additionalProperties: false;
|
|
908
|
+
readonly required: readonly ["visibility"];
|
|
909
|
+
readonly properties: {
|
|
910
|
+
readonly visibility: {
|
|
911
|
+
readonly $ref: "#/$defs/RepoVisibility";
|
|
912
|
+
};
|
|
913
|
+
readonly description: {
|
|
914
|
+
readonly type: "string";
|
|
915
|
+
readonly maxLength: 350;
|
|
916
|
+
};
|
|
917
|
+
};
|
|
918
|
+
};
|
|
919
|
+
readonly BindTarget: {
|
|
920
|
+
readonly title: "BindTarget";
|
|
921
|
+
readonly description: "The forge owner whose control the binding admin is to prove.";
|
|
922
|
+
readonly type: "object";
|
|
923
|
+
readonly additionalProperties: false;
|
|
924
|
+
readonly required: readonly ["forge", "owner"];
|
|
925
|
+
readonly properties: {
|
|
926
|
+
readonly forge: {
|
|
927
|
+
readonly $ref: "#/$defs/ForgeHost";
|
|
928
|
+
};
|
|
929
|
+
readonly owner: {
|
|
930
|
+
readonly $ref: "#/$defs/Segment";
|
|
931
|
+
};
|
|
932
|
+
};
|
|
933
|
+
};
|
|
934
|
+
readonly Response: {
|
|
935
|
+
readonly $anchor: "response";
|
|
936
|
+
readonly title: "Git Namespaces — Bridge Job — response payload";
|
|
937
|
+
readonly description: "Whether the bridge took the job.";
|
|
938
|
+
readonly type: "object";
|
|
939
|
+
readonly additionalProperties: false;
|
|
940
|
+
readonly required: readonly ["jobId", "accepted"];
|
|
941
|
+
readonly properties: {
|
|
942
|
+
readonly jobId: {
|
|
943
|
+
readonly $ref: "#/$defs/JobId";
|
|
944
|
+
};
|
|
945
|
+
readonly accepted: {
|
|
946
|
+
readonly type: "boolean";
|
|
947
|
+
readonly description: "`true` — the job is durably queued, or was already queued or running under this `jobId`; a git-ns/bridge/result follows. `false` — the bridge already finished this `jobId`; it does not run it again, and sends its git-ns/bridge/result again.";
|
|
948
|
+
};
|
|
949
|
+
readonly next: {
|
|
950
|
+
readonly type: "object";
|
|
951
|
+
readonly additionalProperties: false;
|
|
952
|
+
readonly required: readonly ["url", "expiresAt"];
|
|
953
|
+
readonly description: "For `beginBind` and `beginAccountLink` when `accepted` is `true`: where the VTC sends the person.";
|
|
954
|
+
readonly properties: {
|
|
955
|
+
readonly url: {
|
|
956
|
+
readonly type: "string";
|
|
957
|
+
readonly format: "uri";
|
|
958
|
+
readonly maxLength: 2048;
|
|
959
|
+
readonly pattern: "^https://";
|
|
960
|
+
};
|
|
961
|
+
readonly userCode: {
|
|
962
|
+
readonly type: "string";
|
|
963
|
+
readonly minLength: 1;
|
|
964
|
+
readonly maxLength: 64;
|
|
965
|
+
readonly description: "The device-flow code, for a forge that uses one.";
|
|
966
|
+
};
|
|
967
|
+
readonly expiresAt: {
|
|
968
|
+
readonly type: "string";
|
|
969
|
+
readonly format: "date-time";
|
|
970
|
+
};
|
|
971
|
+
};
|
|
972
|
+
};
|
|
973
|
+
readonly ext: {
|
|
974
|
+
readonly $ref: "#/$defs/Ext";
|
|
975
|
+
};
|
|
976
|
+
};
|
|
977
|
+
};
|
|
978
|
+
readonly Ext: {
|
|
979
|
+
readonly title: "Ext";
|
|
980
|
+
readonly 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.";
|
|
981
|
+
readonly type: "object";
|
|
982
|
+
readonly minProperties: 1;
|
|
983
|
+
readonly additionalProperties: true;
|
|
984
|
+
readonly propertyNames: {
|
|
985
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
986
|
+
};
|
|
987
|
+
};
|
|
988
|
+
readonly Segment: {
|
|
989
|
+
readonly title: "Segment";
|
|
990
|
+
readonly description: "One lowercased owner or repository name. Forges compare these case-insensitively, so the wire form is always lowercase and a producer lowercases before sending. A leading `.` is refused, which rules out `.` and `..`.";
|
|
991
|
+
readonly type: "string";
|
|
992
|
+
readonly minLength: 1;
|
|
993
|
+
readonly maxLength: 100;
|
|
994
|
+
readonly pattern: "^[a-z0-9_-][a-z0-9._-]*$";
|
|
995
|
+
};
|
|
996
|
+
readonly ForgeHost: {
|
|
997
|
+
readonly title: "ForgeHost";
|
|
998
|
+
readonly 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.";
|
|
999
|
+
readonly type: "string";
|
|
1000
|
+
readonly minLength: 3;
|
|
1001
|
+
readonly maxLength: 253;
|
|
1002
|
+
readonly pattern: "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$";
|
|
1003
|
+
};
|
|
1004
|
+
readonly RepoVisibility: {
|
|
1005
|
+
readonly title: "RepoVisibility";
|
|
1006
|
+
readonly type: "string";
|
|
1007
|
+
readonly enum: readonly ["public", "private"];
|
|
1008
|
+
readonly description: "Repository visibility on the forge.";
|
|
1009
|
+
};
|
|
1010
|
+
readonly Right: {
|
|
1011
|
+
readonly title: "Right";
|
|
1012
|
+
readonly description: "One of the five git rights. Each string is also the TRQP `action` the VTC publishes the right under in its Trust Registry, so it is carried verbatim. `git.ns.admin` and `git.repo.create` apply to a namespace resource; `git.repo.own` and `git.repo.maintain` to a repository resource; `git.commit.sign` to either.";
|
|
1013
|
+
readonly type: "string";
|
|
1014
|
+
readonly enum: readonly ["git.ns.admin", "git.repo.create", "git.repo.own", "git.repo.maintain", "git.commit.sign"];
|
|
1015
|
+
};
|
|
1016
|
+
readonly ForgeAccount: {
|
|
1017
|
+
readonly title: "ForgeAccount";
|
|
1018
|
+
readonly description: "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.";
|
|
1019
|
+
readonly type: "object";
|
|
1020
|
+
readonly additionalProperties: false;
|
|
1021
|
+
readonly required: readonly ["forge", "id", "login"];
|
|
1022
|
+
readonly properties: {
|
|
1023
|
+
readonly forge: {
|
|
1024
|
+
readonly $ref: "#/$defs/ForgeHost";
|
|
1025
|
+
};
|
|
1026
|
+
readonly id: {
|
|
1027
|
+
readonly $ref: "#/$defs/ForgeId";
|
|
1028
|
+
};
|
|
1029
|
+
readonly login: {
|
|
1030
|
+
readonly type: "string";
|
|
1031
|
+
readonly minLength: 1;
|
|
1032
|
+
readonly maxLength: 100;
|
|
1033
|
+
readonly description: "The account's current login, as the forge reported it when last seen. Display only.";
|
|
1034
|
+
};
|
|
1035
|
+
};
|
|
1036
|
+
};
|
|
1037
|
+
readonly ForgeId: {
|
|
1038
|
+
readonly title: "ForgeId";
|
|
1039
|
+
readonly 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.";
|
|
1040
|
+
readonly type: "string";
|
|
1041
|
+
readonly minLength: 1;
|
|
1042
|
+
readonly maxLength: 64;
|
|
1043
|
+
};
|
|
1044
|
+
readonly Did: {
|
|
1045
|
+
readonly title: "Did";
|
|
1046
|
+
readonly description: "A DID, compared by exact string equality.";
|
|
1047
|
+
readonly type: "string";
|
|
1048
|
+
readonly maxLength: 2048;
|
|
1049
|
+
readonly pattern: "^did:[a-z0-9]+:\\S+$";
|
|
1050
|
+
};
|
|
1051
|
+
readonly RepoResource: {
|
|
1052
|
+
readonly title: "RepoResource";
|
|
1053
|
+
readonly description: "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.";
|
|
1054
|
+
readonly type: "string";
|
|
1055
|
+
readonly maxLength: 455;
|
|
1056
|
+
readonly 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}$";
|
|
1057
|
+
};
|
|
1058
|
+
readonly NamespaceId: {
|
|
1059
|
+
readonly title: "NamespaceId";
|
|
1060
|
+
readonly 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.";
|
|
1061
|
+
readonly type: "string";
|
|
1062
|
+
readonly minLength: 1;
|
|
1063
|
+
readonly maxLength: 128;
|
|
1064
|
+
};
|
|
1065
|
+
};
|
|
1066
|
+
};
|
|
1067
|
+
};
|
|
1068
|
+
//# sourceMappingURL=payload.d.ts.map
|