@reclaimprotocol/client 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -35
- package/lib/enckeys.d.ts +38 -31
- package/lib/enckeys.js +88 -13
- package/lib/encoding.d.ts +5 -0
- package/lib/encoding.js +19 -3
- package/lib/index.d.ts +3 -3
- package/lib/index.js +2 -2
- package/lib/keypair.d.ts +3 -2
- package/lib/keypair.js +15 -1
- package/lib/reclaim.d.ts +35 -32
- package/lib/reclaim.js +19 -15
- package/lib/result.d.ts +20 -16
- package/lib/result.js +68 -54
- package/lib/routes.gen.d.ts +48 -12
- package/lib/routes.gen.js +13 -4
- package/lib/secp.d.ts +1 -2
- package/lib/secp.js +1 -1
- package/lib/types/openapi.d.ts +2 -2
- package/lib/types/openapi.gen.d.ts +711 -122
- package/package.json +7 -2
- package/src/enckeys.ts +114 -35
- package/src/encoding.ts +21 -3
- package/src/index.ts +6 -3
- package/src/keypair.ts +20 -3
- package/src/reclaim.ts +54 -51
- package/src/result.ts +86 -65
- package/src/routes.gen.ts +13 -4
- package/src/secp.ts +1 -1
- package/src/types/openapi.gen.ts +711 -122
- package/src/types/openapi.ts +2 -2
package/lib/reclaim.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReclaimClient } from "./client.js";
|
|
2
|
-
import { loadDecryptionKey,
|
|
2
|
+
import { loadDecryptionKey, } from "./enckeys.js";
|
|
3
3
|
import { decryptCallback, verifyResultFull, } from "./result.js";
|
|
4
4
|
/** The three terminal events a subscription can receive. */
|
|
5
5
|
export const TERMINAL_EVENTS = [
|
|
@@ -18,11 +18,9 @@ export function createReclaim(config) {
|
|
|
18
18
|
fetch: config.fetch,
|
|
19
19
|
headers: config.headers,
|
|
20
20
|
});
|
|
21
|
-
// Load
|
|
21
|
+
// Load the eth decryption key on demand — `undefined` input ⇒ no key, so
|
|
22
22
|
// plaintext-only consumers never touch the loader.
|
|
23
|
-
const resolveKey = (input) => (input === undefined
|
|
24
|
-
? Promise.resolve(undefined)
|
|
25
|
-
: loadDecryptionKey(input));
|
|
23
|
+
const resolveKey = (input) => (input === undefined ? undefined : loadDecryptionKey(input));
|
|
26
24
|
return {
|
|
27
25
|
api: client.call.bind(client),
|
|
28
26
|
sessions: {
|
|
@@ -67,26 +65,32 @@ export function createReclaim(config) {
|
|
|
67
65
|
});
|
|
68
66
|
},
|
|
69
67
|
},
|
|
70
|
-
|
|
68
|
+
keypair: {
|
|
71
69
|
async set(orgId, input) {
|
|
72
|
-
//
|
|
73
|
-
//
|
|
74
|
-
const
|
|
75
|
-
|
|
70
|
+
// Forward the eth public key as given (hex or JWK); the API stores
|
|
71
|
+
// the secp256k1 JWK + derived address.
|
|
72
|
+
const body = {
|
|
73
|
+
...(input.publicKeyJwk
|
|
74
|
+
? { publicKeyJwk: input.publicKeyJwk }
|
|
75
|
+
: { publicKey: input.publicKey }),
|
|
76
|
+
canEncryptResult: input.canEncryptResult ?? false,
|
|
77
|
+
...(input.label ? { label: input.label } : {}),
|
|
78
|
+
};
|
|
79
|
+
const { data } = await client.call('SetOrgKeypair', {
|
|
76
80
|
params: { orgId },
|
|
77
|
-
body
|
|
81
|
+
body,
|
|
78
82
|
});
|
|
79
83
|
return data;
|
|
80
84
|
},
|
|
81
85
|
async get(orgId) {
|
|
82
86
|
try {
|
|
83
|
-
const { data } = await client.call('
|
|
87
|
+
const { data } = await client.call('GetOrgKeypair', {
|
|
84
88
|
params: { orgId },
|
|
85
89
|
});
|
|
86
90
|
return data;
|
|
87
91
|
}
|
|
88
92
|
catch (err) {
|
|
89
|
-
// 404 ⇒
|
|
93
|
+
// 404 ⇒ keyless org (plaintext delivery).
|
|
90
94
|
if (isNotFound(err)) {
|
|
91
95
|
return undefined;
|
|
92
96
|
}
|
|
@@ -96,7 +100,7 @@ export function createReclaim(config) {
|
|
|
96
100
|
},
|
|
97
101
|
results: {
|
|
98
102
|
async decrypt(body, credential) {
|
|
99
|
-
return decryptCallback(
|
|
103
|
+
return decryptCallback(resolveKey(credential), body);
|
|
100
104
|
},
|
|
101
105
|
verify(jws, opts) {
|
|
102
106
|
return verifyResultFull(jws, { fetchImpl: config.fetch, ...opts });
|
|
@@ -120,7 +124,7 @@ export function createReclaim(config) {
|
|
|
120
124
|
}
|
|
121
125
|
}
|
|
122
126
|
const { credential, ...verifyOpts } = opts ?? {};
|
|
123
|
-
const key =
|
|
127
|
+
const key = resolveKey(credential);
|
|
124
128
|
const jws = await decryptCallback(key, body);
|
|
125
129
|
const result = await verifyResultFull(jws, {
|
|
126
130
|
fetchImpl: config.fetch,
|
package/lib/result.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { JWK } from 'jose';
|
|
2
1
|
import type { components } from './types/openapi.gen.ts';
|
|
3
2
|
import type { DecryptionKey } from './enckeys.ts';
|
|
3
|
+
import { type Jwk } from './jwks.ts';
|
|
4
4
|
export interface Jws {
|
|
5
5
|
payload: string;
|
|
6
6
|
signatures: {
|
|
@@ -24,23 +24,25 @@ export interface VerifyResultOutcome {
|
|
|
24
24
|
reclaimSessionId?: string;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
* `{kty:'
|
|
29
|
-
* by the first-party Verification Client to
|
|
30
|
-
* Consumer before submitting it to the Builder
|
|
31
|
-
* ciphertext). Consumers never call this — they only
|
|
27
|
+
* ECIES-encrypt `plaintext` for the holder of `publicJwk` (the org's secp256k1
|
|
28
|
+
* **eth** public JWK, `{kty:'EC', crv:'secp256k1', x, y}`) — `eciesjs` defaults
|
|
29
|
+
* (secp256k1 + AES-256-GCM). Used by the first-party Verification Client to
|
|
30
|
+
* encrypt the signed JWS for the Consumer before submitting it to the Builder
|
|
31
|
+
* (which only relays the ciphertext). Consumers never call this — they only
|
|
32
|
+
* {@link decryptCallback}.
|
|
32
33
|
*
|
|
33
34
|
* `plaintext` is bytes (e.g. `new TextEncoder().encode(JSON.stringify(jws))`);
|
|
34
|
-
* returns the
|
|
35
|
+
* returns the ciphertext as a base64url string (single token, never starts with
|
|
36
|
+
* `{`, so {@link decryptCallback} can tell it apart from a plaintext JWS JSON).
|
|
35
37
|
*/
|
|
36
|
-
export declare function
|
|
38
|
+
export declare function encryptForEthPublicKey(publicJwk: Jwk, plaintext: Uint8Array): Promise<string>;
|
|
37
39
|
/**
|
|
38
40
|
* What a consumer's callback endpoint receives — the Builder POSTs the JSON
|
|
39
41
|
* `VerificationResultDelivery` envelope: plaintext `sessionId`/`event`/
|
|
40
|
-
* `timestamp` routing hints. For terminal events `data` is
|
|
41
|
-
*
|
|
42
|
-
* no
|
|
43
|
-
* decrypted+verified JWS.
|
|
42
|
+
* `timestamp` routing hints. For terminal events `data` is an ECIES ciphertext
|
|
43
|
+
* (base64url) wrapping the signed JWS (or the plaintext JWS JSON when the org
|
|
44
|
+
* has no key / `canEncryptResult` is off). The envelope is unauthenticated;
|
|
45
|
+
* trust only the decrypted+verified JWS.
|
|
44
46
|
*
|
|
45
47
|
* Derived from the generated spec type so it can't drift; the hint fields
|
|
46
48
|
* are relaxed to optional — decryption only needs `data`.
|
|
@@ -50,10 +52,10 @@ export type DeliveryEnvelope = Partial<components['schemas']['VerificationResult
|
|
|
50
52
|
* JSON text, its raw body bytes — or a bare compact JWE / JWS string. */
|
|
51
53
|
export type CallbackBody = DeliveryEnvelope | string | Uint8Array | ArrayBuffer;
|
|
52
54
|
/**
|
|
53
|
-
* Decrypt a delivered terminal callback to the signed JWS. `data` is either
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
55
|
+
* Decrypt a delivered terminal callback to the signed JWS. `data` is either an
|
|
56
|
+
* ECIES ciphertext (base64url, decrypted with the eth `privateKey` scalar) or —
|
|
57
|
+
* when the org has no key / `canEncryptResult` is off — the plaintext JWS JSON.
|
|
58
|
+
* A JSON JWS starts with `{`; anything else is the ECIES ciphertext.
|
|
57
59
|
*
|
|
58
60
|
* `privateKey` may be absent (plaintext delivery); an encrypted delivery with
|
|
59
61
|
* no key throws a clear error.
|
|
@@ -88,6 +90,8 @@ export interface VerifyResultFullOptions {
|
|
|
88
90
|
now?: number;
|
|
89
91
|
}
|
|
90
92
|
export interface ResultProofOutcome {
|
|
93
|
+
/** Which provider this proof belongs to (results grouped per provider). */
|
|
94
|
+
providerId?: string;
|
|
91
95
|
requestId?: string;
|
|
92
96
|
proofValid: boolean;
|
|
93
97
|
reason?: string;
|
package/lib/result.js
CHANGED
|
@@ -11,32 +11,33 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { sha256 } from '@noble/hashes/sha2.js';
|
|
13
13
|
import { keccak_256 } from '@noble/hashes/sha3.js';
|
|
14
|
-
import {
|
|
14
|
+
import { decrypt as eciesDecrypt, encrypt as eciesEncrypt } from 'eciesjs';
|
|
15
15
|
import { verifyNestedProof } from "./attestor-proof.js";
|
|
16
16
|
import { canonicalJson } from "./canonical.js";
|
|
17
17
|
import { b64url, base64urlToBytes, bytesToHex, hexToBytes } from "./encoding.js";
|
|
18
|
-
import { fetchJwks, jwkToUncompressedPublicKey, selectKey } from "./jwks.js";
|
|
18
|
+
import { fetchJwks, jwkToUncompressedPublicKey, selectKey, } from "./jwks.js";
|
|
19
19
|
import { addressFromUncompressedPubkey, secp } from "./secp.js";
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
* `{kty:'
|
|
23
|
-
* by the first-party Verification Client to
|
|
24
|
-
* Consumer before submitting it to the Builder
|
|
25
|
-
* ciphertext). Consumers never call this — they only
|
|
21
|
+
* ECIES-encrypt `plaintext` for the holder of `publicJwk` (the org's secp256k1
|
|
22
|
+
* **eth** public JWK, `{kty:'EC', crv:'secp256k1', x, y}`) — `eciesjs` defaults
|
|
23
|
+
* (secp256k1 + AES-256-GCM). Used by the first-party Verification Client to
|
|
24
|
+
* encrypt the signed JWS for the Consumer before submitting it to the Builder
|
|
25
|
+
* (which only relays the ciphertext). Consumers never call this — they only
|
|
26
|
+
* {@link decryptCallback}.
|
|
26
27
|
*
|
|
27
28
|
* `plaintext` is bytes (e.g. `new TextEncoder().encode(JSON.stringify(jws))`);
|
|
28
|
-
* returns the
|
|
29
|
+
* returns the ciphertext as a base64url string (single token, never starts with
|
|
30
|
+
* `{`, so {@link decryptCallback} can tell it apart from a plaintext JWS JSON).
|
|
29
31
|
*/
|
|
30
|
-
export async function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
.encrypt(key);
|
|
32
|
+
export async function encryptForEthPublicKey(publicJwk, plaintext) {
|
|
33
|
+
// Uncompressed `0x04`‖X‖Y bytes — what eciesjs accepts as the recipient key.
|
|
34
|
+
const pubBytes = hexToBytes(jwkToUncompressedPublicKey(publicJwk));
|
|
35
|
+
return b64url(eciesEncrypt(pubBytes, plaintext));
|
|
35
36
|
}
|
|
36
37
|
/** Normalize any {@link CallbackBody} to the terminal-result `data` string —
|
|
37
|
-
* either
|
|
38
|
-
*
|
|
39
|
-
*
|
|
38
|
+
* either an ECIES ciphertext (base64url) or the plaintext JWS JSON (`{…}`).
|
|
39
|
+
* The envelope object/text wraps it in `.data`; raw bytes are decoded to text
|
|
40
|
+
* first. */
|
|
40
41
|
function payloadFrom(body) {
|
|
41
42
|
if (typeof body === 'string') {
|
|
42
43
|
const s = body.trim();
|
|
@@ -60,10 +61,10 @@ function payloadFrom(body) {
|
|
|
60
61
|
return body.data;
|
|
61
62
|
}
|
|
62
63
|
/**
|
|
63
|
-
* Decrypt a delivered terminal callback to the signed JWS. `data` is either
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
64
|
+
* Decrypt a delivered terminal callback to the signed JWS. `data` is either an
|
|
65
|
+
* ECIES ciphertext (base64url, decrypted with the eth `privateKey` scalar) or —
|
|
66
|
+
* when the org has no key / `canEncryptResult` is off — the plaintext JWS JSON.
|
|
67
|
+
* A JSON JWS starts with `{`; anything else is the ECIES ciphertext.
|
|
67
68
|
*
|
|
68
69
|
* `privateKey` may be absent (plaintext delivery); an encrypted delivery with
|
|
69
70
|
* no key throws a clear error.
|
|
@@ -75,13 +76,13 @@ export async function decryptCallback(privateKey, body) {
|
|
|
75
76
|
if (trimmed.startsWith('{')) {
|
|
76
77
|
return JSON.parse(trimmed);
|
|
77
78
|
}
|
|
78
|
-
// Otherwise it's
|
|
79
|
+
// Otherwise it's an ECIES ciphertext (base64url).
|
|
79
80
|
if (!privateKey) {
|
|
80
|
-
throw new Error('received an encrypted (
|
|
81
|
-
+ 'configured — pass the
|
|
81
|
+
throw new Error('received an encrypted (ECIES) delivery but no decryption credential was '
|
|
82
|
+
+ 'configured — pass the eth private key (0x-hex): '
|
|
82
83
|
+ 'results.receive(body, { credential }) or decrypt(body, credential)');
|
|
83
84
|
}
|
|
84
|
-
const
|
|
85
|
+
const plaintext = eciesDecrypt(privateKey, base64urlToBytes(trimmed));
|
|
85
86
|
return JSON.parse(new TextDecoder().decode(plaintext));
|
|
86
87
|
}
|
|
87
88
|
/**
|
|
@@ -228,48 +229,61 @@ export async function verifyResultFull(jws, opts = {}) {
|
|
|
228
229
|
if (typeof payload.exp === 'number' && payload.exp < now) {
|
|
229
230
|
return fail('expired');
|
|
230
231
|
}
|
|
231
|
-
// 3. Per-
|
|
232
|
-
|
|
232
|
+
// 3. Per-provider, per-request nested attestor proof + content_hash binding.
|
|
233
|
+
// `results` is grouped by provider: [{ provider_id, resolved_version,
|
|
234
|
+
// requests: [...] }]. Every request across every provider must verify.
|
|
235
|
+
const providerResults = Array.isArray(payload.results)
|
|
233
236
|
? payload.results
|
|
234
237
|
: [];
|
|
235
238
|
const proofs = [];
|
|
236
|
-
for (const
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
239
|
+
for (const prov of providerResults) {
|
|
240
|
+
const providerId = typeof prov.provider_id === 'string' ? prov.provider_id : undefined;
|
|
241
|
+
const requests = Array.isArray(prov.requests)
|
|
242
|
+
? prov.requests
|
|
243
|
+
: [];
|
|
244
|
+
for (const r of requests) {
|
|
245
|
+
const requestId = typeof r.request_id === 'string' ? r.request_id : undefined;
|
|
246
|
+
if (typeof r.proof !== 'string') {
|
|
247
|
+
proofs.push({
|
|
248
|
+
providerId, requestId, proofValid: false, reason: 'proof-missing',
|
|
249
|
+
});
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
const np = verifyNestedProof(r.proof, {
|
|
253
|
+
attestorAddresses: opts.attestorAddresses,
|
|
251
254
|
});
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
if (typeof r.content_hash === 'string' &&
|
|
255
|
-
r.extracted_parameters &&
|
|
256
|
-
typeof r.extracted_parameters === 'object') {
|
|
257
|
-
const params = r.extracted_parameters;
|
|
258
|
-
if (contentHash(params).toLowerCase() !== r.content_hash.toLowerCase()) {
|
|
255
|
+
if (!np.valid) {
|
|
259
256
|
proofs.push({
|
|
257
|
+
providerId,
|
|
260
258
|
requestId,
|
|
261
259
|
proofValid: false,
|
|
262
|
-
reason:
|
|
260
|
+
reason: np.reason,
|
|
263
261
|
attestorAddress: np.attestorAddress,
|
|
264
262
|
});
|
|
265
263
|
continue;
|
|
266
264
|
}
|
|
265
|
+
if (typeof r.content_hash === 'string' &&
|
|
266
|
+
r.extracted_parameters &&
|
|
267
|
+
typeof r.extracted_parameters === 'object') {
|
|
268
|
+
const params = r.extracted_parameters;
|
|
269
|
+
if (contentHash(params).toLowerCase() !== r.content_hash.toLowerCase()) {
|
|
270
|
+
proofs.push({
|
|
271
|
+
providerId,
|
|
272
|
+
requestId,
|
|
273
|
+
proofValid: false,
|
|
274
|
+
reason: 'content-hash-mismatch',
|
|
275
|
+
attestorAddress: np.attestorAddress,
|
|
276
|
+
});
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
proofs.push({
|
|
281
|
+
providerId,
|
|
282
|
+
requestId,
|
|
283
|
+
proofValid: true,
|
|
284
|
+
attestorAddress: np.attestorAddress,
|
|
285
|
+
});
|
|
267
286
|
}
|
|
268
|
-
proofs.push({
|
|
269
|
-
requestId,
|
|
270
|
-
proofValid: true,
|
|
271
|
-
attestorAddress: np.attestorAddress,
|
|
272
|
-
});
|
|
273
287
|
}
|
|
274
288
|
if (!proofs.every((p) => p.proofValid)) {
|
|
275
289
|
return fail('invalid-proof', { proofs });
|
package/lib/routes.gen.d.ts
CHANGED
|
@@ -35,6 +35,10 @@ export declare const ROUTES: {
|
|
|
35
35
|
readonly method: "get";
|
|
36
36
|
readonly path: "/admin/users";
|
|
37
37
|
};
|
|
38
|
+
readonly AttachLanding: {
|
|
39
|
+
readonly method: "get";
|
|
40
|
+
readonly path: "/attach";
|
|
41
|
+
};
|
|
38
42
|
readonly AttachPage: {
|
|
39
43
|
readonly method: "get";
|
|
40
44
|
readonly path: "/attach/{code}";
|
|
@@ -103,14 +107,14 @@ export declare const ROUTES: {
|
|
|
103
107
|
readonly method: "delete";
|
|
104
108
|
readonly path: "/orgs/{orgId}/callback-subscriptions/{subscriptionId}";
|
|
105
109
|
};
|
|
106
|
-
readonly DeleteOrgCredential: {
|
|
107
|
-
readonly method: "delete";
|
|
108
|
-
readonly path: "/orgs/{orgId}/credential";
|
|
109
|
-
};
|
|
110
110
|
readonly DeleteOrgIcon: {
|
|
111
111
|
readonly method: "delete";
|
|
112
112
|
readonly path: "/orgs/{orgId}/icon";
|
|
113
113
|
};
|
|
114
|
+
readonly DeleteOrgKeypair: {
|
|
115
|
+
readonly method: "delete";
|
|
116
|
+
readonly path: "/orgs/{orgId}/keypair";
|
|
117
|
+
};
|
|
114
118
|
readonly DeleteProvider: {
|
|
115
119
|
readonly method: "delete";
|
|
116
120
|
readonly path: "/providers/{providerId}";
|
|
@@ -123,6 +127,22 @@ export declare const ROUTES: {
|
|
|
123
127
|
readonly method: "delete";
|
|
124
128
|
readonly path: "/orgs/{orgId}/themes/{themeId}";
|
|
125
129
|
};
|
|
130
|
+
readonly DiscoverResolve: {
|
|
131
|
+
readonly method: "get";
|
|
132
|
+
readonly path: "/discover/resolve";
|
|
133
|
+
};
|
|
134
|
+
readonly DiscoverTeachAgent: {
|
|
135
|
+
readonly method: "get";
|
|
136
|
+
readonly path: "/discover/teach";
|
|
137
|
+
};
|
|
138
|
+
readonly DiscoverWebsites: {
|
|
139
|
+
readonly method: "get";
|
|
140
|
+
readonly path: "/discover/websites";
|
|
141
|
+
};
|
|
142
|
+
readonly DisposeVerificationSession: {
|
|
143
|
+
readonly method: "post";
|
|
144
|
+
readonly path: "/v/{sessionId}/dispose";
|
|
145
|
+
};
|
|
126
146
|
readonly Docs: {
|
|
127
147
|
readonly method: "get";
|
|
128
148
|
readonly path: "/docs";
|
|
@@ -151,9 +171,9 @@ export declare const ROUTES: {
|
|
|
151
171
|
readonly method: "get";
|
|
152
172
|
readonly path: "/orgs/{orgId}/billing";
|
|
153
173
|
};
|
|
154
|
-
readonly
|
|
174
|
+
readonly GetOrgKeypair: {
|
|
155
175
|
readonly method: "get";
|
|
156
|
-
readonly path: "/orgs/{orgId}/
|
|
176
|
+
readonly path: "/orgs/{orgId}/keypair";
|
|
157
177
|
};
|
|
158
178
|
readonly GetOrgSession: {
|
|
159
179
|
readonly method: "get";
|
|
@@ -307,18 +327,38 @@ export declare const ROUTES: {
|
|
|
307
327
|
readonly method: "get";
|
|
308
328
|
readonly path: "/robots.txt";
|
|
309
329
|
};
|
|
310
|
-
readonly
|
|
330
|
+
readonly SearchOrgMembers: {
|
|
331
|
+
readonly method: "get";
|
|
332
|
+
readonly path: "/orgs/{orgId}/members";
|
|
333
|
+
};
|
|
334
|
+
readonly SetOrgKeypair: {
|
|
311
335
|
readonly method: "put";
|
|
312
|
-
readonly path: "/orgs/{orgId}/
|
|
336
|
+
readonly path: "/orgs/{orgId}/keypair";
|
|
313
337
|
};
|
|
314
338
|
readonly SetupProviderCreate: {
|
|
315
339
|
readonly method: "post";
|
|
316
340
|
readonly path: "/providers/setup";
|
|
317
341
|
};
|
|
342
|
+
readonly SiteBuild: {
|
|
343
|
+
readonly method: "get";
|
|
344
|
+
readonly path: "/site/{domain}/build";
|
|
345
|
+
};
|
|
346
|
+
readonly SiteBuildTry: {
|
|
347
|
+
readonly method: "post";
|
|
348
|
+
readonly path: "/site/{domain}/try";
|
|
349
|
+
};
|
|
318
350
|
readonly Sitemap: {
|
|
319
351
|
readonly method: "get";
|
|
320
352
|
readonly path: "/sitemap.xml";
|
|
321
353
|
};
|
|
354
|
+
readonly SitePage: {
|
|
355
|
+
readonly method: "get";
|
|
356
|
+
readonly path: "/site/{domain}";
|
|
357
|
+
};
|
|
358
|
+
readonly SitePanel: {
|
|
359
|
+
readonly method: "get";
|
|
360
|
+
readonly path: "/site/{domain}/panel";
|
|
361
|
+
};
|
|
322
362
|
readonly SubmitProviderVersionForReview: {
|
|
323
363
|
readonly method: "post";
|
|
324
364
|
readonly path: "/providers/{providerId}/versions/{version}/review";
|
|
@@ -331,10 +371,6 @@ export declare const ROUTES: {
|
|
|
331
371
|
readonly method: "post";
|
|
332
372
|
readonly path: "/providers/{providerId}/transfer";
|
|
333
373
|
};
|
|
334
|
-
readonly UpdateMe: {
|
|
335
|
-
readonly method: "patch";
|
|
336
|
-
readonly path: "/me";
|
|
337
|
-
};
|
|
338
374
|
readonly UpdateOrg: {
|
|
339
375
|
readonly method: "patch";
|
|
340
376
|
readonly path: "/orgs/{orgId}";
|
package/lib/routes.gen.js
CHANGED
|
@@ -12,6 +12,7 @@ export const ROUTES = {
|
|
|
12
12
|
"AdminSessions": { "method": "get", "path": "/admin/sessions" },
|
|
13
13
|
"AdminThemes": { "method": "get", "path": "/admin/themes" },
|
|
14
14
|
"AdminUsers": { "method": "get", "path": "/admin/users" },
|
|
15
|
+
"AttachLanding": { "method": "get", "path": "/attach" },
|
|
15
16
|
"AttachPage": { "method": "get", "path": "/attach/{code}" },
|
|
16
17
|
"CancelPublicListingRequest": { "method": "post", "path": "/providers/{providerId}/versions/{version}/cancel-review" },
|
|
17
18
|
"ComponentsDemo": { "method": "get", "path": "/components_demo" },
|
|
@@ -29,11 +30,15 @@ export const ROUTES = {
|
|
|
29
30
|
"DeleteOrg": { "method": "delete", "path": "/orgs/{orgId}" },
|
|
30
31
|
"DeleteOrgBilling": { "method": "delete", "path": "/orgs/{orgId}/billing" },
|
|
31
32
|
"DeleteOrgCallbackSubscription": { "method": "delete", "path": "/orgs/{orgId}/callback-subscriptions/{subscriptionId}" },
|
|
32
|
-
"DeleteOrgCredential": { "method": "delete", "path": "/orgs/{orgId}/credential" },
|
|
33
33
|
"DeleteOrgIcon": { "method": "delete", "path": "/orgs/{orgId}/icon" },
|
|
34
|
+
"DeleteOrgKeypair": { "method": "delete", "path": "/orgs/{orgId}/keypair" },
|
|
34
35
|
"DeleteProvider": { "method": "delete", "path": "/providers/{providerId}" },
|
|
35
36
|
"DeleteProviderVersion": { "method": "delete", "path": "/providers/{providerId}/versions/{version}" },
|
|
36
37
|
"DeleteTheme": { "method": "delete", "path": "/orgs/{orgId}/themes/{themeId}" },
|
|
38
|
+
"DiscoverResolve": { "method": "get", "path": "/discover/resolve" },
|
|
39
|
+
"DiscoverTeachAgent": { "method": "get", "path": "/discover/teach" },
|
|
40
|
+
"DiscoverWebsites": { "method": "get", "path": "/discover/websites" },
|
|
41
|
+
"DisposeVerificationSession": { "method": "post", "path": "/v/{sessionId}/dispose" },
|
|
37
42
|
"Docs": { "method": "get", "path": "/docs" },
|
|
38
43
|
"ExplorePreviewImage": { "method": "get", "path": "/og/explore.png" },
|
|
39
44
|
"GetAttachSession": { "method": "get", "path": "/credentials/attach/sessions/{code}" },
|
|
@@ -41,7 +46,7 @@ export const ROUTES = {
|
|
|
41
46
|
"GetMe": { "method": "get", "path": "/me" },
|
|
42
47
|
"GetOrg": { "method": "get", "path": "/orgs/{orgId}" },
|
|
43
48
|
"GetOrgBilling": { "method": "get", "path": "/orgs/{orgId}/billing" },
|
|
44
|
-
"
|
|
49
|
+
"GetOrgKeypair": { "method": "get", "path": "/orgs/{orgId}/keypair" },
|
|
45
50
|
"GetOrgSession": { "method": "get", "path": "/orgs/{orgId}/sessions/{sessionId}" },
|
|
46
51
|
"GetOrgToken": { "method": "get", "path": "/orgs/{orgId}/token" },
|
|
47
52
|
"GetProvider": { "method": "get", "path": "/providers/{providerId}" },
|
|
@@ -80,13 +85,17 @@ export const ROUTES = {
|
|
|
80
85
|
"RetryCallbackDlq": { "method": "post", "path": "/verifications/callback-dlq/{dlqId}/retry" },
|
|
81
86
|
"RetryVerificationCallback": { "method": "post", "path": "/verifications/sessions/{sessionId}/retry-callback" },
|
|
82
87
|
"Robots": { "method": "get", "path": "/robots.txt" },
|
|
83
|
-
"
|
|
88
|
+
"SearchOrgMembers": { "method": "get", "path": "/orgs/{orgId}/members" },
|
|
89
|
+
"SetOrgKeypair": { "method": "put", "path": "/orgs/{orgId}/keypair" },
|
|
84
90
|
"SetupProviderCreate": { "method": "post", "path": "/providers/setup" },
|
|
91
|
+
"SiteBuild": { "method": "get", "path": "/site/{domain}/build" },
|
|
92
|
+
"SiteBuildTry": { "method": "post", "path": "/site/{domain}/try" },
|
|
85
93
|
"Sitemap": { "method": "get", "path": "/sitemap.xml" },
|
|
94
|
+
"SitePage": { "method": "get", "path": "/site/{domain}" },
|
|
95
|
+
"SitePanel": { "method": "get", "path": "/site/{domain}/panel" },
|
|
86
96
|
"SubmitProviderVersionForReview": { "method": "post", "path": "/providers/{providerId}/versions/{version}/review" },
|
|
87
97
|
"SubmitVerificationResult": { "method": "post", "path": "/verifications/sessions/{sessionId}/result" },
|
|
88
98
|
"TransferProvider": { "method": "post", "path": "/providers/{providerId}/transfer" },
|
|
89
|
-
"UpdateMe": { "method": "patch", "path": "/me" },
|
|
90
99
|
"UpdateOrg": { "method": "patch", "path": "/orgs/{orgId}" },
|
|
91
100
|
"UpdateOrgBilling": { "method": "put", "path": "/orgs/{orgId}/billing" },
|
|
92
101
|
"UpdateOrgIcon": { "method": "put", "path": "/orgs/{orgId}/icon" },
|
package/lib/secp.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { keccak_256 } from '@noble/hashes/sha3.js';
|
|
2
1
|
import * as secp from '@noble/secp256k1';
|
|
3
|
-
export {
|
|
2
|
+
export { secp };
|
|
4
3
|
/** Lowercase 0x ETH address from an uncompressed (65-byte) public key:
|
|
5
4
|
* keccak256 of the 64-byte X‖Y (drop the 0x04 prefix), last 20 bytes. */
|
|
6
5
|
export declare function addressFromUncompressedPubkey(pub: Uint8Array): string;
|
package/lib/secp.js
CHANGED
|
@@ -13,7 +13,7 @@ secp.hashes.sha256 = sha256;
|
|
|
13
13
|
secp.hashes.hmacSha256 = (key, msg) => {
|
|
14
14
|
return hmac(sha256, key, msg);
|
|
15
15
|
};
|
|
16
|
-
export {
|
|
16
|
+
export { secp };
|
|
17
17
|
/** Lowercase 0x ETH address from an uncompressed (65-byte) public key:
|
|
18
18
|
* keccak256 of the 64-byte X‖Y (drop the 0x04 prefix), last 20 bytes. */
|
|
19
19
|
export function addressFromUncompressedPubkey(pub) {
|
package/lib/types/openapi.d.ts
CHANGED
|
@@ -80,8 +80,8 @@ export type VerificationResultDelivery = components['schemas']['VerificationResu
|
|
|
80
80
|
export type ProviderRequiredContext = components['schemas']['ProviderRequiredContext'];
|
|
81
81
|
export type Provider = components['schemas']['Provider'];
|
|
82
82
|
export type ProviderVersion = components['schemas']['ProviderVersion'];
|
|
83
|
-
export type
|
|
84
|
-
export type
|
|
83
|
+
export type OrgKeypair = components['schemas']['OrgKeypair'];
|
|
84
|
+
export type JwkSecp256k1Public = components['schemas']['JwkSecp256k1Public'];
|
|
85
85
|
export type OrgToken = components['schemas']['OrgToken'];
|
|
86
86
|
export type OrgTokenMeta = components['schemas']['OrgTokenMeta'];
|
|
87
87
|
export type Organization = components['schemas']['Organization'];
|