@openvtc/trust-tasks 0.20.1 → 0.20.3
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 +110 -0
- package/dist/_shared/components.d.ts +175 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/git-ns/_shared/0.1/git-ns.d.ts +16 -0
- package/dist/git-ns/_shared/0.1/git-ns.d.ts.map +1 -0
- package/dist/git-ns/_shared/0.1/git-ns.js +6 -0
- package/dist/git-ns/_shared/0.1/git-ns.js.map +1 -0
- package/dist/git-ns/account/link/0.1/payload.d.ts +355 -0
- package/dist/git-ns/account/link/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/account/link/0.1/payload.js +192 -0
- package/dist/git-ns/account/link/0.1/payload.js.map +1 -0
- package/dist/git-ns/account/link-status/0.1/payload.d.ts +403 -0
- package/dist/git-ns/account/link-status/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/account/link-status/0.1/payload.js +234 -0
- package/dist/git-ns/account/link-status/0.1/payload.js.map +1 -0
- package/dist/git-ns/bridge/event/0.1/payload.d.ts +1348 -0
- package/dist/git-ns/bridge/event/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/bridge/event/0.1/payload.js +785 -0
- package/dist/git-ns/bridge/event/0.1/payload.js.map +1 -0
- package/dist/git-ns/bridge/job/0.1/payload.d.ts +1044 -0
- package/dist/git-ns/bridge/job/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/bridge/job/0.1/payload.js +564 -0
- package/dist/git-ns/bridge/job/0.1/payload.js.map +1 -0
- package/dist/git-ns/bridge/result/0.1/payload.d.ts +462 -0
- package/dist/git-ns/bridge/result/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/bridge/result/0.1/payload.js +248 -0
- package/dist/git-ns/bridge/result/0.1/payload.js.map +1 -0
- package/dist/git-ns/namespace/bind/0.1/payload.d.ts +547 -0
- package/dist/git-ns/namespace/bind/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/namespace/bind/0.1/payload.js +322 -0
- package/dist/git-ns/namespace/bind/0.1/payload.js.map +1 -0
- package/dist/git-ns/namespace/unbind/0.1/payload.d.ts +300 -0
- package/dist/git-ns/namespace/unbind/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/namespace/unbind/0.1/payload.js +168 -0
- package/dist/git-ns/namespace/unbind/0.1/payload.js.map +1 -0
- package/dist/git-ns/repo/adopt/0.1/payload.d.ts +962 -0
- package/dist/git-ns/repo/adopt/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/repo/adopt/0.1/payload.js +583 -0
- package/dist/git-ns/repo/adopt/0.1/payload.js.map +1 -0
- package/dist/git-ns/repo/archive/0.1/payload.d.ts +959 -0
- package/dist/git-ns/repo/archive/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/repo/archive/0.1/payload.js +584 -0
- package/dist/git-ns/repo/archive/0.1/payload.js.map +1 -0
- package/dist/git-ns/repo/create/0.1/payload.d.ts +1074 -0
- package/dist/git-ns/repo/create/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/repo/create/0.1/payload.js +636 -0
- package/dist/git-ns/repo/create/0.1/payload.js.map +1 -0
- package/dist/git-ns/repo/transfer/0.1/payload.d.ts +947 -0
- package/dist/git-ns/repo/transfer/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/repo/transfer/0.1/payload.js +577 -0
- package/dist/git-ns/repo/transfer/0.1/payload.js.map +1 -0
- package/dist/git-ns/right/grant/0.1/payload.d.ts +506 -0
- package/dist/git-ns/right/grant/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/right/grant/0.1/payload.js +289 -0
- package/dist/git-ns/right/grant/0.1/payload.js.map +1 -0
- package/dist/git-ns/right/revoke/0.1/payload.d.ts +492 -0
- package/dist/git-ns/right/revoke/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/right/revoke/0.1/payload.js +284 -0
- package/dist/git-ns/right/revoke/0.1/payload.js.map +1 -0
- package/dist/git-ns/view/0.1/payload.d.ts +1407 -0
- package/dist/git-ns/view/0.1/payload.d.ts.map +1 -0
- package/dist/git-ns/view/0.1/payload.js +860 -0
- package/dist/git-ns/view/0.1/payload.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/vetting/attestation/0.1/payload.d.ts +690 -0
- package/dist/vetting/attestation/0.1/payload.d.ts.map +1 -0
- package/dist/vetting/attestation/0.1/payload.js +374 -0
- package/dist/vetting/attestation/0.1/payload.js.map +1 -0
- package/dist/vtc/vetting/pcs-challenge/0.1/payload.d.ts +261 -0
- package/dist/vtc/vetting/pcs-challenge/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/vetting/pcs-challenge/0.1/payload.js +145 -0
- package/dist/vtc/vetting/pcs-challenge/0.1/payload.js.map +1 -0
- package/dist/vtc/vetting/vetters/event-mode/0.1/payload.d.ts +546 -0
- package/dist/vtc/vetting/vetters/event-mode/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/vetting/vetters/event-mode/0.1/payload.js +290 -0
- package/dist/vtc/vetting/vetters/event-mode/0.1/payload.js.map +1 -0
- package/dist/vtc/vetting/vetters/pcs-root/0.1/payload.d.ts +336 -0
- package/dist/vtc/vetting/vetters/pcs-root/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/vetting/vetters/pcs-root/0.1/payload.js +178 -0
- package/dist/vtc/vetting/vetters/pcs-root/0.1/payload.js.map +1 -0
- package/dist/vtc/vetting/vetters/pcs-tokens/0.1/payload.d.ts +402 -0
- package/dist/vtc/vetting/vetters/pcs-tokens/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/vetting/vetters/pcs-tokens/0.1/payload.js +205 -0
- package/dist/vtc/vetting/vetters/pcs-tokens/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +181 -0
- package/src/git-ns/_shared/0.1/git-ns.ts +17 -0
- package/src/git-ns/account/link/0.1/payload.ts +242 -0
- package/src/git-ns/account/link-status/0.1/payload.ts +276 -0
- package/src/git-ns/bridge/event/0.1/payload.ts +902 -0
- package/src/git-ns/bridge/job/0.1/payload.ts +676 -0
- package/src/git-ns/bridge/result/0.1/payload.ts +321 -0
- package/src/git-ns/namespace/bind/0.1/payload.ts +374 -0
- package/src/git-ns/namespace/unbind/0.1/payload.ts +211 -0
- package/src/git-ns/repo/adopt/0.1/payload.ts +628 -0
- package/src/git-ns/repo/archive/0.1/payload.ts +626 -0
- package/src/git-ns/repo/create/0.1/payload.ts +689 -0
- package/src/git-ns/repo/transfer/0.1/payload.ts +619 -0
- package/src/git-ns/right/grant/0.1/payload.ts +340 -0
- package/src/git-ns/right/revoke/0.1/payload.ts +331 -0
- package/src/git-ns/view/0.1/payload.ts +906 -0
- package/src/index.ts +20 -0
- package/src/vetting/attestation/0.1/payload.ts +493 -0
- package/src/vtc/vetting/pcs-challenge/0.1/payload.ts +187 -0
- package/src/vtc/vetting/vetters/event-mode/0.1/payload.ts +375 -0
- package/src/vtc/vetting/vetters/pcs-root/0.1/payload.ts +241 -0
- package/src/vtc/vetting/vetters/pcs-tokens/0.1/payload.ts +286 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/git-ns/account/link/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext, ForgeHost } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A member begins linking their account on a forge to their DID. The response carries where the member goes to authorise it; the member then polls git-ns/account/link-status.
|
|
11
|
+
*/
|
|
12
|
+
export interface GitNamespacesLinkForgeAccountPayload {
|
|
13
|
+
/**
|
|
14
|
+
* The forge whose account to link.
|
|
15
|
+
*/
|
|
16
|
+
forge: ForgeHost;
|
|
17
|
+
ext?: Ext;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Where to authorise the link.
|
|
21
|
+
*/
|
|
22
|
+
export interface GitNamespacesLinkForgeAccountResponsePayload {
|
|
23
|
+
/**
|
|
24
|
+
* Identifies this attempt for git-ns/account/link-status. Opaque; meaningful only to the member who began it.
|
|
25
|
+
*/
|
|
26
|
+
linkId: string;
|
|
27
|
+
/**
|
|
28
|
+
* Where the member authorises the link: the device-code entry page (GitHub), or the forge's authorisation page (Forgejo, authorisation code with PKCE).
|
|
29
|
+
*/
|
|
30
|
+
url: string;
|
|
31
|
+
/**
|
|
32
|
+
* The code the member types at `url`, for a forge that uses a device flow. Absent otherwise.
|
|
33
|
+
*/
|
|
34
|
+
userCode?: string;
|
|
35
|
+
/**
|
|
36
|
+
* When this attempt lapses if not completed.
|
|
37
|
+
*/
|
|
38
|
+
expiresAt: string;
|
|
39
|
+
ext?: Ext;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
43
|
+
export type { Ext, ForgeHost };
|
|
44
|
+
|
|
45
|
+
/** Trust Task type URI. */
|
|
46
|
+
export const TYPE_URI = "https://trusttasks.org/spec/git-ns/account/link/0.1" as const;
|
|
47
|
+
|
|
48
|
+
/** Stable alias for this specification's request payload shape. */
|
|
49
|
+
export type Payload = GitNamespacesLinkForgeAccountPayload;
|
|
50
|
+
|
|
51
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
52
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/git-ns/account/link/0.1#response" as const;
|
|
53
|
+
|
|
54
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
55
|
+
export type Response = GitNamespacesLinkForgeAccountResponsePayload;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* This specification's payload schema, as a value.
|
|
59
|
+
*
|
|
60
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
61
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
62
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
63
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
64
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
65
|
+
*/
|
|
66
|
+
export const PAYLOAD_SCHEMA = {
|
|
67
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
68
|
+
"$id": "https://trusttasks.org/spec/git-ns/account/link/0.1",
|
|
69
|
+
"title": "Git Namespaces — Link Forge Account — payload",
|
|
70
|
+
"description": "A member begins linking their account on a forge to their DID. The response carries where the member goes to authorise it; the member then polls git-ns/account/link-status.",
|
|
71
|
+
"type": "object",
|
|
72
|
+
"additionalProperties": false,
|
|
73
|
+
"required": [
|
|
74
|
+
"forge"
|
|
75
|
+
],
|
|
76
|
+
"properties": {
|
|
77
|
+
"forge": {
|
|
78
|
+
"$ref": "#/$defs/ForgeHost",
|
|
79
|
+
"description": "The forge whose account to link."
|
|
80
|
+
},
|
|
81
|
+
"ext": {
|
|
82
|
+
"$ref": "#/$defs/Ext"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"$defs": {
|
|
86
|
+
"Response": {
|
|
87
|
+
"$anchor": "response",
|
|
88
|
+
"title": "Git Namespaces — Link Forge Account — response payload",
|
|
89
|
+
"description": "Where to authorise the link.",
|
|
90
|
+
"type": "object",
|
|
91
|
+
"additionalProperties": false,
|
|
92
|
+
"required": [
|
|
93
|
+
"linkId",
|
|
94
|
+
"url",
|
|
95
|
+
"expiresAt"
|
|
96
|
+
],
|
|
97
|
+
"properties": {
|
|
98
|
+
"linkId": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"minLength": 1,
|
|
101
|
+
"maxLength": 128,
|
|
102
|
+
"description": "Identifies this attempt for git-ns/account/link-status. Opaque; meaningful only to the member who began it."
|
|
103
|
+
},
|
|
104
|
+
"url": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"format": "uri",
|
|
107
|
+
"maxLength": 2048,
|
|
108
|
+
"pattern": "^https://",
|
|
109
|
+
"description": "Where the member authorises the link: the device-code entry page (GitHub), or the forge's authorisation page (Forgejo, authorisation code with PKCE)."
|
|
110
|
+
},
|
|
111
|
+
"userCode": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"minLength": 1,
|
|
114
|
+
"maxLength": 64,
|
|
115
|
+
"description": "The code the member types at `url`, for a forge that uses a device flow. Absent otherwise."
|
|
116
|
+
},
|
|
117
|
+
"expiresAt": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"format": "date-time",
|
|
120
|
+
"description": "When this attempt lapses if not completed."
|
|
121
|
+
},
|
|
122
|
+
"ext": {
|
|
123
|
+
"$ref": "#/$defs/Ext"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"Ext": {
|
|
128
|
+
"title": "Ext",
|
|
129
|
+
"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.",
|
|
130
|
+
"type": "object",
|
|
131
|
+
"minProperties": 1,
|
|
132
|
+
"additionalProperties": true,
|
|
133
|
+
"propertyNames": {
|
|
134
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"ForgeHost": {
|
|
138
|
+
"title": "ForgeHost",
|
|
139
|
+
"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.",
|
|
140
|
+
"type": "string",
|
|
141
|
+
"minLength": 3,
|
|
142
|
+
"maxLength": 253,
|
|
143
|
+
"pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
} as const;
|
|
147
|
+
|
|
148
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
149
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
150
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
151
|
+
"$ref": "#/$defs/Response",
|
|
152
|
+
"$defs": {
|
|
153
|
+
"Response": {
|
|
154
|
+
"$anchor": "response",
|
|
155
|
+
"title": "Git Namespaces — Link Forge Account — response payload",
|
|
156
|
+
"description": "Where to authorise the link.",
|
|
157
|
+
"type": "object",
|
|
158
|
+
"additionalProperties": false,
|
|
159
|
+
"required": [
|
|
160
|
+
"linkId",
|
|
161
|
+
"url",
|
|
162
|
+
"expiresAt"
|
|
163
|
+
],
|
|
164
|
+
"properties": {
|
|
165
|
+
"linkId": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"minLength": 1,
|
|
168
|
+
"maxLength": 128,
|
|
169
|
+
"description": "Identifies this attempt for git-ns/account/link-status. Opaque; meaningful only to the member who began it."
|
|
170
|
+
},
|
|
171
|
+
"url": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"format": "uri",
|
|
174
|
+
"maxLength": 2048,
|
|
175
|
+
"pattern": "^https://",
|
|
176
|
+
"description": "Where the member authorises the link: the device-code entry page (GitHub), or the forge's authorisation page (Forgejo, authorisation code with PKCE)."
|
|
177
|
+
},
|
|
178
|
+
"userCode": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"minLength": 1,
|
|
181
|
+
"maxLength": 64,
|
|
182
|
+
"description": "The code the member types at `url`, for a forge that uses a device flow. Absent otherwise."
|
|
183
|
+
},
|
|
184
|
+
"expiresAt": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"format": "date-time",
|
|
187
|
+
"description": "When this attempt lapses if not completed."
|
|
188
|
+
},
|
|
189
|
+
"ext": {
|
|
190
|
+
"$ref": "#/$defs/Ext"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
"Ext": {
|
|
195
|
+
"title": "Ext",
|
|
196
|
+
"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.",
|
|
197
|
+
"type": "object",
|
|
198
|
+
"minProperties": 1,
|
|
199
|
+
"additionalProperties": true,
|
|
200
|
+
"propertyNames": {
|
|
201
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"ForgeHost": {
|
|
205
|
+
"title": "ForgeHost",
|
|
206
|
+
"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.",
|
|
207
|
+
"type": "string",
|
|
208
|
+
"minLength": 3,
|
|
209
|
+
"maxLength": 253,
|
|
210
|
+
"pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
} as const;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
217
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
218
|
+
* per-specification and cannot be derived from the document alone, and
|
|
219
|
+
* item 2 needs the schema this carries.
|
|
220
|
+
*/
|
|
221
|
+
export const SPEC = {
|
|
222
|
+
typeUri: TYPE_URI,
|
|
223
|
+
isBearer: false,
|
|
224
|
+
isProofRequired: true,
|
|
225
|
+
isRecipientRequired: true,
|
|
226
|
+
isIssuedAtRequired: true,
|
|
227
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
228
|
+
} as const;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
232
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
233
|
+
* parties (§7.3 item 5).
|
|
234
|
+
*/
|
|
235
|
+
export const RESPONSE_SPEC = {
|
|
236
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
237
|
+
isBearer: false,
|
|
238
|
+
isProofRequired: true,
|
|
239
|
+
isRecipientRequired: true,
|
|
240
|
+
isIssuedAtRequired: true,
|
|
241
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
242
|
+
} as const;
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/git-ns/account/link-status/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Ext, ForgeAccount, ForgeHost, ForgeId } from "../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A member asks where a forge account link they began stands.
|
|
11
|
+
*/
|
|
12
|
+
export interface GitNamespacesForgeAccountLinkStatusPayload {
|
|
13
|
+
/**
|
|
14
|
+
* From git-ns/account/link.
|
|
15
|
+
*/
|
|
16
|
+
linkId: string;
|
|
17
|
+
ext?: Ext;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Where the link stands.
|
|
21
|
+
*/
|
|
22
|
+
export interface GitNamespacesForgeAccountLinkStatusResponsePayload {
|
|
23
|
+
/**
|
|
24
|
+
* `pending` — waiting for the member to authorise. `linked` — the account is bound to the member's DID. `expired` — not authorised in time. `failed` — the forge refused, or the account is already linked to another member.
|
|
25
|
+
*/
|
|
26
|
+
state: "pending" | "linked" | "expired" | "failed";
|
|
27
|
+
/**
|
|
28
|
+
* The linked account. Present only when `state` is `linked`.
|
|
29
|
+
*/
|
|
30
|
+
account?: ForgeAccount;
|
|
31
|
+
ext?: Ext;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
35
|
+
export type { Ext, ForgeAccount, ForgeHost, ForgeId };
|
|
36
|
+
|
|
37
|
+
/** Trust Task type URI. */
|
|
38
|
+
export const TYPE_URI = "https://trusttasks.org/spec/git-ns/account/link-status/0.1" as const;
|
|
39
|
+
|
|
40
|
+
/** Stable alias for this specification's request payload shape. */
|
|
41
|
+
export type Payload = GitNamespacesForgeAccountLinkStatusPayload;
|
|
42
|
+
|
|
43
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
44
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/git-ns/account/link-status/0.1#response" as const;
|
|
45
|
+
|
|
46
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
47
|
+
export type Response = GitNamespacesForgeAccountLinkStatusResponsePayload;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* This specification's payload schema, as a value.
|
|
51
|
+
*
|
|
52
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
53
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
54
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
55
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
56
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
57
|
+
*/
|
|
58
|
+
export const PAYLOAD_SCHEMA = {
|
|
59
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
60
|
+
"$id": "https://trusttasks.org/spec/git-ns/account/link-status/0.1",
|
|
61
|
+
"title": "Git Namespaces — Forge Account Link Status — payload",
|
|
62
|
+
"description": "A member asks where a forge account link they began stands.",
|
|
63
|
+
"type": "object",
|
|
64
|
+
"additionalProperties": false,
|
|
65
|
+
"required": [
|
|
66
|
+
"linkId"
|
|
67
|
+
],
|
|
68
|
+
"properties": {
|
|
69
|
+
"linkId": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"minLength": 1,
|
|
72
|
+
"maxLength": 128,
|
|
73
|
+
"description": "From git-ns/account/link."
|
|
74
|
+
},
|
|
75
|
+
"ext": {
|
|
76
|
+
"$ref": "#/$defs/Ext"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"$defs": {
|
|
80
|
+
"Response": {
|
|
81
|
+
"$anchor": "response",
|
|
82
|
+
"title": "Git Namespaces — Forge Account Link Status — response payload",
|
|
83
|
+
"description": "Where the link stands.",
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"required": [
|
|
87
|
+
"state"
|
|
88
|
+
],
|
|
89
|
+
"properties": {
|
|
90
|
+
"state": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"enum": [
|
|
93
|
+
"pending",
|
|
94
|
+
"linked",
|
|
95
|
+
"expired",
|
|
96
|
+
"failed"
|
|
97
|
+
],
|
|
98
|
+
"description": "`pending` — waiting for the member to authorise. `linked` — the account is bound to the member's DID. `expired` — not authorised in time. `failed` — the forge refused, or the account is already linked to another member."
|
|
99
|
+
},
|
|
100
|
+
"account": {
|
|
101
|
+
"$ref": "#/$defs/ForgeAccount",
|
|
102
|
+
"description": "The linked account. Present only when `state` is `linked`."
|
|
103
|
+
},
|
|
104
|
+
"ext": {
|
|
105
|
+
"$ref": "#/$defs/Ext"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"Ext": {
|
|
110
|
+
"title": "Ext",
|
|
111
|
+
"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.",
|
|
112
|
+
"type": "object",
|
|
113
|
+
"minProperties": 1,
|
|
114
|
+
"additionalProperties": true,
|
|
115
|
+
"propertyNames": {
|
|
116
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"ForgeAccount": {
|
|
120
|
+
"title": "ForgeAccount",
|
|
121
|
+
"description": "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.",
|
|
122
|
+
"type": "object",
|
|
123
|
+
"additionalProperties": false,
|
|
124
|
+
"required": [
|
|
125
|
+
"forge",
|
|
126
|
+
"id",
|
|
127
|
+
"login"
|
|
128
|
+
],
|
|
129
|
+
"properties": {
|
|
130
|
+
"forge": {
|
|
131
|
+
"$ref": "#/$defs/ForgeHost"
|
|
132
|
+
},
|
|
133
|
+
"id": {
|
|
134
|
+
"$ref": "#/$defs/ForgeId"
|
|
135
|
+
},
|
|
136
|
+
"login": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"minLength": 1,
|
|
139
|
+
"maxLength": 100,
|
|
140
|
+
"description": "The account's current login, as the forge reported it when last seen. Display only."
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"ForgeId": {
|
|
145
|
+
"title": "ForgeId",
|
|
146
|
+
"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.",
|
|
147
|
+
"type": "string",
|
|
148
|
+
"minLength": 1,
|
|
149
|
+
"maxLength": 64
|
|
150
|
+
},
|
|
151
|
+
"ForgeHost": {
|
|
152
|
+
"title": "ForgeHost",
|
|
153
|
+
"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.",
|
|
154
|
+
"type": "string",
|
|
155
|
+
"minLength": 3,
|
|
156
|
+
"maxLength": 253,
|
|
157
|
+
"pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
} as const;
|
|
161
|
+
|
|
162
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
163
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
164
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
165
|
+
"$ref": "#/$defs/Response",
|
|
166
|
+
"$defs": {
|
|
167
|
+
"Response": {
|
|
168
|
+
"$anchor": "response",
|
|
169
|
+
"title": "Git Namespaces — Forge Account Link Status — response payload",
|
|
170
|
+
"description": "Where the link stands.",
|
|
171
|
+
"type": "object",
|
|
172
|
+
"additionalProperties": false,
|
|
173
|
+
"required": [
|
|
174
|
+
"state"
|
|
175
|
+
],
|
|
176
|
+
"properties": {
|
|
177
|
+
"state": {
|
|
178
|
+
"type": "string",
|
|
179
|
+
"enum": [
|
|
180
|
+
"pending",
|
|
181
|
+
"linked",
|
|
182
|
+
"expired",
|
|
183
|
+
"failed"
|
|
184
|
+
],
|
|
185
|
+
"description": "`pending` — waiting for the member to authorise. `linked` — the account is bound to the member's DID. `expired` — not authorised in time. `failed` — the forge refused, or the account is already linked to another member."
|
|
186
|
+
},
|
|
187
|
+
"account": {
|
|
188
|
+
"$ref": "#/$defs/ForgeAccount",
|
|
189
|
+
"description": "The linked account. Present only when `state` is `linked`."
|
|
190
|
+
},
|
|
191
|
+
"ext": {
|
|
192
|
+
"$ref": "#/$defs/Ext"
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"Ext": {
|
|
197
|
+
"title": "Ext",
|
|
198
|
+
"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.",
|
|
199
|
+
"type": "object",
|
|
200
|
+
"minProperties": 1,
|
|
201
|
+
"additionalProperties": true,
|
|
202
|
+
"propertyNames": {
|
|
203
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"ForgeAccount": {
|
|
207
|
+
"title": "ForgeAccount",
|
|
208
|
+
"description": "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.",
|
|
209
|
+
"type": "object",
|
|
210
|
+
"additionalProperties": false,
|
|
211
|
+
"required": [
|
|
212
|
+
"forge",
|
|
213
|
+
"id",
|
|
214
|
+
"login"
|
|
215
|
+
],
|
|
216
|
+
"properties": {
|
|
217
|
+
"forge": {
|
|
218
|
+
"$ref": "#/$defs/ForgeHost"
|
|
219
|
+
},
|
|
220
|
+
"id": {
|
|
221
|
+
"$ref": "#/$defs/ForgeId"
|
|
222
|
+
},
|
|
223
|
+
"login": {
|
|
224
|
+
"type": "string",
|
|
225
|
+
"minLength": 1,
|
|
226
|
+
"maxLength": 100,
|
|
227
|
+
"description": "The account's current login, as the forge reported it when last seen. Display only."
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"ForgeId": {
|
|
232
|
+
"title": "ForgeId",
|
|
233
|
+
"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.",
|
|
234
|
+
"type": "string",
|
|
235
|
+
"minLength": 1,
|
|
236
|
+
"maxLength": 64
|
|
237
|
+
},
|
|
238
|
+
"ForgeHost": {
|
|
239
|
+
"title": "ForgeHost",
|
|
240
|
+
"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.",
|
|
241
|
+
"type": "string",
|
|
242
|
+
"minLength": 3,
|
|
243
|
+
"maxLength": 253,
|
|
244
|
+
"pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
} as const;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
251
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
252
|
+
* per-specification and cannot be derived from the document alone, and
|
|
253
|
+
* item 2 needs the schema this carries.
|
|
254
|
+
*/
|
|
255
|
+
export const SPEC = {
|
|
256
|
+
typeUri: TYPE_URI,
|
|
257
|
+
isBearer: false,
|
|
258
|
+
isProofRequired: false,
|
|
259
|
+
isRecipientRequired: true,
|
|
260
|
+
isIssuedAtRequired: false,
|
|
261
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
262
|
+
} as const;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
266
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
267
|
+
* parties (§7.3 item 5).
|
|
268
|
+
*/
|
|
269
|
+
export const RESPONSE_SPEC = {
|
|
270
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
271
|
+
isBearer: false,
|
|
272
|
+
isProofRequired: false,
|
|
273
|
+
isRecipientRequired: true,
|
|
274
|
+
isIssuedAtRequired: false,
|
|
275
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
276
|
+
} as const;
|