@trustlayer-foundation/aria-sdk 0.0.0-stage → 1.0.1
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/API.md +207 -0
- package/LICENSE +202 -0
- package/MIGRATION.md +86 -0
- package/README.md +153 -2
- package/dist/index.d.ts +435 -0
- package/dist/index.js +1029 -0
- package/dist/index.js.map +1 -0
- package/package.json +71 -3
- package/schemas/aid-1.0.json +394 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
/** A trust level an issuer may assert. */
|
|
2
|
+
type TrustLevel = 'L0' | 'L1' | 'L2' | 'L3';
|
|
3
|
+
/** A `did:aria` identifier. */
|
|
4
|
+
type Did = `did:aria:${string}`;
|
|
5
|
+
/** The exact issued document a result is about: never the agent's DID alone. */
|
|
6
|
+
interface CredentialBinding {
|
|
7
|
+
/** The credential's top-level `id`. */
|
|
8
|
+
readonly credentialId: string;
|
|
9
|
+
/** `sha-256=:<base64>:` of the document's canonical bytes. */
|
|
10
|
+
readonly digest: string;
|
|
11
|
+
/** The trust profile it was verified under. */
|
|
12
|
+
readonly profile: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Type-only mark of values the SDK produces. The runtime boundary is the verifier's own record of each result. */
|
|
16
|
+
declare const produced: unique symbol;
|
|
17
|
+
type Produced<K extends string> = {
|
|
18
|
+
readonly [produced]: K;
|
|
19
|
+
};
|
|
20
|
+
/** Parsed fields of a credential nobody has verified. */
|
|
21
|
+
interface Inspection {
|
|
22
|
+
readonly kind: 'inspection';
|
|
23
|
+
/** Always false: inspection never establishes anything. */
|
|
24
|
+
readonly verified: false;
|
|
25
|
+
readonly did: string | null;
|
|
26
|
+
readonly credentialId: string | null;
|
|
27
|
+
readonly issuer: string | null;
|
|
28
|
+
readonly specVersion: string | null;
|
|
29
|
+
readonly trustLevel: string | null;
|
|
30
|
+
readonly scopes: readonly string[];
|
|
31
|
+
readonly validFrom: string | null;
|
|
32
|
+
readonly validUntil: string | null;
|
|
33
|
+
/** Why parsing stopped, when it did. */
|
|
34
|
+
readonly problem?: 'not_json' | 'not_a_credential';
|
|
35
|
+
}
|
|
36
|
+
/** Why a credential is not verified. Fixed names; no caller-supplied text. */
|
|
37
|
+
type CredentialFailure =
|
|
38
|
+
/** Not a JSON object within the size bound, or not valid against the schema of its `spec_version`. */
|
|
39
|
+
'malformed' | 'unsupported_version'
|
|
40
|
+
/** Proof metadata is not the trust profile's. Checking it does not make it signed. */
|
|
41
|
+
| 'unsupported_proof' | 'untrusted_issuer'
|
|
42
|
+
/** The level is above what the issuer's trust profile may assert. */
|
|
43
|
+
| 'level_not_trusted'
|
|
44
|
+
/** Either half of the composite issuer signature fails. */
|
|
45
|
+
| 'signature_invalid' | 'not_yet_valid' | 'expired'
|
|
46
|
+
/** A validity bound is not an instant, or the bounds are inverted. */
|
|
47
|
+
| 'invalid_validity'
|
|
48
|
+
/** Not the 32 raw bytes of an Ed25519 key, the ARIA 1.0 compatibility encoding, or not the subject's. */
|
|
49
|
+
| 'holder_key_invalid'
|
|
50
|
+
/** Valid against its schema but not its rules, e.g. `hitlRequired` outside `scope`. */
|
|
51
|
+
| 'semantic_invalid'
|
|
52
|
+
/** It names a status list its trust profile does not publish. */
|
|
53
|
+
| 'status_list_untrusted';
|
|
54
|
+
interface Principal {
|
|
55
|
+
readonly did: string;
|
|
56
|
+
readonly type: 'organization' | 'individual';
|
|
57
|
+
/** An organization's asserted name; never a natural person's. */
|
|
58
|
+
readonly legalName: string | null;
|
|
59
|
+
readonly jurisdiction: string | null;
|
|
60
|
+
readonly verificationStatus: 'self-declared' | 'registry-confirmed' | 'legal-verified';
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* One exact issued document that conforms to its `spec_version`, is within its
|
|
64
|
+
* validity interval and verifies under a trusted issuer. It says nothing about
|
|
65
|
+
* who presents it, nor about its current status.
|
|
66
|
+
*
|
|
67
|
+
* A frozen view: the verifier that produced it keeps the authoritative copy, and
|
|
68
|
+
* accepts this exact object only. A copy or an altered one is refused.
|
|
69
|
+
*/
|
|
70
|
+
interface VerifiedCredential extends Produced<'credential'> {
|
|
71
|
+
readonly kind: 'verified-credential';
|
|
72
|
+
readonly binding: CredentialBinding;
|
|
73
|
+
/** The agent's stable identity. */
|
|
74
|
+
readonly did: Did;
|
|
75
|
+
readonly issuer: Did;
|
|
76
|
+
readonly specVersion: '1.0';
|
|
77
|
+
readonly trustLevel: TrustLevel;
|
|
78
|
+
readonly scopes: readonly string[];
|
|
79
|
+
/** Scopes the receiver must not act on without a human's approval; a declaration, not an approval. */
|
|
80
|
+
readonly hitlRequired: readonly string[];
|
|
81
|
+
readonly delegationDepth: number;
|
|
82
|
+
readonly principal: Principal;
|
|
83
|
+
/** `id` and the key as published (multibase); the verifier keeps the decoded 32 bytes. */
|
|
84
|
+
readonly holderKey: {
|
|
85
|
+
readonly id: string;
|
|
86
|
+
readonly publicKeyMultibase: string;
|
|
87
|
+
};
|
|
88
|
+
/** Signed validity bounds (RFC 3339). There is no issuance time: `proof.created` is outside the signature. */
|
|
89
|
+
readonly validFrom: string;
|
|
90
|
+
readonly validUntil: string;
|
|
91
|
+
/** Signed predecessor reference, as data. Verification never fetches it. */
|
|
92
|
+
readonly previousCredentialId: string | null;
|
|
93
|
+
readonly statusEntry: {
|
|
94
|
+
readonly list: string;
|
|
95
|
+
readonly index: number;
|
|
96
|
+
};
|
|
97
|
+
/** Local time of this verification. */
|
|
98
|
+
readonly verifiedAt: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* What a verifier established about one of its own credential results, read
|
|
102
|
+
* through `Verifier.facts` from its record, never from the view. A fresh copy at
|
|
103
|
+
* each call, holder key bytes included. Data, not evidence: no entry point of this
|
|
104
|
+
* SDK or of ARIA AP accepts it in place of a result.
|
|
105
|
+
*/
|
|
106
|
+
interface CredentialFacts {
|
|
107
|
+
readonly binding: CredentialBinding;
|
|
108
|
+
readonly did: Did;
|
|
109
|
+
readonly issuer: Did;
|
|
110
|
+
readonly trustLevel: TrustLevel;
|
|
111
|
+
readonly scopes: readonly string[];
|
|
112
|
+
readonly hitlRequired: readonly string[];
|
|
113
|
+
readonly delegationDepth: number;
|
|
114
|
+
/** The 32 raw bytes, already accepted by the strict key rule; a copy the caller owns. */
|
|
115
|
+
readonly holderKey: {
|
|
116
|
+
readonly id: string;
|
|
117
|
+
readonly publicKey: Uint8Array;
|
|
118
|
+
};
|
|
119
|
+
readonly validFrom: string;
|
|
120
|
+
readonly validUntil: string;
|
|
121
|
+
}
|
|
122
|
+
type CredentialResult = {
|
|
123
|
+
readonly ok: true;
|
|
124
|
+
readonly credential: VerifiedCredential;
|
|
125
|
+
} | {
|
|
126
|
+
readonly ok: false;
|
|
127
|
+
readonly reason: CredentialFailure;
|
|
128
|
+
readonly path?: string;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* A retained document that verifies under a trusted issuer as `verifyCredential`
|
|
132
|
+
* checks it, except against the current time: what past statements are checked
|
|
133
|
+
* against. It is not a verified credential: `facts`, `standing`, `checkStatus`
|
|
134
|
+
* and ARIA AP's admission refuse it, so it never authorizes anything now.
|
|
135
|
+
*/
|
|
136
|
+
interface AuthenticCredential extends Produced<'authentic-credential'> {
|
|
137
|
+
readonly kind: 'authentic-credential';
|
|
138
|
+
readonly binding: CredentialBinding;
|
|
139
|
+
readonly did: Did;
|
|
140
|
+
readonly issuer: Did;
|
|
141
|
+
readonly holderKey: {
|
|
142
|
+
readonly id: string;
|
|
143
|
+
readonly publicKeyMultibase: string;
|
|
144
|
+
};
|
|
145
|
+
/** Signed validity bounds (RFC 3339), reported and not judged. */
|
|
146
|
+
readonly validFrom: string;
|
|
147
|
+
readonly validUntil: string;
|
|
148
|
+
readonly statusEntry: {
|
|
149
|
+
readonly list: string;
|
|
150
|
+
readonly index: number;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
/** Why a retained document is not authentic: the credential failures without the current time. */
|
|
154
|
+
type AuthenticityFailure = Exclude<CredentialFailure, 'not_yet_valid' | 'expired'>;
|
|
155
|
+
type AuthenticityResult = {
|
|
156
|
+
readonly ok: true;
|
|
157
|
+
readonly credential: AuthenticCredential;
|
|
158
|
+
} | {
|
|
159
|
+
readonly ok: false;
|
|
160
|
+
readonly reason: AuthenticityFailure;
|
|
161
|
+
readonly path?: string;
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* What a verifier established about one of its authentic credentials, read through
|
|
165
|
+
* `Verifier.historicalFacts`, with what a retained list said about it. Data for
|
|
166
|
+
* checking past statements; nothing accepts it as a result.
|
|
167
|
+
*/
|
|
168
|
+
interface HistoricalFacts {
|
|
169
|
+
readonly binding: CredentialBinding;
|
|
170
|
+
readonly did: Did;
|
|
171
|
+
readonly issuer: Did;
|
|
172
|
+
/** The 32 raw bytes, already accepted by the strict key rule; a copy the caller owns. */
|
|
173
|
+
readonly holderKey: {
|
|
174
|
+
readonly id: string;
|
|
175
|
+
readonly publicKey: Uint8Array;
|
|
176
|
+
};
|
|
177
|
+
readonly validFrom: string;
|
|
178
|
+
readonly validUntil: string;
|
|
179
|
+
/** From `readRetainedStatus` when given: the list's statement and its own validity. */
|
|
180
|
+
readonly retainedStatus: {
|
|
181
|
+
readonly state: 'active' | 'revoked';
|
|
182
|
+
readonly validFrom: string;
|
|
183
|
+
readonly validUntil: string;
|
|
184
|
+
} | null;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** Why the status of a credential could not be established. */
|
|
188
|
+
type StatusUnavailable =
|
|
189
|
+
/** No fetch policy: the verifier is offline. */
|
|
190
|
+
'offline'
|
|
191
|
+
/** The trust profile names no online status endpoint. */
|
|
192
|
+
| 'no_online_endpoint' | 'origin_not_allowed' | 'fetch_failed' | 'too_large' | 'malformed' | 'signature_invalid' | 'wrong_issuer'
|
|
193
|
+
/** Outside its signed validity, or a validity window longer than 24 hours. */
|
|
194
|
+
| 'not_valid_now'
|
|
195
|
+
/** The signed list is older than the verifier's maximum age, counted from its own `validFrom`. */
|
|
196
|
+
| 'stale';
|
|
197
|
+
interface StatusBase extends Produced<'status'> {
|
|
198
|
+
readonly kind: 'status-evidence';
|
|
199
|
+
/** The exact document this evidence is about. */
|
|
200
|
+
readonly credential: CredentialBinding;
|
|
201
|
+
/** Local time the evidence was obtained (RFC 3339). Fetching an old list does not make it new. */
|
|
202
|
+
readonly fetchedAt: string;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Status of one exact credential. Only the signed list carries signed times; an
|
|
206
|
+
* online answer carries none and is only as strong as TLS to the configured
|
|
207
|
+
* endpoint. `superseded` comes only from an online answer that names another
|
|
208
|
+
* current document: a revocation bit cannot say why.
|
|
209
|
+
*/
|
|
210
|
+
type StatusEvidence = (StatusBase & {
|
|
211
|
+
readonly source: 'status-list';
|
|
212
|
+
readonly state: 'active' | 'revoked';
|
|
213
|
+
readonly list: {
|
|
214
|
+
readonly url: string;
|
|
215
|
+
readonly index: number;
|
|
216
|
+
readonly validFrom: string;
|
|
217
|
+
readonly validUntil: string;
|
|
218
|
+
};
|
|
219
|
+
}) | (StatusBase & {
|
|
220
|
+
readonly source: 'online';
|
|
221
|
+
readonly state: 'active' | 'revoked' | 'superseded';
|
|
222
|
+
/** The current document, when the answer names another one. */
|
|
223
|
+
readonly currentCredentialId?: string;
|
|
224
|
+
}) | (StatusBase & {
|
|
225
|
+
readonly source: 'status-list' | 'online';
|
|
226
|
+
readonly state: 'unavailable';
|
|
227
|
+
readonly reason: StatusUnavailable;
|
|
228
|
+
});
|
|
229
|
+
/** The judgment itself, without its time. */
|
|
230
|
+
type StandingState = {
|
|
231
|
+
readonly state: 'good';
|
|
232
|
+
readonly source: 'status-list' | 'online';
|
|
233
|
+
}
|
|
234
|
+
/** Outside its signed validity at the moment judged: expired, or not yet valid. */
|
|
235
|
+
| {
|
|
236
|
+
readonly state: 'not_valid_now';
|
|
237
|
+
} | {
|
|
238
|
+
readonly state: 'revoked';
|
|
239
|
+
} | {
|
|
240
|
+
readonly state: 'superseded';
|
|
241
|
+
} | {
|
|
242
|
+
readonly state: 'unknown';
|
|
243
|
+
/** No evidence, evidence past its validity or maximum age, or evidence about another verified result. */
|
|
244
|
+
readonly reason: 'unavailable' | 'stale' | 'other_document';
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* Whether one exact credential stands now, from `Verifier.standing`: judged at
|
|
248
|
+
* the call under the verifier's own clock and freshness rules. A judgment, not
|
|
249
|
+
* evidence: no entry point of this SDK or of ARIA AP accepts it as input.
|
|
250
|
+
*/
|
|
251
|
+
type Standing = StandingState & {
|
|
252
|
+
readonly kind: 'standing';
|
|
253
|
+
/** When it was judged (RFC 3339, the verifier's clock). */
|
|
254
|
+
readonly judgedAt: string;
|
|
255
|
+
};
|
|
256
|
+
/** Why a retained status list says nothing about a credential. */
|
|
257
|
+
type RetainedStatusFailure = 'malformed' | 'signature_invalid' | 'wrong_issuer'
|
|
258
|
+
/** A validity bound is not an instant, the bounds are inverted, or longer than 24 hours. */
|
|
259
|
+
| 'invalid_validity';
|
|
260
|
+
/**
|
|
261
|
+
* What a retained, signed status list said about one authentic credential, during
|
|
262
|
+
* the list's own validity. Never judged against the current time and never
|
|
263
|
+
* accepted by `standing`: history, not current status.
|
|
264
|
+
*/
|
|
265
|
+
interface RetainedStatus extends Produced<'retained-status'> {
|
|
266
|
+
readonly kind: 'retained-status';
|
|
267
|
+
readonly credential: CredentialBinding;
|
|
268
|
+
readonly state: 'active' | 'revoked';
|
|
269
|
+
readonly list: {
|
|
270
|
+
readonly url: string;
|
|
271
|
+
readonly index: number;
|
|
272
|
+
readonly validFrom: string;
|
|
273
|
+
readonly validUntil: string;
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
type RetainedStatusResult = {
|
|
277
|
+
readonly ok: true;
|
|
278
|
+
readonly status: RetainedStatus;
|
|
279
|
+
} | {
|
|
280
|
+
readonly ok: false;
|
|
281
|
+
readonly reason: RetainedStatusFailure;
|
|
282
|
+
};
|
|
283
|
+
interface StatusOptions {
|
|
284
|
+
/** `status-list` (default) tells the issuer nothing about which credential is checked. */
|
|
285
|
+
readonly via?: 'status-list' | 'online';
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/** One issuer the verifier trusts. Its `id` is a label for results, never a trust identity. */
|
|
289
|
+
interface TrustProfile {
|
|
290
|
+
/** E.g. `demo` or `production`. */
|
|
291
|
+
readonly id: string;
|
|
292
|
+
readonly issuer: Did;
|
|
293
|
+
/** The DID URL the issuer's proofs name, e.g. `did:aria:registry.aria.bar#key-1`. */
|
|
294
|
+
readonly verificationMethod: string;
|
|
295
|
+
readonly keys: {
|
|
296
|
+
readonly mldsa65: Uint8Array;
|
|
297
|
+
readonly ed25519: Uint8Array;
|
|
298
|
+
};
|
|
299
|
+
/** Highest level this profile may assert; a credential claiming more fails. */
|
|
300
|
+
readonly maxLevel: TrustLevel;
|
|
301
|
+
/** Status lists this issuer publishes; a credential naming another fails. */
|
|
302
|
+
readonly statusLists: readonly string[];
|
|
303
|
+
/** The issuer's online status endpoint, to which the DID is appended, e.g. `https://api.aria.bar/v1/verify/`. */
|
|
304
|
+
readonly onlineStatus?: string;
|
|
305
|
+
}
|
|
306
|
+
/** Bounds on everything the SDK fetches. Without it the verifier is offline and status is `unavailable`. */
|
|
307
|
+
interface FetchPolicy {
|
|
308
|
+
/** Exact origins it may fetch from; redirects are never followed. */
|
|
309
|
+
readonly allowedOrigins: readonly string[];
|
|
310
|
+
/** Default 5000. */
|
|
311
|
+
readonly timeoutMs?: number;
|
|
312
|
+
/** Default 262144; the decompressed status list is bounded separately. */
|
|
313
|
+
readonly maxBytes?: number;
|
|
314
|
+
/** The fetch implementation; the global one by default. */
|
|
315
|
+
readonly fetch?: typeof fetch;
|
|
316
|
+
}
|
|
317
|
+
/** Trusted configuration: everything here comes from the adopter, never from a message. It is copied when the verifier is created. */
|
|
318
|
+
interface VerifierConfig {
|
|
319
|
+
readonly trust: readonly TrustProfile[];
|
|
320
|
+
readonly fetch?: FetchPolicy;
|
|
321
|
+
readonly clock?: () => Date;
|
|
322
|
+
/** Maximum age of signed status-list evidence, from the list's own `validFrom`. Default 3600. */
|
|
323
|
+
readonly statusMaxAgeSeconds?: number;
|
|
324
|
+
/** Maximum age of an online status answer when admission uses it, from when it was fetched. Default 60. */
|
|
325
|
+
readonly onlineStatusMaxAgeSeconds?: number;
|
|
326
|
+
/** Tolerated clock skew on validity bounds. Default 5. */
|
|
327
|
+
readonly skewSeconds?: number;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* A verifier with its own, fixed trust. Two verifiers never affect each other;
|
|
331
|
+
* nothing in the package is configured globally. Results are accepted only by the
|
|
332
|
+
* verifier that produced them, as the exact objects it returned.
|
|
333
|
+
*/
|
|
334
|
+
interface Verifier {
|
|
335
|
+
/** Verifies one document. Says nothing about who presents it or its status. */
|
|
336
|
+
verifyCredential(document: unknown): CredentialResult;
|
|
337
|
+
/** Status of the credential's exact document. */
|
|
338
|
+
checkStatus(credential: VerifiedCredential, options?: StatusOptions): Promise<StatusEvidence>;
|
|
339
|
+
/**
|
|
340
|
+
* What this verifier established about `credential`, from its own record: a
|
|
341
|
+
* fresh copy, holder key bytes included. This is how packages built on this one
|
|
342
|
+
* (ARIA AP) read a credential. Throws `AriaUsageError` for anything this verifier
|
|
343
|
+
* did not produce: a copy, an altered or hand-made object, another verifier's result.
|
|
344
|
+
*/
|
|
345
|
+
facts(credential: VerifiedCredential): CredentialFacts;
|
|
346
|
+
/**
|
|
347
|
+
* Whether `credential` stands now: inside its signed validity, with `status`
|
|
348
|
+
* being this verifier's evidence about that same result, still fresh under its
|
|
349
|
+
* rules. Judged at every call with this verifier's clock. Throws like `facts`.
|
|
350
|
+
*/
|
|
351
|
+
standing(credential: VerifiedCredential, status: StatusEvidence): Standing;
|
|
352
|
+
/**
|
|
353
|
+
* Verifies a retained document as `verifyCredential` does, except against the
|
|
354
|
+
* current time: an expired document can be authentic. The result is not a
|
|
355
|
+
* verified credential, and nothing that authorizes accepts it.
|
|
356
|
+
*/
|
|
357
|
+
verifyAuthenticity(document: unknown): AuthenticityResult;
|
|
358
|
+
/**
|
|
359
|
+
* What a retained, signed status list (as a parsed object or JSON text) said about
|
|
360
|
+
* `credential`, offline: same issuer, the exact list it names, both signatures.
|
|
361
|
+
* The list's validity is reported, never judged against the current time.
|
|
362
|
+
*/
|
|
363
|
+
readRetainedStatus(credential: AuthenticCredential, list: unknown): Promise<RetainedStatusResult>;
|
|
364
|
+
/**
|
|
365
|
+
* What this verifier established about an authentic credential and, when given,
|
|
366
|
+
* what a retained list said about it: a fresh copy, holder key bytes included.
|
|
367
|
+
* Throws `AriaUsageError` for anything this verifier did not produce, and for a
|
|
368
|
+
* retained status about another document.
|
|
369
|
+
*/
|
|
370
|
+
historicalFacts(credential: AuthenticCredential, status?: RetainedStatus): HistoricalFacts;
|
|
371
|
+
}
|
|
372
|
+
/** Creates a verifier from a copy of `config`; later changes to `config` or its keys do not reach it. */
|
|
373
|
+
declare function createVerifier(config: VerifierConfig): Verifier;
|
|
374
|
+
/** Parses a credential without verifying anything. Its result cannot be passed where verification is required. */
|
|
375
|
+
declare function inspectCredential(document: unknown): Inspection;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* ARIA canonical JSON (INVARIANTS §3): keys sorted at every level, no whitespace,
|
|
379
|
+
* `JSON.stringify` escaping. The same function as `@aria-registry/verify`'s, so the
|
|
380
|
+
* bytes match what the authority signs. It is not generic JCS; the closed AID
|
|
381
|
+
* schema keeps it out of the cases where the two differ.
|
|
382
|
+
*/
|
|
383
|
+
declare function canonicalJson(value: unknown): string;
|
|
384
|
+
|
|
385
|
+
declare const LEVELS: readonly TrustLevel[];
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* The `did:aria` identifier grammar (specification §3.1): four shapes, two subject
|
|
389
|
+
* kinds crossed with two anchoring modes. The same rules as the authority's parser
|
|
390
|
+
* and the shared vectors (`conformance/vectors/abnf-cases.json`).
|
|
391
|
+
*
|
|
392
|
+
* Verifying a credential does not apply it: a signed 1.0 document is read under its
|
|
393
|
+
* own schema. Use it for identifiers being created or compared.
|
|
394
|
+
*/
|
|
395
|
+
type ParsedDid =
|
|
396
|
+
/** An agent under a domain its principal has verified. */
|
|
397
|
+
{
|
|
398
|
+
readonly shape: 'agent-domain-form';
|
|
399
|
+
readonly did: Did;
|
|
400
|
+
readonly domain: string;
|
|
401
|
+
readonly slug: string;
|
|
402
|
+
}
|
|
403
|
+
/** An agent under a registry namespace. */
|
|
404
|
+
| {
|
|
405
|
+
readonly shape: 'agent-registry-form';
|
|
406
|
+
readonly did: Did;
|
|
407
|
+
readonly host: string;
|
|
408
|
+
readonly account: string;
|
|
409
|
+
readonly slug: string;
|
|
410
|
+
}
|
|
411
|
+
/** An organization that has verified a domain. */
|
|
412
|
+
| {
|
|
413
|
+
readonly shape: 'principal-domain-form';
|
|
414
|
+
readonly did: Did;
|
|
415
|
+
readonly domain: string;
|
|
416
|
+
}
|
|
417
|
+
/** An organization without a verified domain: no host, so it survives a registry move. */
|
|
418
|
+
| {
|
|
419
|
+
readonly shape: 'principal-registry-form';
|
|
420
|
+
readonly did: Did;
|
|
421
|
+
readonly account: string;
|
|
422
|
+
};
|
|
423
|
+
/** The parts of a `did:aria` identifier, or `null` when it is not one. */
|
|
424
|
+
declare function parseDid(value: unknown): ParsedDid | null;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* A value that this verifier did not produce was passed where one of its results
|
|
428
|
+
* is required: a copy, an altered object, a result of another verifier, or a
|
|
429
|
+
* hand-made one. A programming error, never a verification outcome.
|
|
430
|
+
*/
|
|
431
|
+
declare class AriaUsageError extends TypeError {
|
|
432
|
+
constructor(message: string);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export { AriaUsageError, type AuthenticCredential, type AuthenticityFailure, type AuthenticityResult, type CredentialBinding, type CredentialFacts, type CredentialFailure, type CredentialResult, type Did, type FetchPolicy, type HistoricalFacts, type Inspection, type ParsedDid, type Principal, type Produced, type RetainedStatus, type RetainedStatusFailure, type RetainedStatusResult, type Standing, type StandingState, type StatusEvidence, type StatusOptions, type StatusUnavailable, LEVELS as TRUST_LEVELS, type TrustLevel, type TrustProfile, type VerifiedCredential, type Verifier, type VerifierConfig, canonicalJson, createVerifier, inspectCredential, parseDid };
|