@libid/contracts 0.17.0 → 0.18.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 +108 -47
- package/dist/abis/bindErrors.d.ts +714 -0
- package/dist/abis/bindErrors.d.ts.map +1 -0
- package/dist/abis/bindErrors.js +955 -0
- package/dist/abis/bindErrors.js.map +1 -0
- package/dist/abis/ceremonyPayloads.d.ts +118 -0
- package/dist/abis/ceremonyPayloads.d.ts.map +1 -0
- package/dist/abis/ceremonyPayloads.js +154 -0
- package/dist/abis/ceremonyPayloads.js.map +1 -0
- package/dist/abis/ceremonyProofVerifier.d.ts +6 -6
- package/dist/abis/ceremonyProofVerifier.js +6 -6
- package/dist/abis/ceremonyProofVerifier.js.map +1 -1
- package/dist/abis/handleEscrow.d.ts +56 -16
- package/dist/abis/handleEscrow.d.ts.map +1 -1
- package/dist/abis/handleEscrow.js +71 -19
- package/dist/abis/handleEscrow.js.map +1 -1
- package/dist/abis/honkVerifierErrors.d.ts +54 -0
- package/dist/abis/honkVerifierErrors.d.ts.map +1 -0
- package/dist/abis/honkVerifierErrors.js +71 -0
- package/dist/abis/honkVerifierErrors.js.map +1 -0
- package/dist/abis/identityRegistry.d.ts +123 -157
- package/dist/abis/identityRegistry.d.ts.map +1 -1
- package/dist/abis/identityRegistry.js +150 -194
- package/dist/abis/identityRegistry.js.map +1 -1
- package/dist/abis/index.d.ts +3 -0
- package/dist/abis/index.d.ts.map +1 -1
- package/dist/abis/index.js +3 -0
- package/dist/abis/index.js.map +1 -1
- package/dist/calls/handleEscrow.d.ts +1 -0
- package/dist/calls/handleEscrow.d.ts.map +1 -1
- package/dist/calls/handleEscrow.js +7 -0
- package/dist/calls/handleEscrow.js.map +1 -1
- package/dist/calls/identityRegistry.d.ts +2 -1
- package/dist/calls/identityRegistry.d.ts.map +1 -1
- package/dist/calls/identityRegistry.js +9 -2
- package/dist/calls/identityRegistry.js.map +1 -1
- package/dist/ceremony/profiles.d.ts +38 -48
- package/dist/ceremony/profiles.d.ts.map +1 -1
- package/dist/ceremony/profiles.js +31 -36
- package/dist/ceremony/profiles.js.map +1 -1
- package/dist/identity/index.d.ts +1 -2
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +5 -10
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/node.d.ts +3 -3
- package/dist/identity/node.d.ts.map +1 -1
- package/dist/identity/node.js +25 -16
- package/dist/identity/node.js.map +1 -1
- package/dist/identity/resolve.d.ts +6 -8
- package/dist/identity/resolve.d.ts.map +1 -1
- package/dist/identity/resolve.js +54 -86
- package/dist/identity/resolve.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/payloads.d.ts +124 -0
- package/dist/payloads.d.ts.map +1 -0
- package/dist/payloads.js +59 -0
- package/dist/payloads.js.map +1 -0
- package/dist/platforms/handle.d.ts +11 -0
- package/dist/platforms/handle.d.ts.map +1 -0
- package/dist/platforms/handle.js +29 -0
- package/dist/platforms/handle.js.map +1 -0
- package/dist/platforms/id.d.ts +8 -0
- package/dist/platforms/id.d.ts.map +1 -0
- package/dist/platforms/id.js +21 -0
- package/dist/platforms/id.js.map +1 -0
- package/dist/platforms/index.d.ts +4 -0
- package/dist/platforms/index.d.ts.map +1 -0
- package/dist/platforms/index.js +7 -0
- package/dist/platforms/index.js.map +1 -0
- package/dist/platforms/platforms.d.ts +39 -0
- package/dist/platforms/platforms.d.ts.map +1 -0
- package/dist/platforms/platforms.js +90 -0
- package/dist/platforms/platforms.js.map +1 -0
- package/package.json +8 -3
- package/src/abis/bindErrors.ts +957 -0
- package/src/abis/ceremonyPayloads.ts +156 -0
- package/src/abis/ceremonyProofVerifier.ts +6 -6
- package/src/abis/handleEscrow.ts +71 -19
- package/src/abis/honkVerifierErrors.ts +73 -0
- package/src/abis/identityRegistry.ts +150 -194
- package/src/abis/index.ts +3 -0
- package/src/calls/handleEscrow.ts +12 -0
- package/src/calls/identityRegistry.ts +14 -2
- package/src/ceremony/profiles.ts +53 -65
- package/src/identity/index.ts +5 -10
- package/src/identity/node.ts +25 -21
- package/src/identity/resolve.ts +72 -118
- package/src/index.ts +3 -4
- package/src/payloads.ts +90 -0
- package/src/platforms/handle.ts +36 -0
- package/src/platforms/id.ts +26 -0
- package/src/platforms/index.ts +7 -0
- package/src/platforms/platforms.ts +114 -0
- package/dist/identity/handle.d.ts +0 -22
- package/dist/identity/handle.d.ts.map +0 -1
- package/dist/identity/handle.js +0 -140
- package/dist/identity/handle.js.map +0 -1
- package/dist/identity/handleVectors.d.ts +0 -50
- package/dist/identity/handleVectors.d.ts.map +0 -1
- package/dist/identity/handleVectors.js +0 -89
- package/dist/identity/handleVectors.js.map +0 -1
- package/src/identity/handle.ts +0 -176
- package/src/identity/handleVectors.ts +0 -104
|
@@ -6,8 +6,9 @@ type IdentityRegistryFn = ContractFunctionName<typeof identityRegistryAbi, Mutab
|
|
|
6
6
|
type IdentityRegistryArgs<F extends IdentityRegistryFn> = ContractFunctionArgs<typeof identityRegistryAbi, Mutability, F>;
|
|
7
7
|
export declare function acceptOwnership(to: Address, ...args: IdentityRegistryArgs<'acceptOwnership'>): Call;
|
|
8
8
|
export declare function bind(to: Address, value: bigint, ...args: IdentityRegistryArgs<'bind'>): Call;
|
|
9
|
+
export declare function bindPrivately(to: Address, value: bigint, ...args: IdentityRegistryArgs<'bindPrivately'>): Call;
|
|
9
10
|
export declare function initialize(to: Address, ...args: IdentityRegistryArgs<'initialize'>): Call;
|
|
10
|
-
export declare function
|
|
11
|
+
export declare function publish(to: Address, ...args: IdentityRegistryArgs<'publish'>): Call;
|
|
11
12
|
export declare function setProofVerifier(to: Address, ...args: IdentityRegistryArgs<'setProofVerifier'>): Call;
|
|
12
13
|
export declare function transferOwnership(to: Address, ...args: IdentityRegistryArgs<'transferOwnership'>): Call;
|
|
13
14
|
export declare function unpublish(to: Address, ...args: IdentityRegistryArgs<'unpublish'>): Call;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identityRegistry.d.ts","sourceRoot":"","sources":["../../src/calls/identityRegistry.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAE1B,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,KAAK,UAAU,GAAG,YAAY,GAAG,SAAS,CAAA;AAC1C,KAAK,kBAAkB,GAAG,oBAAoB,CAAC,OAAO,mBAAmB,EAAE,UAAU,CAAC,CAAA;AACtF,KAAK,oBAAoB,CAAC,CAAC,SAAS,kBAAkB,IAAI,oBAAoB,CAC5E,OAAO,mBAAmB,EAC1B,UAAU,EACV,CAAC,CACF,CAAA;AAED,wBAAgB,eAAe,CAC7B,EAAE,EAAE,OAAO,EACX,GAAG,IAAI,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,GAC/C,IAAI,CAKN;AAED,wBAAgB,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC,GAAG,IAAI,CAM5F;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,oBAAoB,CAAC,YAAY,CAAC,GAAG,IAAI,CAKzF;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"identityRegistry.d.ts","sourceRoot":"","sources":["../../src/calls/identityRegistry.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAE1B,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM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AAgB,gBAAgB,CAC9B,EAAE,EAAE,OAAO,EACX,KAAK,EAAE,MAAM,EACb,GAAG,IAAI,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,GAChD,IAAI,CAMN"}
|
|
@@ -15,16 +15,23 @@ export function bind(to, value, ...args) {
|
|
|
15
15
|
data: encodeFunctionData({ abi: identityRegistryAbi, functionName: 'bind', args }),
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
+
export function bindPrivately(to, value, ...args) {
|
|
19
|
+
return {
|
|
20
|
+
to,
|
|
21
|
+
value,
|
|
22
|
+
data: encodeFunctionData({ abi: identityRegistryAbi, functionName: 'bindPrivately', args }),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
18
25
|
export function initialize(to, ...args) {
|
|
19
26
|
return {
|
|
20
27
|
to,
|
|
21
28
|
data: encodeFunctionData({ abi: identityRegistryAbi, functionName: 'initialize', args }),
|
|
22
29
|
};
|
|
23
30
|
}
|
|
24
|
-
export function
|
|
31
|
+
export function publish(to, ...args) {
|
|
25
32
|
return {
|
|
26
33
|
to,
|
|
27
|
-
data: encodeFunctionData({ abi: identityRegistryAbi, functionName: '
|
|
34
|
+
data: encodeFunctionData({ abi: identityRegistryAbi, functionName: 'publish', args }),
|
|
28
35
|
};
|
|
29
36
|
}
|
|
30
37
|
export function setProofVerifier(to, ...args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identityRegistry.js","sourceRoot":"","sources":["../../src/calls/identityRegistry.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,2EAA2E;AAE3E,OAAO,EAIL,kBAAkB,GACnB,MAAM,MAAM,CAAA;AAGb,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAUjE,MAAM,UAAU,eAAe,CAC7B,EAAW,EACX,GAAG,IAA6C;IAEhD,OAAO;QACL,EAAE;QACF,IAAI,EAAE,kBAAkB,CAAC,EAAE,GAAG,EAAE,mBAAmB,EAAE,YAAY,EAAE,iBA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CAC9B,EAAW,EACX,KAAa,EACb,GAAG,IAA8C;IAEjD,OAAO;QACL,EAAE;QACF,KAAK;QACL,IAAI,EAAE,kBAAkB,CAAC,EAAE,GAAG,EAAE,mBAAmB,EAAE,YAAY,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;KAC/F,CAAA;AACH,CAAC"}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
3
|
-
* TypeScript constants
|
|
4
|
-
*
|
|
5
|
-
* written and READ these constants; only the values live here.
|
|
2
|
+
* The ceremony profiles. scripts/regen-ceremony-profiles.py generates
|
|
3
|
+
* the Solidity, Rust and TypeScript constants from profiles.json, and
|
|
4
|
+
* the hand-written Platform Verifiers read them.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
6
|
+
* These literals are the one copy the verifiers, the browser that
|
|
7
|
+
* notarizes the sessions and the notary must reproduce byte for byte.
|
|
8
|
+
* A mismatch fails silently: a Consumer and a verifier keyed by
|
|
9
|
+
* different strings never meet, and a request line composed one byte
|
|
10
|
+
* differently is refused with no reason given.
|
|
12
11
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* string and a verifier registered under another simply never meet, and a
|
|
17
|
-
* request line a prover composes one byte differently is an attestation
|
|
18
|
-
* rejected with no error that says why.
|
|
19
|
-
*
|
|
20
|
-
* Changing a value here changes what a deployed verifier accepts. That is a
|
|
21
|
-
* new ceremonyVersion, not an edit.
|
|
12
|
+
* Changing a value changes what a deployed verifier accepts. On a live
|
|
13
|
+
* deployment that is a new ceremonyVersion; a fresh deployment keeps its
|
|
14
|
+
* versions.
|
|
22
15
|
*/
|
|
23
16
|
/** Which shape a platform's immutable identifier takes in its response. */
|
|
24
17
|
export type IdShape = 'jsonString' | 'jsonInteger';
|
|
@@ -32,21 +25,21 @@ export interface Session {
|
|
|
32
25
|
}
|
|
33
26
|
export interface TokenSession {
|
|
34
27
|
readonly session: Session;
|
|
35
|
-
/** The header lines a Platform Verifier requires
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
28
|
+
/** The header lines a Platform Verifier requires exactly once: `host`
|
|
29
|
+
* and `content-type`. Other headers pass unless
|
|
30
|
+
* `FORBIDDEN_REQUEST_HEADERS` names them. `content-length` is absent:
|
|
31
|
+
* the HTTP client writes it. */
|
|
39
32
|
readonly requiredHeaders: readonly string[];
|
|
40
|
-
/** The form fields
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* decoded form on ASM-PROV-07, so the contract is stricter than the
|
|
45
|
-
* specification there. */
|
|
33
|
+
/** The body's form fields in serialization order. Verifiers require
|
|
34
|
+
* exactly these names in this order, each once with a nonempty value,
|
|
35
|
+
* and nothing after the last. GitHub's list is REQ-PLAT-61's and X's
|
|
36
|
+
* is REQ-PLAT-63's. */
|
|
46
37
|
readonly tokenFields: readonly string[];
|
|
47
38
|
}
|
|
48
39
|
export interface IdentitySession {
|
|
49
40
|
readonly session: Session;
|
|
41
|
+
/** The header lines a Platform Verifier requires exactly once: `host`. */
|
|
42
|
+
readonly requiredHeaders: readonly string[];
|
|
50
43
|
readonly idField: string;
|
|
51
44
|
readonly idShape: IdShape;
|
|
52
45
|
readonly handleField: string;
|
|
@@ -59,9 +52,9 @@ export interface Profile {
|
|
|
59
52
|
readonly identity: IdentitySession | null;
|
|
60
53
|
}
|
|
61
54
|
/**
|
|
62
|
-
* Google's evidence is a
|
|
63
|
-
*
|
|
64
|
-
*
|
|
55
|
+
* Google's evidence is a token signed with Google's published keys, so
|
|
56
|
+
* the profile notarizes nothing: no session, no attestation and no
|
|
57
|
+
* Notary Fee.
|
|
65
58
|
*/
|
|
66
59
|
export declare const GOOGLE: Profile;
|
|
67
60
|
/**
|
|
@@ -71,31 +64,28 @@ export declare const GOOGLE: Profile;
|
|
|
71
64
|
export declare const X: Profile;
|
|
72
65
|
/**
|
|
73
66
|
* The credential GitHub calls `client_secret` is sent and revealed, so
|
|
74
|
-
* an attestation publishes it
|
|
75
|
-
*
|
|
76
|
-
* authority per profile would be wrong.
|
|
67
|
+
* an attestation publishes it. The two sessions are served by different
|
|
68
|
+
* hosts, so each session pins its own authority.
|
|
77
69
|
*/
|
|
78
70
|
export declare const GITHUB: Profile;
|
|
79
|
-
/** The
|
|
71
|
+
/** The launch profiles. */
|
|
80
72
|
export declare const LAUNCH: readonly Profile[];
|
|
81
73
|
/** The launch profile for a platform name, or undefined. */
|
|
82
74
|
export declare function launch(platform: string): Profile | undefined;
|
|
83
75
|
/** How many attestations a submission for this profile carries. */
|
|
84
76
|
export declare function attestationCount(profile: Profile): number;
|
|
85
77
|
/**
|
|
86
|
-
* Header names no notarized request may carry, compared
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* both lists changes only what the platform answers, and a wrong answer
|
|
98
|
-
* is a response the verifier cannot read.
|
|
78
|
+
* Header names no notarized request may carry, compared lowercased, with
|
|
79
|
+
* whitespace removed and `_` read as `-`. Each changes what the platform
|
|
80
|
+
* does in a way no revealed byte shows: `authorization` the client it
|
|
81
|
+
* authenticates, `content-encoding` and `transfer-encoding` the bytes it
|
|
82
|
+
* parses, `cookie` the session, the three override names the method. The
|
|
83
|
+
* identity request is excepted from `authorization` alone: its one such
|
|
84
|
+
* header, under any scheme, is what REQ-COMMON-39 counts. The verifier
|
|
85
|
+
* also requires each session's requiredHeaders once with their value,
|
|
86
|
+
* reads the token request's `content-length`, and ignores every other
|
|
87
|
+
* header: such a header changes only the response, which the verifier
|
|
88
|
+
* then cannot read.
|
|
99
89
|
*/
|
|
100
90
|
export declare const FORBIDDEN_REQUEST_HEADERS: readonly string[];
|
|
101
91
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../src/ceremony/profiles.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../src/ceremony/profiles.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AAEH,2EAA2E;AAC3E,MAAM,MAAM,OAAO,GAAG,YAAY,GAAG,aAAa,CAAA;AAElD,MAAM,WAAW,OAAO;IACtB,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,mEAAmE;IACnE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB;;;oCAGgC;IAChC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;IAC3C;;;2BAGuB;IACvB,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;CACxC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;IAC3C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,OAAO;IACtB,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,QAAQ,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAA;CAC1C;AAED;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,OAKpB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,CAAC,EAAE,OAyBf,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,OAyBpB,CAAA;AAED,2BAA2B;AAC3B,eAAO,MAAM,MAAM,EAAE,SAAS,OAAO,EAAwB,CAAA;AAE7D,4DAA4D;AAC5D,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAE5D;AAED,mEAAmE;AACnE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEzD;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAQtD,CAAA;AAaD;;;;GAIG;AACH,eAAO,MAAM,2CAA2C,OAAO,CAAA;AAK/D;;GAEG;AACH,eAAO,MAAM,wBAAwB,OAAO,CAAA;AAC5C;;;GAGG;AACH,eAAO,MAAM,qCAAqC,MAAM,CAAA;AACxD;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,MAAM,CAAA;AAGzD;;GAEG;AACH,eAAO,MAAM,6BAA6B,OAAO,CAAA;AACjD;;;GAGG;AACH,eAAO,MAAM,0CAA0C,MAAM,CAAA;AAC7D;;;;GAIG;AACH,eAAO,MAAM,2CAA2C,MAAM,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Generated by scripts/regen-ceremony-profiles.py. Do not edit.
|
|
2
2
|
// The source of truth is solidity/contracts/ceremony/profiles.json.
|
|
3
3
|
/**
|
|
4
|
-
* Google's evidence is a
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Google's evidence is a token signed with Google's published keys, so
|
|
5
|
+
* the profile notarizes nothing: no session, no attestation and no
|
|
6
|
+
* Notary Fee.
|
|
7
7
|
*/
|
|
8
8
|
export const GOOGLE = {
|
|
9
9
|
platform: 'google',
|
|
@@ -35,6 +35,7 @@ export const X = {
|
|
|
35
35
|
path: '/2/users/me',
|
|
36
36
|
requestLine: 'GET /2/users/me ',
|
|
37
37
|
},
|
|
38
|
+
requiredHeaders: ['host: api.x.com'],
|
|
38
39
|
idField: 'id',
|
|
39
40
|
idShape: 'jsonString',
|
|
40
41
|
handleField: 'username',
|
|
@@ -42,9 +43,8 @@ export const X = {
|
|
|
42
43
|
};
|
|
43
44
|
/**
|
|
44
45
|
* The credential GitHub calls `client_secret` is sent and revealed, so
|
|
45
|
-
* an attestation publishes it
|
|
46
|
-
*
|
|
47
|
-
* authority per profile would be wrong.
|
|
46
|
+
* an attestation publishes it. The two sessions are served by different
|
|
47
|
+
* hosts, so each session pins its own authority.
|
|
48
48
|
*/
|
|
49
49
|
export const GITHUB = {
|
|
50
50
|
platform: 'github',
|
|
@@ -66,12 +66,13 @@ export const GITHUB = {
|
|
|
66
66
|
path: '/user',
|
|
67
67
|
requestLine: 'GET /user ',
|
|
68
68
|
},
|
|
69
|
+
requiredHeaders: ['host: api.github.com'],
|
|
69
70
|
idField: 'id',
|
|
70
71
|
idShape: 'jsonInteger',
|
|
71
72
|
handleField: 'login',
|
|
72
73
|
},
|
|
73
74
|
};
|
|
74
|
-
/** The
|
|
75
|
+
/** The launch profiles. */
|
|
75
76
|
export const LAUNCH = [GOOGLE, X, GITHUB];
|
|
76
77
|
/** The launch profile for a platform name, or undefined. */
|
|
77
78
|
export function launch(platform) {
|
|
@@ -82,19 +83,17 @@ export function attestationCount(profile) {
|
|
|
82
83
|
return (profile.token ? 1 : 0) + (profile.identity ? 1 : 0);
|
|
83
84
|
}
|
|
84
85
|
/**
|
|
85
|
-
* Header names no notarized request may carry, compared
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* both lists changes only what the platform answers, and a wrong answer
|
|
97
|
-
* is a response the verifier cannot read.
|
|
86
|
+
* Header names no notarized request may carry, compared lowercased, with
|
|
87
|
+
* whitespace removed and `_` read as `-`. Each changes what the platform
|
|
88
|
+
* does in a way no revealed byte shows: `authorization` the client it
|
|
89
|
+
* authenticates, `content-encoding` and `transfer-encoding` the bytes it
|
|
90
|
+
* parses, `cookie` the session, the three override names the method. The
|
|
91
|
+
* identity request is excepted from `authorization` alone: its one such
|
|
92
|
+
* header, under any scheme, is what REQ-COMMON-39 counts. The verifier
|
|
93
|
+
* also requires each session's requiredHeaders once with their value,
|
|
94
|
+
* reads the token request's `content-length`, and ignores every other
|
|
95
|
+
* header: such a header changes only the response, which the verifier
|
|
96
|
+
* then cannot read.
|
|
98
97
|
*/
|
|
99
98
|
export const FORBIDDEN_REQUEST_HEADERS = [
|
|
100
99
|
'authorization',
|
|
@@ -106,28 +105,24 @@ export const FORBIDDEN_REQUEST_HEADERS = [
|
|
|
106
105
|
'x-method-override',
|
|
107
106
|
];
|
|
108
107
|
// The seconds each profile fixes. A Platform Verifier reads them as
|
|
109
|
-
// constants
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
// observation is the token's `exp`: Google issues about an hour of
|
|
119
|
-
// life, and the claim reads roughly an hour ahead of the moment it
|
|
120
|
-
// describes.
|
|
108
|
+
// constants, so a different value is a new ceremonyVersion (REQ-PARAM-01)
|
|
109
|
+
// and a client that knows its version knows the validity every chain
|
|
110
|
+
// enforces. `IdentityRegistry` replaces a binding only on a strictly newer
|
|
111
|
+
// `observedAt`, so the future allowance bounds how long a proof dated ahead
|
|
112
|
+
// holds a name.
|
|
113
|
+
// The signed `exp` bounds validity, so the profile fixes no lifetime and
|
|
114
|
+
// no attestation skew. The OIDC circuit exposes no `iat`, so the
|
|
115
|
+
// observation is the token's `exp`, about an hour after Google issued
|
|
116
|
+
// it.
|
|
121
117
|
/**
|
|
122
118
|
* `google/v1`: how far ahead of Block Time the evidence time may run.
|
|
123
119
|
* The verifier subtracts it, so every version of a platform reports
|
|
124
120
|
* time on one scale.
|
|
125
121
|
*/
|
|
126
122
|
export const FUTURE_OBSERVATION_ALLOWANCE_SECONDS_GOOGLE = 7200;
|
|
127
|
-
// The token attestation's creation time is the evidence time. A
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
// and the chain.
|
|
123
|
+
// The token attestation's creation time is the evidence time. A notary
|
|
124
|
+
// states the wall-clock time it observes, so five minutes covers clock
|
|
125
|
+
// skew between the notary and the chain.
|
|
131
126
|
/**
|
|
132
127
|
* `x/v1`: maximum age of the token attestation.
|
|
133
128
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/ceremony/profiles.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,oEAAoE;
|
|
1
|
+
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/ceremony/profiles.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,oEAAoE;AA6DpE;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAY;IAC7B,QAAQ,EAAE,QAAQ;IAClB,eAAe,EAAE,CAAC;IAClB,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,IAAI;CACf,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,CAAC,GAAY;IACxB,QAAQ,EAAE,GAAG;IACb,eAAe,EAAE,CAAC;IAClB,KAAK,EAAE;QACL,OAAO,EAAE;YACP,SAAS,EAAE,WAAW;YACtB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,uBAAuB;SACrC;QACD,eAAe,EAAE,CAAC,iBAAiB,EAAE,iDAAiD,CAAC;QACvF,WAAW,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAA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UAAU,gBAAgB,CAAC,OAAgB;IAC/C,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC7D,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAsB;IAC1D,eAAe;IACf,kBAAkB;IAClB,QAAQ;IACR,mBAAmB;IACnB,eAAe;IACf,wBAAwB;IACxB,mBAAmB;CACpB,CAAA;AAED,oEAAoE;AACpE,0EAA0E;AAC1E,qEAAqE;AACrE,2EAA2E;AAC3E,4EAA4E;AAC5E,gBAAgB;AAEhB,yEAAyE;AACzE,iEAAiE;AACjE,sEAAsE;AACtE,MAAM;AACN;;;;GAIG;AACH,MAAM,CAAC,MAAM,2CAA2C,GAAG,IAAI,CAAA;AAE/D,uEAAuE;AACvE,uEAAuE;AACvE,yCAAyC;AACzC;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAA;AAC5C;;;GAGG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,GAAG,CAAA;AACxD;;;;GAIG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,GAAG,CAAA;AAEzD,uDAAuD;AACvD;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAA;AACjD;;;GAGG;AACH,MAAM,CAAC,MAAM,0CAA0C,GAAG,GAAG,CAAA;AAC7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,2CAA2C,GAAG,GAAG,CAAA"}
|
package/dist/identity/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAMA,cAAc,uBAAuB,CAAA;AACrC,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
|
package/dist/identity/index.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
///
|
|
1
|
+
/// Identity helpers: handle normalization, node derivation, and resolvers over
|
|
2
|
+
/// the `IdentityRegistry` view calls.
|
|
2
3
|
///
|
|
3
|
-
///
|
|
4
|
-
///
|
|
5
|
-
|
|
6
|
-
/// cannot drift apart silently.
|
|
7
|
-
///
|
|
8
|
-
/// Calldata for the writes is generated too, in `../calls` — `unpublish` had a
|
|
9
|
-
/// hand-written builder here until every write function got one.
|
|
10
|
-
export * from './handle.js';
|
|
11
|
-
export * from './handleVectors.js';
|
|
4
|
+
/// Normalization applies the token check and the fold the circuits enforce;
|
|
5
|
+
/// the chain only folds A-Z. Calldata for the writes is in `../calls`.
|
|
6
|
+
export * from '../platforms/index.js';
|
|
12
7
|
export * from './node.js';
|
|
13
8
|
export * from './resolve.js';
|
|
14
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,sCAAsC;AACtC,GAAG;AACH,4EAA4E;AAC5E,uEAAuE;AAEvE,cAAc,uBAAuB,CAAA;AACrC,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
|
package/dist/identity/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Hex } from 'viem';
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
2
|
+
export declare function handleNode(platformKey: string, raw: string): Hex;
|
|
3
|
+
export declare function foldedHandleNode(platformKey: string, text: string): Hex;
|
|
4
|
+
export declare function idNode(platformKey: string, id: string): Hex;
|
|
5
5
|
//# sourceMappingURL=node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/identity/node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/identity/node.ts"],"names":[],"mappings":"AAGA,OAAO,EAAU,KAAK,GAAG,EAAiB,MAAM,MAAM,CAAA;AAYtD,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,GAAG,CAGhE;AAID,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG,CAGvE;AAGD,wBAAgB,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,GAAG,CAG3D"}
|
package/dist/identity/node.js
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
///
|
|
2
|
-
///
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export function handleHash(raw, rules) {
|
|
11
|
-
return keccak256(toHex(normalize(raw, rules)));
|
|
1
|
+
/// The keys a binding is stored under, `SHA256(tag || value)`, computed
|
|
2
|
+
/// locally so the handle or id never reaches an RPC.
|
|
3
|
+
import { concat, sha256, toHex } from 'viem';
|
|
4
|
+
import { checkId, normalize, platform } from '../platforms/index.js';
|
|
5
|
+
function keysOf(platformKey) {
|
|
6
|
+
const keys = platform(platformKey);
|
|
7
|
+
if (keys === undefined)
|
|
8
|
+
throw new Error(`unknown platform ${JSON.stringify(platformKey)}`);
|
|
9
|
+
return keys;
|
|
12
10
|
}
|
|
13
|
-
/// The node a handle
|
|
14
|
-
///
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return
|
|
11
|
+
/// The node a typed handle is bound under: normalized, then hashed under
|
|
12
|
+
/// its handle tag. Throws `HandleError` for text no binding can have.
|
|
13
|
+
export function handleNode(platformKey, raw) {
|
|
14
|
+
const keys = keysOf(platformKey);
|
|
15
|
+
return sha256(concat([toHex(keys.handleTag), toHex(normalize(raw, keys.rules))]));
|
|
16
|
+
}
|
|
17
|
+
/// The node `depositToHandle` and the registry's `handleNodeOf` derive from
|
|
18
|
+
/// `text`: A-Z folded, nothing checked, so text no circuit hashes has one too.
|
|
19
|
+
export function foldedHandleNode(platformKey, text) {
|
|
20
|
+
const bytes = new TextEncoder().encode(text).map((b) => (b >= 0x41 && b <= 0x5a ? b + 0x20 : b));
|
|
21
|
+
return sha256(concat([toHex(keysOf(platformKey).handleTag), toHex(bytes)]));
|
|
22
|
+
}
|
|
23
|
+
/// The node an id is bound under: the id as given, under its user-id tag.
|
|
24
|
+
export function idNode(platformKey, id) {
|
|
25
|
+
checkId(platformKey, id);
|
|
26
|
+
return sha256(concat([toHex(keysOf(platformKey).userIdTag), toHex(id)]));
|
|
18
27
|
}
|
|
19
28
|
//# sourceMappingURL=node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/identity/node.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/identity/node.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,qDAAqD;AAErD,OAAO,EAAE,MAAM,EAAY,MAAM,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAEtD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAiB,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEnF,SAAS,MAAM,CAAC,WAAmB;IACjC,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAA;IAClC,IAAI,IAAI,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;IAC1F,OA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ends string> = K extends `0x${string}` ? never : K;
|
|
4
3
|
export declare function platformId<K extends string>(platformKey: PlatformKey<K>): `0x${string}`;
|
|
5
4
|
export interface RegistryReader {
|
|
6
5
|
client: PublicClient;
|
|
7
6
|
address: Address;
|
|
8
7
|
}
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function resolveId(reader: RegistryReader, platformId: `0x${string}`, id: string): Promise<Address | null>;
|
|
11
|
-
export declare function resolveHandle(reader: RegistryReader, platformId: `0x${string}`, handle: string): Promise<Address | null>;
|
|
12
|
-
export declare function publishedHandleOf(reader: RegistryReader, holder: Address, platformId: `0x${string}`): Promise<string | null>;
|
|
8
|
+
export declare function resolveId(reader: RegistryReader, idNode: `0x${string}`): Promise<Address | null>;
|
|
13
9
|
export interface HandleAndIdResolution {
|
|
14
10
|
holder: Address | null;
|
|
15
11
|
idAgrees: boolean;
|
|
16
12
|
}
|
|
17
|
-
export declare function resolveHandleAndId(reader: RegistryReader,
|
|
13
|
+
export declare function resolveHandleAndId(reader: RegistryReader, id: `0x${string}`, handle: string, idNode: `0x${string}`): Promise<HandleAndIdResolution>;
|
|
14
|
+
export declare function resolveHandle(reader: RegistryReader, platformId: `0x${string}`, handle: string): Promise<Address | null>;
|
|
15
|
+
export declare function publishedHandleOf(reader: RegistryReader, holder: Address, platformId: `0x${string}`): Promise<string | null>;
|
|
18
16
|
export interface Identity {
|
|
19
17
|
platformId: `0x${string}`;
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
idNode: `0x${string}`;
|
|
19
|
+
handleNode: `0x${string}`;
|
|
22
20
|
handleCurrent: boolean;
|
|
23
21
|
}
|
|
24
22
|
export declare function identityCount(reader: RegistryReader, holder: Address): Promise<bigint>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/identity/resolve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/identity/resolve.ts"],"names":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