@coordination-network/user-app-core 0.0.1 → 0.0.2
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/dist/index.cjs +4 -1
- package/dist/index.js +4 -1
- package/package.json +8 -8
- package/src/handlers/credential-issue.ts +1 -0
- package/src/member-api.ts +3 -1
package/dist/index.cjs
CHANGED
|
@@ -181,7 +181,9 @@ const challengeNonceSchema = zod.z
|
|
|
181
181
|
.string()
|
|
182
182
|
.regex(/^(0x)?[0-9a-fA-F]{64}$/i, "must be 32-byte hex")
|
|
183
183
|
.transform((value) => `0x${value.replace(/^0x/i, "")}`.toLowerCase());
|
|
184
|
-
const challengeResponseSchema = zod.z
|
|
184
|
+
const challengeResponseSchema = zod.z
|
|
185
|
+
.object({ challengeId: zod.z.uuid(), nonce: challengeNonceSchema, expiresAt: zod.z.number() })
|
|
186
|
+
.strict();
|
|
185
187
|
const issueCredentialResponseSchema = zod.z.object({ id: zod.z.string().min(1), credential: zod.z.unknown() }).strict();
|
|
186
188
|
/**
|
|
187
189
|
* Not `.strict()`: `POST /v1/verify` also answers with its own `ok`/`code`, which the wallet
|
|
@@ -371,6 +373,7 @@ async function credentialIssueHandler(ports, deviceSecret, params) {
|
|
|
371
373
|
const { signature: accountPopSignature } = identity.signAccountBinding(keys.account.privateKey, nonce, credential.jwkToPublicKeyBytes(confirmationKey));
|
|
372
374
|
step(CREDENTIAL_ISSUE_STEPS.signing);
|
|
373
375
|
const issued = await postToMember(ports.http, params.credentialsUrl, {
|
|
376
|
+
challengeId: challenge.value.challengeId,
|
|
374
377
|
subjectNetworkId: keys.networkId,
|
|
375
378
|
approvalScope: params.approvalScope,
|
|
376
379
|
confirmationKey,
|
package/dist/index.js
CHANGED
|
@@ -179,7 +179,9 @@ const challengeNonceSchema = z
|
|
|
179
179
|
.string()
|
|
180
180
|
.regex(/^(0x)?[0-9a-fA-F]{64}$/i, "must be 32-byte hex")
|
|
181
181
|
.transform((value) => `0x${value.replace(/^0x/i, "")}`.toLowerCase());
|
|
182
|
-
const challengeResponseSchema = z
|
|
182
|
+
const challengeResponseSchema = z
|
|
183
|
+
.object({ challengeId: z.uuid(), nonce: challengeNonceSchema, expiresAt: z.number() })
|
|
184
|
+
.strict();
|
|
183
185
|
const issueCredentialResponseSchema = z.object({ id: z.string().min(1), credential: z.unknown() }).strict();
|
|
184
186
|
/**
|
|
185
187
|
* Not `.strict()`: `POST /v1/verify` also answers with its own `ok`/`code`, which the wallet
|
|
@@ -369,6 +371,7 @@ async function credentialIssueHandler(ports, deviceSecret, params) {
|
|
|
369
371
|
const { signature: accountPopSignature } = signAccountBinding(keys.account.privateKey, nonce, jwkToPublicKeyBytes(confirmationKey));
|
|
370
372
|
step(CREDENTIAL_ISSUE_STEPS.signing);
|
|
371
373
|
const issued = await postToMember(ports.http, params.credentialsUrl, {
|
|
374
|
+
challengeId: challenge.value.challengeId,
|
|
372
375
|
subjectNetworkId: keys.networkId,
|
|
373
376
|
approvalScope: params.approvalScope,
|
|
374
377
|
confirmationKey,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coordination-network/user-app-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "The three user-app-link operations a user app serves, over injected device, storage and proving ports.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/zk-kit/coordination-network",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"build": "rimraf dist types && rollup -c rollup.config.mjs"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@coordination-network/credential": "^0.0.
|
|
36
|
-
"@coordination-network/identity": "^0.0.
|
|
37
|
-
"@coordination-network/issuer-set": "^0.0.
|
|
38
|
-
"@coordination-network/revocation-registry": "^0.0.
|
|
39
|
-
"@coordination-network/user-app-link": "^0.0.
|
|
40
|
-
"@coordination-network/user-client": "^0.0.
|
|
41
|
-
"@coordination-network/wallet": "^0.0.
|
|
35
|
+
"@coordination-network/credential": "^0.0.2",
|
|
36
|
+
"@coordination-network/identity": "^0.0.2",
|
|
37
|
+
"@coordination-network/issuer-set": "^0.0.2",
|
|
38
|
+
"@coordination-network/revocation-registry": "^0.0.2",
|
|
39
|
+
"@coordination-network/user-app-link": "^0.0.2",
|
|
40
|
+
"@coordination-network/user-client": "^0.0.2",
|
|
41
|
+
"@coordination-network/wallet": "^0.0.2",
|
|
42
42
|
"@semaphore-protocol/identity": "4.14.3",
|
|
43
43
|
"zod": "^4.3.11"
|
|
44
44
|
},
|
package/src/member-api.ts
CHANGED
|
@@ -19,7 +19,9 @@ const challengeNonceSchema = z
|
|
|
19
19
|
.regex(/^(0x)?[0-9a-fA-F]{64}$/i, "must be 32-byte hex")
|
|
20
20
|
.transform((value) => `0x${value.replace(/^0x/i, "")}`.toLowerCase() as `0x${string}`)
|
|
21
21
|
|
|
22
|
-
export const challengeResponseSchema = z
|
|
22
|
+
export const challengeResponseSchema = z
|
|
23
|
+
.object({ challengeId: z.uuid(), nonce: challengeNonceSchema, expiresAt: z.number() })
|
|
24
|
+
.strict()
|
|
23
25
|
|
|
24
26
|
export const issueCredentialResponseSchema = z.object({ id: z.string().min(1), credential: z.unknown() }).strict()
|
|
25
27
|
|