@e-sig/uaid-exch 0.1.0-preview.0 → 0.1.0-preview.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/LICENSE +21 -0
- package/README.md +40 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/revocation.d.ts +103 -0
- package/dist/revocation.d.ts.map +1 -0
- package/dist/revocation.js +213 -0
- package/dist/revocation.js.map +1 -0
- package/package.json +6 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 VMVTech, Ltd.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -82,6 +82,46 @@ Per [UAP-EXCH-1 § 4](https://github.com/uuaid/spec/blob/main/docs/profiles/UAP-
|
|
|
82
82
|
|
|
83
83
|
Counterparties enforce a minimum level; this SDK renders it into the Signing Credential and Exchange so verification is one JSON check.
|
|
84
84
|
|
|
85
|
+
## Revocation
|
|
86
|
+
|
|
87
|
+
Status-list style revocation for Signing Credentials (UAP-EXCH-1 § 9, draft). An issuer publishes an append-only `RevocationList` — `{ id, issuer, issued, revoked: [{ credentialId, revokedAt, reason? }], digest }` — whose `digest` is `sha256:<hex>` over the JCS (RFC 8785) canonicalization of the list body. Any mutation (removing an entry, backdating, issuer swap) fails integrity verification, and verifiers **fail closed**: a list that doesn't verify blocks the credential rather than silently allowing it.
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
import {
|
|
91
|
+
createRevocationList,
|
|
92
|
+
revokeCredential,
|
|
93
|
+
isRevoked,
|
|
94
|
+
verifyRevocationListIntegrity,
|
|
95
|
+
assertCredentialUsable,
|
|
96
|
+
CredentialRevokedError,
|
|
97
|
+
CredentialExpiredError,
|
|
98
|
+
} from "@e-sig/uaid-exch";
|
|
99
|
+
|
|
100
|
+
// Issuer side: cut a list, revoke a credential. Every call returns a NEW,
|
|
101
|
+
// re-digested list — the input is never mutated, and double-revoking the
|
|
102
|
+
// same id is idempotent.
|
|
103
|
+
let list = await createRevocationList({ issuer: certifierUuaid });
|
|
104
|
+
list = await revokeCredential(list, signingCredentialId, "key compromise");
|
|
105
|
+
|
|
106
|
+
// Verifier side: gate every use of a Signing Credential.
|
|
107
|
+
await isRevoked(list, signingCredentialId); // → true; THROWS
|
|
108
|
+
// RevocationListIntegrityError on a tampered list (fail-closed — a lookup
|
|
109
|
+
// against an unverified list could be silently un-revoked by an attacker)
|
|
110
|
+
await verifyRevocationListIntegrity(list); // → true (false on ANY tamper)
|
|
111
|
+
|
|
112
|
+
try {
|
|
113
|
+
await assertCredentialUsable(signingCredential, list); // checks validFrom,
|
|
114
|
+
// validUntil (malformed dates fail closed), AND the revocation list —
|
|
115
|
+
// throws typed errors: CredentialExpiredError | CredentialNotYetValidError |
|
|
116
|
+
// CredentialMalformedValidityError | CredentialRevokedError |
|
|
117
|
+
// RevocationListIntegrityError
|
|
118
|
+
} catch (e) {
|
|
119
|
+
if (e instanceof CredentialRevokedError) console.error(e.entry.reason);
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Note:** this module has no exchange-verification path to hook into (verification is network-side per § 8), so `assertCredentialUsable()` is exported standalone — call it before acting on a credential, i.e. before `createExchange()` / `UaidNetworkClient.submit()`.
|
|
124
|
+
|
|
85
125
|
## Strictly opt-in
|
|
86
126
|
|
|
87
127
|
Absent `UUAID_API_KEY`, the package is a pure library — no network calls. `UaidNetworkClient.submit()` throws early rather than dropping data into a silent no-op. Reads (`get`, `getReceipt`) are unauthenticated per the spec.
|
package/dist/index.d.ts
CHANGED
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
*
|
|
8
8
|
* See docs/profiles/UAP-EXCH-1/v0.1.md in the uuaid repo for the normative
|
|
9
9
|
* profile. This module implements the § 5 (Signing Credential), § 6 (Exchange),
|
|
10
|
-
* and § 7 (Receipt) shapes plus the § 8 submission API.
|
|
10
|
+
* and § 7 (Receipt) shapes plus the § 8 submission API. § 9 (Revocation,
|
|
11
|
+
* draft) lives in ./revocation.ts and is re-exported below.
|
|
11
12
|
*/
|
|
13
|
+
export * from "./revocation.js";
|
|
12
14
|
export type AssuranceLevel = "L0" | "L1" | "L2" | "L3" | "L4" | "L5";
|
|
13
15
|
export interface UaidSigningCredential {
|
|
14
16
|
"@context": string[];
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","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,KAAK,EAAE,OAAO,GAAG,UAAU,CAEnD;AA+DD;;;GAGG;AACH,wBAAgB,MAAM,IAAI,MAAM,CAsB/B"}
|
package/dist/index.js
CHANGED
|
@@ -7,9 +7,19 @@
|
|
|
7
7
|
*
|
|
8
8
|
* See docs/profiles/UAP-EXCH-1/v0.1.md in the uuaid repo for the normative
|
|
9
9
|
* profile. This module implements the § 5 (Signing Credential), § 6 (Exchange),
|
|
10
|
-
* and § 7 (Receipt) shapes plus the § 8 submission API.
|
|
10
|
+
* and § 7 (Receipt) shapes plus the § 8 submission API. § 9 (Revocation,
|
|
11
|
+
* draft) lives in ./revocation.ts and is re-exported below.
|
|
11
12
|
*/
|
|
12
13
|
// ============================================================================
|
|
14
|
+
// Revocation (§ 9, draft) — status-list style credential revocation
|
|
15
|
+
// ============================================================================
|
|
16
|
+
//
|
|
17
|
+
// There is no verify entry point in this module to wire into, so the
|
|
18
|
+
// usability gate is exported standalone: call assertCredentialUsable()
|
|
19
|
+
// before acting on a Signing Credential (e.g. before createExchange /
|
|
20
|
+
// UaidNetworkClient.submit).
|
|
21
|
+
export * from "./revocation.js";
|
|
22
|
+
// ============================================================================
|
|
13
23
|
// Exchange creation
|
|
14
24
|
// ============================================================================
|
|
15
25
|
const CONTEXT = [
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,+EAA+E;AAC/E,oEAAoE;AACpE,+EAA+E;AAC/E,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,sEAAsE;AACtE,6BAA6B;AAE7B,cAAc,iBAAiB,CAAC;AAgKhC,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E,MAAM,OAAO,GAAG;IACd,sCAAsC;IACtC,sCA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AI,CAAC,EAAE,CAAC,CAAC;IACZ,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CACxD,EAAE,EACF,EAAE,CACH,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;AAC5C,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAe;IACvC,MAAM,CAAC,GAAI,UAA6C,CAAC,MAAM,CAAC;IAChE,IAAI,CAAC,EAAE,eAAe,EAAE,CAAC;QACvB,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO;IACT,CAAC;IACD,sEAAsE;IACtE,+DAA+D;IAC/D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @e-sig/uaid-exch — UAP-EXCH-1 § 9 (Revocation, draft) — status-list style
|
|
3
|
+
* credential revocation.
|
|
4
|
+
*
|
|
5
|
+
* A RevocationList is an append-only, issuer-published list of revoked
|
|
6
|
+
* Signing Credential ids. Integrity is a sha256 digest over the JCS
|
|
7
|
+
* (RFC 8785) canonicalization of the list body (everything except the
|
|
8
|
+
* `digest` field itself), so any mutation — reordering, backdating, entry
|
|
9
|
+
* removal — is detectable offline. Verifiers MUST fail closed: a list whose
|
|
10
|
+
* digest does not verify is treated as unusable, not as "nothing revoked".
|
|
11
|
+
*
|
|
12
|
+
* Like § 5–§ 8 in ./index.ts this is a preview shape; it will be re-cut to
|
|
13
|
+
* the accepted IAASO ADR-006 schemas when the doctrine lands.
|
|
14
|
+
*/
|
|
15
|
+
import { type UaidSigningCredential } from "./index.js";
|
|
16
|
+
export interface RevocationEntry {
|
|
17
|
+
credentialId: string;
|
|
18
|
+
revokedAt: string;
|
|
19
|
+
reason?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface RevocationList {
|
|
22
|
+
id: string;
|
|
23
|
+
issuer: string;
|
|
24
|
+
issued: string;
|
|
25
|
+
revoked: RevocationEntry[];
|
|
26
|
+
digest: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The minimal credential surface needed for a usability check. Structural
|
|
30
|
+
* (Pick-style) so any § 5 UaidSigningCredential — or anything with the same
|
|
31
|
+
* id + validity window — is accepted without a hard dependency.
|
|
32
|
+
*/
|
|
33
|
+
export type RevocableCredential = Pick<UaidSigningCredential, "id" | "validFrom" | "validUntil">;
|
|
34
|
+
export interface CreateRevocationListInput {
|
|
35
|
+
issuer: string;
|
|
36
|
+
now?: () => Date;
|
|
37
|
+
idFactory?: () => string;
|
|
38
|
+
}
|
|
39
|
+
export type CredentialUsabilityErrorCode = "CREDENTIAL_EXPIRED" | "CREDENTIAL_NOT_YET_VALID" | "CREDENTIAL_REVOKED" | "CREDENTIAL_MALFORMED_VALIDITY" | "REVOCATION_LIST_INTEGRITY";
|
|
40
|
+
export declare class CredentialUsabilityError extends Error {
|
|
41
|
+
readonly code: CredentialUsabilityErrorCode;
|
|
42
|
+
constructor(code: CredentialUsabilityErrorCode, message: string);
|
|
43
|
+
}
|
|
44
|
+
export declare class CredentialExpiredError extends CredentialUsabilityError {
|
|
45
|
+
constructor(credentialId: string, validUntil: string, now: Date);
|
|
46
|
+
}
|
|
47
|
+
export declare class CredentialNotYetValidError extends CredentialUsabilityError {
|
|
48
|
+
constructor(credentialId: string, validFrom: string, now: Date);
|
|
49
|
+
}
|
|
50
|
+
export declare class CredentialRevokedError extends CredentialUsabilityError {
|
|
51
|
+
readonly entry: RevocationEntry;
|
|
52
|
+
constructor(entry: RevocationEntry);
|
|
53
|
+
}
|
|
54
|
+
export declare class CredentialMalformedValidityError extends CredentialUsabilityError {
|
|
55
|
+
constructor(credentialId: string, field: "validFrom" | "validUntil", value: string);
|
|
56
|
+
}
|
|
57
|
+
export declare class RevocationListIntegrityError extends CredentialUsabilityError {
|
|
58
|
+
constructor(listId: string);
|
|
59
|
+
}
|
|
60
|
+
/** Create an empty, digested revocation list for an issuer. */
|
|
61
|
+
export declare function createRevocationList(input: CreateRevocationListInput): Promise<RevocationList>;
|
|
62
|
+
/**
|
|
63
|
+
* Revoke a credential id. Returns a NEW list — the input is never mutated —
|
|
64
|
+
* with the entry appended and the digest recomputed. Revoking an id that is
|
|
65
|
+
* already revoked is idempotent: the input list is returned unchanged (the
|
|
66
|
+
* original entry, including its `revokedAt` and `reason`, is authoritative).
|
|
67
|
+
*
|
|
68
|
+
* Fails closed: refuses to append to a list that does not verify.
|
|
69
|
+
*/
|
|
70
|
+
export declare function revokeCredential(list: RevocationList, credentialId: string, reason?: string, opts?: {
|
|
71
|
+
now?: () => Date;
|
|
72
|
+
}): Promise<RevocationList>;
|
|
73
|
+
/**
|
|
74
|
+
* True if `credentialId` appears in the list's revoked entries.
|
|
75
|
+
*
|
|
76
|
+
* Verifies list integrity first and throws {@link RevocationListIntegrityError}
|
|
77
|
+
* on any tampered/malformed list — a lookup against an unverified list would
|
|
78
|
+
* fail open (an attacker who can strip an entry could un-revoke a credential).
|
|
79
|
+
*/
|
|
80
|
+
export declare function isRevoked(list: RevocationList, credentialId: string): Promise<boolean>;
|
|
81
|
+
/**
|
|
82
|
+
* Look up the revocation entry for a credential id, if any. Same fail-closed
|
|
83
|
+
* integrity gate as {@link isRevoked}.
|
|
84
|
+
*/
|
|
85
|
+
export declare function getRevocationEntry(list: RevocationList, credentialId: string): Promise<RevocationEntry | undefined>;
|
|
86
|
+
/**
|
|
87
|
+
* Recompute the JCS + sha256 digest over the list body and compare against
|
|
88
|
+
* `list.digest`. Fail-closed: any structural anomaly, canonicalization error,
|
|
89
|
+
* or digest mismatch returns false — it never throws.
|
|
90
|
+
*/
|
|
91
|
+
export declare function verifyRevocationListIntegrity(list: RevocationList): Promise<boolean>;
|
|
92
|
+
/**
|
|
93
|
+
* Assert a Signing Credential is currently usable: the revocation list
|
|
94
|
+
* verifies, the credential's § 5 validity window (validFrom/validUntil)
|
|
95
|
+
* covers `now`, and the credential id is not revoked.
|
|
96
|
+
*
|
|
97
|
+
* Throws a typed CredentialUsabilityError subclass on the first failure;
|
|
98
|
+
* resolves (void) on the happy path. Standalone by design — ./index.ts has
|
|
99
|
+
* no verify entry point to wire into, so call this before acting on a
|
|
100
|
+
* credential (e.g. before createExchange / UaidNetworkClient.submit).
|
|
101
|
+
*/
|
|
102
|
+
export declare function assertCredentialUsable(credential: RevocableCredential, list: RevocationList, now?: Date): Promise<void>;
|
|
103
|
+
//# sourceMappingURL=revocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revocation.d.ts","sourceRoot":"","sources":["../src/revocation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAM1E,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,qBAAqB,EACrB,IAAI,GAAG,WAAW,GAAG,YAAY,CAClC,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACxC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CAqBzB;AAWD;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAKtC;AAED;;;;GAIG;AACH,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,OAAO,CAAC,CAuBlB;AAMD;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,mBAAmB,EAC/B,IAAI,EAAE,cAAc,EACpB,GAAG,CAAC,EAAE,IAAI,GACT,OAAO,CAAC,IAAI,CAAC,CAwBf"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @e-sig/uaid-exch — UAP-EXCH-1 § 9 (Revocation, draft) — status-list style
|
|
3
|
+
* credential revocation.
|
|
4
|
+
*
|
|
5
|
+
* A RevocationList is an append-only, issuer-published list of revoked
|
|
6
|
+
* Signing Credential ids. Integrity is a sha256 digest over the JCS
|
|
7
|
+
* (RFC 8785) canonicalization of the list body (everything except the
|
|
8
|
+
* `digest` field itself), so any mutation — reordering, backdating, entry
|
|
9
|
+
* removal — is detectable offline. Verifiers MUST fail closed: a list whose
|
|
10
|
+
* digest does not verify is treated as unusable, not as "nothing revoked".
|
|
11
|
+
*
|
|
12
|
+
* Like § 5–§ 8 in ./index.ts this is a preview shape; it will be re-cut to
|
|
13
|
+
* the accepted IAASO ADR-006 schemas when the doctrine lands.
|
|
14
|
+
*/
|
|
15
|
+
import { jcsBytes, uuidv7 } from "./index.js";
|
|
16
|
+
export class CredentialUsabilityError extends Error {
|
|
17
|
+
code;
|
|
18
|
+
constructor(code, message) {
|
|
19
|
+
super(message);
|
|
20
|
+
this.name = "CredentialUsabilityError";
|
|
21
|
+
this.code = code;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export class CredentialExpiredError extends CredentialUsabilityError {
|
|
25
|
+
constructor(credentialId, validUntil, now) {
|
|
26
|
+
super("CREDENTIAL_EXPIRED", `credential ${credentialId} expired at ${validUntil} (now ${now.toISOString()})`);
|
|
27
|
+
this.name = "CredentialExpiredError";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export class CredentialNotYetValidError extends CredentialUsabilityError {
|
|
31
|
+
constructor(credentialId, validFrom, now) {
|
|
32
|
+
super("CREDENTIAL_NOT_YET_VALID", `credential ${credentialId} is not valid until ${validFrom} (now ${now.toISOString()})`);
|
|
33
|
+
this.name = "CredentialNotYetValidError";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export class CredentialRevokedError extends CredentialUsabilityError {
|
|
37
|
+
entry;
|
|
38
|
+
constructor(entry) {
|
|
39
|
+
super("CREDENTIAL_REVOKED", `credential ${entry.credentialId} was revoked at ${entry.revokedAt}` +
|
|
40
|
+
(entry.reason ? ` (${entry.reason})` : ""));
|
|
41
|
+
this.name = "CredentialRevokedError";
|
|
42
|
+
this.entry = entry;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export class CredentialMalformedValidityError extends CredentialUsabilityError {
|
|
46
|
+
constructor(credentialId, field, value) {
|
|
47
|
+
super("CREDENTIAL_MALFORMED_VALIDITY", `credential ${credentialId} has unparseable ${field} ${JSON.stringify(value)}; failing closed`);
|
|
48
|
+
this.name = "CredentialMalformedValidityError";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export class RevocationListIntegrityError extends CredentialUsabilityError {
|
|
52
|
+
constructor(listId) {
|
|
53
|
+
super("REVOCATION_LIST_INTEGRITY", `revocation list ${listId} failed integrity verification; failing closed`);
|
|
54
|
+
this.name = "RevocationListIntegrityError";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// ============================================================================
|
|
58
|
+
// List construction + mutation (append-only, always re-digested)
|
|
59
|
+
// ============================================================================
|
|
60
|
+
/** Create an empty, digested revocation list for an issuer. */
|
|
61
|
+
export async function createRevocationList(input) {
|
|
62
|
+
const now = (input.now ?? (() => new Date()))();
|
|
63
|
+
const body = {
|
|
64
|
+
id: `uuaid:foundation:revocation-list:${(input.idFactory ?? uuidv7)()}`,
|
|
65
|
+
issuer: input.issuer,
|
|
66
|
+
issued: now.toISOString(),
|
|
67
|
+
revoked: [],
|
|
68
|
+
};
|
|
69
|
+
return { ...body, digest: await computeListDigest(body) };
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Revoke a credential id. Returns a NEW list — the input is never mutated —
|
|
73
|
+
* with the entry appended and the digest recomputed. Revoking an id that is
|
|
74
|
+
* already revoked is idempotent: the input list is returned unchanged (the
|
|
75
|
+
* original entry, including its `revokedAt` and `reason`, is authoritative).
|
|
76
|
+
*
|
|
77
|
+
* Fails closed: refuses to append to a list that does not verify.
|
|
78
|
+
*/
|
|
79
|
+
export async function revokeCredential(list, credentialId, reason, opts) {
|
|
80
|
+
if (!(await verifyRevocationListIntegrity(list))) {
|
|
81
|
+
throw new RevocationListIntegrityError(list.id);
|
|
82
|
+
}
|
|
83
|
+
// Integrity verified above — the unverified lookup is safe here.
|
|
84
|
+
if (findRevocationEntry(list, credentialId)) {
|
|
85
|
+
return list;
|
|
86
|
+
}
|
|
87
|
+
const now = (opts?.now ?? (() => new Date()))();
|
|
88
|
+
const entry = {
|
|
89
|
+
credentialId,
|
|
90
|
+
revokedAt: now.toISOString(),
|
|
91
|
+
...(reason !== undefined ? { reason } : {}),
|
|
92
|
+
};
|
|
93
|
+
const body = {
|
|
94
|
+
id: list.id,
|
|
95
|
+
issuer: list.issuer,
|
|
96
|
+
issued: now.toISOString(),
|
|
97
|
+
revoked: [...list.revoked, entry],
|
|
98
|
+
};
|
|
99
|
+
return { ...body, digest: await computeListDigest(body) };
|
|
100
|
+
}
|
|
101
|
+
/** Entry lookup WITHOUT integrity verification — internal use only, after
|
|
102
|
+
* the caller has already verified the list digest. */
|
|
103
|
+
function findRevocationEntry(list, credentialId) {
|
|
104
|
+
return list.revoked.find((e) => e.credentialId === credentialId);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* True if `credentialId` appears in the list's revoked entries.
|
|
108
|
+
*
|
|
109
|
+
* Verifies list integrity first and throws {@link RevocationListIntegrityError}
|
|
110
|
+
* on any tampered/malformed list — a lookup against an unverified list would
|
|
111
|
+
* fail open (an attacker who can strip an entry could un-revoke a credential).
|
|
112
|
+
*/
|
|
113
|
+
export async function isRevoked(list, credentialId) {
|
|
114
|
+
if (!(await verifyRevocationListIntegrity(list))) {
|
|
115
|
+
throw new RevocationListIntegrityError(list.id);
|
|
116
|
+
}
|
|
117
|
+
return findRevocationEntry(list, credentialId) !== undefined;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Look up the revocation entry for a credential id, if any. Same fail-closed
|
|
121
|
+
* integrity gate as {@link isRevoked}.
|
|
122
|
+
*/
|
|
123
|
+
export async function getRevocationEntry(list, credentialId) {
|
|
124
|
+
if (!(await verifyRevocationListIntegrity(list))) {
|
|
125
|
+
throw new RevocationListIntegrityError(list.id);
|
|
126
|
+
}
|
|
127
|
+
return findRevocationEntry(list, credentialId);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Recompute the JCS + sha256 digest over the list body and compare against
|
|
131
|
+
* `list.digest`. Fail-closed: any structural anomaly, canonicalization error,
|
|
132
|
+
* or digest mismatch returns false — it never throws.
|
|
133
|
+
*/
|
|
134
|
+
export async function verifyRevocationListIntegrity(list) {
|
|
135
|
+
try {
|
|
136
|
+
if (typeof list !== "object" ||
|
|
137
|
+
list === null ||
|
|
138
|
+
typeof list.id !== "string" ||
|
|
139
|
+
typeof list.issuer !== "string" ||
|
|
140
|
+
typeof list.issued !== "string" ||
|
|
141
|
+
typeof list.digest !== "string" ||
|
|
142
|
+
!Array.isArray(list.revoked)) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
const body = {
|
|
146
|
+
id: list.id,
|
|
147
|
+
issuer: list.issuer,
|
|
148
|
+
issued: list.issued,
|
|
149
|
+
revoked: list.revoked,
|
|
150
|
+
};
|
|
151
|
+
return (await computeListDigest(body)) === list.digest;
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// ============================================================================
|
|
158
|
+
// Usability gate
|
|
159
|
+
// ============================================================================
|
|
160
|
+
/**
|
|
161
|
+
* Assert a Signing Credential is currently usable: the revocation list
|
|
162
|
+
* verifies, the credential's § 5 validity window (validFrom/validUntil)
|
|
163
|
+
* covers `now`, and the credential id is not revoked.
|
|
164
|
+
*
|
|
165
|
+
* Throws a typed CredentialUsabilityError subclass on the first failure;
|
|
166
|
+
* resolves (void) on the happy path. Standalone by design — ./index.ts has
|
|
167
|
+
* no verify entry point to wire into, so call this before acting on a
|
|
168
|
+
* credential (e.g. before createExchange / UaidNetworkClient.submit).
|
|
169
|
+
*/
|
|
170
|
+
export async function assertCredentialUsable(credential, list, now) {
|
|
171
|
+
if (!(await verifyRevocationListIntegrity(list))) {
|
|
172
|
+
throw new RevocationListIntegrityError(list.id);
|
|
173
|
+
}
|
|
174
|
+
const at = now ?? new Date();
|
|
175
|
+
const from = Date.parse(credential.validFrom);
|
|
176
|
+
const until = Date.parse(credential.validUntil);
|
|
177
|
+
if (!Number.isFinite(from)) {
|
|
178
|
+
throw new CredentialMalformedValidityError(credential.id, "validFrom", credential.validFrom);
|
|
179
|
+
}
|
|
180
|
+
if (!Number.isFinite(until)) {
|
|
181
|
+
throw new CredentialMalformedValidityError(credential.id, "validUntil", credential.validUntil);
|
|
182
|
+
}
|
|
183
|
+
if (at.getTime() < from) {
|
|
184
|
+
throw new CredentialNotYetValidError(credential.id, credential.validFrom, at);
|
|
185
|
+
}
|
|
186
|
+
if (at.getTime() > until) {
|
|
187
|
+
throw new CredentialExpiredError(credential.id, credential.validUntil, at);
|
|
188
|
+
}
|
|
189
|
+
// List integrity was verified above — the unverified lookup is safe here.
|
|
190
|
+
const entry = findRevocationEntry(list, credential.id);
|
|
191
|
+
if (entry) {
|
|
192
|
+
throw new CredentialRevokedError(entry);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// ============================================================================
|
|
196
|
+
// Digest — JCS (RFC 8785) canonical body → sha256:<hex>
|
|
197
|
+
// ============================================================================
|
|
198
|
+
async function computeListDigest(body) {
|
|
199
|
+
return `sha256:${await sha256Hex(jcsBytes(body))}`;
|
|
200
|
+
}
|
|
201
|
+
async function sha256Hex(bytes) {
|
|
202
|
+
const subtle = globalThis.crypto?.subtle;
|
|
203
|
+
if (!subtle) {
|
|
204
|
+
// Node >= 20 and all modern browsers expose WebCrypto; integrity cannot
|
|
205
|
+
// be computed without it, so refuse rather than degrade.
|
|
206
|
+
throw new Error("WebCrypto subtle digest unavailable (requires Node >= 20)");
|
|
207
|
+
}
|
|
208
|
+
const digest = await subtle.digest("SHA-256", bytes);
|
|
209
|
+
return Array.from(new Uint8Array(digest))
|
|
210
|
+
.map((b) => b.toString(16).padStart(2, "0"))
|
|
211
|
+
.join("");
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=revocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revocation.js","sourceRoot":"","sources":["../src/revocation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAA8B,MAAM,YAAY,CAAC;AA+C1E,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACxC,IAAI,CAA+B;IAE5C,YAAY,IAAkC,EAAE,OAAe;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,MAAM,OAA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7E,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,wEAAwE;QACxE,yDAAyD;QACzD,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAAqB,CAAC,CAAC;IACrE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;SACtC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SAC3C,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-sig/uaid-exch",
|
|
3
|
-
"version": "0.1.0-preview.
|
|
3
|
+
"version": "0.1.0-preview.1",
|
|
4
4
|
"description": "Preview implementation of the IAASO Exchange Profile (ADR-006, under review). Wraps @e-sig/core envelopes as per-transaction signed authorizations on the UUAID Network with subject + issuer proofs and Polygon-anchored batch receipts. Wire format will be finalized when ADR-006 is Accepted.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -53,16 +53,17 @@
|
|
|
53
53
|
"@uuaid/sdk": "^0.1.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@e-sig/core": "^0.5.0"
|
|
56
|
+
"@e-sig/core": "^0.5.0 || ^0.6.0 || ^0.7.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@e-sig/core": "^0.
|
|
59
|
+
"@e-sig/core": "^0.7.0",
|
|
60
60
|
"@types/node": "^22.0.0",
|
|
61
61
|
"typescript": "^5.4.0",
|
|
62
|
-
"vitest": "^
|
|
62
|
+
"vitest": "^4.1.10"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"registry": "https://registry.npmjs.org",
|
|
66
|
-
"access": "public"
|
|
66
|
+
"access": "public",
|
|
67
|
+
"tag": "preview"
|
|
67
68
|
}
|
|
68
69
|
}
|