@pagopa/io-react-native-wallet 0.9.2 → 0.10.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/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 +7 -2
- 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/commonjs/utils/par.js +2 -2
- package/lib/commonjs/utils/par.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 +7 -2
- 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/module/utils/par.js +2 -2
- package/lib/module/utils/par.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 +10 -2
- package/lib/typescript/trust/index.d.ts.map +1 -1
- package/lib/typescript/trust/types.d.ts +254 -22
- 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/lib/typescript/utils/par.d.ts +7 -7
- package/package.json +2 -2
- 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 +6 -2
- package/src/utils/misc.ts +4 -2
- package/src/utils/par.ts +2 -2
package/src/trust/types.ts
CHANGED
|
@@ -45,7 +45,7 @@ const CredentialDefinitionMetadata = z.object({
|
|
|
45
45
|
type SupportedCredentialMetadata = z.infer<typeof SupportedCredentialMetadata>;
|
|
46
46
|
const SupportedCredentialMetadata = z.object({
|
|
47
47
|
id: z.string(),
|
|
48
|
-
format: z.literal("vc+sd-jwt"),
|
|
48
|
+
format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
|
|
49
49
|
cryptographic_binding_methods_supported: z.array(z.string()),
|
|
50
50
|
cryptographic_suites_supported: z.array(z.string()),
|
|
51
51
|
display: z.array(CredentialDisplayMetadata),
|
|
@@ -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(),
|
|
@@ -139,7 +143,7 @@ export const CredentialIssuerEntityConfiguration = BaseEntityConfiguration.and(
|
|
|
139
143
|
credentials_supported: z.array(SupportedCredentialMetadata),
|
|
140
144
|
jwks: z.object({ keys: z.array(JWK) }),
|
|
141
145
|
}),
|
|
142
|
-
/** Credential Issuers act as Relying Party
|
|
146
|
+
/** Credential Issuers act as Relying Party
|
|
143
147
|
when they require the presentation of other credentials.
|
|
144
148
|
This does not apply for PID issuance, which requires CIE authz. */
|
|
145
149
|
wallet_relying_party: RelyingPartyMetadata.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;
|
package/src/utils/par.ts
CHANGED
|
@@ -13,7 +13,7 @@ export const AuthorizationDetail = z.object({
|
|
|
13
13
|
credential_definition: z.object({
|
|
14
14
|
type: z.string(),
|
|
15
15
|
}),
|
|
16
|
-
format: z.literal("vc+sd-jwt"),
|
|
16
|
+
format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
|
|
17
17
|
type: z.literal("openid_credential"),
|
|
18
18
|
});
|
|
19
19
|
|
|
@@ -48,7 +48,7 @@ export const makeParRequest =
|
|
|
48
48
|
const iss = WalletInstanceAttestation.decode(walletInstanceAttestation)
|
|
49
49
|
.payload.cnf.jwk.kid;
|
|
50
50
|
|
|
51
|
-
/** A code challenge is provided so that the PAR is bound
|
|
51
|
+
/** A code challenge is provided so that the PAR is bound
|
|
52
52
|
to the subsequent authorization code request
|
|
53
53
|
@see https://datatracker.ietf.org/doc/html/rfc9126#name-request */
|
|
54
54
|
const codeChallengeMethod = "s256";
|