@pagopa/io-react-native-wallet 3.5.0 → 3.6.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/api/IssuerConfig.js +1 -1
- package/lib/commonjs/credential/issuance/api/IssuerConfig.js.map +1 -1
- package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.mdoc.js +8 -3
- package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.mdoc.js.map +1 -1
- package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js +6 -4
- package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/mappers.js +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/mappers.js.map +1 -1
- package/lib/commonjs/credential/status/README.md +15 -13
- package/lib/commonjs/credential/status/api/index.js.map +1 -1
- package/lib/commonjs/credential/status/api/types.js +27 -0
- package/lib/commonjs/credential/status/api/types.js.map +1 -1
- package/lib/commonjs/credential/status/v1.3.3/01-status-list.js +26 -22
- package/lib/commonjs/credential/status/v1.3.3/01-status-list.js.map +1 -1
- package/lib/commonjs/credential/status/v1.3.3/02-verify-and-parse-status-list.js +4 -25
- package/lib/commonjs/credential/status/v1.3.3/02-verify-and-parse-status-list.js.map +1 -1
- package/lib/commonjs/credential/status/v1.3.3/03-get-status.js +34 -0
- package/lib/commonjs/credential/status/v1.3.3/03-get-status.js.map +1 -0
- package/lib/commonjs/credential/status/v1.3.3/index.js +4 -1
- package/lib/commonjs/credential/status/v1.3.3/index.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js +1 -0
- package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/common/get-status-l10n-ids.js +1 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/mappers.js +2 -2
- package/lib/commonjs/credentials-catalogue/v1.3.3/mappers.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/types.js +2 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/types.js.map +1 -1
- package/lib/commonjs/mdoc/const.js +3 -1
- package/lib/commonjs/mdoc/const.js.map +1 -1
- package/lib/commonjs/mdoc/utils.js +5 -5
- package/lib/commonjs/mdoc/utils.js.map +1 -1
- package/lib/module/credential/issuance/api/IssuerConfig.js +1 -1
- package/lib/module/credential/issuance/api/IssuerConfig.js.map +1 -1
- package/lib/module/credential/issuance/common/06-verify-and-parse-credential.mdoc.js +8 -3
- package/lib/module/credential/issuance/common/06-verify-and-parse-credential.mdoc.js.map +1 -1
- package/lib/module/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js +6 -4
- package/lib/module/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/mappers.js +1 -1
- package/lib/module/credential/issuance/v1.3.3/mappers.js.map +1 -1
- package/lib/module/credential/status/README.md +15 -13
- package/lib/module/credential/status/api/index.js +3 -1
- package/lib/module/credential/status/api/index.js.map +1 -1
- package/lib/module/credential/status/api/types.js +20 -0
- package/lib/module/credential/status/api/types.js.map +1 -1
- package/lib/module/credential/status/v1.3.3/01-status-list.js +24 -21
- package/lib/module/credential/status/v1.3.3/01-status-list.js.map +1 -1
- package/lib/module/credential/status/v1.3.3/02-verify-and-parse-status-list.js +5 -26
- package/lib/module/credential/status/v1.3.3/02-verify-and-parse-status-list.js.map +1 -1
- package/lib/module/credential/status/v1.3.3/03-get-status.js +27 -0
- package/lib/module/credential/status/v1.3.3/03-get-status.js.map +1 -0
- package/lib/module/credential/status/v1.3.3/index.js +5 -2
- package/lib/module/credential/status/v1.3.3/index.js.map +1 -1
- package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js +1 -0
- package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
- package/lib/module/credentials-catalogue/common/get-status-l10n-ids.js +1 -1
- package/lib/module/credentials-catalogue/v1.3.3/mappers.js +2 -2
- package/lib/module/credentials-catalogue/v1.3.3/mappers.js.map +1 -1
- package/lib/module/credentials-catalogue/v1.3.3/types.js +2 -1
- package/lib/module/credentials-catalogue/v1.3.3/types.js.map +1 -1
- package/lib/module/mdoc/const.js +1 -0
- package/lib/module/mdoc/const.js.map +1 -1
- package/lib/module/mdoc/utils.js +6 -6
- package/lib/module/mdoc/utils.js.map +1 -1
- package/lib/typescript/credential/issuance/api/IssuerConfig.d.ts +2 -2
- package/lib/typescript/credential/issuance/common/06-verify-and-parse-credential.mdoc.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/common/06-verify-and-parse-credential.sdjwt.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/mappers.d.ts +2 -2
- package/lib/typescript/credential/issuance/v1.3.3/mappers.d.ts +2 -2
- package/lib/typescript/credential/issuance/v1.3.3/mappers.d.ts.map +1 -1
- package/lib/typescript/credential/status/api/index.d.ts +3 -1
- package/lib/typescript/credential/status/api/index.d.ts.map +1 -1
- package/lib/typescript/credential/status/api/status-assertion.d.ts +1 -1
- package/lib/typescript/credential/status/api/status-list.d.ts +27 -9
- package/lib/typescript/credential/status/api/status-list.d.ts.map +1 -1
- package/lib/typescript/credential/status/api/types.d.ts +20 -0
- package/lib/typescript/credential/status/api/types.d.ts.map +1 -1
- package/lib/typescript/credential/status/v1.3.3/01-status-list.d.ts +1 -0
- package/lib/typescript/credential/status/v1.3.3/01-status-list.d.ts.map +1 -1
- package/lib/typescript/credential/status/v1.3.3/02-verify-and-parse-status-list.d.ts.map +1 -1
- package/lib/typescript/credential/status/v1.3.3/03-get-status.d.ts +3 -0
- package/lib/typescript/credential/status/v1.3.3/03-get-status.d.ts.map +1 -0
- package/lib/typescript/credential/status/v1.3.3/index.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts +2 -0
- package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/api/index.d.ts +1 -1
- package/lib/typescript/credentials-catalogue/common/get-status-l10n-ids.d.ts +1 -1
- package/lib/typescript/credentials-catalogue/v1.0.0/mappers.d.ts +1 -0
- package/lib/typescript/credentials-catalogue/v1.0.0/mappers.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.3.3/mappers.d.ts +6 -4
- package/lib/typescript/credentials-catalogue/v1.3.3/mappers.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.3.3/types.d.ts +6 -4
- package/lib/typescript/credentials-catalogue/v1.3.3/types.d.ts.map +1 -1
- package/lib/typescript/mdoc/const.d.ts +1 -0
- package/lib/typescript/mdoc/const.d.ts.map +1 -1
- package/lib/typescript/mdoc/utils.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/credential/issuance/api/IssuerConfig.ts +1 -1
- package/src/credential/issuance/common/06-verify-and-parse-credential.mdoc.ts +19 -3
- package/src/credential/issuance/common/06-verify-and-parse-credential.sdjwt.ts +14 -4
- package/src/credential/issuance/v1.3.3/mappers.ts +1 -1
- package/src/credential/status/README.md +15 -13
- package/src/credential/status/api/index.ts +3 -1
- package/src/credential/status/api/status-assertion.ts +1 -1
- package/src/credential/status/api/status-list.ts +35 -12
- package/src/credential/status/api/types.ts +27 -0
- package/src/credential/status/v1.3.3/01-status-list.ts +30 -18
- package/src/credential/status/v1.3.3/02-verify-and-parse-status-list.ts +5 -27
- package/src/credential/status/v1.3.3/03-get-status.ts +40 -0
- package/src/credential/status/v1.3.3/index.ts +4 -1
- package/src/credentials-catalogue/api/DigitalCredentialsCatalogue.ts +1 -0
- package/src/credentials-catalogue/api/index.ts +1 -1
- package/src/credentials-catalogue/common/get-status-l10n-ids.ts +1 -1
- package/src/credentials-catalogue/v1.3.3/mappers.ts +4 -2
- package/src/credentials-catalogue/v1.3.3/types.ts +4 -6
- package/src/mdoc/const.ts +1 -0
- package/src/mdoc/utils.ts +11 -8
|
@@ -54,7 +54,7 @@ export interface CredentialsCatalogueApi {
|
|
|
54
54
|
* Given a statusBit (e.g. "0x00", "0x0B") and a DigitalCredential from the
|
|
55
55
|
* catalogue, returns the matching l10n IDs or undefined if not found.
|
|
56
56
|
* The comparison is case-insensitive to handle uppercase statusBit values
|
|
57
|
-
* returned by
|
|
57
|
+
* returned by getStatus against lowercase keys in the catalogue.
|
|
58
58
|
*
|
|
59
59
|
* @since 1.0.0
|
|
60
60
|
*/
|
|
@@ -5,7 +5,7 @@ import { type CredentialsCatalogueApi } from "../api";
|
|
|
5
5
|
* Given a statusBit (e.g. "0x00", "0x0B") and a DigitalCredential from the
|
|
6
6
|
* catalogue, returns the matching l10n IDs or undefined if not found.
|
|
7
7
|
* The comparison is case-insensitive to handle uppercase statusBit values
|
|
8
|
-
* returned by
|
|
8
|
+
* returned by getStatus against lowercase keys in the catalogue.
|
|
9
9
|
*/
|
|
10
10
|
export const getStatusL10nIds: CredentialsCatalogueApi["getStatusL10nIds"] = (
|
|
11
11
|
statusBit,
|
|
@@ -65,7 +65,7 @@ export const mapToCredentialsCatalogue = createMapper<
|
|
|
65
65
|
`Schemas for ${credentialType} must be present in the Schema Registry`
|
|
66
66
|
);
|
|
67
67
|
return schemas.map((schema) => ({
|
|
68
|
-
configuration_id: schema.id, // TODO: [SIW-3978]
|
|
68
|
+
configuration_id: schema.id, // TODO: [SIW-3978] Fix this, the schema ID does not correspond to configuration_id
|
|
69
69
|
...schema,
|
|
70
70
|
}));
|
|
71
71
|
};
|
|
@@ -87,7 +87,9 @@ export const mapToCredentialsCatalogue = createMapper<
|
|
|
87
87
|
({ authentic_sources, credential_name_l10n_id, ...credential }) => ({
|
|
88
88
|
name_l10n_id: credential_name_l10n_id,
|
|
89
89
|
formats: resolveFormats(credential.credential_type),
|
|
90
|
-
authentic_sources: authentic_sources
|
|
90
|
+
authentic_sources: authentic_sources
|
|
91
|
+
? authentic_sources.map(resolveAuthSource)
|
|
92
|
+
: [],
|
|
91
93
|
...credential,
|
|
92
94
|
})
|
|
93
95
|
),
|
|
@@ -132,12 +132,10 @@ export const DigitalCredential = z.object({
|
|
|
132
132
|
classes: z.array(z.string()).optional(),
|
|
133
133
|
purposes: z.array(z.string()),
|
|
134
134
|
issuers: z.array(CredentialIssuer),
|
|
135
|
-
authentic_sources: z
|
|
136
|
-
z.object({
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
})
|
|
140
|
-
),
|
|
135
|
+
authentic_sources: z
|
|
136
|
+
.array(z.object({ id: z.string(), dataset_id: z.string() }))
|
|
137
|
+
.optional(),
|
|
138
|
+
parent_credentials: z.array(z.string()).optional(),
|
|
141
139
|
});
|
|
142
140
|
|
|
143
141
|
const JwtHeader = z.object({
|
package/src/mdoc/const.ts
CHANGED
package/src/mdoc/utils.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { CBOR } from "@pagopa/io-react-native-iso18013";
|
|
|
2
2
|
import { Verification } from "../sd-jwt/types";
|
|
3
3
|
import type { IssuanceApi } from "../credential/issuance";
|
|
4
4
|
import type { Out } from "../utils/misc";
|
|
5
|
-
import {
|
|
5
|
+
import { MDOC_VERIFICATION_IDENTIFIER } from "./const";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @param namespace The mdoc credential `namespace`
|
|
@@ -25,11 +25,12 @@ export const getVerificationFromParsedCredential = (
|
|
|
25
25
|
IssuanceApi["verifyAndParseCredential"]
|
|
26
26
|
>["parsedCredential"]
|
|
27
27
|
) => {
|
|
28
|
-
const verificationKey =
|
|
29
|
-
|
|
30
|
-
"verification"
|
|
28
|
+
const verificationKey = Object.keys(parsedCredential).find((key) =>
|
|
29
|
+
key.endsWith(MDOC_VERIFICATION_IDENTIFIER)
|
|
31
30
|
);
|
|
32
|
-
const verification =
|
|
31
|
+
const verification = verificationKey
|
|
32
|
+
? parsedCredential[verificationKey]?.value
|
|
33
|
+
: undefined;
|
|
33
34
|
return verification ? Verification.parse(verification) : undefined;
|
|
34
35
|
};
|
|
35
36
|
|
|
@@ -43,9 +44,11 @@ export const getVerificationFromParsedCredential = (
|
|
|
43
44
|
*/
|
|
44
45
|
export const getVerification = async (token: string) => {
|
|
45
46
|
const issuerSigned = await CBOR.decodeIssuerSigned(token);
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
47
|
+
|
|
48
|
+
const flattenedClaims = Object.values(issuerSigned.nameSpaces).flat();
|
|
49
|
+
|
|
50
|
+
const verification = flattenedClaims?.find(
|
|
51
|
+
(x) => x.elementIdentifier === MDOC_VERIFICATION_IDENTIFIER
|
|
49
52
|
)?.elementValue;
|
|
50
53
|
|
|
51
54
|
return verification ? Verification.parse(verification) : undefined;
|