@metacensus/api 0.3.0 → 0.5.0
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/README.md +93 -44
- package/dist/signing.d.ts +2 -1
- package/dist/signing.d.ts.map +1 -1
- package/dist/signing.js +1 -1
- package/dist/signing.js.map +1 -1
- package/dist/src/client.d.ts +14 -7
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +20 -12
- package/dist/src/client.js.map +1 -1
- package/dist/src/metacensus/v1/auth.d.ts +51 -7
- package/dist/src/metacensus/v1/auth.d.ts.map +1 -1
- package/dist/src/metacensus/v1/common.d.ts +68 -53
- package/dist/src/metacensus/v1/common.d.ts.map +1 -1
- package/dist/src/metacensus/v1/common.js +0 -10
- package/dist/src/metacensus/v1/common.js.map +1 -1
- package/dist/src/metacensus/v1/prop.d.ts +28 -25
- package/dist/src/metacensus/v1/prop.d.ts.map +1 -1
- package/dist/src/metacensus/v1/prop.js.map +1 -1
- package/dist/src/metacensus/v1/topic.d.ts +11 -13
- package/dist/src/metacensus/v1/topic.d.ts.map +1 -1
- package/dist/src/metacensus/v1/user.d.ts +12 -14
- package/dist/src/metacensus/v1/user.d.ts.map +1 -1
- package/dist/src/route-manifest.d.ts.map +1 -1
- package/dist/src/route-manifest.js +2 -1
- package/dist/src/route-manifest.js.map +1 -1
- package/dist/src/signing.d.ts +84 -17
- package/dist/src/signing.d.ts.map +1 -1
- package/dist/src/signing.js +251 -60
- package/dist/src/signing.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,78 +14,93 @@ export interface HealthcheckResponse {
|
|
|
14
14
|
status: string;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* How to read a stored record: which signing scheme produced it and which
|
|
18
|
+
* message its `content` holds. A stored record is append-only — it can be
|
|
19
|
+
* neither re-signed nor allowed to assume the schema around it stays put — so
|
|
20
|
+
* it self-describes how to verify it rather than deriving that from the current
|
|
21
|
+
* envelope. Two independent axes of one concern, so one object; it is a
|
|
22
|
+
* record-level property, identical for both signatures, sealed by both digests.
|
|
23
|
+
* See README.md, "The signing chain".
|
|
19
24
|
*/
|
|
20
|
-
export interface
|
|
25
|
+
export interface Interpretation {
|
|
21
26
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
signerId: string;
|
|
26
|
-
/** base64url SHA-256 of public_key's SPKI DER. */
|
|
27
|
-
keyId: string;
|
|
28
|
-
alg: UserSignature_Alg;
|
|
29
|
-
/** base64url SPKI DER; set only on the sign-up that enrolls the key. */
|
|
30
|
-
publicKey: string;
|
|
31
|
-
/**
|
|
32
|
-
* The signer's claimed time, not the server's — see `recorded` on signed
|
|
33
|
-
* records for what the pair does and does not bound.
|
|
34
|
-
*/
|
|
35
|
-
signingTime?: string | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Exactly how this signature is computed and checked; changing the
|
|
38
|
-
* canonicalization, digest, or encoding changes this string.
|
|
27
|
+
* The signing scheme as one atom: canonicalization, digest, curve and
|
|
28
|
+
* encoding together. Changing any of them changes this string, and a verifier
|
|
29
|
+
* that does not recognize it refuses rather than guesses.
|
|
39
30
|
*/
|
|
40
31
|
spec: string;
|
|
41
32
|
/**
|
|
42
|
-
* Full proto name of the message `content` holds, e.g.
|
|
43
|
-
*
|
|
44
|
-
*
|
|
33
|
+
* Full proto name of the message `content` holds, e.g. "metacensus.v1.Prop".
|
|
34
|
+
* Read from the record, never inferred from the surrounding envelope: the
|
|
35
|
+
* envelope's schema may drift, the sealed name does not. Stops a signature
|
|
36
|
+
* over one type being replayed as another.
|
|
45
37
|
*/
|
|
46
38
|
contentType: string;
|
|
47
|
-
/** Excluded from its own digest by being emptied, not dropped. */
|
|
48
|
-
value: string;
|
|
49
39
|
}
|
|
50
40
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
41
|
+
* One signature in the chain, in one format for every layer. The participant
|
|
42
|
+
* signs with a passkey (WebAuthn); the institution countersigns headless
|
|
43
|
+
* (server/HSM). Both are the same object — a WebAuthn-shaped assertion whose
|
|
44
|
+
* challenge is the record's digest — so there is one decoder and one crypto
|
|
45
|
+
* primitive (ECDSA P-256 / ES256) the whole chain down. The only honest
|
|
46
|
+
* difference between the layers is the assertion's own metadata (`type`,
|
|
47
|
+
* `origin`, the user-verified flag), which each layer's acceptance policy
|
|
48
|
+
* checks; it is never a second code path. Not verified at the API edge — see
|
|
49
|
+
* README.md, "The signing chain".
|
|
53
50
|
*/
|
|
54
|
-
export
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
export interface Signature {
|
|
52
|
+
/**
|
|
53
|
+
* Selects the signer's enrolled key from persistence's key history; that
|
|
54
|
+
* enrolled key is the trust anchor. Deliberately not a key carried on the
|
|
55
|
+
* record: resolving against persistence is what stops a forged {content, key,
|
|
56
|
+
* signature} triple verifying against itself. The signer's id is not carried
|
|
57
|
+
* either — it is this key_id's resolved owner, persistence's to determine,
|
|
58
|
+
* never a client claim. The one exception is sign-up, where no key is
|
|
59
|
+
* enrolled yet; see auth.proto's SignUpRequest.
|
|
60
|
+
*/
|
|
61
|
+
keyId: string;
|
|
62
|
+
/**
|
|
63
|
+
* This signer's own time: a participant's claim, an institution's
|
|
64
|
+
* observation. Inside the digest, so it cannot be re-dated after the fact.
|
|
65
|
+
* Record ordering still uses the record-level `recorded`, never this — see
|
|
66
|
+
* `recorded` on the signed records.
|
|
67
|
+
*/
|
|
68
|
+
time?: string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* The WebAuthn assertion. Stored verbatim; the digest it commits to is
|
|
71
|
+
* recomputed from the record's own fields at verify time, never
|
|
72
|
+
* reverse-engineered from what is stored.
|
|
73
|
+
*/
|
|
74
|
+
assertion?: Signature_Assertion | undefined;
|
|
58
75
|
}
|
|
59
76
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* it is the store's, below the persistence seam; this contract only carries
|
|
65
|
-
* the shape so a later runtime needs no wire break. See README.md.
|
|
77
|
+
* What navigator.credentials.get() returns for a passkey, and what a headless
|
|
78
|
+
* signer emits in the identical shape. WebAuthn does not sign arbitrary bytes:
|
|
79
|
+
* it signs authenticator_data ‖ SHA-256(client_data_json), with the content
|
|
80
|
+
* digest carried inside client_data_json.challenge.
|
|
66
81
|
*/
|
|
67
|
-
export interface
|
|
68
|
-
/** The institution that countersigned. */
|
|
69
|
-
signerId: string;
|
|
82
|
+
export interface Signature_Assertion {
|
|
70
83
|
/**
|
|
71
|
-
* base64url
|
|
72
|
-
*
|
|
84
|
+
* base64url of authenticatorData: the rpId hash, and the UP/UV/BE/BS flags
|
|
85
|
+
* a verifier reads presence, user-verification and credential custody
|
|
86
|
+
* (synced vs device-bound) from. Signed over directly.
|
|
73
87
|
*/
|
|
74
|
-
|
|
75
|
-
/** Reuses UserSignature's closed algorithm vocabulary. */
|
|
76
|
-
alg: UserSignature_Alg;
|
|
88
|
+
authenticatorData: string;
|
|
77
89
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
90
|
+
* base64url of the UTF-8 clientDataJSON. Its `challenge` is this record's
|
|
91
|
+
* digest (base64url); its `type` and, for a passkey, `origin` are the
|
|
92
|
+
* honest per-layer metadata the acceptance policy checks. A headless signer
|
|
93
|
+
* uses an honest institutional `type` and no origin, and never forges a
|
|
94
|
+
* passkey's metadata — the flags and type are the custody signal a verifier
|
|
95
|
+
* reads.
|
|
80
96
|
*/
|
|
81
|
-
|
|
82
|
-
/** Versions the countersignature scheme, independently of UserSignature.spec. */
|
|
83
|
-
spec: string;
|
|
97
|
+
clientDataJson: string;
|
|
84
98
|
/**
|
|
85
|
-
* base64url
|
|
86
|
-
*
|
|
99
|
+
* base64url of the ECDSA signature over authenticator_data ‖
|
|
100
|
+
* SHA-256(client_data_json). DER (ASN.1 SEQUENCE), as WebAuthn emits — not
|
|
101
|
+
* the fixed-width r‖s the prior scheme carried.
|
|
87
102
|
*/
|
|
88
|
-
|
|
103
|
+
signature: string;
|
|
89
104
|
}
|
|
90
105
|
/**
|
|
91
106
|
* The part of a user record its owner signs. Lives here, not user.proto,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/metacensus/v1/common.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAE/C,oBAAoB;AAEpB,sEAAsE;AACtE,MAAM,WAAW,YAAY;IAC3B,eAAe;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/metacensus/v1/common.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAE/C,oBAAoB;AAEpB,sEAAsE;AACtE,MAAM,WAAW,YAAY;IAC3B,eAAe;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;;OAQG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,IAAI,CAAC,EACD,MAAM,GACN,SAAS,CAAC;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;CAC7C;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;;;;;OAOG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -5,14 +5,4 @@
|
|
|
5
5
|
// source: metacensus/v1/common.proto
|
|
6
6
|
/* eslint-disable */
|
|
7
7
|
export const protobufPackage = "metacensus.v1";
|
|
8
|
-
/**
|
|
9
|
-
* Closed vocabulary: an unrecognized value fails to decode rather than
|
|
10
|
-
* reaching a verifier. See README.md, "The signing chain", before adding one.
|
|
11
|
-
*/
|
|
12
|
-
export var UserSignature_Alg;
|
|
13
|
-
(function (UserSignature_Alg) {
|
|
14
|
-
UserSignature_Alg["Unspecified"] = "Unspecified";
|
|
15
|
-
/** Es384 - JOSE fixed-width r||s, never DER. */
|
|
16
|
-
UserSignature_Alg["Es384"] = "Es384";
|
|
17
|
-
})(UserSignature_Alg || (UserSignature_Alg = {}));
|
|
18
8
|
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/metacensus/v1/common.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,YAAY;AACZ,gCAAgC;AAChC,iCAAiC;AACjC,qCAAqC;AAErC,oBAAoB;AAEpB,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/metacensus/v1/common.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,YAAY;AACZ,gCAAgC;AAChC,iCAAiC;AACjC,qCAAqC;AAErC,oBAAoB;AAEpB,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Interpretation, Signature } from "./common.js";
|
|
2
2
|
export declare const protobufPackage = "metacensus.v1";
|
|
3
3
|
/** Propositions and votes: the consensus mechanism. */
|
|
4
4
|
/**
|
|
5
5
|
* A motion a topic's members vote on, as a signed record. `author_id` and
|
|
6
|
-
* `created` were removed:
|
|
7
|
-
*
|
|
6
|
+
* `created` were removed: the author is `user_signature.key_id`'s resolved
|
|
7
|
+
* owner, and the claimed time is `user_signature.time`.
|
|
8
8
|
*/
|
|
9
9
|
export interface PropSigned {
|
|
10
|
-
/** Minted by the server, outside
|
|
10
|
+
/** Minted by the server, outside every signature. */
|
|
11
11
|
id: string;
|
|
12
|
-
/**
|
|
13
|
-
* Server's observation; see UserSignature.signing_time for the author's
|
|
14
|
-
* claim.
|
|
15
|
-
*/
|
|
12
|
+
/** Server's observation; see Signature.time for the author's claim. */
|
|
16
13
|
recorded?: string | undefined;
|
|
17
14
|
content?: Prop | undefined;
|
|
18
|
-
|
|
15
|
+
/** How to read this record; sealed by both signatures below. */
|
|
16
|
+
interpretation?: Interpretation | undefined;
|
|
17
|
+
/** The participant vouches for `content`. */
|
|
18
|
+
userSignature?: Signature | undefined;
|
|
19
19
|
/**
|
|
20
|
-
* The institution
|
|
21
|
-
* UserSigned.
|
|
20
|
+
* The institution vouches for `user_signature` (it nests over it); see
|
|
21
|
+
* UserSigned and README.md, "The signing chain".
|
|
22
22
|
*/
|
|
23
|
-
institutionalSignature?:
|
|
23
|
+
institutionalSignature?: Signature | undefined;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* What a prop's author signs; carries `topic_id` but not the prop's own
|
|
@@ -50,20 +50,20 @@ export declare enum Prop_Type {
|
|
|
50
50
|
export interface VoteSigned {
|
|
51
51
|
/**
|
|
52
52
|
* Server's observation, and the only ordering a reader may use —
|
|
53
|
-
* `user_signature.
|
|
53
|
+
* `user_signature.time` is the voter's own claim.
|
|
54
54
|
*/
|
|
55
55
|
recorded?: string | undefined;
|
|
56
56
|
content?: Vote | undefined;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
institutionalSignature?:
|
|
57
|
+
/** How to read this record; sealed by both signatures below. */
|
|
58
|
+
interpretation?: Interpretation | undefined;
|
|
59
|
+
/** The participant vouches for `content`. */
|
|
60
|
+
userSignature?: Signature | undefined;
|
|
61
|
+
/** The institution vouches for `user_signature`; see UserSigned. */
|
|
62
|
+
institutionalSignature?: Signature | undefined;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* What a voter signs. `user_id` duplicates `user_signature.
|
|
66
|
-
*
|
|
65
|
+
* What a voter signs. `user_id` duplicates the author `user_signature.key_id`
|
|
66
|
+
* resolves to; persistence owes refusing the two when they disagree (see
|
|
67
67
|
* README.md, "Open questions").
|
|
68
68
|
*/
|
|
69
69
|
export interface Vote {
|
|
@@ -100,13 +100,15 @@ export interface PropGetRequest {
|
|
|
100
100
|
propId: string;
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
|
-
* No author field —
|
|
104
|
-
* by the path and re-signed inside `content`; the two must
|
|
103
|
+
* No author field — the author is `user_signature.key_id`'s resolved owner.
|
|
104
|
+
* `topic_id` is bound by the path and re-signed inside `content`; the two must
|
|
105
|
+
* agree. `interpretation` is the client's, re-stamped onto the stored record.
|
|
105
106
|
*/
|
|
106
107
|
export interface PropCreateRequest {
|
|
107
108
|
topicId: string;
|
|
108
109
|
content?: Prop | undefined;
|
|
109
|
-
|
|
110
|
+
interpretation?: Interpretation | undefined;
|
|
111
|
+
userSignature?: Signature | undefined;
|
|
110
112
|
}
|
|
111
113
|
export interface VoteListRequest {
|
|
112
114
|
topicId: string;
|
|
@@ -124,6 +126,7 @@ export interface VoteSetRequest {
|
|
|
124
126
|
topicId: string;
|
|
125
127
|
propId: string;
|
|
126
128
|
content?: Vote | undefined;
|
|
127
|
-
|
|
129
|
+
interpretation?: Interpretation | undefined;
|
|
130
|
+
userSignature?: Signature | undefined;
|
|
128
131
|
}
|
|
129
132
|
//# sourceMappingURL=prop.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop.d.ts","sourceRoot":"","sources":["../../../../src/metacensus/v1/prop.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"prop.d.ts","sourceRoot":"","sources":["../../../../src/metacensus/v1/prop.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7D,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAE/C,uDAAuD;AAEvD;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,qDAAqD;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EACJ,IAAI,GACJ,SAAS,CAAC;IACd,gEAAgE;IAChE,cAAc,CAAC,EACX,cAAc,GACd,SAAS,CAAC;IACd,6CAA6C;IAC7C,aAAa,CAAC,EACV,SAAS,GACT,SAAS,CAAC;IACd;;;OAGG;IACH,sBAAsB,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAChD;AAED;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,kDAAkD;AAClD,oBAAY,SAAS;IACnB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,aAAa,kBAAkB;IAC/B,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,uBAA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,SAAS,GAAG,SAAS,CAAC;CACvC;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,2CAA2C;AAC3C,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAC3B,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC5C,aAAa,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop.js","sourceRoot":"","sources":["../../../../src/metacensus/v1/prop.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,YAAY;AACZ,gCAAgC;AAChC,iCAAiC;AACjC,mCAAmC;AAKnC,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"prop.js","sourceRoot":"","sources":["../../../../src/metacensus/v1/prop.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,YAAY;AACZ,gCAAgC;AAChC,iCAAiC;AACjC,mCAAmC;AAKnC,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;AA2C/C,kDAAkD;AAClD,MAAM,CAAN,IAAY,SASX;AATD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,oCAAuB,CAAA;IACvB,4CAA+B,CAAA;IAC/B,wCAA2B,CAAA;IAC3B,oCAAuB,CAAA;IACvB,wCAA2B,CAAA;IAC3B,gEAAmD,CAAA;IACnD,kEAAqD,CAAA;AACvD,CAAC,EATW,SAAS,KAAT,SAAS,QASpB;AA6CD,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,4CAA2B,CAAA;IAC3B,4BAAW,CAAA;IACX,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;AACrB,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB"}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Interpretation, Signature } from "./common.js";
|
|
2
2
|
export declare const protobufPackage = "metacensus.v1";
|
|
3
3
|
/** Topics and their membership. */
|
|
4
4
|
/** A systematic review in progress, as a signed record. */
|
|
5
5
|
export interface TopicSigned {
|
|
6
|
-
/** Minted by the server, outside
|
|
6
|
+
/** Minted by the server, outside every signature. */
|
|
7
7
|
id: string;
|
|
8
|
-
/**
|
|
9
|
-
* Server's observation; see UserSignature.signing_time for the author's
|
|
10
|
-
* claim.
|
|
11
|
-
*/
|
|
8
|
+
/** Server's observation; see Signature.time for the author's claim. */
|
|
12
9
|
recorded?: string | undefined;
|
|
13
10
|
content?: Topic | undefined;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
institutionalSignature?:
|
|
11
|
+
/** How to read this record; sealed by both signatures below. */
|
|
12
|
+
interpretation?: Interpretation | undefined;
|
|
13
|
+
/** The participant vouches for `content`. */
|
|
14
|
+
userSignature?: Signature | undefined;
|
|
15
|
+
/** The institution vouches for `user_signature`; see UserSigned. */
|
|
16
|
+
institutionalSignature?: Signature | undefined;
|
|
20
17
|
}
|
|
21
18
|
/**
|
|
22
19
|
* What a topic's author signs; carries no id — the server mints the
|
|
@@ -36,7 +33,8 @@ export interface TopicGetRequest {
|
|
|
36
33
|
}
|
|
37
34
|
export interface TopicCreateRequest {
|
|
38
35
|
content?: Topic | undefined;
|
|
39
|
-
|
|
36
|
+
interpretation?: Interpretation | undefined;
|
|
37
|
+
userSignature?: Signature | undefined;
|
|
40
38
|
}
|
|
41
39
|
/**
|
|
42
40
|
* A user's membership of a topic. No backend implements the member routes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topic.d.ts","sourceRoot":"","sources":["../../../../src/metacensus/v1/topic.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"topic.d.ts","sourceRoot":"","sources":["../../../../src/metacensus/v1/topic.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7D,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAE/C,mCAAmC;AAEnC,2DAA2D;AAC3D,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EACJ,KAAK,GACL,SAAS,CAAC;IACd,gEAAgE;IAChE,cAAc,CAAC,EACX,cAAc,GACd,SAAS,CAAC;IACd,6CAA6C;IAC7C,aAAa,CAAC,EACV,SAAS,GACT,SAAS,CAAC;IACd,oEAAoE;IACpE,sBAAsB,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAChD;AAED;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;CAChC;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAC5B,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC5C,aAAa,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,gEAAgE;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Interpretation, Signature, User } from "./common.js";
|
|
2
2
|
export declare const protobufPackage = "metacensus.v1";
|
|
3
3
|
/** Users. Sign-up and login live in auth.proto. */
|
|
4
4
|
/**
|
|
5
|
-
* A signed record. Also the key directory:
|
|
6
|
-
*
|
|
5
|
+
* A signed record. Also the key directory: a user's enrolling key (carried on
|
|
6
|
+
* the SignUpRequest that created them) is how a verifier resolves a `key_id` to
|
|
7
|
+
* its trust anchor.
|
|
7
8
|
*/
|
|
8
9
|
export interface UserSigned {
|
|
9
|
-
/** Minted by the server, outside
|
|
10
|
+
/** Minted by the server, outside every signature. */
|
|
10
11
|
id: string;
|
|
11
|
-
/**
|
|
12
|
-
* Server's observation; see UserSignature.signing_time for the author's
|
|
13
|
-
* claim.
|
|
14
|
-
*/
|
|
12
|
+
/** Server's observation; see Signature.time for the author's claim. */
|
|
15
13
|
recorded?: string | undefined;
|
|
16
14
|
content?: User | undefined;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
institutionalSignature?:
|
|
15
|
+
/** How to read this record; sealed by both signatures below. */
|
|
16
|
+
interpretation?: Interpretation | undefined;
|
|
17
|
+
/** The participant vouches for `content`. */
|
|
18
|
+
userSignature?: Signature | undefined;
|
|
19
|
+
/** The institution vouches for `user_signature`; see the Signature type. */
|
|
20
|
+
institutionalSignature?: Signature | undefined;
|
|
23
21
|
}
|
|
24
22
|
export interface UserListRequest {
|
|
25
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/metacensus/v1/user.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/metacensus/v1/user.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnE,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAE/C,mDAAmD;AAEnD;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,qDAAqD;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EACJ,IAAI,GACJ,SAAS,CAAC;IACd,gEAAgE;IAChE,cAAc,CAAC,EACX,cAAc,GACd,SAAS,CAAC;IACd,6CAA6C;IAC7C,aAAa,CAAC,EACV,SAAS,GACT,SAAS,CAAC;IACd,4EAA4E;IAC5E,sBAAsB,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAChD;AAED,MAAM,WAAW,eAAe;CAC/B;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gDAAgD;AAChD,MAAM,WAAW,cAAc;CAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-manifest.d.ts","sourceRoot":"","sources":["../../src/route-manifest.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS,uBAAuB,CAAC;AAK9C,eAAO,MAAM,YAAY,uBAAuB,CAAC;AAMjD,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAA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public";
|
|
|
16
16
|
export const routes = [
|
|
17
17
|
{ prefix: apiPrefix, service: "AuthRoutes", rpc: "Login", method: "POST", path: "/login", params: [], query: [], body: "*", signed: false, request: "LoginRequest", response: "Session" },
|
|
18
18
|
{ prefix: apiPrefix, service: "AuthRoutes", rpc: "SignUp", method: "POST", path: "/signup", params: [], query: [], body: "*", signed: true, request: "SignUpRequest", response: "Session" },
|
|
19
|
-
{ prefix: apiPrefix, service: "AuthRoutes", rpc: "
|
|
19
|
+
{ prefix: apiPrefix, service: "AuthRoutes", rpc: "Refresh", method: "POST", path: "/refresh", params: [], query: [], body: "*", signed: false, request: "RefreshRequest", response: "Session" },
|
|
20
|
+
{ prefix: apiPrefix, service: "AuthRoutes", rpc: "Logout", method: "POST", path: "/logout", params: [], query: [], body: "*", signed: false, request: "LogoutRequest", response: "LogoutResponse" },
|
|
20
21
|
{ prefix: apiPrefix, service: "HealthRoutes", rpc: "Healthcheck", method: "GET", path: "/healthcheck", params: [], query: [], body: "", signed: false, request: "HealthcheckRequest", response: "HealthcheckResponse" },
|
|
21
22
|
{ prefix: apiPrefix, service: "PropRoutes", rpc: "ListProps", method: "GET", path: "/topic/{topicId}/prop", params: ["topicId"], query: [], body: "", signed: false, request: "PropListRequest", response: "PropList" },
|
|
22
23
|
{ prefix: apiPrefix, service: "PropRoutes", rpc: "GetProp", method: "GET", path: "/topic/{topicId}/prop/{propId}", params: ["topicId", "propId"], query: [], body: "", signed: false, request: "PropGetRequest", response: "PropSigned" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-manifest.js","sourceRoot":"","sources":["../../src/route-manifest.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAE3C,2EAA2E;AAC3E,uEAAuE;AACvE,gEAAgE;AAChE,EAAE;AACF,4DAA4D;AAC5D,0EAA0E;AAE1E,yFAAyF;AACzF,8EAA8E;AAC9E,4DAA4D;AAC5D,MAAM,CAAC,MAAM,SAAS,GAAG,oBAAoB,CAAC;AAE9C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EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE;IAC9M,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE;IAC7L,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,gBAAgB,EAAE;CAC9N,CAAC"}
|
package/dist/src/signing.d.ts
CHANGED
|
@@ -1,25 +1,84 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Interpretation, Signature, Signature_Assertion } from "./metacensus/v1/common.js";
|
|
2
|
+
type Bytes = Uint8Array<ArrayBuffer>;
|
|
3
|
+
export declare const SPEC = "metacensus.sig/2";
|
|
4
|
+
export declare const TYPE_GET = "webauthn.get";
|
|
5
|
+
export declare const TYPE_COUNTERSIGN = "metacensus.countersign";
|
|
6
|
+
export declare const FLAG_UP: number;
|
|
7
|
+
export declare const FLAG_UV: number;
|
|
8
|
+
export declare const FLAG_BE: number;
|
|
9
|
+
export declare const FLAG_BS: number;
|
|
3
10
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
11
|
+
* A value as RFC 8785 canonical JSON of a ts-proto message — shaped to match
|
|
12
|
+
* what protojson emits on the Go side (see buf.gen.yaml, wire.test.mjs).
|
|
6
13
|
*/
|
|
7
14
|
export declare function canonicalize(value: unknown): string;
|
|
15
|
+
/** An Interpretation for content of the given full proto name, under this SPEC. */
|
|
16
|
+
export declare function interpretation(contentType: string): Interpretation;
|
|
8
17
|
/**
|
|
9
|
-
* The exact string the digest is taken over
|
|
10
|
-
*
|
|
18
|
+
* The exact string the participant digest is taken over: {content,
|
|
19
|
+
* interpretation, keyId, time}. Exported so a mismatch between implementations
|
|
20
|
+
* shows up as two strings, not two hashes.
|
|
11
21
|
*/
|
|
12
|
-
export declare function
|
|
13
|
-
/**
|
|
14
|
-
export declare function
|
|
22
|
+
export declare function userSigningInput(content: unknown, interp: Interpretation, keyId: string, time: string): string;
|
|
23
|
+
/** The string the institutional digest is taken over: {signature, interpretation, keyId, time}. */
|
|
24
|
+
export declare function countersignInput(userSignature: Signature, interp: Interpretation, keyId: string, time: string): string;
|
|
25
|
+
/** SHA-256 over userSigningInput — the participant assertion's challenge. */
|
|
26
|
+
export declare function userChallenge(content: unknown, interp: Interpretation, keyId: string, time: string): Promise<Bytes>;
|
|
27
|
+
/** SHA-256 over countersignInput — the institutional assertion's challenge. */
|
|
28
|
+
export declare function countersignChallenge(userSignature: Signature, interp: Interpretation, keyId: string, time: string): Promise<Bytes>;
|
|
29
|
+
/** The clientDataJSON fields a headless signer sets; a passkey's carries more. */
|
|
30
|
+
export interface ClientData {
|
|
31
|
+
type: string;
|
|
32
|
+
origin?: string;
|
|
33
|
+
}
|
|
15
34
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* already inside the digest.
|
|
35
|
+
* authenticatorData for a headless signer: SHA-256(rpId) ‖ flags ‖ signCount(0).
|
|
36
|
+
* A participant's comes from the authenticator with the real UV/BE/BS flags.
|
|
19
37
|
*/
|
|
20
|
-
export declare function
|
|
21
|
-
/**
|
|
22
|
-
|
|
38
|
+
export declare function authenticatorData(rpId: string, flags: number): Promise<Bytes>;
|
|
39
|
+
/**
|
|
40
|
+
* Builds the assertion a headless signer emits: fills the challenge, serialises
|
|
41
|
+
* clientDataJSON, and signs authenticatorData ‖ SHA-256(clientDataJSON) with
|
|
42
|
+
* privateKey, DER-encoded as WebAuthn does. authData carries the honest flags
|
|
43
|
+
* (see authenticatorData). For a participant, the browser produces all of this
|
|
44
|
+
* and this module only verifies it.
|
|
45
|
+
*/
|
|
46
|
+
export declare function assert(privateKey: CryptoKey, challenge: Bytes, authData: Bytes, clientData: ClientData): Promise<Signature_Assertion>;
|
|
47
|
+
/**
|
|
48
|
+
* What a verifier requires of an assertion's own metadata — the one honest
|
|
49
|
+
* difference between the layers, and a check here rather than a second verify
|
|
50
|
+
* path. `type` is the required clientDataJSON.type; `origins`, when non-empty,
|
|
51
|
+
* is the closed set a participant assertion must name, and when empty requires
|
|
52
|
+
* no origin (a headless signer); `requireUV` demands the user-verified flag.
|
|
53
|
+
*/
|
|
54
|
+
export interface Policy {
|
|
55
|
+
type: string;
|
|
56
|
+
origins: string[];
|
|
57
|
+
requireUV: boolean;
|
|
58
|
+
}
|
|
59
|
+
/** Accepts a passkey assertion: webauthn.get from a known origin, user-verified. */
|
|
60
|
+
export declare function participantPolicy(...origins: string[]): Policy;
|
|
61
|
+
/** Accepts the headless countersignature: the institutional type, no origin. */
|
|
62
|
+
export declare function institutionPolicy(): Policy;
|
|
63
|
+
/**
|
|
64
|
+
* Checks one assertion against a challenge under publicKey and policy: the
|
|
65
|
+
* challenge binding, then the assertion's own metadata, then the signature over
|
|
66
|
+
* the wrapper. clientDataJSON is hashed as stored and only parsed to read
|
|
67
|
+
* `challenge`/`type`; it is never re-serialised.
|
|
68
|
+
*/
|
|
69
|
+
export declare function verifyAssertion(publicKey: CryptoKey, assertion: Signature_Assertion, challenge: Bytes, policy: Policy): Promise<boolean>;
|
|
70
|
+
/**
|
|
71
|
+
* Checks a participant signature over content: the interpretation is this
|
|
72
|
+
* scheme's and names content's type, the assertion binds to the record's
|
|
73
|
+
* digest, and it satisfies policy. Resolving publicKey — the enrolled key keyId
|
|
74
|
+
* names — is the caller's, except at sign-up (see enrolledKey).
|
|
75
|
+
*/
|
|
76
|
+
export declare function verifyUser(publicKey: CryptoKey, content: unknown, interp: Interpretation, signature: Signature, policy: Policy): Promise<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* Checks an institutional signature nesting over userSignature: it binds to
|
|
79
|
+
* userSignature (plus the record's interpretation) and satisfies policy.
|
|
80
|
+
*/
|
|
81
|
+
export declare function verifyCountersign(publicKey: CryptoKey, userSignature: Signature, interp: Interpretation, institutional: Signature, policy: Policy): Promise<boolean>;
|
|
23
82
|
/** Generates a signing keypair. The private key is non-extractable. */
|
|
24
83
|
export declare function generateKeyPair(): Promise<CryptoKeyPair>;
|
|
25
84
|
/**
|
|
@@ -30,8 +89,16 @@ export declare function encodePublicKey(publicKey: CryptoKey): Promise<string>;
|
|
|
30
89
|
/** Reads what `encodePublicKey` wrote. */
|
|
31
90
|
export declare function decodePublicKey(encoded: string): Promise<CryptoKey>;
|
|
32
91
|
/**
|
|
33
|
-
* base64url of SHA-256 over the SPKI DER — `
|
|
34
|
-
*
|
|
92
|
+
* base64url of SHA-256 over the SPKI DER — `Signature.keyId`. Derived rather
|
|
93
|
+
* than minted, so a client can compute it before it has an account.
|
|
35
94
|
*/
|
|
36
95
|
export declare function keyId(publicKey: CryptoKey): Promise<string>;
|
|
96
|
+
/**
|
|
97
|
+
* Resolves the key being enrolled at sign-up, the one write whose key is not
|
|
98
|
+
* yet in persistence: the key offered must thumbprint to the keyId claimed, or
|
|
99
|
+
* a key that is not the sender's could be enrolled under their account. Every
|
|
100
|
+
* other record resolves keyId against its owner's enrolled key.
|
|
101
|
+
*/
|
|
102
|
+
export declare function enrolledKey(publicKey: string, claimedKeyId: string): Promise<CryptoKey>;
|
|
103
|
+
export {};
|
|
37
104
|
//# sourceMappingURL=signing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signing.d.ts","sourceRoot":"","sources":["../../src/signing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"signing.d.ts","sourceRoot":"","sources":["../../src/signing.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIhG,KAAK,KAAK,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;AAIrC,eAAO,MAAM,IAAI,qBAAqB,CAAC;AAIvC,eAAO,MAAM,QAAQ,iBAAiB,CAAC;AACvC,eAAO,MAAM,gBAAgB,2BAA2B,CAAC;AAIzD,eAAO,MAAM,OAAO,QAAS,CAAC;AAC9B,eAAO,MAAM,OAAO,QAAS,CAAC;AAC9B,eAAO,MAAM,OAAO,QAAS,CAAC;AAC9B,eAAO,MAAM,OAAO,QAAS,CAAC;AAc9B;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAyBnD;AAoDD,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,CAElE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,MAAM,CAER;AAED,mGAAmG;AACnG,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,SAAS,EACxB,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,MAAM,CAER;AAiBD,6EAA6E;AAC7E,wBAAsB,aAAa,CACjC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,CAAC,CAEhB;AAED,+EAA+E;AAC/E,wBAAsB,oBAAoB,CACxC,aAAa,EAAE,SAAS,EACxB,MAAM,EAAE,cAAc,EACtB,KAA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