@openvtc/trust-tasks 0.6.4 → 0.6.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/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/provision/integration/0.3/payload.d.ts +279 -0
- package/dist/provision/integration/0.3/payload.d.ts.map +1 -0
- package/dist/provision/integration/0.3/payload.js +31 -0
- package/dist/provision/integration/0.3/payload.js.map +1 -0
- package/dist/vault/_shared/0.3/consumer-context.d.ts +11 -0
- package/dist/vault/_shared/0.3/consumer-context.d.ts.map +1 -0
- package/dist/vault/_shared/0.3/consumer-context.js +6 -0
- package/dist/vault/_shared/0.3/consumer-context.js.map +1 -0
- package/dist/vault/_shared/0.3/sealed-envelope.d.ts +15 -0
- package/dist/vault/_shared/0.3/sealed-envelope.d.ts.map +1 -0
- package/dist/vault/_shared/0.3/sealed-envelope.js +6 -0
- package/dist/vault/_shared/0.3/sealed-envelope.js.map +1 -0
- package/dist/vault/_shared/0.3/session-blob.d.ts +13 -0
- package/dist/vault/_shared/0.3/session-blob.d.ts.map +1 -0
- package/dist/vault/_shared/0.3/session-blob.js +6 -0
- package/dist/vault/_shared/0.3/session-blob.js.map +1 -0
- package/dist/vault/_shared/0.3/vault-entry.d.ts +13 -0
- package/dist/vault/_shared/0.3/vault-entry.d.ts.map +1 -0
- package/dist/vault/_shared/0.3/vault-entry.js +6 -0
- package/dist/vault/_shared/0.3/vault-entry.js.map +1 -0
- package/dist/vault/_shared/0.3/vault-secret.d.ts +15 -0
- package/dist/vault/_shared/0.3/vault-secret.d.ts.map +1 -0
- package/dist/vault/_shared/0.3/vault-secret.js +6 -0
- package/dist/vault/_shared/0.3/vault-secret.js.map +1 -0
- package/dist/vault/get/0.3/payload.d.ts +211 -0
- package/dist/vault/get/0.3/payload.d.ts.map +1 -0
- package/dist/vault/get/0.3/payload.js +31 -0
- package/dist/vault/get/0.3/payload.js.map +1 -0
- package/dist/vault/list/0.3/payload.d.ts +287 -0
- package/dist/vault/list/0.3/payload.d.ts.map +1 -0
- package/dist/vault/list/0.3/payload.js +31 -0
- package/dist/vault/list/0.3/payload.js.map +1 -0
- package/dist/vault/upsert/0.3/payload.d.ts +305 -0
- package/dist/vault/upsert/0.3/payload.d.ts.map +1 -0
- package/dist/vault/upsert/0.3/payload.js +31 -0
- package/dist/vault/upsert/0.3/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +9 -0
- package/src/provision/integration/0.3/payload.ts +286 -0
- package/src/vault/_shared/0.3/consumer-context.ts +11 -0
- package/src/vault/_shared/0.3/sealed-envelope.ts +15 -0
- package/src/vault/_shared/0.3/session-blob.ts +13 -0
- package/src/vault/_shared/0.3/vault-entry.ts +13 -0
- package/src/vault/_shared/0.3/vault-secret.ts +15 -0
- package/src/vault/get/0.3/payload.ts +226 -0
- package/src/vault/list/0.3/payload.ts +310 -0
- package/src/vault/upsert/0.3/payload.ts +328 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/provision/integration/0.3/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* What the holder is asking the maintainer to do. Tagged on `type`; see `TemplateBootstrapAsk` and `AdminRotationAsk`.
|
|
8
|
+
*/
|
|
9
|
+
export type BootstrapAsk = TemplateBootstrapAsk | AdminRotationAsk;
|
|
10
|
+
/**
|
|
11
|
+
* Digest over the armored ciphertext, for holders that pin the bundle out-of-band. Taken over the armored bytes exactly as carried in `bundle`, not over a canonicalization: the armor is the artifact, and re-armoring the same ciphertext does not have to reproduce the same bytes.
|
|
12
|
+
*/
|
|
13
|
+
export type DigestMultibase = string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Relayer presents a VP-signed bootstrap request from an integration holder; the maintainer mints the integration's DIDs and admin credential from a registered DID template and ships the material back HPKE-sealed to the holder's ephemeral did:key. Two ask variants are supported: TemplateBootstrap (mint integration DID + optional admin DID) and AdminRotation (mint only the long-term admin DID).
|
|
17
|
+
*/
|
|
18
|
+
export interface ProvisionIntegrationPayload {
|
|
19
|
+
request: BootstrapRequest;
|
|
20
|
+
/**
|
|
21
|
+
* The maintainer's context identifier the integration is to be provisioned into. When present, authoritative — overrides any `contextHint` carried inside `request.ask`. When ABSENT, the maintainer infers the target context using these rules in order: (1) if the relayer's grant scopes to exactly one context, use that context; (2) if the relayer is a super-admin (Admin role with unrestricted scope) and the maintainer has exactly one context registered, use that context; (3) otherwise reject the request with `provision/integration:context_required`. Wallet-class consumers (browser plugins, mobile companions) that don't know the maintainer's context layout SHOULD omit this field; integration-class consumers (mediator, did-hosting) targeting a specific operational context SHOULD send it explicitly.
|
|
22
|
+
*/
|
|
23
|
+
context?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Producer-assertion mode the maintainer should apply to the returned sealed bundle. `didSigned` (default) — Ed25519 signature over the bundle's domain-bound digest, verified by the holder against the maintainer's published key. `pinnedOnly` — holder pins the bundle's SHA-256 digest as the sole integrity anchor; for dev/test only. Maintainers MAY support additional modes (e.g. `attested` for TEE deployments) and respond with `provision/integration:assertion_unsupported` to unsupported requests.
|
|
26
|
+
*/
|
|
27
|
+
assertion?: "didSigned" | "pinnedOnly";
|
|
28
|
+
/**
|
|
29
|
+
* Caller-preferred validity window for the issued VtaAuthorizationCredential, in seconds. The maintainer's policy applies a floor and ceiling; values outside that range MAY be silently clamped. Defaults to the maintainer's policy default (typically 3600s).
|
|
30
|
+
*/
|
|
31
|
+
vcValiditySeconds?: number;
|
|
32
|
+
/**
|
|
33
|
+
* When `true`, the maintainer provisions the target context inline if it does not already exist. Requires super-admin role on the maintainer; context-admin callers MUST receive `provision/integration:forbidden` against a missing context. Idempotent when the context already exists.
|
|
34
|
+
*/
|
|
35
|
+
createContext?: boolean;
|
|
36
|
+
ext?: Ext;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* VP-framed bootstrap request signed by the holder's ephemeral did:key. The proof here is independent of, and additional to, the outer Trust Task envelope's proof — it authenticates the holder (the party the sealed bundle is encrypted for), whereas the envelope's proof authenticates the relayer (the party making the call). The two MAY be the same DID in the common case.
|
|
40
|
+
*/
|
|
41
|
+
export interface BootstrapRequest {
|
|
42
|
+
/**
|
|
43
|
+
* JSON-LD contexts. MUST contain both `https://www.w3.org/ns/credentials/v2` and `https://openvtc.org/contexts/bootstrap-v1`. Maintainers verifying the proof MAY refuse other shapes.
|
|
44
|
+
*
|
|
45
|
+
* @minItems 2
|
|
46
|
+
*/
|
|
47
|
+
"@context": [string, string, ...string[]];
|
|
48
|
+
/**
|
|
49
|
+
* VP types. MUST contain both `VerifiablePresentation` and `BootstrapRequest`. Additional task-specific types MAY be present.
|
|
50
|
+
*
|
|
51
|
+
* @minItems 2
|
|
52
|
+
*/
|
|
53
|
+
type: [string, string, ...string[]];
|
|
54
|
+
/**
|
|
55
|
+
* URN-shaped identifier for this presentation. `urn:uuid:<v4>` is RECOMMENDED.
|
|
56
|
+
*/
|
|
57
|
+
id: string;
|
|
58
|
+
/**
|
|
59
|
+
* The integration's ephemeral did:key (Ed25519). Identifies the party the returned bundle is HPKE-sealed for; the VP proof verifies under this DID's verification method.
|
|
60
|
+
*/
|
|
61
|
+
holder: string;
|
|
62
|
+
/**
|
|
63
|
+
* 16 random bytes encoded as base64url-no-pad (22 characters). The maintainer treats this as the sealed bundle's `bundleId` (decoded to hex, exposed in `summary.bundleIdHex`) and SHOULD enforce one-shot semantics — a second provisioning with the same nonce MUST be refused as a replay.
|
|
64
|
+
*/
|
|
65
|
+
nonce: string;
|
|
66
|
+
/**
|
|
67
|
+
* Freshness bound for the VP. RFC 3339 UTC. Maintainers SHOULD allow ±5 minutes of clock skew.
|
|
68
|
+
*/
|
|
69
|
+
validUntil: string;
|
|
70
|
+
/**
|
|
71
|
+
* Optional human-readable label carried into the maintainer's audit log.
|
|
72
|
+
*/
|
|
73
|
+
label?: string;
|
|
74
|
+
ask: BootstrapAsk;
|
|
75
|
+
proof: DataIntegrityProof;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Mint an integration DID from `template`, and (when `adminTemplate` is present) atomically roll over the holder to a fresh long-term admin DID minted from `adminTemplate`.
|
|
79
|
+
*/
|
|
80
|
+
export interface TemplateBootstrapAsk {
|
|
81
|
+
type: "templateBootstrap";
|
|
82
|
+
/**
|
|
83
|
+
* Hint for the integration's target context. The wire `payload.context` is authoritative; this hint exists for documentation / cross-check only.
|
|
84
|
+
*/
|
|
85
|
+
contextHint?: string;
|
|
86
|
+
template: DidTemplateRef;
|
|
87
|
+
adminTemplate?: DidTemplateRef1;
|
|
88
|
+
/**
|
|
89
|
+
* Free-form operator note carried into the maintainer's audit log.
|
|
90
|
+
*/
|
|
91
|
+
note?: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Integration template. MUST be registered at the maintainer; MUST declare a `kind` other than `"admin"`.
|
|
95
|
+
*/
|
|
96
|
+
export interface DidTemplateRef {
|
|
97
|
+
/**
|
|
98
|
+
* Template name as registered at the maintainer (built-in or operator-uploaded). Examples of built-ins shipped with VTA deployments: `didcomm-mediator`, `vta-admin`, `did-hosting-control`, `did-hosting-daemon`, `did-hosting-server`.
|
|
99
|
+
*/
|
|
100
|
+
name: string;
|
|
101
|
+
/**
|
|
102
|
+
* Variable bindings the maintainer feeds to the template renderer. MUST satisfy the template's `requiredVars`; values for `optionalVars` MAY be supplied. Unknown vars are rejected with `provision/integration:template_vars_invalid`.
|
|
103
|
+
*/
|
|
104
|
+
vars?: {
|
|
105
|
+
[k: string]: unknown | undefined;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Optional admin-DID template. When present, the maintainer mints a fresh long-term admin DID + keys, binds the authorization VC + ACL row to it, and rolls the holder over from the ephemeral did:key in the same transaction. When absent, the authorization VC's subject and ACL row are bound to the ephemeral `holder`, which the operator is expected to swap via `acl/swap-key/0.1` before steady-state operation. MUST declare `kind == "admin"` when present.
|
|
110
|
+
*/
|
|
111
|
+
export interface DidTemplateRef1 {
|
|
112
|
+
/**
|
|
113
|
+
* Template name as registered at the maintainer (built-in or operator-uploaded). Examples of built-ins shipped with VTA deployments: `didcomm-mediator`, `vta-admin`, `did-hosting-control`, `did-hosting-daemon`, `did-hosting-server`.
|
|
114
|
+
*/
|
|
115
|
+
name: string;
|
|
116
|
+
/**
|
|
117
|
+
* Variable bindings the maintainer feeds to the template renderer. MUST satisfy the template's `requiredVars`; values for `optionalVars` MAY be supplied. Unknown vars are rejected with `provision/integration:template_vars_invalid`.
|
|
118
|
+
*/
|
|
119
|
+
vars?: {
|
|
120
|
+
[k: string]: unknown | undefined;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Admin-only mint. No integration DID is produced. Used by holders that bring (or will mint elsewhere) their own integration-side identity and only need an admin credential at this maintainer.
|
|
125
|
+
*/
|
|
126
|
+
export interface AdminRotationAsk {
|
|
127
|
+
type: "adminRotation";
|
|
128
|
+
/**
|
|
129
|
+
* Hint for the admin grant's target context. The wire `payload.context` is authoritative.
|
|
130
|
+
*/
|
|
131
|
+
contextHint?: string;
|
|
132
|
+
adminTemplate: DidTemplateRef2;
|
|
133
|
+
/**
|
|
134
|
+
* Free-form operator note carried into the maintainer's audit log.
|
|
135
|
+
*/
|
|
136
|
+
note?: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Admin-DID template. MUST be registered at the maintainer and MUST declare `kind == "admin"`.
|
|
140
|
+
*/
|
|
141
|
+
export interface DidTemplateRef2 {
|
|
142
|
+
/**
|
|
143
|
+
* Template name as registered at the maintainer (built-in or operator-uploaded). Examples of built-ins shipped with VTA deployments: `didcomm-mediator`, `vta-admin`, `did-hosting-control`, `did-hosting-daemon`, `did-hosting-server`.
|
|
144
|
+
*/
|
|
145
|
+
name: string;
|
|
146
|
+
/**
|
|
147
|
+
* Variable bindings the maintainer feeds to the template renderer. MUST satisfy the template's `requiredVars`; values for `optionalVars` MAY be supplied. Unknown vars are rejected with `provision/integration:template_vars_invalid`.
|
|
148
|
+
*/
|
|
149
|
+
vars?: {
|
|
150
|
+
[k: string]: unknown | undefined;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Data Integrity proof signed by the holder's Ed25519 key. Cryptosuite MUST equal `eddsa-jcs-2022`. `proofPurpose` MUST equal `authentication`. `verificationMethod` MUST resolve under `holder`. Signs the JCS canonicalisation of the VP with `proof` removed.
|
|
155
|
+
*/
|
|
156
|
+
export interface DataIntegrityProof {
|
|
157
|
+
type: "DataIntegrityProof";
|
|
158
|
+
/**
|
|
159
|
+
* This version pins `eddsa-jcs-2022`. Maintainers MUST reject other values until a future minor extends the allowlist.
|
|
160
|
+
*/
|
|
161
|
+
cryptosuite: string;
|
|
162
|
+
/**
|
|
163
|
+
* DID URL with fragment. The DID portion (left of `#`) MUST equal `holder`.
|
|
164
|
+
*/
|
|
165
|
+
verificationMethod: string;
|
|
166
|
+
created?: string;
|
|
167
|
+
proofPurpose: "authentication";
|
|
168
|
+
/**
|
|
169
|
+
* Multibase-encoded Ed25519 signature.
|
|
170
|
+
*/
|
|
171
|
+
proofValue: string;
|
|
172
|
+
[k: string]: unknown | undefined;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
176
|
+
*/
|
|
177
|
+
export interface Ext {
|
|
178
|
+
[k: string]: unknown | undefined;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Carried in a Trust Task document whose type is https://trusttasks.org/spec/provision/integration/0.1#response. The sealed `bundle` is the secret-bearing artefact; `summary` is non-secret audit metadata.
|
|
182
|
+
*/
|
|
183
|
+
export interface ProvisionIntegrationResponsePayload {
|
|
184
|
+
/**
|
|
185
|
+
* OpenPGP-style ASCII-armored ciphertext of `SealedPayloadV1`. HPKE base mode, X25519-HKDF-SHA256 KEM, ChaCha20-Poly1305 AEAD, info string `vta-sealed-transfer/v1`. Recipient is the X25519 derivation of `request.holder`'s Ed25519 pubkey.
|
|
186
|
+
*/
|
|
187
|
+
bundle: string;
|
|
188
|
+
digestMultibase?: DigestMultibase;
|
|
189
|
+
summary: ProvisionSummary;
|
|
190
|
+
ext?: Ext1;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Non-secret audit metadata. MUST NOT include any private key material; the bundle is the only secret-bearing field.
|
|
194
|
+
*/
|
|
195
|
+
export interface ProvisionSummary {
|
|
196
|
+
/**
|
|
197
|
+
* Ephemeral did:key the holder signed the VP with and opens the sealed bundle with. Echo of `request.holder`.
|
|
198
|
+
*/
|
|
199
|
+
clientDid: string;
|
|
200
|
+
/**
|
|
201
|
+
* Long-term admin DID after this provisioning. Equals `clientDid` when no admin rollover occurred (TemplateBootstrap with no `adminTemplate`); equals the freshly-minted admin DID when `adminTemplate` was used or when the ask was `adminRotation`. Maintainers that pre-date admin rollover MAY omit this; consumers SHOULD default it to `clientDid` for backward compatibility.
|
|
202
|
+
*/
|
|
203
|
+
adminDid?: string;
|
|
204
|
+
/**
|
|
205
|
+
* True when the maintainer minted a fresh long-term admin DID and bound the authorization VC + ACL row to it (i.e. `adminDid != clientDid`).
|
|
206
|
+
*/
|
|
207
|
+
adminRolledOver?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* DID rendered from the integration template. Absent for `adminRotation` (no integration was rendered).
|
|
210
|
+
*/
|
|
211
|
+
integrationDid?: string;
|
|
212
|
+
/**
|
|
213
|
+
* Name of the integration template that was rendered. Absent for `adminRotation`.
|
|
214
|
+
*/
|
|
215
|
+
templateName?: string;
|
|
216
|
+
/**
|
|
217
|
+
* `kind` of the integration template (e.g. `mediator`, `did-hosting-control`, `app`). Absent for `adminRotation`.
|
|
218
|
+
*/
|
|
219
|
+
templateKind?: string;
|
|
220
|
+
/**
|
|
221
|
+
* Name of the admin template that was rendered. Present when an admin DID was minted (either via `TemplateBootstrap.adminTemplate` or `adminRotation`).
|
|
222
|
+
*/
|
|
223
|
+
adminTemplateName?: string;
|
|
224
|
+
/**
|
|
225
|
+
* VP nonce as lowercase hex (32 characters = 16 bytes). MUST equal the `Bundle-Id` armor header of `bundle`. Cross-check anchor: a holder that decodes the VP nonce can verify the bundle they opened matches the one the maintainer minted for them.
|
|
226
|
+
*/
|
|
227
|
+
bundleIdHex: string;
|
|
228
|
+
/**
|
|
229
|
+
* Number of DIDs the sealed bundle carries private key material for. `templateBootstrap` with no adminTemplate typically yields 1 (the integration DID's keys). `adminRotation` yields 0 (the `admin` field is top-level, not under `secrets`).
|
|
230
|
+
*/
|
|
231
|
+
secretCount: number;
|
|
232
|
+
/**
|
|
233
|
+
* Number of template-declared side outputs the sealed bundle carries (`did.jsonl` logs, DIDComm service advertisements, etc.). Always 0 for `adminRotation`.
|
|
234
|
+
*/
|
|
235
|
+
outputCount: number;
|
|
236
|
+
/**
|
|
237
|
+
* Identifier of the registered webvh hosting server the maintainer published the integration's `did.jsonl` to, if any. Absent when the integration is self-hosted or when the template did not declare a webvh server var.
|
|
238
|
+
*/
|
|
239
|
+
webvhServerId?: string;
|
|
240
|
+
/**
|
|
241
|
+
* True when `payload.createContext` was honoured and the maintainer provisioned the target context inline. False when the context already existed (or when `createContext` was omitted / false).
|
|
242
|
+
*/
|
|
243
|
+
contextCreated?: boolean;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* 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.
|
|
247
|
+
*/
|
|
248
|
+
export interface Ext1 {
|
|
249
|
+
[k: string]: unknown | undefined;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** Trust Task type URI. */
|
|
253
|
+
export const TYPE_URI = "https://trusttasks.org/spec/provision/integration/0.3" as const;
|
|
254
|
+
|
|
255
|
+
/** Stable alias for this specification's request payload shape. */
|
|
256
|
+
export type Payload = ProvisionIntegrationPayload;
|
|
257
|
+
|
|
258
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
259
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/provision/integration/0.3#response" as const;
|
|
260
|
+
|
|
261
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
262
|
+
export type Response = ProvisionIntegrationResponsePayload;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
266
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
267
|
+
* per-specification and cannot be derived from the document alone.
|
|
268
|
+
*/
|
|
269
|
+
export const SPEC = {
|
|
270
|
+
typeUri: TYPE_URI,
|
|
271
|
+
isBearer: false,
|
|
272
|
+
isProofRequired: true,
|
|
273
|
+
isRecipientRequired: true,
|
|
274
|
+
} as const;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
278
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
279
|
+
* parties (§7.3 item 5).
|
|
280
|
+
*/
|
|
281
|
+
export const RESPONSE_SPEC = {
|
|
282
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
283
|
+
isBearer: false,
|
|
284
|
+
isProofRequired: true,
|
|
285
|
+
isRecipientRequired: false,
|
|
286
|
+
} as const;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vault/_shared/0.3/consumer-context.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Reused by vault/proxy-login, vault/release, and any future vault task that needs to feed situational context to the maintainer's policy engine or carry the response to a step-up demand. Producer-supplied fields are advisory — the maintainer cross-checks anything security-relevant against its own state.
|
|
8
|
+
*/
|
|
9
|
+
export interface ConsumerContextStepUpProofSharedDefinitionsUsedByVaultTasksThatHitThePolicyEngine {
|
|
10
|
+
[k: string]: unknown | undefined;
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vault/_shared/0.3/sealed-envelope.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Discriminated union over `envelope` kind, used by every vault task that ships secret material across the wire (vault/upsert/0.1 → SealedSecret, vault/release/0.1 → SealedSecret in the response, vault/proxy-login/0.1 → SealedSessionBlob in the response). The cleartext shape sitting INSIDE the envelope is task-specific — VaultSecret for the secret variants, SessionBlob for the proxy-login variant — and is referenced from each task's spec.
|
|
8
|
+
*
|
|
9
|
+
* Consumers dispatch on `envelope`. An unknown envelope kind MUST be rejected (`<task>:envelope_unsupported` error code) rather than silently accepted — there is no fallback to "try parsing as DIDComm". Producers SHOULD advertise the envelope kinds they emit via `trust-task-discovery/0.1`.
|
|
10
|
+
*
|
|
11
|
+
* Forward compatibility: this union starts with three variants for the OpenVTC stack today. New variants (KERI/ACDC envelopes, a future TSP successor, hardware-attested envelopes for TEE-to-TEE transfer, etc.) land as additional `oneOf` entries — never as silent schema relaxations on an existing variant.
|
|
12
|
+
*/
|
|
13
|
+
export interface SealedEnvelopePluggableCipherBearingEnvelopeForVaultPayloads {
|
|
14
|
+
[k: string]: unknown | undefined;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vault/_shared/0.3/session-blob.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Cleartext shape of the session material returned by vault/proxy-login/0.1. Like VaultSecret, this is documented for both sides to code-generate against; the wire-form is carried inside an HPKE-sealed envelope.
|
|
8
|
+
*
|
|
9
|
+
* A SessionBlob represents an active session at the third-party service the VTA logged in to on the holder's behalf. The Companion uses it to operate the session (e.g. inject cookies into the browser, set an Authorization header) without ever seeing the long-term credential. The session has a finite TTL; the Companion MUST discard the blob when `expiresAt` passes.
|
|
10
|
+
*/
|
|
11
|
+
export interface SessionBlobSharedDefinitionForTheResultOfAProxyLogin {
|
|
12
|
+
[k: string]: unknown | undefined;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vault/_shared/0.3/vault-entry.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Canonical metadata view of a single vault entry — a credential the holder has stored for use against a third-party site, mobile app, or DID-identified relying party. Referenced by every vault/* specification that returns entry metadata (vault/list, vault/get, vault/upsert response, vault/sync, vault/usage). This definition is the metadata-only view: it deliberately does NOT include secret material. Secrets are released only via vault/release/0.1, and even then are carried inside HPKE-sealed envelopes that the vault Trust Task itself does not parse. The `_shared` folder is skipped by the registry build and by the codegen.
|
|
8
|
+
*
|
|
9
|
+
* Timestamp invariants (SHOULD-level, prose — not expressible in JSON Schema): when both `createdAt` and `updatedAt` are present, `updatedAt >= createdAt`; when `lastUsedAt` is present, `lastUsedAt >= createdAt`; when `expiresAt` is present, `expiresAt > createdAt`. Consumers SHOULD reject documents that violate any of these.
|
|
10
|
+
*/
|
|
11
|
+
export interface VaultEntrySharedDefinitionForTheVaultSpecFamily {
|
|
12
|
+
[k: string]: unknown | undefined;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vault/_shared/0.3/vault-secret.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Schema for the cleartext secret payload of a vault entry. Documents the shape both sides of a vault/release/0.1 transfer code-generate against. The secret payload is NEVER transmitted as plaintext JSON on the wire: vault/release/0.1 returns it inside an HPKE-sealed envelope (see SealedSecret in the vault/release payload schema). This shared schema is the authoritative description of the bytes inside that envelope.
|
|
8
|
+
*
|
|
9
|
+
* Sensitive fields (`password`, `privateKey`, `refreshToken`, `secureNotes`, etc.) MUST be zeroised by consumers as soon as their use is complete. Consumers MUST NOT log, persist beyond cache lifetime, or transmit the cleartext outside the release-time scope.
|
|
10
|
+
*
|
|
11
|
+
* Discriminated by `kind`, which mirrors VaultEntry.secretKind on the metadata side. The `kind` value MUST equal the metadata view's `secretKind` for the same entry.
|
|
12
|
+
*/
|
|
13
|
+
export interface VaultSecretSharedDefinitionForVaultSecretMaterial {
|
|
14
|
+
[k: string]: unknown | undefined;
|
|
15
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vault/get/0.3/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A single binding target for a vault entry. Tagged union over the discriminator `kind`. A VaultEntry's `targets` array MAY mix any number of these.
|
|
8
|
+
*/
|
|
9
|
+
export type SiteTarget = WebOrigin | Did | IosApp | AndroidApp;
|
|
10
|
+
/**
|
|
11
|
+
* Discriminator for the kind of secret this entry holds. The secret material itself is NEVER returned in metadata views; the kind is exposed so consumers can render an appropriate UI affordance and so policy decisions can route by kind.
|
|
12
|
+
*/
|
|
13
|
+
export type SecretKind =
|
|
14
|
+
| "password"
|
|
15
|
+
| "passkey"
|
|
16
|
+
| "oauthTokens"
|
|
17
|
+
| "didSelfIssued"
|
|
18
|
+
| "didcommPeer"
|
|
19
|
+
| "bearerToken"
|
|
20
|
+
| "sshKey"
|
|
21
|
+
| "custom";
|
|
22
|
+
/**
|
|
23
|
+
* Digest over the encrypted blob bytes (post-encryption), so the consumer can verify integrity after fetch. Taken over the bytes as stored, not over a canonicalization: the blob is an opaque artifact, not a JSON document.
|
|
24
|
+
*/
|
|
25
|
+
export type DigestMultibase = string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Fetch the metadata view of a single vault entry by id. Returns the same VaultEntry shape vault/list does, but for one specific entry. Secret material is NEVER returned by this task; use vault/release/0.1 to obtain secret bytes.
|
|
29
|
+
*/
|
|
30
|
+
export interface VaultGetPayload {
|
|
31
|
+
/**
|
|
32
|
+
* Vault entry id (as returned in a prior vault/list or vault/sync response).
|
|
33
|
+
*/
|
|
34
|
+
id: string;
|
|
35
|
+
ext?: Ext;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 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.
|
|
39
|
+
*/
|
|
40
|
+
export interface Ext {
|
|
41
|
+
[k: string]: unknown | undefined;
|
|
42
|
+
}
|
|
43
|
+
export interface VaultGetResponsePayload {
|
|
44
|
+
entry: VaultEntry;
|
|
45
|
+
redactedFields?: string[];
|
|
46
|
+
ext?: Ext;
|
|
47
|
+
}
|
|
48
|
+
export interface VaultEntry {
|
|
49
|
+
/**
|
|
50
|
+
* Opaque vault-maintainer-assigned identifier for the entry. ULID/UUID/base32 are common; the wire spec only requires non-empty string equality.
|
|
51
|
+
*/
|
|
52
|
+
id: string;
|
|
53
|
+
/**
|
|
54
|
+
* Identifier of the trust context (persona) the entry belongs to. Opaque string interpreted by the vault maintainer; corresponds to a single ContextRecord on the VTA side.
|
|
55
|
+
*/
|
|
56
|
+
contextId: string;
|
|
57
|
+
/**
|
|
58
|
+
* One or more binding targets — web origins, mobile app identifiers, and/or DIDs — that this credential applies to. A request from any matching target uses this entry. A typical entry for a service that exists as both a website and mobile apps will list a web origin, an iOS bundle id, and an Android package id; passkeys for that service typically list only the origin (because iOS Associated Domains and Android Asset Links bind apps to the domain at the OS level).
|
|
59
|
+
*
|
|
60
|
+
* @minItems 1
|
|
61
|
+
*/
|
|
62
|
+
targets: [SiteTarget, ...SiteTarget[]];
|
|
63
|
+
/**
|
|
64
|
+
* Human-readable display name (e.g. "Work GitHub", "Personal bank — checking"). Maintainers MAY enforce a maximum length; the wire spec does not.
|
|
65
|
+
*/
|
|
66
|
+
label: string;
|
|
67
|
+
secretKind: SecretKind;
|
|
68
|
+
/**
|
|
69
|
+
* User-defined tags for organisation and filtering (e.g. ["family", "finance"]). Maintainers MAY enforce a maximum count; the wire spec does not.
|
|
70
|
+
*/
|
|
71
|
+
tags?: string[];
|
|
72
|
+
/**
|
|
73
|
+
* Non-sensitive notes the user attached to the entry. Visible in metadata view (suitable for support contact, account number, expiry policy memos). SENSITIVE notes belong in the secret payload as a `secureNotes` field — those are only released by vault/release/0.1.
|
|
74
|
+
*/
|
|
75
|
+
notes?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Optional URI of an icon to display in the consumer UI. Maintainers MAY fetch and cache; consumers SHOULD treat as untrusted content and fetch via a sandboxed pipeline.
|
|
78
|
+
*/
|
|
79
|
+
favicon?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Opaque maintainer-defined selector strings fed to the policy engine when this entry is requested (e.g. "recent_uv_required", "network_class=corp", "step_up_push"). Consumers MUST treat selectors as opaque; they exist for policy authoring on the maintainer side.
|
|
82
|
+
*/
|
|
83
|
+
selectors?: string[];
|
|
84
|
+
/**
|
|
85
|
+
* Names of additional fields the user has attached (e.g. ["security-question-1", "account-number"]). The VALUES live in the secret payload and are only delivered by vault/release/0.1. Exposing names in metadata lets the consumer render the right form layout before requesting release.
|
|
86
|
+
*/
|
|
87
|
+
customFieldNames?: string[];
|
|
88
|
+
/**
|
|
89
|
+
* References to encrypted blobs associated with the entry (recovery codes, PEM files, screenshots of authenticator setup). The blobs themselves are fetched via a separate mechanism the maintainer documents; metadata view exposes only the descriptor.
|
|
90
|
+
*/
|
|
91
|
+
attachments?: AttachmentRef[];
|
|
92
|
+
/**
|
|
93
|
+
* Optional time after which the credential is no longer expected to be valid (e.g. an OAuth refresh token's known expiry, a time-limited API token, an enterprise password rotation policy). Maintainers MAY surface this in the consumer UI as a warning.
|
|
94
|
+
*/
|
|
95
|
+
expiresAt?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Set by the maintainer (via HIBP integration or equivalent) when the password material associated with this entry is known to appear in a public breach. Consumers SHOULD surface this prominently. Cleared when the user rotates the password and the new password is not in any known breach.
|
|
98
|
+
*/
|
|
99
|
+
breachedAt?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Set whenever the password component of the secret payload is rotated. Maintainers MUST update this on every secret-material change for entries of kind `password` (or any kind that carries a password component). Used by consumers to surface rotation-overdue warnings.
|
|
102
|
+
*/
|
|
103
|
+
passwordChangedAt?: string;
|
|
104
|
+
createdAt: string;
|
|
105
|
+
/**
|
|
106
|
+
* VID of the consumer that originally created the entry.
|
|
107
|
+
*/
|
|
108
|
+
createdBy?: string;
|
|
109
|
+
updatedAt: string;
|
|
110
|
+
/**
|
|
111
|
+
* VID of the consumer that last modified the entry.
|
|
112
|
+
*/
|
|
113
|
+
updatedBy?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Most recent time the entry was used (either released or proxy-login performed). Maintainers MAY return this with reduced precision (e.g. hour-floored) when releasing to a less-trusted consumer.
|
|
116
|
+
*/
|
|
117
|
+
lastUsedAt?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Monotonic version counter incremented on every mutation. Used by consumers for optimistic-concurrency checks on vault/upsert and as the seq baseline for vault/sync.
|
|
120
|
+
*/
|
|
121
|
+
version: number;
|
|
122
|
+
/**
|
|
123
|
+
* Optional cached DID the entry will act AS for DID-shaped flows — mirrors the `did` field of the entry's secret payload when `secretKind` carries one (`didSelfIssued`, `didcommPeer`). Absent for kinds that have no DID concept (`password`, `passkey`, `oauthTokens`, `bearerToken`, `sshKey`, `custom`). MAINTAINER-DERIVED, NOT CONSUMER-SUPPLIED: the maintainer MUST recompute this from the canonical secret at every upsert / secret rotation; a producer-supplied value on `vault/upsert/0.1` MUST be ignored (no error, but no honour). Read-only on the wire, present in metadata views so consumers can drive RP-side flows (e.g. fetch `/auth/challenge` keyed on the principal DID before requesting a proxy-login) without releasing the secret.
|
|
124
|
+
*/
|
|
125
|
+
principalDid?: string;
|
|
126
|
+
ext?: Ext1;
|
|
127
|
+
}
|
|
128
|
+
export interface WebOrigin {
|
|
129
|
+
kind: "webOrigin";
|
|
130
|
+
/**
|
|
131
|
+
* Web origin per RFC 6454 (scheme + host + optional port), e.g. "https://github.com". Compared by exact string equality after canonicalisation (lowercase host, default port elided). Consumers wanting subdomain coverage SHOULD add multiple targets, not encode a wildcard.
|
|
132
|
+
*/
|
|
133
|
+
origin: string;
|
|
134
|
+
}
|
|
135
|
+
export interface Did {
|
|
136
|
+
kind: "did";
|
|
137
|
+
/**
|
|
138
|
+
* DID identifying the relying party (e.g. did:web:rp.example). The vault maintainer is responsible for any DID resolution required to act on this entry.
|
|
139
|
+
*/
|
|
140
|
+
did: string;
|
|
141
|
+
}
|
|
142
|
+
export interface IosApp {
|
|
143
|
+
kind: "iosApp";
|
|
144
|
+
/**
|
|
145
|
+
* iOS bundle identifier in reverse-DNS form (e.g. "com.github.stwalkerster.codehub"). Compared by exact string equality. Matches when an iOS Companion identifies the requesting app via its bundle id (typically via the OS Credential Manager integration).
|
|
146
|
+
*/
|
|
147
|
+
bundleId: string;
|
|
148
|
+
/**
|
|
149
|
+
* Optional Apple Developer Team identifier (10-character alphanumeric). When supplied, the maintainer SHOULD also verify the team id of the requesting app before matching — defense in depth against bundle-id squatting on jailbroken devices.
|
|
150
|
+
*/
|
|
151
|
+
teamId?: string;
|
|
152
|
+
}
|
|
153
|
+
export interface AndroidApp {
|
|
154
|
+
kind: "androidApp";
|
|
155
|
+
/**
|
|
156
|
+
* Android package name in reverse-DNS form (e.g. "com.github.android").
|
|
157
|
+
*/
|
|
158
|
+
packageName: string;
|
|
159
|
+
/**
|
|
160
|
+
* SHA-256 fingerprints of the app's signing certificates, in colon-separated hex (the format `apksigner` and the Play Console emit). At least one fingerprint MUST be present. The maintainer matches when ANY of the provided fingerprints matches the requesting app's signature — this supports apps signed by multiple keys (e.g. during certificate rotation via Play App Signing).
|
|
161
|
+
*
|
|
162
|
+
* @minItems 1
|
|
163
|
+
*/
|
|
164
|
+
sha256CertFingerprints: [string, ...string[]];
|
|
165
|
+
}
|
|
166
|
+
export interface AttachmentRef {
|
|
167
|
+
/**
|
|
168
|
+
* Opaque maintainer-assigned id for this attachment; used to fetch the blob via a separate mechanism.
|
|
169
|
+
*/
|
|
170
|
+
id: string;
|
|
171
|
+
/**
|
|
172
|
+
* User-supplied filename (e.g. "recovery-codes.txt").
|
|
173
|
+
*/
|
|
174
|
+
name: string;
|
|
175
|
+
/**
|
|
176
|
+
* Size of the encrypted blob in bytes. Maintainers MAY enforce a maximum per attachment and per entry.
|
|
177
|
+
*/
|
|
178
|
+
sizeBytes: number;
|
|
179
|
+
digestMultibase: DigestMultibase;
|
|
180
|
+
/**
|
|
181
|
+
* Optional MIME type hint for the consumer UI (e.g. "text/plain", "application/x-pem-file").
|
|
182
|
+
*/
|
|
183
|
+
contentType?: string;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* 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.
|
|
187
|
+
*/
|
|
188
|
+
export interface Ext1 {
|
|
189
|
+
[k: string]: unknown | undefined;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** Trust Task type URI. */
|
|
193
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vault/get/0.3" as const;
|
|
194
|
+
|
|
195
|
+
/** Stable alias for this specification's request payload shape. */
|
|
196
|
+
export type Payload = VaultGetPayload;
|
|
197
|
+
|
|
198
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
199
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vault/get/0.3#response" as const;
|
|
200
|
+
|
|
201
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
202
|
+
export type Response = VaultGetResponsePayload;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
206
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
207
|
+
* per-specification and cannot be derived from the document alone.
|
|
208
|
+
*/
|
|
209
|
+
export const SPEC = {
|
|
210
|
+
typeUri: TYPE_URI,
|
|
211
|
+
isBearer: false,
|
|
212
|
+
isProofRequired: false,
|
|
213
|
+
isRecipientRequired: true,
|
|
214
|
+
} as const;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
218
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
219
|
+
* parties (§7.3 item 5).
|
|
220
|
+
*/
|
|
221
|
+
export const RESPONSE_SPEC = {
|
|
222
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
223
|
+
isBearer: false,
|
|
224
|
+
isProofRequired: false,
|
|
225
|
+
isRecipientRequired: true,
|
|
226
|
+
} as const;
|