@pagopa/io-react-native-wallet 0.9.2 → 0.10.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/lib/commonjs/credential/issuance/06-obtain-credential.js +2 -34
- package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +169 -0
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -0
- package/lib/commonjs/credential/issuance/08-confirm-credential.js +6 -0
- package/lib/commonjs/credential/issuance/08-confirm-credential.js.map +1 -0
- package/lib/commonjs/credential/issuance/const.js +6 -1
- package/lib/commonjs/credential/issuance/const.js.map +1 -1
- package/lib/commonjs/credential/issuance/index.js +7 -0
- package/lib/commonjs/credential/issuance/index.js.map +1 -1
- package/lib/commonjs/index.js +3 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/index.test.js +33 -1
- package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/index.js +15 -6
- package/lib/commonjs/sd-jwt/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/types.js +1 -1
- package/lib/commonjs/trust/types.js +5 -0
- package/lib/commonjs/trust/types.js.map +1 -1
- package/lib/commonjs/utils/misc.js +2 -2
- package/lib/commonjs/utils/misc.js.map +1 -1
- package/lib/module/credential/issuance/06-obtain-credential.js +3 -34
- package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js +163 -0
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -0
- package/lib/module/credential/issuance/08-confirm-credential.js +2 -0
- package/lib/module/credential/issuance/08-confirm-credential.js.map +1 -0
- package/lib/module/credential/issuance/const.js +2 -0
- package/lib/module/credential/issuance/const.js.map +1 -1
- package/lib/module/credential/issuance/index.js +2 -1
- package/lib/module/credential/issuance/index.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/sd-jwt/__test__/index.test.js +33 -1
- package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
- package/lib/module/sd-jwt/index.js +10 -6
- package/lib/module/sd-jwt/index.js.map +1 -1
- package/lib/module/sd-jwt/types.js +1 -1
- package/lib/module/trust/types.js +5 -0
- package/lib/module/trust/types.js.map +1 -1
- package/lib/module/utils/misc.js +2 -2
- package/lib/module/utils/misc.js.map +1 -1
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +2 -1
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts +36 -0
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -0
- package/lib/typescript/credential/issuance/08-confirm-credential.d.ts +11 -0
- package/lib/typescript/credential/issuance/08-confirm-credential.d.ts.map +1 -0
- package/lib/typescript/credential/issuance/const.d.ts +3 -0
- package/lib/typescript/credential/issuance/const.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/index.d.ts +4 -3
- package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/index.d.ts +222 -5
- package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/types.d.ts +1 -1
- package/lib/typescript/trust/index.d.ts +8 -0
- package/lib/typescript/trust/index.d.ts.map +1 -1
- package/lib/typescript/trust/types.d.ts +232 -0
- package/lib/typescript/trust/types.d.ts.map +1 -1
- package/lib/typescript/utils/misc.d.ts +1 -1
- package/lib/typescript/utils/misc.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/credential/issuance/06-obtain-credential.ts +3 -51
- package/src/credential/issuance/07-verify-and-parse-credential.ts +229 -0
- package/src/credential/issuance/08-confirm-credential.ts +14 -0
- package/src/credential/issuance/const.ts +6 -0
- package/src/credential/issuance/index.ts +7 -1
- package/src/index.ts +2 -0
- package/src/sd-jwt/__test__/index.test.ts +32 -1
- package/src/sd-jwt/index.ts +14 -8
- package/src/sd-jwt/types.ts +1 -1
- package/src/trust/types.ts +4 -0
- package/src/utils/misc.ts +4 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/trust/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,SAAS;;;;;;;;;EAAuD,CAAC;AAC9E,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAiDlD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc1B,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,yBAAyB,CACjC,CAAC;AACF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAIpC,CAAC;AAuCH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,8BAA8B,CACtC,CAAC;AACF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4D7E,CAAC"}
|
@@ -3,6 +3,6 @@
|
|
3
3
|
* @param status The expected status
|
4
4
|
* @returns The given response object
|
5
5
|
*/
|
6
|
-
export declare const hasStatus: (status: number) => (res: Response) => Response
|
6
|
+
export declare const hasStatus: (status: number) => (res: Response) => Promise<Response>;
|
7
7
|
export type Out<FN> = FN extends (...args: any[]) => Promise<any> ? Awaited<ReturnType<FN>> : FN extends (...args: any[]) => any ? ReturnType<FN> : never;
|
8
8
|
//# sourceMappingURL=misc.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../src/utils/misc.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,SAAS,WACX,MAAM,
|
1
|
+
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../src/utils/misc.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,SAAS,WACX,MAAM,WACH,QAAQ,KAAG,QAAQ,QAAQ,CAStC,CAAC;AAIJ,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,GAC7D,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,GACvB,EAAE,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAClC,UAAU,CAAC,EAAE,CAAC,GACd,KAAK,CAAC"}
|
package/package.json
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
import * as z from "zod";
|
2
2
|
import uuid from "react-native-uuid";
|
3
3
|
import { SignJWT, type CryptoContext } from "@pagopa/io-react-native-jwt";
|
4
|
-
import { verify as verifySdJwt } from "../../sd-jwt";
|
5
4
|
import { createDPopToken } from "../../utils/dpop";
|
6
5
|
|
7
6
|
import type { StartFlow } from "./01-start-flow";
|
8
7
|
import { hasStatus, type Out } from "../../utils/misc";
|
9
8
|
import type { EvaluateIssuerTrust } from "./02-evaluate-issuer-trust";
|
10
9
|
import type { AuthorizeAccess } from "./05-authorize-access";
|
11
|
-
import {
|
12
|
-
import { IoWalletError } from "../../utils/errors";
|
13
|
-
import type { JWK } from "../../utils/jwk";
|
10
|
+
import { SupportedCredentialFormat } from "./const";
|
14
11
|
|
15
12
|
/**
|
16
13
|
* Return the signed jwt for nonce proof of possession
|
@@ -36,46 +33,9 @@ export const createNonceProof = async (
|
|
36
33
|
.sign();
|
37
34
|
};
|
38
35
|
|
39
|
-
/**
|
40
|
-
* Given a credential, verify it's in the supported format
|
41
|
-
* and the credential is correctly signed
|
42
|
-
* and it's bound to the given key
|
43
|
-
*
|
44
|
-
* @param rawCredential The received credential
|
45
|
-
* @param issuerKeys The set of public keys of the issuer,
|
46
|
-
* which will be used to verify the signature
|
47
|
-
* @param holderBindingContext The access to the holder's key
|
48
|
-
*
|
49
|
-
* @throws If the signature verification fails
|
50
|
-
* @throws If the credential is not in the SdJwt4VC format
|
51
|
-
* @throws If the holder binding is not properly configured
|
52
|
-
*
|
53
|
-
*/
|
54
|
-
async function verifyCredential(
|
55
|
-
rawCredential: string,
|
56
|
-
issuerKeys: JWK[],
|
57
|
-
holderBindingContext: CryptoContext
|
58
|
-
): Promise<void> {
|
59
|
-
const [{ sdJwt }, holderBindingKey] =
|
60
|
-
// parallel for optimization
|
61
|
-
await Promise.all([
|
62
|
-
verifySdJwt(rawCredential, issuerKeys, SdJwt4VC),
|
63
|
-
holderBindingContext.getPublicKey(),
|
64
|
-
]);
|
65
|
-
|
66
|
-
if (
|
67
|
-
!sdJwt.payload.cnf.jwk.kid ||
|
68
|
-
sdJwt.payload.cnf.jwk.kid !== holderBindingKey.kid
|
69
|
-
) {
|
70
|
-
throw new IoWalletError(
|
71
|
-
`Failed to verify holder binding, expected kid: ${holderBindingKey.kid}, got: ${sdJwt.payload.cnf.jwk.kid}`
|
72
|
-
);
|
73
|
-
}
|
74
|
-
}
|
75
|
-
|
76
36
|
const CredentialEndpointResponse = z.object({
|
77
37
|
credential: z.string(),
|
78
|
-
format:
|
38
|
+
format: SupportedCredentialFormat,
|
79
39
|
});
|
80
40
|
|
81
41
|
export type ObtainCredential = (
|
@@ -89,7 +49,7 @@ export type ObtainCredential = (
|
|
89
49
|
walletProviderBaseUrl: string;
|
90
50
|
appFetch?: GlobalFetch["fetch"];
|
91
51
|
}
|
92
|
-
) => Promise<{ credential: string; format:
|
52
|
+
) => Promise<{ credential: string; format: SupportedCredentialFormat }>;
|
93
53
|
|
94
54
|
/**
|
95
55
|
* Fetch a credential from the issuer
|
@@ -167,13 +127,5 @@ export const obtainCredential: ObtainCredential = async (
|
|
167
127
|
.then((res) => res.json())
|
168
128
|
.then(CredentialEndpointResponse.parse);
|
169
129
|
|
170
|
-
/** validate the received credential signature
|
171
|
-
is correct and refers to the public keys of the issuer */
|
172
|
-
await verifyCredential(
|
173
|
-
credential,
|
174
|
-
issuerConf.openid_credential_issuer.jwks.keys,
|
175
|
-
credentialCryptoContext
|
176
|
-
);
|
177
|
-
|
178
130
|
return { credential, format };
|
179
131
|
};
|
@@ -0,0 +1,229 @@
|
|
1
|
+
import type { Out } from "../../utils/misc";
|
2
|
+
import type { EvaluateIssuerTrust } from "./02-evaluate-issuer-trust";
|
3
|
+
import type { ObtainCredential } from "./06-obtain-credential";
|
4
|
+
import { IoWalletError } from "../../utils/errors";
|
5
|
+
import { SdJwt4VC } from "../../sd-jwt/types";
|
6
|
+
import { verify as verifySdJwt } from "../../sd-jwt";
|
7
|
+
import type { JWK } from "../../utils/jwk";
|
8
|
+
import type { CryptoContext } from "@pagopa/io-react-native-jwt";
|
9
|
+
|
10
|
+
export type VerifyAndParseCredential = (
|
11
|
+
issuerConf: Out<EvaluateIssuerTrust>["issuerConf"],
|
12
|
+
credential: Out<ObtainCredential>["credential"],
|
13
|
+
format: Out<ObtainCredential>["format"],
|
14
|
+
context: {
|
15
|
+
credentialCryptoContext: CryptoContext;
|
16
|
+
ignoreMissingAttributes?: boolean;
|
17
|
+
}
|
18
|
+
) => Promise<{ parsedCredential: ParsedCredential }>;
|
19
|
+
|
20
|
+
// The credential as a collection of attributes in plain value
|
21
|
+
type ParsedCredential = Record<
|
22
|
+
/** Attribute key */
|
23
|
+
string,
|
24
|
+
{
|
25
|
+
/** Human-readable name of the attribute */
|
26
|
+
name:
|
27
|
+
| /* if i18n is provided */ Record<
|
28
|
+
string /* locale */,
|
29
|
+
string /* value */
|
30
|
+
>
|
31
|
+
| /* if no i18n is provided */ string;
|
32
|
+
/** If in defined as mandatory by the Issuer */
|
33
|
+
mandatory: boolean;
|
34
|
+
/** The actual value of the attribute */
|
35
|
+
value: unknown;
|
36
|
+
}
|
37
|
+
>;
|
38
|
+
|
39
|
+
// handy alias
|
40
|
+
type DecodedSdJwtCredential = Out<typeof verifySdJwt> & {
|
41
|
+
sdJwt: SdJwt4VC;
|
42
|
+
};
|
43
|
+
|
44
|
+
const parseCredentialSdJwt = (
|
45
|
+
// the list of supported credentials, as defined in the issuer configuration
|
46
|
+
credentials_supported: Out<EvaluateIssuerTrust>["issuerConf"]["openid_credential_issuer"]["credentials_supported"],
|
47
|
+
{ sdJwt, disclosures }: DecodedSdJwtCredential,
|
48
|
+
ignoreMissingAttributes: boolean = false
|
49
|
+
): ParsedCredential => {
|
50
|
+
// find the definition that matches the received credential's type
|
51
|
+
// warning: if more then a defintion is found, the first is retrieved
|
52
|
+
const credentialSubject = credentials_supported.find((c) =>
|
53
|
+
c.credential_definition.type.includes(sdJwt.payload.type)
|
54
|
+
)?.credential_definition.credentialSubject;
|
55
|
+
|
56
|
+
// the received credential matches no supported credential, throw an exception
|
57
|
+
if (!credentialSubject) {
|
58
|
+
const expected = credentials_supported
|
59
|
+
.flatMap((_) => _.credential_definition.type)
|
60
|
+
.join(", ");
|
61
|
+
throw new IoWalletError(
|
62
|
+
`Received credential is of an unknwown type. Expected one of [${expected}], received '${sdJwt.payload.type}', `
|
63
|
+
);
|
64
|
+
}
|
65
|
+
|
66
|
+
// transfrom a record { key: value } in an iterable of pairs [key, value]
|
67
|
+
const attrDefinitions = Object.entries(credentialSubject);
|
68
|
+
|
69
|
+
// every mandatory attribute must be present in the credential's disclosures
|
70
|
+
// the key of the attribute defintion must match the disclosure's name
|
71
|
+
const attrsNotInDisclosures = attrDefinitions.filter(
|
72
|
+
([attrKey, { mandatory }]) =>
|
73
|
+
mandatory && !disclosures.some(([, name]) => name === attrKey)
|
74
|
+
);
|
75
|
+
if (attrsNotInDisclosures.length > 0) {
|
76
|
+
const missing = attrsNotInDisclosures.map((_) => _[0 /* key */]).join(", ");
|
77
|
+
const received = disclosures.map((_) => _[1 /* name */]).join(", ");
|
78
|
+
// the rationale of this condition is that we may want to be permissive
|
79
|
+
// on incomplete credentials in the test phase of the project.
|
80
|
+
// we might want to be strict once in production, hence remove this condition
|
81
|
+
if (!ignoreMissingAttributes) {
|
82
|
+
throw new IoWalletError(
|
83
|
+
`Some attributes are missing in the credential. Missing: [${missing}], received: [${received}]`
|
84
|
+
);
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
// attributes that are defined in the issuer configuration
|
89
|
+
// and are present in the disclosure set
|
90
|
+
const definedValues = attrDefinitions
|
91
|
+
// retrieve the value from the disclosure set
|
92
|
+
.map(
|
93
|
+
([attrKey, definition]) =>
|
94
|
+
[
|
95
|
+
attrKey,
|
96
|
+
{
|
97
|
+
...definition,
|
98
|
+
value: disclosures.find(
|
99
|
+
(_) => _[1 /* name */] === attrKey
|
100
|
+
)?.[2 /* value */],
|
101
|
+
},
|
102
|
+
] as const
|
103
|
+
)
|
104
|
+
// add a human readable attribute name, with i18n, in the form { locale: name }
|
105
|
+
// example: { "it-IT": "Nome", "en-EN": "Name", "es-ES": "Nombre" }
|
106
|
+
.map(
|
107
|
+
([attrKey, { display, ...definition }]) =>
|
108
|
+
[
|
109
|
+
attrKey,
|
110
|
+
{
|
111
|
+
...definition,
|
112
|
+
name: display.reduce(
|
113
|
+
(names, { locale, name }) => ({ ...names, [locale]: name }),
|
114
|
+
{} as Record<string, string>
|
115
|
+
),
|
116
|
+
},
|
117
|
+
] as const
|
118
|
+
);
|
119
|
+
|
120
|
+
// attributes that are in the disclosure set
|
121
|
+
// but are not defined in the issuer configuration
|
122
|
+
const undefinedValues = disclosures
|
123
|
+
.filter((_) => !Object.keys(definedValues).includes(_[1]))
|
124
|
+
.map(([, key, value]) => [key, { value, mandatory: false, name: key }]);
|
125
|
+
|
126
|
+
return {
|
127
|
+
...Object.fromEntries(definedValues),
|
128
|
+
...Object.fromEntries(undefinedValues),
|
129
|
+
};
|
130
|
+
};
|
131
|
+
|
132
|
+
/**
|
133
|
+
* Given a credential, verify it's in the supported format
|
134
|
+
* and the credential is correctly signed
|
135
|
+
* and it's bound to the given key
|
136
|
+
*
|
137
|
+
* @param rawCredential The received credential
|
138
|
+
* @param issuerKeys The set of public keys of the issuer,
|
139
|
+
* which will be used to verify the signature
|
140
|
+
* @param holderBindingContext The access to the holder's key
|
141
|
+
*
|
142
|
+
* @throws If the signature verification fails
|
143
|
+
* @throws If the credential is not in the SdJwt4VC format
|
144
|
+
* @throws If the holder binding is not properly configured
|
145
|
+
*
|
146
|
+
*/
|
147
|
+
async function verifyCredentialSdJwt(
|
148
|
+
rawCredential: string,
|
149
|
+
issuerKeys: JWK[],
|
150
|
+
holderBindingContext: CryptoContext
|
151
|
+
): Promise<DecodedSdJwtCredential> {
|
152
|
+
const [decodedCredential, holderBindingKey] =
|
153
|
+
// parallel for optimization
|
154
|
+
await Promise.all([
|
155
|
+
verifySdJwt(rawCredential, issuerKeys, SdJwt4VC),
|
156
|
+
holderBindingContext.getPublicKey(),
|
157
|
+
]);
|
158
|
+
|
159
|
+
const { cnf } = decodedCredential.sdJwt.payload;
|
160
|
+
|
161
|
+
if (!cnf.jwk.kid || cnf.jwk.kid !== holderBindingKey.kid) {
|
162
|
+
throw new IoWalletError(
|
163
|
+
`Failed to verify holder binding, expected kid: ${holderBindingKey.kid}, got: ${decodedCredential.sdJwt.payload.cnf.jwk.kid}`
|
164
|
+
);
|
165
|
+
}
|
166
|
+
|
167
|
+
return decodedCredential;
|
168
|
+
}
|
169
|
+
|
170
|
+
// utility type that specialize VerifyAndParseCredential for given format
|
171
|
+
type WithFormat<Format extends Parameters<VerifyAndParseCredential>[2]> = (
|
172
|
+
_0: Parameters<VerifyAndParseCredential>[0],
|
173
|
+
_1: Parameters<VerifyAndParseCredential>[1],
|
174
|
+
_2: Format,
|
175
|
+
_3: Parameters<VerifyAndParseCredential>[3]
|
176
|
+
) => ReturnType<VerifyAndParseCredential>;
|
177
|
+
|
178
|
+
const verifyAndParseCredentialSdJwt: WithFormat<"vc+sd-jwt"> = async (
|
179
|
+
issuerConf,
|
180
|
+
credential,
|
181
|
+
_,
|
182
|
+
{ credentialCryptoContext, ignoreMissingAttributes }
|
183
|
+
) => {
|
184
|
+
const decoded = await verifyCredentialSdJwt(
|
185
|
+
credential,
|
186
|
+
issuerConf.openid_credential_issuer.jwks.keys,
|
187
|
+
credentialCryptoContext
|
188
|
+
);
|
189
|
+
|
190
|
+
const parsedCredential = parseCredentialSdJwt(
|
191
|
+
issuerConf.openid_credential_issuer.credentials_supported,
|
192
|
+
decoded,
|
193
|
+
ignoreMissingAttributes
|
194
|
+
);
|
195
|
+
|
196
|
+
return { parsedCredential };
|
197
|
+
};
|
198
|
+
|
199
|
+
/**
|
200
|
+
* Verify and parse an encoded credential
|
201
|
+
*
|
202
|
+
* @param issuerConf The Issuer configuration
|
203
|
+
* @param credential The encoded credential
|
204
|
+
* @param format The format of the credentual
|
205
|
+
* @param context.credentialCryptoContext The context to access the key the Credential will be bound to
|
206
|
+
* @param context.ignoreMissingAttributes (optional) Whether to fail if a defined attribute is note present in the credentual. Default: false
|
207
|
+
* @returns A parsed credential with attributes in plain value
|
208
|
+
* @throws If the credential signature is not verified with the Issuer key set
|
209
|
+
* @throws If the credential is not bound to the provided user key
|
210
|
+
* @throws If the credential data fail to parse
|
211
|
+
*/
|
212
|
+
export const verifyAndParseCredential: VerifyAndParseCredential = async (
|
213
|
+
issuerConf,
|
214
|
+
credential,
|
215
|
+
format,
|
216
|
+
context
|
217
|
+
) => {
|
218
|
+
if (format === "vc+sd-jwt") {
|
219
|
+
return verifyAndParseCredentialSdJwt(
|
220
|
+
issuerConf,
|
221
|
+
credential,
|
222
|
+
format,
|
223
|
+
context
|
224
|
+
);
|
225
|
+
}
|
226
|
+
|
227
|
+
const _: never = format;
|
228
|
+
throw new IoWalletError(`Unsupported credential format: ${_}`);
|
229
|
+
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { ObtainCredential } from "./06-obtain-credential";
|
2
|
+
import type { Out } from "../../utils/misc";
|
3
|
+
|
4
|
+
/**
|
5
|
+
* The end of the issuing flow.
|
6
|
+
* The User accepted the Credential and it can be stored in the device according to the app implementation preferences.
|
7
|
+
* To be implemented.
|
8
|
+
*
|
9
|
+
* @returns The type of the Credential to be issued and the url of the Issuer
|
10
|
+
*/
|
11
|
+
export type ConfirmCredential = (
|
12
|
+
credential: Out<ObtainCredential>["credential"],
|
13
|
+
format: Out<ObtainCredential>["format"]
|
14
|
+
) => Promise<void>;
|
@@ -1,2 +1,8 @@
|
|
1
|
+
import * as z from "zod";
|
1
2
|
export const ASSERTION_TYPE =
|
2
3
|
"urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation";
|
4
|
+
|
5
|
+
export type SupportedCredentialFormat = z.infer<
|
6
|
+
typeof SupportedCredentialFormat
|
7
|
+
>;
|
8
|
+
export const SupportedCredentialFormat = z.literal("vc+sd-jwt");
|
@@ -13,13 +13,18 @@ import {
|
|
13
13
|
obtainCredential,
|
14
14
|
type ObtainCredential,
|
15
15
|
} from "./06-obtain-credential";
|
16
|
-
import
|
16
|
+
import {
|
17
|
+
verifyAndParseCredential,
|
18
|
+
type VerifyAndParseCredential,
|
19
|
+
} from "./07-verify-and-parse-credential";
|
20
|
+
import type { ConfirmCredential } from "./08-confirm-credential";
|
17
21
|
|
18
22
|
export {
|
19
23
|
evaluateIssuerTrust,
|
20
24
|
startUserAuthorization,
|
21
25
|
authorizeAccess,
|
22
26
|
obtainCredential,
|
27
|
+
verifyAndParseCredential,
|
23
28
|
};
|
24
29
|
export type {
|
25
30
|
StartFlow,
|
@@ -28,5 +33,6 @@ export type {
|
|
28
33
|
CompleteUserAuthorization,
|
29
34
|
AuthorizeAccess,
|
30
35
|
ObtainCredential,
|
36
|
+
VerifyAndParseCredential,
|
31
37
|
ConfirmCredential,
|
32
38
|
};
|
package/src/index.ts
CHANGED
@@ -4,6 +4,7 @@ import "react-native-url-polyfill/auto";
|
|
4
4
|
|
5
5
|
import * as Credential from "./credential";
|
6
6
|
import * as PID from "./pid";
|
7
|
+
import * as SdJwt from "./sd-jwt";
|
7
8
|
import * as Errors from "./utils/errors";
|
8
9
|
import * as WalletInstanceAttestation from "./wallet-instance-attestation";
|
9
10
|
import * as Trust from "./trust";
|
@@ -11,6 +12,7 @@ import { AuthorizationDetail, AuthorizationDetails } from "./utils/par";
|
|
11
12
|
import { createCryptoContextFor } from "./utils/crypto";
|
12
13
|
|
13
14
|
export {
|
15
|
+
SdJwt,
|
14
16
|
PID,
|
15
17
|
Credential,
|
16
18
|
WalletInstanceAttestation,
|
@@ -1,9 +1,10 @@
|
|
1
|
+
import { z } from "zod";
|
1
2
|
import { decode, disclose } from "../index";
|
2
3
|
|
3
4
|
import { encodeBase64, decodeBase64 } from "@pagopa/io-react-native-jwt";
|
4
5
|
import { SdJwt4VC } from "../types";
|
5
6
|
|
6
|
-
// Examples from https://www.ietf.org/id/draft-terbu-sd-jwt-vc-02.html#name-example-4
|
7
|
+
// Examples from https://www.ietf.org/archive/id/draft-terbu-sd-jwt-vc-02.html#name-example-4
|
7
8
|
// but adapted to adhere to format declared in https://italia.github.io/eudi-wallet-it-docs/versione-corrente/en/pid-eaa-data-model.html#id2
|
8
9
|
// In short, the token is a Frankenstein composed as follows:
|
9
10
|
// - the header is taken from the italian specification, with kid and alg valued according to the signing keys
|
@@ -124,6 +125,36 @@ describe("decode", () => {
|
|
124
125
|
})),
|
125
126
|
});
|
126
127
|
});
|
128
|
+
|
129
|
+
it("should decode with default decoder", () => {
|
130
|
+
const result = decode(token);
|
131
|
+
expect(result).toEqual({
|
132
|
+
sdJwt,
|
133
|
+
disclosures: disclosures.map((decoded, i) => ({
|
134
|
+
decoded,
|
135
|
+
encoded: tokenizedDisclosures[i],
|
136
|
+
})),
|
137
|
+
});
|
138
|
+
});
|
139
|
+
|
140
|
+
it("should accept only decoders that extend SdJwt4VC", () => {
|
141
|
+
const validDecoder = SdJwt4VC.and(
|
142
|
+
z.object({ payload: z.object({ customField: z.string() }) })
|
143
|
+
);
|
144
|
+
const invalidDecoder = z.object({
|
145
|
+
payload: z.object({ customField: z.string() }),
|
146
|
+
});
|
147
|
+
|
148
|
+
try {
|
149
|
+
// ts is fine
|
150
|
+
decode(token, validDecoder);
|
151
|
+
// @ts-expect-error break types
|
152
|
+
decode(token, invalidDecoder);
|
153
|
+
} catch (error) {
|
154
|
+
// ignore actual result, just focus on types
|
155
|
+
// spot the error during type checking phase
|
156
|
+
}
|
157
|
+
});
|
127
158
|
});
|
128
159
|
|
129
160
|
describe("disclose", () => {
|
package/src/sd-jwt/index.ts
CHANGED
@@ -27,14 +27,14 @@ const decodeDisclosure = (encoded: string): DisclosureWithEncoded => {
|
|
27
27
|
*
|
28
28
|
* @function
|
29
29
|
* @param token The encoded token that represents a valid sd-jwt for verifiable credentials
|
30
|
-
* @param
|
30
|
+
* @param customSchema (optional) Schema to use to parse the SD-JWT. Default: SdJwt4VC
|
31
31
|
*
|
32
32
|
* @returns The parsed SD-JWT token and the parsed disclosures
|
33
33
|
*
|
34
34
|
*/
|
35
|
-
export const decode = <S extends z.
|
35
|
+
export const decode = <S extends z.ZodType<SdJwt4VC>>(
|
36
36
|
token: string,
|
37
|
-
|
37
|
+
customSchema?: S
|
38
38
|
): {
|
39
39
|
sdJwt: z.infer<S>;
|
40
40
|
disclosures: DisclosureWithEncoded[];
|
@@ -48,7 +48,11 @@ export const decode = <S extends z.AnyZodObject>(
|
|
48
48
|
// get the sd-jwt as object
|
49
49
|
// validate it's a valid SD-JWT for Verifiable Credentials
|
50
50
|
const decodedJwt = decodeJwt(rawSdJwt);
|
51
|
-
|
51
|
+
|
52
|
+
// use a custom parsed if provided, otherwise use base SdJwt4VC
|
53
|
+
const parser = customSchema || SdJwt4VC;
|
54
|
+
|
55
|
+
const sdJwt = parser.parse({
|
52
56
|
header: decodedJwt.protectedHeader,
|
53
57
|
payload: decodedJwt.payload,
|
54
58
|
});
|
@@ -136,19 +140,19 @@ export const disclose = async (
|
|
136
140
|
*
|
137
141
|
* @param token The encoded token that represents a valid sd-jwt for verifiable credentials
|
138
142
|
* @param publicKey The single public key or an array of public keys to validate the signature.
|
139
|
-
* @param
|
143
|
+
* @param customSchema Schema to use to parse the SD-JWT
|
140
144
|
*
|
141
145
|
* @returns The parsed SD-JWT token and the parsed disclosures
|
142
146
|
*
|
143
147
|
*/
|
144
|
-
export const verify = async <S extends z.
|
148
|
+
export const verify = async <S extends z.ZodType<SdJwt4VC>>(
|
145
149
|
token: string,
|
146
150
|
publicKey: JWK | JWK[],
|
147
|
-
|
151
|
+
customSchema?: S
|
148
152
|
): Promise<{ sdJwt: z.infer<S>; disclosures: Disclosure[] }> => {
|
149
153
|
// get decoded data
|
150
154
|
const [rawSdJwt = ""] = token.split("~");
|
151
|
-
const decoded = decode(token,
|
155
|
+
const decoded = decode(token, customSchema);
|
152
156
|
|
153
157
|
//Check signature
|
154
158
|
await verifyJwt(rawSdJwt, publicKey);
|
@@ -170,3 +174,5 @@ export const verify = async <S extends z.AnyZodObject>(
|
|
170
174
|
disclosures: decoded.disclosures.map((d) => d.decoded),
|
171
175
|
};
|
172
176
|
};
|
177
|
+
|
178
|
+
export { SdJwt4VC };
|
package/src/sd-jwt/types.ts
CHANGED
@@ -26,7 +26,7 @@ export const Disclosure = z.tuple([
|
|
26
26
|
* For such reason, we may find conveninent to have encoded and decode values stored explicitly in the same structure.
|
27
27
|
* Please note that `encoded` can always decode into `decode`, but `decode` may or may not be encoded with the same value of `encoded`
|
28
28
|
*
|
29
|
-
* @see https://www.ietf.org/id/draft-ietf-oauth-selective-disclosure-jwt-05.html#name-disclosures-for-object-prop
|
29
|
+
* @see https://www.ietf.org/archive/id/draft-ietf-oauth-selective-disclosure-jwt-05.html#name-disclosures-for-object-prop
|
30
30
|
*/
|
31
31
|
export type DisclosureWithEncoded = {
|
32
32
|
decoded: Disclosure;
|
package/src/trust/types.ts
CHANGED
@@ -78,6 +78,9 @@ export const EntityConfigurationHeader = z.object({
|
|
78
78
|
kid: z.string(),
|
79
79
|
});
|
80
80
|
|
81
|
+
/**
|
82
|
+
* @see https://openid.net/specs/openid-connect-federation-1_0-29.html#name-federation-entity
|
83
|
+
*/
|
81
84
|
const FederationEntityMetadata = z
|
82
85
|
.object({
|
83
86
|
federation_fetch_endpoint: z.string().optional(),
|
@@ -85,6 +88,7 @@ const FederationEntityMetadata = z
|
|
85
88
|
federation_resolve_endpoint: z.string().optional(),
|
86
89
|
federation_trust_mark_status_endpoint: z.string().optional(),
|
87
90
|
federation_trust_mark_list_endpoint: z.string().optional(),
|
91
|
+
organization_name: z.string().optional(),
|
88
92
|
homepage_uri: z.string().optional(),
|
89
93
|
policy_uri: z.string().optional(),
|
90
94
|
logo_uri: z.string().optional(),
|
package/src/utils/misc.ts
CHANGED
@@ -7,10 +7,12 @@ import { IoWalletError } from "./errors";
|
|
7
7
|
*/
|
8
8
|
export const hasStatus =
|
9
9
|
(status: number) =>
|
10
|
-
(res: Response): Response => {
|
10
|
+
async (res: Response): Promise<Response> => {
|
11
11
|
if (res.status !== status) {
|
12
12
|
throw new IoWalletError(
|
13
|
-
`Http request failed. Expected ${status}, got ${res.status}, url: ${
|
13
|
+
`Http request failed. Expected ${status}, got ${res.status}, url: ${
|
14
|
+
res.url
|
15
|
+
} with response: ${await res.text()}`
|
14
16
|
);
|
15
17
|
}
|
16
18
|
return res;
|