@pagopa/io-react-native-wallet 0.11.1 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commonjs/client/generated/wallet-provider.js +126 -0
- package/lib/commonjs/client/generated/wallet-provider.js.map +1 -0
- package/lib/commonjs/client/index.js +40 -0
- package/lib/commonjs/client/index.js.map +1 -0
- package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js +2 -1
- package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js.map +1 -1
- package/lib/commonjs/credential/issuance/03-start-credential-issuance.js +287 -0
- package/lib/commonjs/credential/issuance/03-start-credential-issuance.js.map +1 -0
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js +56 -83
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +88 -0
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/05-authorize-access.js +56 -33
- package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/commonjs/credential/issuance/06-obtain-credential.js +51 -78
- package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +21 -44
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.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/credential/issuance/types.js +28 -0
- package/lib/commonjs/credential/issuance/types.js.map +1 -0
- package/lib/commonjs/index.js +10 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/pid/sd-jwt/converters.js +5 -9
- package/lib/commonjs/pid/sd-jwt/converters.js.map +1 -1
- package/lib/commonjs/pid/sd-jwt/types.js +3 -3
- package/lib/commonjs/pid/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/converters.test.js +1 -1
- package/lib/commonjs/sd-jwt/__test__/converters.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/index.test.js +30 -43
- package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/types.test.js +16 -24
- package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/index.js +3 -9
- package/lib/commonjs/sd-jwt/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/types.js +11 -16
- package/lib/commonjs/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/trust/types.js +70 -29
- package/lib/commonjs/trust/types.js.map +1 -1
- package/lib/commonjs/utils/auth.js +44 -0
- package/lib/commonjs/utils/auth.js.map +1 -0
- package/lib/commonjs/utils/errors.js +104 -1
- package/lib/commonjs/utils/errors.js.map +1 -1
- package/lib/commonjs/utils/integrity.js +2 -0
- package/lib/commonjs/utils/integrity.js.map +1 -0
- package/lib/commonjs/utils/misc.js +34 -1
- package/lib/commonjs/utils/misc.js.map +1 -1
- package/lib/commonjs/utils/par.js +23 -15
- package/lib/commonjs/utils/par.js.map +1 -1
- package/lib/commonjs/utils/pop.js +33 -0
- package/lib/commonjs/utils/pop.js.map +1 -0
- package/lib/commonjs/wallet-instance/index.js +29 -0
- package/lib/commonjs/wallet-instance/index.js.map +1 -0
- package/lib/commonjs/wallet-instance-attestation/issuing.js +62 -65
- package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/types.js +8 -8
- package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
- package/lib/module/client/generated/wallet-provider.js +102 -0
- package/lib/module/client/generated/wallet-provider.js.map +1 -0
- package/lib/module/client/index.js +33 -0
- package/lib/module/client/index.js.map +1 -0
- package/lib/module/credential/issuance/02-evaluate-issuer-trust.js +2 -1
- package/lib/module/credential/issuance/02-evaluate-issuer-trust.js.map +1 -1
- package/lib/module/credential/issuance/03-start-credential-issuance.js +276 -0
- package/lib/module/credential/issuance/03-start-credential-issuance.js.map +1 -0
- package/lib/module/credential/issuance/03-start-user-authorization.js +56 -80
- package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/04-complete-user-authorization.js +85 -1
- package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/05-authorize-access.js +54 -33
- package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/module/credential/issuance/06-obtain-credential.js +50 -75
- package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js +21 -44
- package/lib/module/credential/issuance/07-verify-and-parse-credential.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/credential/issuance/types.js +18 -0
- package/lib/module/credential/issuance/types.js.map +1 -0
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/pid/sd-jwt/converters.js +5 -9
- package/lib/module/pid/sd-jwt/converters.js.map +1 -1
- package/lib/module/pid/sd-jwt/types.js +3 -3
- package/lib/module/pid/sd-jwt/types.js.map +1 -1
- package/lib/module/sd-jwt/__test__/converters.test.js +1 -1
- package/lib/module/sd-jwt/__test__/converters.test.js.map +1 -1
- package/lib/module/sd-jwt/__test__/index.test.js +30 -43
- package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
- package/lib/module/sd-jwt/__test__/types.test.js +16 -24
- package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/module/sd-jwt/index.js +3 -9
- package/lib/module/sd-jwt/index.js.map +1 -1
- package/lib/module/sd-jwt/types.js +11 -16
- package/lib/module/sd-jwt/types.js.map +1 -1
- package/lib/module/trust/types.js +70 -29
- package/lib/module/trust/types.js.map +1 -1
- package/lib/module/utils/auth.js +35 -0
- package/lib/module/utils/auth.js.map +1 -0
- package/lib/module/utils/errors.js +98 -0
- package/lib/module/utils/errors.js.map +1 -1
- package/lib/module/utils/integrity.js +2 -0
- package/lib/module/utils/integrity.js.map +1 -0
- package/lib/module/utils/misc.js +31 -0
- package/lib/module/utils/misc.js.map +1 -1
- package/lib/module/utils/par.js +24 -16
- package/lib/module/utils/par.js.map +1 -1
- package/lib/module/utils/pop.js +24 -0
- package/lib/module/utils/pop.js.map +1 -0
- package/lib/module/wallet-instance/index.js +23 -0
- package/lib/module/wallet-instance/index.js.map +1 -0
- package/lib/module/wallet-instance-attestation/issuing.js +63 -67
- package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
- package/lib/module/wallet-instance-attestation/types.js +8 -8
- package/lib/module/wallet-instance-attestation/types.js.map +1 -1
- package/lib/typescript/client/generated/wallet-provider.d.ts +264 -0
- package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -0
- package/lib/typescript/client/index.d.ts +7 -0
- package/lib/typescript/client/index.d.ts.map +1 -0
- package/lib/typescript/credential/issuance/01-start-flow.d.ts +1 -0
- package/lib/typescript/credential/issuance/01-start-flow.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts +2 -1
- package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/03-start-credential-issuance.d.ts +41 -0
- package/lib/typescript/credential/issuance/03-start-credential-issuance.d.ts.map +1 -0
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +23 -18
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +24 -12
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/05-authorize-access.d.ts +22 -16
- package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +19 -26
- 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 +10 -15
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/index.d.ts +3 -4
- package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/types.d.ts +63 -0
- package/lib/typescript/credential/issuance/types.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/types.d.ts +6 -6
- package/lib/typescript/index.d.ts +6 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/pid/sd-jwt/converters.d.ts.map +1 -1
- package/lib/typescript/pid/sd-jwt/types.d.ts +36 -36
- package/lib/typescript/pid/sd-jwt/types.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/index.d.ts +40 -68
- package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/types.d.ts +64 -121
- package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
- package/lib/typescript/trust/index.d.ts +150 -48
- package/lib/typescript/trust/index.d.ts.map +1 -1
- package/lib/typescript/trust/types.d.ts +2838 -1740
- package/lib/typescript/trust/types.d.ts.map +1 -1
- package/lib/typescript/utils/auth.d.ts +52 -0
- package/lib/typescript/utils/auth.d.ts.map +1 -0
- package/lib/typescript/utils/errors.d.ts +48 -0
- package/lib/typescript/utils/errors.d.ts.map +1 -1
- package/lib/typescript/utils/integrity.d.ts +21 -0
- package/lib/typescript/utils/integrity.d.ts.map +1 -0
- package/lib/typescript/utils/misc.d.ts +18 -0
- package/lib/typescript/utils/misc.d.ts.map +1 -1
- package/lib/typescript/utils/par.d.ts +8 -31
- package/lib/typescript/utils/par.d.ts.map +1 -1
- package/lib/typescript/utils/pop.d.ts +26 -0
- package/lib/typescript/utils/pop.d.ts.map +1 -0
- package/lib/typescript/wallet-instance/index.d.ts +7 -0
- package/lib/typescript/wallet-instance/index.d.ts.map +1 -0
- package/lib/typescript/wallet-instance-attestation/issuing.d.ts +17 -4
- package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/types.d.ts +64 -64
- package/lib/typescript/wallet-instance-attestation/types.d.ts.map +1 -1
- package/package.json +9 -5
- package/src/client/generated/wallet-provider.ts +173 -0
- package/src/client/index.ts +53 -0
- package/src/credential/issuance/01-start-flow.ts +1 -0
- package/src/credential/issuance/02-evaluate-issuer-trust.ts +2 -1
- package/src/credential/issuance/03-start-credential-issuance.ts +407 -0
- package/src/credential/issuance/03-start-user-authorization.ts +91 -92
- package/src/credential/issuance/04-complete-user-authorization.ts +114 -13
- package/src/credential/issuance/05-authorize-access.ts +74 -49
- package/src/credential/issuance/06-obtain-credential.ts +77 -111
- package/src/credential/issuance/07-verify-and-parse-credential.ts +30 -67
- package/src/credential/issuance/index.ts +6 -4
- package/src/credential/issuance/types.ts +25 -0
- package/src/index.ts +8 -0
- package/src/pid/sd-jwt/converters.ts +5 -11
- package/src/pid/sd-jwt/types.ts +8 -6
- package/src/sd-jwt/__test__/converters.test.ts +1 -1
- package/src/sd-jwt/__test__/index.test.ts +45 -74
- package/src/sd-jwt/__test__/types.test.ts +21 -33
- package/src/sd-jwt/index.ts +3 -12
- package/src/sd-jwt/types.ts +17 -22
- package/src/trust/types.ts +64 -32
- package/src/utils/auth.ts +37 -0
- package/src/utils/errors.ts +112 -0
- package/src/utils/integrity.ts +23 -0
- package/src/utils/misc.ts +43 -0
- package/src/utils/par.ts +29 -17
- package/src/utils/pop.ts +34 -0
- package/src/wallet-instance/index.ts +29 -0
- package/src/wallet-instance-attestation/issuing.ts +101 -97
- package/src/wallet-instance-attestation/types.ts +12 -8
- package/lib/commonjs/credential/issuance/07-confirm-credential.js +0 -6
- package/lib/commonjs/credential/issuance/07-confirm-credential.js.map +0 -1
- package/lib/commonjs/credential/issuance/08-confirm-credential.js +0 -6
- package/lib/commonjs/credential/issuance/08-confirm-credential.js.map +0 -1
- package/lib/module/credential/issuance/07-confirm-credential.js +0 -2
- package/lib/module/credential/issuance/07-confirm-credential.js.map +0 -1
- package/lib/module/credential/issuance/08-confirm-credential.js +0 -2
- package/lib/module/credential/issuance/08-confirm-credential.js.map +0 -1
- package/lib/typescript/credential/issuance/07-confirm-credential.d.ts +0 -11
- package/lib/typescript/credential/issuance/07-confirm-credential.d.ts.map +0 -1
- package/lib/typescript/credential/issuance/08-confirm-credential.d.ts +0 -11
- package/lib/typescript/credential/issuance/08-confirm-credential.d.ts.map +0 -1
- package/src/credential/issuance/07-confirm-credential.ts +0 -14
- package/src/credential/issuance/08-confirm-credential.ts +0 -14
@@ -4,107 +4,80 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.obtainCredential = exports.createNonceProof = void 0;
|
7
|
-
var z = _interopRequireWildcard(require("zod"));
|
8
|
-
var _reactNativeUuid = _interopRequireDefault(require("react-native-uuid"));
|
9
7
|
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
10
|
-
var
|
11
|
-
var
|
12
|
-
var
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
16
|
-
/**
|
17
|
-
* Return the signed jwt for nonce proof of possession
|
18
|
-
*/
|
8
|
+
var _misc = require("../../../src/utils/misc");
|
9
|
+
var _errors = require("../../../src/utils/errors");
|
10
|
+
var _types = require("./types");
|
19
11
|
const createNonceProof = async (nonce, issuer, audience, ctx) => {
|
12
|
+
const jwk = await ctx.getPublicKey();
|
20
13
|
return new _ioReactNativeJwt.SignJWT(ctx).setPayload({
|
21
|
-
nonce
|
22
|
-
jwk: await ctx.getPublicKey()
|
14
|
+
nonce
|
23
15
|
}).setProtectedHeader({
|
24
|
-
|
25
|
-
|
16
|
+
typ: "openid4vci-proof+jwt",
|
17
|
+
jwk
|
18
|
+
}).setAudience(audience).setIssuer(issuer).setIssuedAt().setExpirationTime("5min").sign();
|
26
19
|
};
|
27
|
-
exports.createNonceProof = createNonceProof;
|
28
|
-
const CredentialEndpointResponse = z.object({
|
29
|
-
credential: z.string(),
|
30
|
-
format: _const.SupportedCredentialFormat,
|
31
|
-
// nonce used to perform multiple credential requests
|
32
|
-
// re-using the same authorization profile
|
33
|
-
c_nonce: z.string(),
|
34
|
-
c_nonce_expires_in: z.number()
|
35
|
-
});
|
36
|
-
// Checks whether in the Entity confoguration at least one credential
|
37
|
-
// is defined for the given type and format
|
38
|
-
const isCredentialAvailable = (issuerConf, credentialType, credentialFormat) => issuerConf.openid_credential_issuer.credentials_supported.some(c => c.format === credentialFormat && c.credential_definition.type.includes(credentialType));
|
39
20
|
|
40
21
|
/**
|
41
|
-
*
|
42
|
-
*
|
43
|
-
*
|
44
|
-
*
|
45
|
-
*
|
46
|
-
* @param
|
47
|
-
* @param
|
48
|
-
* @param
|
49
|
-
* @param
|
50
|
-
* @param
|
22
|
+
* Obtains the credential from the issuer.
|
23
|
+
* The key pair of the credentialCryptoContext is used for Openid4vci proof JWT to be presented with the Access Token and the DPoP Proof JWT at the Credential Endpoint
|
24
|
+
* of the Credential Issuer to request the issuance of a credential linked to the public key contained in the JWT proof.
|
25
|
+
* The Openid4vci proof JWT incapsulates the nonce extracted from the token response from the {@link authorizeAccess} step.
|
26
|
+
* The credential request is sent to the Credential Endpoint of the Credential Issuer via HTTP POST with the type of the credential, its format, the access token and the JWT proof.
|
27
|
+
* @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
|
28
|
+
* @param accessToken The access token response returned by {@link authorizeAccess}
|
29
|
+
* @param clientId The client id returned by {@link startUserAuthorization}
|
30
|
+
* @param credentialDefinition The credential definition of the credential to be obtained returned by {@link startUserAuthorization}
|
31
|
+
* @param tokenRequestSignedDPop The DPoP signed token request returned by {@link authorizeAccess}
|
32
|
+
* @param context.credentialCryptoContext The crypto context used to obtain the credential
|
51
33
|
* @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
|
52
|
-
* @returns The
|
34
|
+
* @returns The credential response containing the credential
|
53
35
|
*/
|
54
|
-
|
36
|
+
exports.createNonceProof = createNonceProof;
|
37
|
+
const obtainCredential = async (issuerConf, accessToken, clientId, credentialDefinition, tokenRequestSignedDPop, context) => {
|
55
38
|
const {
|
56
39
|
credentialCryptoContext,
|
57
|
-
walletProviderBaseUrl,
|
58
40
|
appFetch = fetch
|
59
41
|
} = context;
|
60
|
-
if (!isCredentialAvailable(issuerConf, credentialType, credentialFormat)) {
|
61
|
-
throw new Error(`The Issuer provides no credential for type ${credentialType} and format ${credentialFormat}`);
|
62
|
-
}
|
63
42
|
const credentialUrl = issuerConf.openid_credential_issuer.credential_endpoint;
|
64
43
|
|
65
|
-
/**
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
jti: `${_reactNativeUuid.default.v4()}`
|
72
|
-
}, credentialCryptoContext);
|
44
|
+
/**
|
45
|
+
* JWT proof token to bind the request nonce to the key that will bind the holder User with the Credential
|
46
|
+
* This is presented along with the access token to the Credential Endpoint as proof of possession of the private key used to sign the Access Token.
|
47
|
+
* @see https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#name-proof-types
|
48
|
+
*/
|
49
|
+
const signedNonceProof = await createNonceProof(accessToken.c_nonce, clientId, credentialUrl, credentialCryptoContext);
|
73
50
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
51
|
+
// Validation of accessTokenResponse.authorization_details if contain credentialDefinition
|
52
|
+
const constainsCredentialDefinition = accessToken.authorization_details.some(c => c.credential_configuration_id === credentialDefinition.credential_configuration_id && c.format === credentialDefinition.format && c.type === credentialDefinition.type);
|
53
|
+
if (!constainsCredentialDefinition) {
|
54
|
+
throw new _errors.ValidationFailed("The access token response does not contain the requested credential");
|
55
|
+
}
|
78
56
|
|
79
57
|
/** The credential request body */
|
80
|
-
const
|
81
|
-
credential_definition:
|
82
|
-
type: [
|
83
|
-
}
|
84
|
-
format:
|
85
|
-
proof:
|
58
|
+
const credentialRequestFormBody = {
|
59
|
+
credential_definition: {
|
60
|
+
type: [credentialDefinition.credential_configuration_id]
|
61
|
+
},
|
62
|
+
format: credentialDefinition.format,
|
63
|
+
proof: {
|
86
64
|
jwt: signedNonceProof,
|
87
65
|
proof_type: "jwt"
|
88
|
-
}
|
89
|
-
}
|
90
|
-
const {
|
91
|
-
credential,
|
92
|
-
format,
|
93
|
-
c_nonce
|
94
|
-
} = await appFetch(credentialUrl, {
|
66
|
+
}
|
67
|
+
};
|
68
|
+
const credentialRes = await appFetch(credentialUrl, {
|
95
69
|
method: "POST",
|
96
70
|
headers: {
|
97
|
-
"Content-Type": "application/
|
98
|
-
DPoP:
|
99
|
-
Authorization: accessToken
|
71
|
+
"Content-Type": "application/json",
|
72
|
+
DPoP: tokenRequestSignedDPop,
|
73
|
+
Authorization: `${accessToken.token_type} ${accessToken.access_token}`
|
100
74
|
},
|
101
|
-
body:
|
102
|
-
}).then((0, _misc.hasStatus)(200)).then(res => res.json()).then(
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
};
|
75
|
+
body: JSON.stringify(credentialRequestFormBody)
|
76
|
+
}).then((0, _misc.hasStatus)(200)).then(res => res.json()).then(body => _types.CredentialResponse.safeParse(body));
|
77
|
+
if (!credentialRes.success) {
|
78
|
+
throw new _errors.ValidationFailed(credentialRes.error.message);
|
79
|
+
}
|
80
|
+
return credentialRes.data;
|
108
81
|
};
|
109
82
|
exports.obtainCredential = obtainCredential;
|
110
83
|
//# sourceMappingURL=06-obtain-credential.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_misc","_errors","_types","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","SignJWT","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","exports","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","tokenRequestSignedDPop","context","credentialCryptoContext","appFetch","fetch","credentialUrl","openid_credential_issuer","credential_endpoint","signedNonceProof","c_nonce","constainsCredentialDefinition","authorization_details","some","c","credential_configuration_id","format","type","ValidationFailed","credentialRequestFormBody","credential_definition","proof","jwt","proof_type","credentialRes","method","headers","DPoP","Authorization","token_type","access_token","body","JSON","stringify","then","hasStatus","res","json","CredentialResponse","safeParse","success","error","message","data"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAGA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAcO,MAAMI,gBAAgB,GAAG,MAAAA,CAC9BC,KAAa,EACbC,MAAc,EACdC,QAAgB,EAChBC,GAAkB,KACE;EACpB,MAAMC,GAAG,GAAG,MAAMD,GAAG,CAACE,YAAY,CAAC,CAAC;EACpC,OAAO,IAAIC,yBAAO,CAACH,GAAG,CAAC,CACpBI,UAAU,CAAC;IACVP;EACF,CAAC,CAAC,CACDQ,kBAAkB,CAAC;IAClBC,GAAG,EAAE,sBAAsB;IAC3BL;EACF,CAAC,CAAC,C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EAAE;IACd;EACF,CAAC;EAED,MAAMC,aAAa,GAAG,MAAMpB,QAAQ,CAACE,aAAa,EAAE;IAClDmB,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MACP,cAAc,EAAE,kBAAkB;MAClCC,IAAI,EAAE1B,sBAAsB;MAC5B2B,aAAa,EAAG,GAAE9B,WAAW,CAAC+B,UAAW,IAAG/B,WAAW,CAACgC,YAAa;IACvE,CAAC;IACDC,IAAI,EAAEC,IAAI,CAACC,SAAS,CAACd,yBAAyB;EAChD,CAAC,CAAC,CACCe,IAAI,CAAC,IAAAC,eAAS,EAAC,GAAG,CAAC,CAAC,CACpBD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAAEH,IAAI,IAAKO,yBAAkB,CAACC,SAAS,CAACR,IAAI,CAAC,CAAC;EAErD,IAAI,CAACP,aAAa,CAACgB,OAAO,EAAE;IAC1B,MAAM,IAAItB,wBAAgB,CAACM,aAAa,CAACiB,KAAK,CAACC,OAAO,CAAC;EACzD;EAEA,OAAOlB,aAAa,CAACmB,IAAI;AAC3B,CAAC;AAAChD,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
|
@@ -11,33 +11,26 @@ var _sdJwt = require("../../sd-jwt");
|
|
11
11
|
|
12
12
|
// handy alias
|
13
13
|
|
14
|
-
const parseCredentialSdJwt =
|
15
|
-
var _credentials_supporte;
|
14
|
+
const parseCredentialSdJwt = (credentials_supported, _ref) => {
|
16
15
|
let {
|
17
16
|
sdJwt,
|
18
17
|
disclosures
|
19
18
|
} = _ref;
|
20
|
-
|
21
|
-
// find the definition that matches the received credential's type
|
22
|
-
// warning: if more then a defintion is found, the first is retrieved
|
23
|
-
const credentialSubject = (_credentials_supporte = credentials_supported.find(c => c.format === "vc+sd-jwt" && c.credential_definition.type.includes(sdJwt.payload.type))) === null || _credentials_supporte === void 0 ? void 0 : _credentials_supporte.credential_definition.credentialSubject;
|
24
|
-
|
25
|
-
// the received credential matches no supported credential, throw an exception
|
19
|
+
const credentialSubject = credentials_supported[sdJwt.payload.vct];
|
26
20
|
if (!credentialSubject) {
|
27
|
-
|
28
|
-
|
21
|
+
throw new _errors.IoWalletError("Credential type not supported by the issuer");
|
22
|
+
}
|
23
|
+
if (credentialSubject.format !== sdJwt.header.typ) {
|
24
|
+
throw new _errors.IoWalletError(`Received credential is of an unknwown type. Expected one of [${credentialSubject.format}], received '${sdJwt.header.typ}', `);
|
29
25
|
}
|
30
26
|
|
31
27
|
// transfrom a record { key: value } in an iterable of pairs [key, value]
|
32
|
-
const attrDefinitions = Object.entries(credentialSubject);
|
28
|
+
const attrDefinitions = Object.entries(credentialSubject.claims);
|
33
29
|
|
34
|
-
// every mandatory attribute must be present in the credential's disclosures
|
35
30
|
// the key of the attribute defintion must match the disclosure's name
|
36
31
|
const attrsNotInDisclosures = attrDefinitions.filter(_ref2 => {
|
37
|
-
let [attrKey
|
38
|
-
|
39
|
-
}] = _ref2;
|
40
|
-
return mandatory && !disclosures.some(_ref3 => {
|
32
|
+
let [attrKey] = _ref2;
|
33
|
+
return !disclosures.some(_ref3 => {
|
41
34
|
let [, name] = _ref3;
|
42
35
|
return name === attrKey;
|
43
36
|
});
|
@@ -45,12 +38,7 @@ const parseCredentialSdJwt = function (credentials_supported, _ref) {
|
|
45
38
|
if (attrsNotInDisclosures.length > 0) {
|
46
39
|
const missing = attrsNotInDisclosures.map(_ => _[0 /* key */]).join(", ");
|
47
40
|
const received = disclosures.map(_ => _[1 /* name */]).join(", ");
|
48
|
-
|
49
|
-
// on incomplete credentials in the test phase of the project.
|
50
|
-
// we might want to be strict once in production, hence remove this condition
|
51
|
-
if (!ignoreMissingAttributes) {
|
52
|
-
throw new _errors.IoWalletError(`Some attributes are missing in the credential. Missing: [${missing}], received: [${received}]`);
|
53
|
-
}
|
41
|
+
throw new _errors.IoWalletError(`Some attributes are missing in the credential. Missing: [${missing}], received: [${received}]`);
|
54
42
|
}
|
55
43
|
|
56
44
|
// attributes that are defined in the issuer configuration
|
@@ -93,7 +81,6 @@ const parseCredentialSdJwt = function (credentials_supported, _ref) {
|
|
93
81
|
let [, key, value] = _ref7;
|
94
82
|
return [key, {
|
95
83
|
value,
|
96
|
-
mandatory: false,
|
97
84
|
name: key
|
98
85
|
}];
|
99
86
|
}));
|
@@ -135,41 +122,31 @@ async function verifyCredentialSdJwt(rawCredential, issuerKeys, holderBindingCon
|
|
135
122
|
|
136
123
|
const verifyAndParseCredentialSdJwt = async (issuerConf, credential, _, _ref8) => {
|
137
124
|
let {
|
138
|
-
credentialCryptoContext
|
139
|
-
ignoreMissingAttributes
|
125
|
+
credentialCryptoContext
|
140
126
|
} = _ref8;
|
141
127
|
const decoded = await verifyCredentialSdJwt(credential, issuerConf.openid_credential_issuer.jwks.keys, credentialCryptoContext);
|
142
|
-
const parsedCredential = parseCredentialSdJwt(issuerConf.openid_credential_issuer.
|
128
|
+
const parsedCredential = parseCredentialSdJwt(issuerConf.openid_credential_issuer.credential_configurations_supported, decoded);
|
143
129
|
return {
|
144
130
|
parsedCredential
|
145
131
|
};
|
146
132
|
};
|
147
|
-
const verifyAndParseCredentialMdoc = async (_issuerConf, _credential, _, _ctx) => {
|
148
|
-
// TODO: [SIW-686] decode MDOC credentials
|
149
|
-
throw new Error("verifyAndParseCredentialMdoc not implemented yet");
|
150
|
-
};
|
151
133
|
|
152
134
|
/**
|
153
|
-
* Verify and parse an encoded credential
|
154
|
-
*
|
155
|
-
* @param
|
156
|
-
* @param
|
157
|
-
* @param
|
158
|
-
* @param context.credentialCryptoContext The context to access the key the Credential will be bound to
|
159
|
-
* @param context.ignoreMissingAttributes (optional) Whether to fail if a defined attribute is note present in the credentual. Default: false
|
135
|
+
* Verify and parse an encoded credential.
|
136
|
+
* @param issuerConf The Issuer configuration returned by {@link evaluateIssuerTrust}
|
137
|
+
* @param credential The encoded credential returned by {@link obtainCredential}
|
138
|
+
* @param format The format of the credentual returned by {@link obtainCredential}
|
139
|
+
* @param context.credentialCryptoContext The crypto context used to obtain the credential in {@link obtainCredential}
|
160
140
|
* @returns A parsed credential with attributes in plain value
|
161
|
-
* @throws If the credential signature is not verified with the Issuer key set
|
162
|
-
* @throws If the credential is not bound to the provided user key
|
163
|
-
* @throws If the credential data fail to parse
|
141
|
+
* @throws {IoWalletError} If the credential signature is not verified with the Issuer key set
|
142
|
+
* @throws {IoWalletError} If the credential is not bound to the provided user key
|
143
|
+
* @throws {IoWalletError} If the credential data fail to parse
|
164
144
|
*/
|
165
145
|
const verifyAndParseCredential = async (issuerConf, credential, format, context) => {
|
166
146
|
if (format === "vc+sd-jwt") {
|
167
147
|
return verifyAndParseCredentialSdJwt(issuerConf, credential, format, context);
|
168
|
-
} else if (format === "vc+mdoc-cbor") {
|
169
|
-
return verifyAndParseCredentialMdoc(issuerConf, credential, format, context);
|
170
148
|
}
|
171
|
-
|
172
|
-
throw new _errors.IoWalletError(`Unsupported credential format: ${_}`);
|
149
|
+
throw new _errors.IoWalletError(`Unsupported credential format: ${format}`);
|
173
150
|
};
|
174
151
|
exports.verifyAndParseCredential = verifyAndParseCredential;
|
175
152
|
//# sourceMappingURL=07-verify-and-parse-credential.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_errors","require","_types","_sdJwt","parseCredentialSdJwt","credentials_supported","_ref","
|
1
|
+
{"version":3,"names":["_errors","require","_types","_sdJwt","parseCredentialSdJwt","credentials_supported","_ref","sdJwt","disclosures","credentialSubject","payload","vct","IoWalletError","format","header","typ","attrDefinitions","Object","entries","claims","attrsNotInDisclosures","filter","_ref2","attrKey","some","_ref3","name","length","missing","map","_","join","received","definedValues","fromEntries","_ref4","_disclosures$find","definition","value","find","_ref5","display","reduce","names","_ref6","locale","undefinedValues","keys","includes","_ref7","key","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","verifySdJwt","SdJwt4VC","getPublicKey","cnf","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","_ref8","credentialCryptoContext","decoded","openid_credential_issuer","jwks","parsedCredential","credential_configurations_supported","verifyAndParseCredential","context","exports"],"sourceRoot":"../../../../src","sources":["credential/issuance/07-verify-and-parse-credential.ts"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAcA;;AAkBA;;AAKA,MAAMG,oBAAoB,GAAGA,CAE3BC,qBAAgI,EAAAC,IAAA,KAE3G;EAAA,IADrB;IAAEC,KAAK;IAAEC;EAAoC,CAAC,GAAAF,IAAA;EAE9C,MAAMG,iBAAiB,GAAGJ,qBAAqB,CAACE,KAAK,CAACG,OAAO,CAACC,GAAG,CAAC;EAElE,IAAI,CAACF,iBAAiB,EAAE;IACtB,MAAM,IAAIG,qBAAa,CAAC,6CAA6C,CAAC;EACxE;EAEA,IAAIH,iBAAiB,CAACI,MAAM,KAAKN,KAAK,CAACO,MAAM,CAACC,GAAG,EAAE;IACjD,MAAM,IAAIH,qBAAa,CACpB,gEAA+DH,iBAAiB,CAACI,MAAO,gBAAeN,KAAK,CAACO,MAAM,CAACC,GAAI,KAC3H,CAAC;EACH;;EAEA;EACA,MAAMC,eAAe,GAAGC,MAAM,CAACC,OAAO,CAACT,iBAAiB,CAACU,MAAM,CAAC;;EAEhE;EACA,MAAMC,qBAAqB,GAAGJ,eAAe,CAACK,MAAM,CAClDC,KAAA;IAAA,IAAC,CAACC,OAAO,CAAC,GAAAD,KAAA;IAAA,OAAK,CAACd,WAAW,CAACgB,IAAI,CAACC,KAAA;MAAA,IAAC,GAAGC,IAAI,CAAC,GAAAD,KAAA;MAAA,OAAKC,IAAI,KAAKH,OAAO;IAAA,EAAC;EAAA,CAClE,CAAC;EACD,IAAIH,qBAAqB,CAACO,MAAM,GAAG,CAAC,EAAE;IACpC,MAAMC,OAAO,GAAGR,qBAAqB,CAACS,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAAC,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AAwB,CAAC,GAAAD,KAAA;EAE3B,MAAME,OAAO,GAAG,MAAMnB,qBAAqB,CACzCgB,UAAU,EACVD,UAAU,CAACK,wBAAwB,CAACC,IAAI,CAACzB,IAAI,EAC7CsB,uBACF,CAAC;EAED,MAAMI,gBAAgB,GAAGrE,oBAAoB,CAC3C8D,UAAU,CAACK,wBAAwB,CAACG,mCAAmC,EACvEJ,OACF,CAAC;EAED,OAAO;IAAEG;EAAiB,CAAC;AAC7B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,wBAAkD,GAAG,MAAAA,CAChET,UAAU,EACVC,UAAU,EACVtD,MAAM,EACN+D,OAAO,KACJ;EACH,IAAI/D,MAAM,KAAK,WAAW,EAAE;IAC1B,OAAOoD,6BAA6B,CAClCC,UAAU,EACVC,UAAU,EACVtD,MAAM,EACN+D,OACF,CAAC;EACH;EAEA,MAAM,IAAIhE,qBAAa,CAAE,kCAAiCC,MAAO,EAAC,CAAC;AACrE,CAAC;AAACgE,OAAA,CAAAF,wBAAA,GAAAA,wBAAA"}
|
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "authorizeAccess", {
|
|
9
9
|
return _authorizeAccess.authorizeAccess;
|
10
10
|
}
|
11
11
|
});
|
12
|
+
Object.defineProperty(exports, "completeUserAuthorizationWithQueryMode", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function () {
|
15
|
+
return _completeUserAuthorization.completeUserAuthorizationWithQueryMode;
|
16
|
+
}
|
17
|
+
});
|
12
18
|
Object.defineProperty(exports, "evaluateIssuerTrust", {
|
13
19
|
enumerable: true,
|
14
20
|
get: function () {
|
@@ -35,6 +41,7 @@ Object.defineProperty(exports, "verifyAndParseCredential", {
|
|
35
41
|
});
|
36
42
|
var _evaluateIssuerTrust = require("./02-evaluate-issuer-trust");
|
37
43
|
var _startUserAuthorization = require("./03-start-user-authorization");
|
44
|
+
var _completeUserAuthorization = require("./04-complete-user-authorization");
|
38
45
|
var _authorizeAccess = require("./05-authorize-access");
|
39
46
|
var _obtainCredential = require("./06-obtain-credential");
|
40
47
|
var _verifyAndParseCredential = require("./07-verify-and-parse-credential");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_evaluateIssuerTrust","require","_startUserAuthorization","_authorizeAccess","_obtainCredential","_verifyAndParseCredential"],"sourceRoot":"../../../../src","sources":["credential/issuance/index.ts"],"mappings":"
|
1
|
+
{"version":3,"names":["_evaluateIssuerTrust","require","_startUserAuthorization","_completeUserAuthorization","_authorizeAccess","_obtainCredential","_verifyAndParseCredential"],"sourceRoot":"../../../../src","sources":["credential/issuance/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AAIA,IAAAC,uBAAA,GAAAD,OAAA;AAIA,IAAAE,0BAAA,GAAAF,OAAA;AAIA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAIA,IAAAK,yBAAA,GAAAL,OAAA"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.TokenResponse = exports.CredentialResponse = void 0;
|
7
|
+
var _par = require("../../utils/par");
|
8
|
+
var z = _interopRequireWildcard(require("zod"));
|
9
|
+
var _const = require("./const");
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
11
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
12
|
+
const TokenResponse = z.object({
|
13
|
+
access_token: z.string(),
|
14
|
+
authorization_details: z.array(_par.AuthorizationDetail),
|
15
|
+
c_nonce: z.string(),
|
16
|
+
c_nonce_expires_in: z.number(),
|
17
|
+
expires_in: z.number(),
|
18
|
+
token_type: z.string()
|
19
|
+
});
|
20
|
+
exports.TokenResponse = TokenResponse;
|
21
|
+
const CredentialResponse = z.object({
|
22
|
+
c_nonce: z.string(),
|
23
|
+
c_nonce_expires_in: z.number(),
|
24
|
+
credential: z.string(),
|
25
|
+
format: _const.SupportedCredentialFormat
|
26
|
+
});
|
27
|
+
exports.CredentialResponse = CredentialResponse;
|
28
|
+
//# sourceMappingURL=types.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_par","require","z","_interopRequireWildcard","_const","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TokenResponse","object","access_token","string","authorization_details","array","AuthorizationDetail","c_nonce","c_nonce_expires_in","number","expires_in","token_type","exports","CredentialResponse","credential","format","SupportedCredentialFormat"],"sourceRoot":"../../../../src","sources":["credential/issuance/types.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAoD,SAAAI,yBAAAC,WAAA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,CAAC;EACnDC,OAAO,EAAEhC,CAAC,CAAC4B,MAAM,CAAC,CAAC;EACnBK,kBAAkB,EAAEjC,CAAC,CAACkC,MAAM,CAAC,CAAC;EAC9BC,UAAU,EAAEnC,CAAC,CAACkC,MAAM,CAAC,CAAC;EACtBE,UAAU,EAAEpC,CAAC,CAAC4B,MAAM,CAAC;AACvB,CAAC,CAAC;AAACS,OAAA,CAAAZ,aAAA,GAAAA,aAAA;AAII,MAAMa,kBAAkB,GAAGtC,CAAC,CAAC0B,MAAM,CAAC;EACzCM,OAAO,EAAEhC,CAAC,CAAC4B,MAAM,CAAC,CAAC;EACnBK,kBAAkB,EAAEjC,CAAC,CAACkC,MAAM,CAAC,CAAC;EAC9BK,UAAU,EAAEvC,CAAC,CAAC4B,MAAM,CAAC,CAAC;EACtBY,MAAM,EAAEC;AACV,CAAC,CAAC;AAACJ,OAAA,CAAAC,kBAAA,GAAAA,kBAAA"}
|
package/lib/commonjs/index.js
CHANGED
@@ -15,13 +15,20 @@ Object.defineProperty(exports, "AuthorizationDetails", {
|
|
15
15
|
return _par.AuthorizationDetails;
|
16
16
|
}
|
17
17
|
});
|
18
|
-
exports.WalletInstanceAttestation = exports.Trust = exports.SdJwt = exports.PID = exports.Errors = exports.Credential = void 0;
|
18
|
+
exports.WalletInstanceAttestation = exports.WalletInstance = exports.Trust = exports.SdJwt = exports.PID = exports.Errors = exports.Credential = void 0;
|
19
19
|
Object.defineProperty(exports, "createCryptoContextFor", {
|
20
20
|
enumerable: true,
|
21
21
|
get: function () {
|
22
22
|
return _crypto.createCryptoContextFor;
|
23
23
|
}
|
24
24
|
});
|
25
|
+
Object.defineProperty(exports, "fixBase64EncodingOnKey", {
|
26
|
+
enumerable: true,
|
27
|
+
get: function () {
|
28
|
+
return _jwk.fixBase64EncodingOnKey;
|
29
|
+
}
|
30
|
+
});
|
31
|
+
var _jwk = require("./utils/jwk");
|
25
32
|
require("react-native-url-polyfill/auto");
|
26
33
|
var Credential = _interopRequireWildcard(require("./credential"));
|
27
34
|
exports.Credential = Credential;
|
@@ -35,6 +42,8 @@ var WalletInstanceAttestation = _interopRequireWildcard(require("./wallet-instan
|
|
35
42
|
exports.WalletInstanceAttestation = WalletInstanceAttestation;
|
36
43
|
var Trust = _interopRequireWildcard(require("./trust"));
|
37
44
|
exports.Trust = Trust;
|
45
|
+
var WalletInstance = _interopRequireWildcard(require("./wallet-instance"));
|
46
|
+
exports.WalletInstance = WalletInstance;
|
38
47
|
var _par = require("./utils/par");
|
39
48
|
var _crypto = require("./utils/crypto");
|
40
49
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["require","Credential","_interopRequireWildcard","exports","PID","SdJwt","Errors","WalletInstanceAttestation","Trust","_par","_crypto","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"
|
1
|
+
{"version":3,"names":["_jwk","require","Credential","_interopRequireWildcard","exports","PID","SdJwt","Errors","WalletInstanceAttestation","Trust","WalletInstance","_par","_crypto","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,IAAA,GAAAC,OAAA;AAGAA,OAAA;AAEA,IAAAC,UAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA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,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
|
@@ -7,22 +7,18 @@ exports.pidFromToken = pidFromToken;
|
|
7
7
|
var _converters = require("../../sd-jwt/converters");
|
8
8
|
var _types = require("./types");
|
9
9
|
function pidFromToken(sdJwt, disclosures) {
|
10
|
+
const placeOfBirth = (0, _converters.getValueFromDisclosures)(disclosures, "place_of_birth");
|
10
11
|
return _types.PID.parse({
|
11
12
|
issuer: sdJwt.payload.iss,
|
12
|
-
issuedAt: new Date(
|
13
|
+
issuedAt: new Date((0, _converters.getValueFromDisclosures)(disclosures, "iat") * 1000),
|
13
14
|
expiration: new Date(sdJwt.payload.exp * 1000),
|
14
|
-
verification: {
|
15
|
-
trustFramework: sdJwt.payload.verified_claims.verification.trust_framework,
|
16
|
-
assuranceLevel: sdJwt.payload.verified_claims.verification.assurance_level,
|
17
|
-
evidence: (0, _converters.getValueFromDisclosures)(disclosures, "evidence")
|
18
|
-
},
|
19
15
|
claims: {
|
20
16
|
uniqueId: (0, _converters.getValueFromDisclosures)(disclosures, "unique_id"),
|
21
17
|
givenName: (0, _converters.getValueFromDisclosures)(disclosures, "given_name"),
|
22
18
|
familyName: (0, _converters.getValueFromDisclosures)(disclosures, "family_name"),
|
23
|
-
|
24
|
-
placeOfBirth
|
25
|
-
taxIdCode: (0, _converters.getValueFromDisclosures)(disclosures, "
|
19
|
+
birthDate: (0, _converters.getValueFromDisclosures)(disclosures, "birth_date"),
|
20
|
+
...(placeOfBirth && placeOfBirth),
|
21
|
+
taxIdCode: (0, _converters.getValueFromDisclosures)(disclosures, "tax_id_code")
|
26
22
|
}
|
27
23
|
});
|
28
24
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_converters","require","_types","pidFromToken","sdJwt","disclosures","PID","parse","issuer","payload","iss","issuedAt","Date","
|
1
|
+
{"version":3,"names":["_converters","require","_types","pidFromToken","sdJwt","disclosures","placeOfBirth","getValueFromDisclosures","PID","parse","issuer","payload","iss","issuedAt","Date","expiration","exp","claims","uniqueId","givenName","familyName","birthDate","taxIdCode"],"sourceRoot":"../../../../src","sources":["pid/sd-jwt/converters.ts"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEO,SAASE,YAAYA,CAACC,KAAe,EAAEC,WAAyB,EAAO;EAC5E,MAAMC,YAAY,GAAG,IAAAC,mCAAuB,EAACF,WAAW,EAAE,gBAAgB,CAAC;EAC3E,OAAOG,UAAG,CAACC,KAAK,CAAC;IACfC,MAAM,EAAEN,KAAK,CAACO,OAAO,CAACC,GAAG;IACzBC,QAAQ,EAAE,IAAIC,IAAI,CAAC,IAAAP,mCAAuB,EAACF,WAAW,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;IACtEU,UAAU,EAAE,IAAID,IAAI,CAACV,KAAK,CAACO,OAAO,CAACK,GAAG,GAAG,IAAI,CAAC;IAC9CC,MAAM,EAAE;MACNC,QAAQ,EAAE,IAAAX,mCAAuB,EAACF,WAAW,EAAE,WAAW,CAAC;MAC3Dc,SAAS,EAAE,IAAAZ,mCAAuB,EAACF,WAAW,EAAE,YAAY,CAAC;MAC7De,UAAU,EAAE,IAAAb,mCAAuB,EAACF,WAAW,EAAE,aAAa,CAAC;MAC/DgB,SAAS,EAAE,IAAAd,mCAAuB,EAACF,WAAW,EAAE,YAAY,CAAC;MAC7D,IAAIC,YAAY,IAAIA,YAAY,CAAC;MACjCgB,SAAS,EAAE,IAAAf,mCAAuB,EAACF,WAAW,EAAE,aAAa;IAC/D;EACF,CAAC,CAAC;AACJ"}
|
@@ -33,16 +33,16 @@ const PID = _zod.z.object({
|
|
33
33
|
issuer: _zod.z.string(),
|
34
34
|
issuedAt: _zod.z.date(),
|
35
35
|
expiration: _zod.z.date(),
|
36
|
-
verification: Verification,
|
36
|
+
verification: Verification.optional(),
|
37
37
|
claims: _zod.z.object({
|
38
38
|
uniqueId: _zod.z.string(),
|
39
39
|
givenName: _zod.z.string(),
|
40
40
|
familyName: _zod.z.string(),
|
41
|
-
|
41
|
+
birthDate: _zod.z.string(),
|
42
42
|
placeOfBirth: _zod.z.object({
|
43
43
|
country: _zod.z.string(),
|
44
44
|
locality: _zod.z.string()
|
45
|
-
}),
|
45
|
+
}).optional(),
|
46
46
|
taxIdCode: _zod.z.string()
|
47
47
|
})
|
48
48
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_zod","require","VerificationEvidence","z","object","type","string","record","source","organization_name","organization_id","country_code","Verification","trustFramework","literal","assuranceLevel","evidence","array","PID","issuer","issuedAt","date","expiration","verification","claims","uniqueId","givenName","familyName","
|
1
|
+
{"version":3,"names":["_zod","require","VerificationEvidence","z","object","type","string","record","source","organization_name","organization_id","country_code","Verification","trustFramework","literal","assuranceLevel","evidence","array","PID","issuer","issuedAt","date","expiration","verification","optional","claims","uniqueId","givenName","familyName","birthDate","placeOfBirth","country","locality","taxIdCode","exports"],"sourceRoot":"../../../../src","sources":["pid/sd-jwt/types.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAEA,MAAMC,oBAAoB,GAAGC,MAAC,CAACC,MAAM,CAAC;EACpCC,IAAI,EAAEF,MAAC,CAACG,MAAM,CAAC,C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EAAE7B,MAAC,CAACG,MAAM,CAAC;IACrB,CAAC,CAAC,CACDkB,QAAQ,CAAC,CAAC;IACbS,SAAS,EAAE9B,MAAC,CAACG,MAAM,CAAC;EACtB,CAAC;AACH,CAAC,CAAC;AAAC4B,OAAA,CAAAhB,GAAA,GAAAA,GAAA"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _converters = require("../converters");
|
4
|
-
const disclosures = [["6w1_soRXFgaHKfpYn3cvfQ", "given_name", "Mario"], ["fuNp97Hf3wV6y48y-QZhIg", "
|
4
|
+
const disclosures = [["6w1_soRXFgaHKfpYn3cvfQ", "given_name", "Mario"], ["fuNp97Hf3wV6y48y-QZhIg", "birth_date", "1980-10-01"], ["p-9LzyWHZBVDvhXDWkN2xA", "place_of_birth", {
|
5
5
|
country: "IT",
|
6
6
|
locality: "Rome"
|
7
7
|
}]];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_converters","require","disclosures","country","locality","describe","it","success","getValueFromDisclosures","expect","toBe","toEqual","toBeUndefined"],"sourceRoot":"../../../../src","sources":["sd-jwt/__test__/converters.test.ts"],"mappings":";;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAGA,MAAMC,WAAyB,GAAG,CAChC,CAAC,wBAAwB,EAAE,YAAY,EAAE,OAAO,CAAC,EACjD,CAAC,wBAAwB,EAAE,
|
1
|
+
{"version":3,"names":["_converters","require","disclosures","country","locality","describe","it","success","getValueFromDisclosures","expect","toBe","toEqual","toBeUndefined"],"sourceRoot":"../../../../src","sources":["sd-jwt/__test__/converters.test.ts"],"mappings":";;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAGA,MAAMC,WAAyB,GAAG,CAChC,CAAC,wBAAwB,EAAE,YAAY,EAAE,OAAO,CAAC,EACjD,CAAC,wBAAwB,EAAE,YAAY,EAAE,YAAY,CAAC,EACtD,CACE,wBAAwB,EACxB,gBAAgB,EAChB;EAAEC,OAAO,EAAE,IAAI;EAAEC,QAAQ,EAAE;AAAO,CAAC,CACpC,CACF;AAEDC,QAAQ,CAAC,yBAAyB,EAAE,MAAM;EACxCC,EAAE,CAAC,4CAA4C,EAAE,MAAM;IACrD,MAAMC,OAAO,GAAG,IAAAC,mCAAuB,EAACN,WAAW,EAAE,YAAY,CAAC;IAClEO,MAAM,CAACF,OAAO,CAAC,CAACG,IAAI,CAAC,OAAO,CAAC;EAC/B,CAAC,CAAC;EACFJ,EAAE,CAAC,gDAAgD,EAAE,MAAM;IACzD,MAAMC,OAAO,GAAG,IAAAC,mCAAuB,EAACN,WAAW,EAAE,gBAAgB,CAAC;IACtEO,MAAM,CAACF,OAAO,CAAC,CAACI,OAAO,CAAC;MAAER,OAAO,EAAE,IAAI;MAAEC,QAAQ,EAAE;IAAO,CAAC,CAAC;EAC9D,CAAC,CAAC;EACFE,EAAE,CAAC,aAAa,EAAE,MAAM;IACtB,MAAMC,OAAO,GAAG,IAAAC,mCAAuB,EAACN,WAAW,EAAE,eAAe,CAAC;IACrEO,MAAM,CAACF,OAAO,CAAC,CAACK,aAAa,CAAC,CAAC;EACjC,CAAC,CAAC;AACJ,CAAC,CAAC"}
|