@metacensus/api 0.2.0 → 0.4.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 +158 -73
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/public.d.ts +1 -1
- package/dist/public.d.ts.map +1 -1
- package/dist/public.js +2 -2
- package/dist/public.js.map +1 -1
- 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 +57 -38
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +146 -79
- package/dist/src/client.js.map +1 -1
- package/dist/src/metacensus/v1/auth.d.ts +52 -8
- package/dist/src/metacensus/v1/auth.d.ts.map +1 -1
- package/dist/src/metacensus/v1/common.d.ts +77 -31
- 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 +44 -31
- package/dist/src/metacensus/v1/prop.d.ts.map +1 -1
- package/dist/src/metacensus/v1/prop.js +18 -18
- package/dist/src/metacensus/v1/prop.js.map +1 -1
- package/dist/src/metacensus/v1/topic.d.ts +16 -13
- package/dist/src/metacensus/v1/topic.d.ts.map +1 -1
- package/dist/src/metacensus/v1/user.d.ts +15 -12
- 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 +9 -8
- 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 +254 -68
- package/dist/src/signing.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,34 +1,39 @@
|
|
|
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
|
-
export interface
|
|
10
|
-
/** Minted by the server, outside
|
|
9
|
+
export interface PropSigned {
|
|
10
|
+
/** Minted by the server, outside every signature. */
|
|
11
11
|
id: string;
|
|
12
|
+
/** Server's observation; see Signature.time for the author's claim. */
|
|
13
|
+
recorded?: string | undefined;
|
|
14
|
+
content?: Prop | undefined;
|
|
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;
|
|
12
19
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
20
|
+
* The institution vouches for `user_signature` (it nests over it); see
|
|
21
|
+
* UserSigned and README.md, "The signing chain".
|
|
15
22
|
*/
|
|
16
|
-
|
|
17
|
-
content?: PropContent | undefined;
|
|
18
|
-
userSignature?: UserSignature | undefined;
|
|
23
|
+
institutionalSignature?: Signature | undefined;
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
21
26
|
* What a prop's author signs; carries `topic_id` but not the prop's own
|
|
22
27
|
* server-minted id.
|
|
23
28
|
*/
|
|
24
|
-
export interface
|
|
29
|
+
export interface Prop {
|
|
25
30
|
topicId: string;
|
|
26
|
-
type:
|
|
27
|
-
/** The text `
|
|
31
|
+
type: Prop_Type;
|
|
32
|
+
/** The text `Vote.citations` indexes into. */
|
|
28
33
|
description: string;
|
|
29
34
|
}
|
|
30
35
|
/** What the proposition would do if it passed. */
|
|
31
|
-
export declare enum
|
|
36
|
+
export declare enum Prop_Type {
|
|
32
37
|
Unspecified = "Unspecified",
|
|
33
38
|
Statement = "Statement",
|
|
34
39
|
TopicQuestion = "TopicQuestion",
|
|
@@ -42,25 +47,30 @@ export declare enum PropContent_Type {
|
|
|
42
47
|
* One member's position on one prop, keyed by `(propId, userId)`; a second
|
|
43
48
|
* vote from the same user replaces the first rather than adding to it.
|
|
44
49
|
*/
|
|
45
|
-
export interface
|
|
50
|
+
export interface VoteSigned {
|
|
46
51
|
/**
|
|
47
52
|
* Server's observation, and the only ordering a reader may use —
|
|
48
|
-
* `user_signature.
|
|
53
|
+
* `user_signature.time` is the voter's own claim.
|
|
49
54
|
*/
|
|
50
55
|
recorded?: string | undefined;
|
|
51
|
-
content?:
|
|
52
|
-
|
|
56
|
+
content?: Vote | undefined;
|
|
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;
|
|
53
63
|
}
|
|
54
64
|
/**
|
|
55
|
-
* What a voter signs. `user_id` duplicates `user_signature.
|
|
56
|
-
*
|
|
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
|
|
57
67
|
* README.md, "Open questions").
|
|
58
68
|
*/
|
|
59
|
-
export interface
|
|
69
|
+
export interface Vote {
|
|
60
70
|
topicId: string;
|
|
61
71
|
propId: string;
|
|
62
72
|
userId: string;
|
|
63
|
-
position:
|
|
73
|
+
position: Vote_Position;
|
|
64
74
|
explanation: string;
|
|
65
75
|
/**
|
|
66
76
|
* Highlighted spans of the prop's `description`; meaningful only for
|
|
@@ -68,7 +78,7 @@ export interface VoteContent {
|
|
|
68
78
|
*/
|
|
69
79
|
citations: PropCitation[];
|
|
70
80
|
}
|
|
71
|
-
export declare enum
|
|
81
|
+
export declare enum Vote_Position {
|
|
72
82
|
Unspecified = "Unspecified",
|
|
73
83
|
For = "For",
|
|
74
84
|
Against = "Against",
|
|
@@ -83,20 +93,22 @@ export interface PropListRequest {
|
|
|
83
93
|
topicId: string;
|
|
84
94
|
}
|
|
85
95
|
export interface PropList {
|
|
86
|
-
items:
|
|
96
|
+
items: PropSigned[];
|
|
87
97
|
}
|
|
88
98
|
export interface PropGetRequest {
|
|
89
99
|
topicId: string;
|
|
90
100
|
propId: string;
|
|
91
101
|
}
|
|
92
102
|
/**
|
|
93
|
-
* No author field —
|
|
94
|
-
* 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.
|
|
95
106
|
*/
|
|
96
107
|
export interface PropCreateRequest {
|
|
97
108
|
topicId: string;
|
|
98
|
-
content?:
|
|
99
|
-
|
|
109
|
+
content?: Prop | undefined;
|
|
110
|
+
interpretation?: Interpretation | undefined;
|
|
111
|
+
userSignature?: Signature | undefined;
|
|
100
112
|
}
|
|
101
113
|
export interface VoteListRequest {
|
|
102
114
|
topicId: string;
|
|
@@ -104,7 +116,7 @@ export interface VoteListRequest {
|
|
|
104
116
|
}
|
|
105
117
|
/** The only way to read a prop's votes. */
|
|
106
118
|
export interface VoteList {
|
|
107
|
-
items:
|
|
119
|
+
items: VoteSigned[];
|
|
108
120
|
}
|
|
109
121
|
/**
|
|
110
122
|
* Replaces the caller's previous vote rather than creating a new one; both
|
|
@@ -113,7 +125,8 @@ export interface VoteList {
|
|
|
113
125
|
export interface VoteSetRequest {
|
|
114
126
|
topicId: string;
|
|
115
127
|
propId: string;
|
|
116
|
-
content?:
|
|
117
|
-
|
|
128
|
+
content?: Vote | undefined;
|
|
129
|
+
interpretation?: Interpretation | undefined;
|
|
130
|
+
userSignature?: Signature | undefined;
|
|
118
131
|
}
|
|
119
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,uBAAuB,4BAA4B;IACnD,wBAAwB,6BAA6B;CACtD;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EACJ,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B,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"}
|
|
@@ -5,22 +5,22 @@
|
|
|
5
5
|
// source: metacensus/v1/prop.proto
|
|
6
6
|
export const protobufPackage = "metacensus.v1";
|
|
7
7
|
/** What the proposition would do if it passed. */
|
|
8
|
-
export var
|
|
9
|
-
(function (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
})(
|
|
19
|
-
export var
|
|
20
|
-
(function (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})(
|
|
8
|
+
export var Prop_Type;
|
|
9
|
+
(function (Prop_Type) {
|
|
10
|
+
Prop_Type["Unspecified"] = "Unspecified";
|
|
11
|
+
Prop_Type["Statement"] = "Statement";
|
|
12
|
+
Prop_Type["TopicQuestion"] = "TopicQuestion";
|
|
13
|
+
Prop_Type["TopicChange"] = "TopicChange";
|
|
14
|
+
Prop_Type["UserAdmit"] = "UserAdmit";
|
|
15
|
+
Prop_Type["UserExpulse"] = "UserExpulse";
|
|
16
|
+
Prop_Type["PaperExtractionComplete"] = "PaperExtractionComplete";
|
|
17
|
+
Prop_Type["PaperIncludeMetaAnalysis"] = "PaperIncludeMetaAnalysis";
|
|
18
|
+
})(Prop_Type || (Prop_Type = {}));
|
|
19
|
+
export var Vote_Position;
|
|
20
|
+
(function (Vote_Position) {
|
|
21
|
+
Vote_Position["Unspecified"] = "Unspecified";
|
|
22
|
+
Vote_Position["For"] = "For";
|
|
23
|
+
Vote_Position["Against"] = "Against";
|
|
24
|
+
Vote_Position["Abstain"] = "Abstain";
|
|
25
|
+
})(Vote_Position || (Vote_Position = {}));
|
|
26
26
|
//# sourceMappingURL=prop.js.map
|
|
@@ -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,37 +1,40 @@
|
|
|
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
|
-
export interface
|
|
6
|
-
/** Minted by the server, outside
|
|
5
|
+
export interface TopicSigned {
|
|
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
|
-
content?:
|
|
14
|
-
|
|
10
|
+
content?: Topic | undefined;
|
|
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;
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
19
|
* What a topic's author signs; carries no id — the server mints the
|
|
18
20
|
* topic's key.
|
|
19
21
|
*/
|
|
20
|
-
export interface
|
|
22
|
+
export interface Topic {
|
|
21
23
|
name: string;
|
|
22
24
|
description: string;
|
|
23
25
|
}
|
|
24
26
|
export interface TopicListRequest {
|
|
25
27
|
}
|
|
26
28
|
export interface TopicList {
|
|
27
|
-
items:
|
|
29
|
+
items: TopicSigned[];
|
|
28
30
|
}
|
|
29
31
|
export interface TopicGetRequest {
|
|
30
32
|
topicId: string;
|
|
31
33
|
}
|
|
32
34
|
export interface TopicCreateRequest {
|
|
33
|
-
content?:
|
|
34
|
-
|
|
35
|
+
content?: Topic | undefined;
|
|
36
|
+
interpretation?: Interpretation | undefined;
|
|
37
|
+
userSignature?: Signature | undefined;
|
|
35
38
|
}
|
|
36
39
|
/**
|
|
37
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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B,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,28 @@
|
|
|
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
|
-
export interface
|
|
9
|
-
/** Minted by the server, outside
|
|
9
|
+
export interface UserSigned {
|
|
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
|
-
content?:
|
|
17
|
-
|
|
14
|
+
content?: User | undefined;
|
|
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;
|
|
18
21
|
}
|
|
19
22
|
export interface UserListRequest {
|
|
20
23
|
}
|
|
21
24
|
export interface UserList {
|
|
22
|
-
items:
|
|
25
|
+
items: UserSigned[];
|
|
23
26
|
}
|
|
24
27
|
export interface UserGetRequest {
|
|
25
28
|
userId: string;
|
|
@@ -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,EAAE,MAAM,CAA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
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
|
-
{ prefix: apiPrefix, service: "PropRoutes", rpc: "GetProp", method: "GET", path: "/topic/{topicId}/prop/{propId}", params: ["topicId", "propId"], query: [], body: "", signed: false, request: "PropGetRequest", response: "
|
|
23
|
-
{ prefix: apiPrefix, service: "PropRoutes", rpc: "CreateProp", method: "POST", path: "/topic/{topicId}/prop", params: ["topicId"], query: [], body: "*", signed: true, request: "PropCreateRequest", response: "
|
|
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" },
|
|
24
|
+
{ prefix: apiPrefix, service: "PropRoutes", rpc: "CreateProp", method: "POST", path: "/topic/{topicId}/prop", params: ["topicId"], query: [], body: "*", signed: true, request: "PropCreateRequest", response: "PropSigned" },
|
|
24
25
|
{ prefix: apiPrefix, service: "PropRoutes", rpc: "ListVotes", method: "GET", path: "/topic/{topicId}/prop/{propId}/vote", params: ["topicId", "propId"], query: [], body: "", signed: false, request: "VoteListRequest", response: "VoteList" },
|
|
25
|
-
{ prefix: apiPrefix, service: "PropRoutes", rpc: "SetVote", method: "POST", path: "/topic/{topicId}/prop/{propId}/vote", params: ["topicId", "propId"], query: [], body: "*", signed: true, request: "VoteSetRequest", response: "
|
|
26
|
+
{ prefix: apiPrefix, service: "PropRoutes", rpc: "SetVote", method: "POST", path: "/topic/{topicId}/prop/{propId}/vote", params: ["topicId", "propId"], query: [], body: "*", signed: true, request: "VoteSetRequest", response: "VoteSigned" },
|
|
26
27
|
{ prefix: apiPrefix, service: "TopicRoutes", rpc: "ListTopics", method: "GET", path: "/topic", params: [], query: [], body: "", signed: false, request: "TopicListRequest", response: "TopicList" },
|
|
27
|
-
{ prefix: apiPrefix, service: "TopicRoutes", rpc: "GetTopic", method: "GET", path: "/topic/{topicId}", params: ["topicId"], query: [], body: "", signed: false, request: "TopicGetRequest", response: "
|
|
28
|
-
{ prefix: apiPrefix, service: "TopicRoutes", rpc: "CreateTopic", method: "POST", path: "/topic", params: [], query: [], body: "*", signed: true, request: "TopicCreateRequest", response: "
|
|
28
|
+
{ prefix: apiPrefix, service: "TopicRoutes", rpc: "GetTopic", method: "GET", path: "/topic/{topicId}", params: ["topicId"], query: [], body: "", signed: false, request: "TopicGetRequest", response: "TopicSigned" },
|
|
29
|
+
{ prefix: apiPrefix, service: "TopicRoutes", rpc: "CreateTopic", method: "POST", path: "/topic", params: [], query: [], body: "*", signed: true, request: "TopicCreateRequest", response: "TopicSigned" },
|
|
29
30
|
{ prefix: apiPrefix, service: "TopicRoutes", rpc: "ListMembers", method: "GET", path: "/topic/{topicId}/member", params: ["topicId"], query: [], body: "", signed: false, request: "MemberListRequest", response: "MemberList" },
|
|
30
31
|
{ prefix: apiPrefix, service: "TopicRoutes", rpc: "GetMember", method: "GET", path: "/topic/{topicId}/member/{userId}", params: ["topicId", "userId"], query: [], body: "", signed: false, request: "MemberGetRequest", response: "Member" },
|
|
31
32
|
{ prefix: apiPrefix, service: "UserRoutes", rpc: "ListUsers", method: "GET", path: "/user", params: [], query: [], body: "", signed: false, request: "UserListRequest", response: "UserList" },
|
|
32
|
-
{ prefix: apiPrefix, service: "UserRoutes", rpc: "GetUser", method: "GET", path: "/user/{userId}", params: ["userId"], query: [], body: "", signed: false, request: "UserGetRequest", response: "
|
|
33
|
-
{ prefix: apiPrefix, service: "UserRoutes", rpc: "GetSelf", method: "GET", path: "/self", params: [], query: [], body: "", signed: false, request: "SelfGetRequest", response: "
|
|
33
|
+
{ prefix: apiPrefix, service: "UserRoutes", rpc: "GetUser", method: "GET", path: "/user/{userId}", params: ["userId"], query: [], body: "", signed: false, request: "UserGetRequest", response: "UserSigned" },
|
|
34
|
+
{ prefix: apiPrefix, service: "UserRoutes", rpc: "GetSelf", method: "GET", path: "/self", params: [], query: [], body: "", signed: false, request: "SelfGetRequest", response: "UserSigned" },
|
|
34
35
|
{ prefix: publicPrefix, service: "PartnerRoutes", rpc: "SubmitPartnerInterest", method: "POST", path: "/partner", params: [], query: [], body: "*", signed: false, request: "PartnerSubmission", response: "PartnerReceipt" },
|
|
35
36
|
];
|
|
36
37
|
//# sourceMappingURL=route-manifest.js.map
|
|
@@ -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,8GAA8G;AAC9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AE,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"],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