@pagopa/io-react-native-wallet 2.0.0-next.2 → 2.0.0-next.3
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/03-start-user-authorization.js +38 -24
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/05-authorize-access.js +6 -10
- package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/commonjs/credential/issuance/06-obtain-credential.js +43 -11
- package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +51 -48
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/README.md +34 -13
- package/lib/commonjs/credential/issuance/const.js +1 -1
- package/lib/commonjs/credential/issuance/types.js +16 -10
- package/lib/commonjs/credential/issuance/types.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +4 -4
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js +3 -3
- package/lib/commonjs/credential/status/README.md +0 -1
- package/lib/commonjs/sd-jwt/__test__/index.test.js +11 -15
- package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/types.test.js +5 -2
- package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/utils.test.js +37 -0
- package/lib/commonjs/sd-jwt/__test__/utils.test.js.map +1 -0
- package/lib/commonjs/sd-jwt/index.js +20 -0
- package/lib/commonjs/sd-jwt/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/types.js +51 -4
- package/lib/commonjs/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/sd-jwt/utils.js +64 -0
- package/lib/commonjs/sd-jwt/utils.js.map +1 -0
- package/lib/commonjs/trust/types.js +18 -13
- package/lib/commonjs/trust/types.js.map +1 -1
- package/lib/commonjs/utils/par.js +32 -22
- package/lib/commonjs/utils/par.js.map +1 -1
- package/lib/commonjs/utils/pop.js +1 -1
- package/lib/commonjs/utils/pop.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/types.js +5 -1
- package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
- package/lib/module/credential/issuance/03-start-user-authorization.js +38 -24
- package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/05-authorize-access.js +6 -10
- package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
- package/lib/module/credential/issuance/06-obtain-credential.js +44 -12
- package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js +51 -48
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/module/credential/issuance/README.md +34 -13
- package/lib/module/credential/issuance/const.js +1 -1
- package/lib/module/credential/issuance/types.js +12 -8
- package/lib/module/credential/issuance/types.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js +4 -4
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +3 -3
- package/lib/module/credential/status/README.md +0 -1
- package/lib/module/sd-jwt/__test__/index.test.js +11 -16
- package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
- package/lib/module/sd-jwt/__test__/types.test.js +5 -2
- package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/module/sd-jwt/__test__/utils.test.js +35 -0
- package/lib/module/sd-jwt/__test__/utils.test.js.map +1 -0
- package/lib/module/sd-jwt/index.js +1 -0
- package/lib/module/sd-jwt/index.js.map +1 -1
- package/lib/module/sd-jwt/types.js +50 -3
- package/lib/module/sd-jwt/types.js.map +1 -1
- package/lib/module/sd-jwt/utils.js +57 -0
- package/lib/module/sd-jwt/utils.js.map +1 -0
- package/lib/module/trust/types.js +18 -13
- package/lib/module/trust/types.js.map +1 -1
- package/lib/module/utils/par.js +29 -20
- package/lib/module/utils/par.js.map +1 -1
- package/lib/module/utils/pop.js +1 -1
- package/lib/module/utils/pop.js.map +1 -1
- package/lib/module/wallet-instance-attestation/types.js +5 -1
- package/lib/module/wallet-instance-attestation/types.js.map +1 -1
- package/lib/typescript/client/generated/wallet-provider.d.ts +12 -12
- package/lib/typescript/credential/issuance/01-start-flow.d.ts +2 -2
- package/lib/typescript/credential/issuance/01-start-flow.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +7 -6
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +10 -5
- 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 +3 -2
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/const.d.ts +1 -1
- package/lib/typescript/credential/issuance/types.d.ts +46 -26
- package/lib/typescript/credential/issuance/types.d.ts.map +1 -1
- package/lib/typescript/pid/sd-jwt/types.d.ts +7 -7
- package/lib/typescript/sd-jwt/__test__/utils.test.d.ts +2 -0
- package/lib/typescript/sd-jwt/__test__/utils.test.d.ts.map +1 -0
- package/lib/typescript/sd-jwt/index.d.ts +21 -8
- package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/types.d.ts +194 -12
- package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/utils.d.ts +18 -0
- package/lib/typescript/sd-jwt/utils.d.ts.map +1 -0
- package/lib/typescript/trust/build-chain.d.ts +30 -14
- package/lib/typescript/trust/build-chain.d.ts.map +1 -1
- package/lib/typescript/trust/types.d.ts +322 -158
- package/lib/typescript/trust/types.d.ts.map +1 -1
- package/lib/typescript/utils/par.d.ts +29 -13
- package/lib/typescript/utils/par.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/types.d.ts +9 -9
- package/lib/typescript/wallet-instance-attestation/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/credential/issuance/01-start-flow.ts +2 -2
- package/src/credential/issuance/03-start-user-authorization.ts +57 -38
- package/src/credential/issuance/05-authorize-access.ts +5 -11
- package/src/credential/issuance/06-obtain-credential.ts +53 -23
- package/src/credential/issuance/07-verify-and-parse-credential.ts +54 -62
- package/src/credential/issuance/README.md +34 -13
- package/src/credential/issuance/const.ts +1 -1
- package/src/credential/issuance/types.ts +18 -8
- package/src/credential/presentation/07-evaluate-dcql-query.ts +4 -4
- package/src/credential/presentation/07-evaluate-input-descriptor.ts +3 -3
- package/src/credential/status/README.md +0 -1
- package/src/sd-jwt/__test__/index.test.ts +8 -29
- package/src/sd-jwt/__test__/types.test.ts +6 -2
- package/src/sd-jwt/__test__/utils.test.ts +37 -0
- package/src/sd-jwt/index.ts +2 -0
- package/src/sd-jwt/types.ts +49 -2
- package/src/sd-jwt/utils.ts +73 -0
- package/src/trust/types.ts +23 -17
- package/src/utils/par.ts +37 -21
- package/src/utils/pop.ts +1 -1
- package/src/wallet-instance-attestation/types.ts +3 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["hasStatusOrThrow","createDPopToken","v4","uuidv4","createPopToken","WalletInstanceAttestation","
|
1
|
+
{"version":3,"names":["hasStatusOrThrow","createDPopToken","v4","uuidv4","createPopToken","WalletInstanceAttestation","TokenResponse","IssuerResponseError","ValidationFailed","LogLevel","Logger","authorizeAccess","issuerConf","code","_","redirectUri","codeVerifier","context","appFetch","fetch","walletInstanceAttestation","wiaCryptoContext","dPopCryptoContext","aud","openid_credential_issuer","credential_issuer","iss","decode","payload","cnf","jwk","kid","tokenUrl","oauth_authorization_server","token_endpoint","tokenRequestSignedDPop","htm","htu","jti","log","DEBUG","signedWiaPoP","requestBody","grant_type","code_verifier","redirect_uri","authorizationRequestFormBody","URLSearchParams","tokenRes","method","headers","DPoP","body","toString","then","res","json","safeParse","success","ERROR","error","message","reason","accessToken","data"],"sourceRoot":"../../../../src","sources":["credential/issuance/05-authorize-access.ts"],"mappings":"AAAA,SAASA,gBAAgB,QAAkB,kBAAkB;AAG7D,SAASC,eAAe,QAAQ,kBAAkB;AAClD,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AACnC,SAASC,cAAc,QAAQ,iBAAiB;AAChD,OAAO,KAAKC,yBAAyB,MAAM,mCAAmC;AAE9E,SAASC,aAAa,QAAQ,SAAS;AACvC,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,oBAAoB;AAE1E,SAASC,QAAQ,EAAEC,MAAM,QAAQ,qBAAqB;AAgBtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAgC,GAAG,MAAAA,CAC9CC,UAAU,EACVC,IAAI,EACJC,CAAC,EACDC,WAAW,EACXC,YAAY,EACZC,OAAO,KACJ;EACH,MAAM;IACJC,QAAQ,GAAGC,KAAK;IAChBC,yBAAyB;IACzBC,gBAAgB;IAChBC;EACF,CAAC,GAAGL,OAAO;EACX,MAAMM,GAAG,GAAGX,UAAU,CAACY,wBAAwB,CAACC,iBAAiB;EACjE,MAAMC,GAAG,GAAGrB,yBAAyB,CAACsB,MAAM,CAACP,yBAAyB,CAAC,CACpEQ,OAAO,CAACC,GAAG,CAACC,GAAG,CAACC,GAAG;EAEtB,MAAMC,QAAQ,GAAGpB,UAAU,CAACqB,0BAA0B,CAACC,cAAc;EAErE,MAAMC,sBAAsB,GAAG,MAAMlC,eAAe,CAClD;IACEmC,GAAG,EAAE,MAAM;IACXC,GAAG,EAAEL,QAAQ;IACbM,GAAG,EAAG,GAAEnC,MAAM,CAAC,CAAE;EACnB,CAAC,EACDmB,iBACF,CAAC;EAEDZ,MAAM,CAAC6B,GAAG,CAAC9B,QAAQ,CAAC+B,KAAK,EAAG,uBA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,IAAIrD,gBAAgB,CAAC;MACzBqD,OAAO,EAAE,kCAAkC;MAC3CC,MAAM,EAAEd,QAAQ,CAACY,KAAK,CAACC;IACzB,CAAC,CAAC;EACJ;EAEA,OAAO;IAAEE,WAAW,EAAEf,QAAQ,CAACgB;EAAK,CAAC;AACvC,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { sha256ToBase64, SignJWT } from "@pagopa/io-react-native-jwt";
|
2
2
|
import { hasStatusOrThrow } from "../../utils/misc";
|
3
3
|
import { IssuerResponseError, IssuerResponseErrorCodes, ResponseErrorBuilder, UnexpectedStatusCodeError, ValidationFailed } from "../../utils/errors";
|
4
|
-
import { CredentialResponse } from "./types";
|
4
|
+
import { CredentialResponse, NonceResponse } from "./types";
|
5
5
|
import { createDPopToken } from "../../utils/dpop";
|
6
6
|
import { v4 as uuidv4 } from "uuid";
|
7
7
|
import { LogLevel, Logger } from "../../utils/logging";
|
@@ -24,11 +24,11 @@ export const createNonceProof = async (nonce, issuer, audience, ctx) => {
|
|
24
24
|
* @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
|
25
25
|
* @param accessToken The access token response returned by {@link authorizeAccess}
|
26
26
|
* @param clientId The client id returned by {@link startUserAuthorization}
|
27
|
-
* @param credentialDefinition The credential definition of the credential to be obtained returned by {@link
|
28
|
-
* @param tokenRequestSignedDPop The DPoP signed token request returned by {@link authorizeAccess}
|
27
|
+
* @param credentialDefinition The credential definition of the credential to be obtained returned by {@link authorizeAccess}
|
29
28
|
* @param context.credentialCryptoContext The crypto context used to obtain the credential
|
30
29
|
* @param context.dPopCryptoContext The DPoP crypto context
|
31
30
|
* @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
|
31
|
+
* @param operationType Specify the type of credential issuance (used for reissuing)
|
32
32
|
* @returns The credential response containing the credential
|
33
33
|
*/
|
34
34
|
export const obtainCredential = async (issuerConf, accessToken, clientId, credentialDefinition, context, operationType) => {
|
@@ -37,18 +37,34 @@ export const obtainCredential = async (issuerConf, accessToken, clientId, creden
|
|
37
37
|
appFetch = fetch,
|
38
38
|
dPopCryptoContext
|
39
39
|
} = context;
|
40
|
+
const {
|
41
|
+
credential_configuration_id,
|
42
|
+
credential_identifier
|
43
|
+
} = credentialDefinition;
|
40
44
|
const credentialUrl = issuerConf.openid_credential_issuer.credential_endpoint;
|
45
|
+
const issuerUrl = issuerConf.oauth_authorization_server.issuer;
|
46
|
+
const nonceUrl = issuerConf.openid_credential_issuer.nonce_endpoint;
|
47
|
+
|
48
|
+
// Fetch the nonce from the Credential Issuer
|
49
|
+
const {
|
50
|
+
c_nonce
|
51
|
+
} = await appFetch(nonceUrl, {
|
52
|
+
method: "POST",
|
53
|
+
headers: {
|
54
|
+
"Content-Type": "application/json"
|
55
|
+
}
|
56
|
+
}).then(hasStatusOrThrow(200)).then(res => res.json()).then(body => NonceResponse.parse(body));
|
41
57
|
|
42
58
|
/**
|
43
59
|
* JWT proof token to bind the request nonce to the key that will bind the holder User with the Credential
|
44
60
|
* 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.
|
45
61
|
* @see https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#name-proof-types
|
46
62
|
*/
|
47
|
-
const signedNonceProof = await createNonceProof(
|
63
|
+
const signedNonceProof = await createNonceProof(c_nonce, clientId, issuerUrl, credentialCryptoContext);
|
48
64
|
Logger.log(LogLevel.DEBUG, `Signed nonce proof: ${signedNonceProof}`);
|
49
65
|
|
50
66
|
// Validation of accessTokenResponse.authorization_details if contain credentialDefinition
|
51
|
-
const containsCredentialDefinition = accessToken.authorization_details.some(c => c.credential_configuration_id ===
|
67
|
+
const containsCredentialDefinition = accessToken.authorization_details.some(c => c.credential_configuration_id === credential_configuration_id && (credential_identifier ? c.credential_identifiers.includes(credential_identifier) : true));
|
52
68
|
if (!containsCredentialDefinition) {
|
53
69
|
Logger.log(LogLevel.ERROR, `Credential definition not found in the access token response ${accessToken.authorization_details}`);
|
54
70
|
throw new ValidationFailed({
|
@@ -56,12 +72,20 @@ export const obtainCredential = async (issuerConf, accessToken, clientId, creden
|
|
56
72
|
});
|
57
73
|
}
|
58
74
|
|
59
|
-
/**
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
75
|
+
/**
|
76
|
+
* The credential request body.
|
77
|
+
* We accept both `credential_identifier` (recommended) and `credential_configuration_id`
|
78
|
+
* when the Authorization Server does not support `credential_identifier`.
|
79
|
+
* @see https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-15.html#section-3.3.4
|
80
|
+
*/
|
81
|
+
const credentialRequestFormBody = credential_identifier ? {
|
82
|
+
credential_identifier: credential_identifier,
|
83
|
+
proof: {
|
84
|
+
jwt: signedNonceProof,
|
85
|
+
proof_type: "jwt"
|
86
|
+
}
|
87
|
+
} : {
|
88
|
+
credential_configuration_id: credential_configuration_id,
|
65
89
|
proof: {
|
66
90
|
jwt: signedNonceProof,
|
67
91
|
proof_type: "jwt"
|
@@ -95,7 +119,15 @@ export const obtainCredential = async (issuerConf, accessToken, clientId, creden
|
|
95
119
|
});
|
96
120
|
}
|
97
121
|
Logger.log(LogLevel.DEBUG, `Credential Response: ${JSON.stringify(credentialRes.data)}`);
|
98
|
-
|
122
|
+
|
123
|
+
// Extract the format corresponding to the credential_configuration_id used
|
124
|
+
const issuerCredentialConfig = issuerConf.openid_credential_issuer.credential_configurations_supported[credential_configuration_id];
|
125
|
+
|
126
|
+
// TODO: [SIW-2264] Handle multiple credentials
|
127
|
+
return {
|
128
|
+
credential: credentialRes.data.credentials.at(0).credential,
|
129
|
+
format: issuerCredentialConfig.format
|
130
|
+
};
|
99
131
|
};
|
100
132
|
|
101
133
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["sha256ToBase64","SignJWT","hasStatusOrThrow","IssuerResponseError","IssuerResponseErrorCodes","ResponseErrorBuilder","UnexpectedStatusCodeError","ValidationFailed","CredentialResponse","createDPopToken","v4","uuidv4","LogLevel","Logger","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","operationType","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","credentialUrl","openid_credential_issuer","credential_endpoint","
|
1
|
+
{"version":3,"names":["sha256ToBase64","SignJWT","hasStatusOrThrow","IssuerResponseError","IssuerResponseErrorCodes","ResponseErrorBuilder","UnexpectedStatusCodeError","ValidationFailed","CredentialResponse","NonceResponse","createDPopToken","v4","uuidv4","LogLevel","Logger","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","operationType","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","credential_configuration_id","credential_identifier","credentialUrl","openid_credential_issuer","credential_endpoint","issuerUrl","oauth_authorization_server","nonceUrl","nonce_endpoint","c_nonce","method","headers","then","res","json","body","parse","signedNonceProof","log","DEBUG","containsCredentialDefinition","authorization_details","some","c","credential_identifiers","includes","ERROR","message","credentialRequestFormBody","proof","jwt","proof_type","JSON","stringify","tokenRequestSignedDPop","htm","htu","jti","ath","access_token","credentialRes","DPoP","Authorization","token_type","safeParse","catch","handleObtainCredentialError","success","error","reason","data","issuerCredentialConfig","credential_configurations_supported","credential","credentials","at","format","e","handle","code","CredentialIssuingNotSynchronous","CredentialInvalidStatus","CredentialRequestFailed","buildFrom"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":"AAAA,SAEEA,cAAc,EACdC,OAAO,QACF,6BAA6B;AAGpC,SAASC,gBAAgB,QAAkB,kBAAkB;AAE7D,SACEC,mBAAmB,EACnBC,wBAAwB,EACxBC,oBAAoB,EACpBC,yBAAyB,EACzBC,gBAAgB,QACX,oBAAoB;AAC3B,SAASC,kBAAkB,EAAEC,aAAa,QAA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EAAE;EACX,CAAC,CAAC,CACD+B,MAAM,CAAC,GAAG,EAAE;IACXC,IAAI,EAAEhG,wBAAwB,CAACmG,uBAAuB;IACtDnC,OAAO,EAAE;EACX,CAAC,CAAC,CACDoC,SAAS,CAACN,CAAC,CAAC;AACjB,CAAC"}
|
@@ -8,45 +8,39 @@ import { LogLevel, Logger } from "../../utils/logging";
|
|
8
8
|
|
9
9
|
// handy alias
|
10
10
|
|
11
|
-
const parseCredentialSdJwt = function (
|
11
|
+
const parseCredentialSdJwt = function (credentialConfig, _ref) {
|
12
12
|
let {
|
13
13
|
sdJwt,
|
14
14
|
disclosures
|
15
15
|
} = _ref;
|
16
16
|
let ignoreMissingAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
17
17
|
let includeUndefinedAttributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
18
|
-
|
19
|
-
|
20
|
-
Logger.log(LogLevel.ERROR,
|
21
|
-
throw new IoWalletError(
|
22
|
-
}
|
23
|
-
if (credentialSubject.format !== sdJwt.header.typ) {
|
24
|
-
Logger.log(LogLevel.ERROR, `Received credential is of an unknwown type. Expected one of [${credentialSubject.format}], received '${sdJwt.header.typ}'`);
|
25
|
-
throw new IoWalletError(`Received credential is of an unknwown type. Expected one of [${credentialSubject.format}], received '${sdJwt.header.typ}', `);
|
18
|
+
if (credentialConfig.format !== sdJwt.header.typ) {
|
19
|
+
const message = `Received credential is of an unknwown type. Expected one of [${credentialConfig.format}], received '${sdJwt.header.typ}'`;
|
20
|
+
Logger.log(LogLevel.ERROR, message);
|
21
|
+
throw new IoWalletError(message);
|
26
22
|
}
|
27
|
-
|
28
|
-
// transfrom a record { key: value } in an iterable of pairs [key, value]
|
29
|
-
if (!credentialSubject.claims) {
|
23
|
+
if (!credentialConfig.claims) {
|
30
24
|
Logger.log(LogLevel.ERROR, "Missing claims in the credential subject");
|
31
25
|
throw new IoWalletError("Missing claims in the credential subject"); // TODO [SIW-1268]: should not be optional
|
32
26
|
}
|
33
27
|
|
34
|
-
const attrDefinitions =
|
28
|
+
const attrDefinitions = credentialConfig.claims;
|
35
29
|
|
36
30
|
// the key of the attribute defintion must match the disclosure's name
|
37
|
-
const attrsNotInDisclosures = attrDefinitions.filter(_ref2 => {
|
38
|
-
let [
|
39
|
-
return
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
});
|
31
|
+
const attrsNotInDisclosures = attrDefinitions.filter(definition => !disclosures.some(_ref2 => {
|
32
|
+
let [, name] = _ref2;
|
33
|
+
return name === definition.path[0];
|
34
|
+
}) // Ignore nested paths for now, see https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-15.html#name-claims-path-pointer
|
35
|
+
);
|
36
|
+
|
44
37
|
if (attrsNotInDisclosures.length > 0) {
|
45
|
-
const missing = attrsNotInDisclosures.map(_ => _[0
|
38
|
+
const missing = attrsNotInDisclosures.map(_ => _.path[0]).join(", ");
|
46
39
|
const received = disclosures.map(_ => _[1 /* name */]).join(", ");
|
47
40
|
if (!ignoreMissingAttributes) {
|
48
|
-
|
49
|
-
|
41
|
+
const message = `Some attributes are missing in the credential. Missing: [${missing}], received: [${received}]`;
|
42
|
+
Logger.log(LogLevel.ERROR, message);
|
43
|
+
throw new IoWalletError(message);
|
50
44
|
}
|
51
45
|
}
|
52
46
|
|
@@ -54,28 +48,31 @@ const parseCredentialSdJwt = function (credentials_supported, _ref) {
|
|
54
48
|
// and are present in the disclosure set
|
55
49
|
const definedValues = Object.fromEntries(attrDefinitions
|
56
50
|
// retrieve the value from the disclosure set
|
57
|
-
.map(
|
51
|
+
.map(_ref3 => {
|
58
52
|
var _disclosures$find;
|
59
|
-
let
|
60
|
-
|
53
|
+
let {
|
54
|
+
path,
|
55
|
+
...definition
|
56
|
+
} = _ref3;
|
57
|
+
return [path[0], {
|
61
58
|
...definition,
|
62
|
-
value: (_disclosures$find = disclosures.find(_ => _[1 /* name */] ===
|
59
|
+
value: (_disclosures$find = disclosures.find(_ => _[1 /* name */] === path[0])) === null || _disclosures$find === void 0 ? void 0 : _disclosures$find[2 /* value */]
|
63
60
|
}];
|
64
61
|
})
|
65
62
|
// add a human readable attribute name, with i18n, in the form { locale: name }
|
66
63
|
// example: { "it-IT": "Nome", "en-EN": "Name", "es-ES": "Nombre" }
|
67
|
-
.map(
|
64
|
+
.map(_ref4 => {
|
68
65
|
let [attrKey, {
|
69
66
|
display,
|
70
67
|
...definition
|
71
|
-
}] =
|
68
|
+
}] = _ref4;
|
72
69
|
return [attrKey, {
|
73
70
|
...definition,
|
74
|
-
name: display.reduce((names,
|
71
|
+
name: display.reduce((names, _ref5) => {
|
75
72
|
let {
|
76
73
|
locale,
|
77
74
|
name
|
78
|
-
} =
|
75
|
+
} = _ref5;
|
79
76
|
return {
|
80
77
|
...names,
|
81
78
|
[locale]: name
|
@@ -86,8 +83,8 @@ const parseCredentialSdJwt = function (credentials_supported, _ref) {
|
|
86
83
|
if (includeUndefinedAttributes) {
|
87
84
|
// attributes that are in the disclosure set
|
88
85
|
// but are not defined in the issuer configuration
|
89
|
-
const undefinedValues = Object.fromEntries(disclosures.filter(_ => !Object.keys(definedValues).includes(_[1])).map(
|
90
|
-
let [, key, value] =
|
86
|
+
const undefinedValues = Object.fromEntries(disclosures.filter(_ => !Object.keys(definedValues).includes(_[1])).map(_ref6 => {
|
87
|
+
let [, key, value] = _ref6;
|
91
88
|
return [key, {
|
92
89
|
value,
|
93
90
|
name: key
|
@@ -124,23 +121,26 @@ async function verifyCredentialSdJwt(rawCredential, issuerKeys, holderBindingCon
|
|
124
121
|
cnf
|
125
122
|
} = decodedCredential.sdJwt.payload;
|
126
123
|
if (!cnf.jwk.kid || cnf.jwk.kid !== holderBindingKey.kid) {
|
127
|
-
|
128
|
-
|
124
|
+
const message = `Failed to verify holder binding, expected kid: ${holderBindingKey.kid}, got: ${decodedCredential.sdJwt.payload.cnf.jwk.kid}`;
|
125
|
+
Logger.log(LogLevel.ERROR, message);
|
126
|
+
throw new IoWalletError(message);
|
129
127
|
}
|
130
128
|
return decodedCredential;
|
131
129
|
}
|
132
|
-
|
133
|
-
// utility type that specialize VerifyAndParseCredential for given format
|
134
|
-
|
135
|
-
const verifyAndParseCredentialSdJwt = async (issuerConf, credential, _, _ref8) => {
|
130
|
+
const verifyAndParseCredentialSdJwt = async (issuerConf, credential, credentialConfigurationId, _ref7) => {
|
136
131
|
let {
|
137
132
|
credentialCryptoContext,
|
138
133
|
ignoreMissingAttributes,
|
139
134
|
includeUndefinedAttributes
|
140
|
-
} =
|
135
|
+
} = _ref7;
|
141
136
|
const decoded = await verifyCredentialSdJwt(credential, issuerConf.openid_credential_issuer.jwks.keys, credentialCryptoContext);
|
142
137
|
Logger.log(LogLevel.DEBUG, `Decoded credential: ${JSON.stringify(decoded)}`);
|
143
|
-
const
|
138
|
+
const credentialConfig = issuerConf.openid_credential_issuer.credential_configurations_supported[credentialConfigurationId];
|
139
|
+
if (!credentialConfig) {
|
140
|
+
Logger.log(LogLevel.ERROR, `Credential type not supported by the issuer: ${credentialConfigurationId}`);
|
141
|
+
throw new IoWalletError("Credential type not supported by the issuer");
|
142
|
+
}
|
143
|
+
const parsedCredential = parseCredentialSdJwt(credentialConfig, decoded, ignoreMissingAttributes, includeUndefinedAttributes);
|
144
144
|
const maybeIssuedAt = getValueFromDisclosures(decoded.disclosures, "iat");
|
145
145
|
Logger.log(LogLevel.DEBUG, `Parsed credential: ${JSON.stringify(parsedCredential)}\nIssued at: ${maybeIssuedAt}`);
|
146
146
|
return {
|
@@ -154,7 +154,7 @@ const verifyAndParseCredentialSdJwt = async (issuerConf, credential, _, _ref8) =
|
|
154
154
|
* Verify and parse an encoded credential.
|
155
155
|
* @param issuerConf The Issuer configuration returned by {@link evaluateIssuerTrust}
|
156
156
|
* @param credential The encoded credential returned by {@link obtainCredential}
|
157
|
-
* @param
|
157
|
+
* @param credentialConfigurationId The credential configuration ID that defines the provided credential
|
158
158
|
* @param context.credentialCryptoContext The crypto context used to obtain the credential in {@link obtainCredential}
|
159
159
|
* @param context.ignoreMissingAttributes Skip error when attributes declared in the issuer configuration are not found within disclosures
|
160
160
|
* @param context.includeUndefinedAttributes Include attributes not explicitly declared in the issuer configuration
|
@@ -163,12 +163,15 @@ const verifyAndParseCredentialSdJwt = async (issuerConf, credential, _, _ref8) =
|
|
163
163
|
* @throws {IoWalletError} If the credential is not bound to the provided user key
|
164
164
|
* @throws {IoWalletError} If the credential data fail to parse
|
165
165
|
*/
|
166
|
-
export const verifyAndParseCredential = async (issuerConf, credential,
|
167
|
-
|
168
|
-
|
169
|
-
|
166
|
+
export const verifyAndParseCredential = async (issuerConf, credential, credentialConfigurationId, context) => {
|
167
|
+
var _issuerConf$openid_cr;
|
168
|
+
const format = (_issuerConf$openid_cr = issuerConf.openid_credential_issuer.credential_configurations_supported[credentialConfigurationId]) === null || _issuerConf$openid_cr === void 0 ? void 0 : _issuerConf$openid_cr.format;
|
169
|
+
if (format === "dc+sd-jwt") {
|
170
|
+
Logger.log(LogLevel.DEBUG, "Parsing credential in dc+sd-jwt format");
|
171
|
+
return verifyAndParseCredentialSdJwt(issuerConf, credential, credentialConfigurationId, context);
|
170
172
|
}
|
171
|
-
|
172
|
-
|
173
|
+
const message = `Unsupported credential format: ${format}`;
|
174
|
+
Logger.log(LogLevel.ERROR, message);
|
175
|
+
throw new IoWalletError(message);
|
173
176
|
};
|
174
177
|
//# sourceMappingURL=07-verify-and-parse-credential.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["IoWalletError","SdJwt4VC","verify","verifySdJwt","getValueFromDisclosures","LogLevel","Logger","parseCredentialSdJwt","
|
1
|
+
{"version":3,"names":["IoWalletError","SdJwt4VC","verify","verifySdJwt","getValueFromDisclosures","LogLevel","Logger","parseCredentialSdJwt","credentialConfig","_ref","sdJwt","disclosures","ignoreMissingAttributes","arguments","length","undefined","includeUndefinedAttributes","format","header","typ","message","log","ERROR","claims","attrDefinitions","attrsNotInDisclosures","filter","definition","some","_ref2","name","path","missing","map","_","join","received","definedValues","Object","fromEntries","_ref3","_disclosures$find","value","find","_ref4","attrKey","display","reduce","names","_ref5","locale","undefinedValues","keys","includes","_ref6","key","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","getPublicKey","cnf","payload","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","credentialConfigurationId","_ref7","credentialCryptoContext","decoded","openid_credential_issuer","jwks","DEBUG","JSON","stringify","credential_configurations_supported","parsedCredential","maybeIssuedAt","expiration","Date","exp","issuedAt","verifyAndParseCredential","context","_issuerConf$openid_cr"],"sourceRoot":"../../../../src","sources":["credential/issuance/07-verify-and-parse-credential.ts"],"mappings":"AAGA,SAASA,aAAa,QAAQ,oBAAoB;AAClD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,MAAM,IAAIC,WAAW,QAAQ,cAAc;AACpD,SAASC,uBAAuB,QAAQ,yBAAyB;AAGjE,SAASC,QAAQ,EAAEC,MAAM,QAAQ,qBAAqB;;AA2BtD;;AAkBA;;AAKA,MAAMC,oBAAoB,GAAG,SAAAA,CAE3BC,gBAAgC,EAAAC,IAAA,EAIX;EAAA,IAHrB;IAAEC,KAAK;IAAEC;EAAoC,CAAC,GAAAF,IAAA;EAAA,IAC9CG,uBAAgC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAAA,IACxCG,0BAAmC,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAE3C,IAAIL,gBAAgB,CAACS,MAAM,KAAKP,KAAK,CAACQ,MAAM,CAACC,GAAG,EAAE;IAChD,MAAMC,OAAO,GAAI,gEAA+DZ,gBAAgB,CAACS,MAAO,gBAAeP,KAAK,CAACQ,MAAM,CAACC,GAAI,GAAE;IAC1Ib,MAAM,CAACe,GAAG,CAAChB,QAAQ,CAACiB,KAAK,EAAEF,OAAO,CAAC;I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GzE,MAAM;EAEX,IAAIA,MAAM,KAAK,WAAW,EAAE;IAC1BX,MAAM,CAACe,GAAG,CAAChB,QAAQ,CAACyE,KAAK,EAAE,wCAAwC,CAAC;IACpE,OAAOT,6BAA6B,CAClCC,UAAU,EACVC,UAAU,EACVC,yBAAyB,EACzBiB,OACF,CAAC;EACH;EAEA,MAAMrE,OAAO,GAAI,kCAAiCH,MAAO,EAAC;EAC1DX,MAAM,CAACe,GAAG,CAAChB,QAAQ,CAACiB,KAAK,EAAEF,OAAO,CAAC;EACnC,MAAM,IAAIpB,aAAa,CAACoB,OAAO,CAAC;AAClC,CAAC"}
|
@@ -6,7 +6,7 @@ There's a fork in the flow which is based on the type of the credential that is
|
|
6
6
|
This is due to the fact that eID credentials require a different authorization flow than other credentials, which is accomplished by a strong authentication method like SPID or CIE.
|
7
7
|
Credentials instead require a simpler authorization flow and they require other credentials to be presented in order to be issued.
|
8
8
|
|
9
|
-
The supported credentials are defined in the entity configuration of the issuer which is evaluted and parsed in the `evaluateIssuerTrust` step.
|
9
|
+
The supported credentials are defined in the entity configuration of the issuer which is evaluted and parsed in the `evaluateIssuerTrust` step. Available credentials are identified with a unique `credential_configuration_id`, that must be used when requesting authorization. The Authorization Server returns an array of **credential identifiers** that map to the `credential_configuration_id` provided: to obtain the credential, one of the credential identifiers (or all of them) must be requested to the credential endpoint.
|
10
10
|
|
11
11
|
## Sequence Diagram
|
12
12
|
|
@@ -72,6 +72,8 @@ The expected result from the authentication process is in `form_post.jwt` format
|
|
72
72
|
<summary>Credential issuance flow</summary>
|
73
73
|
|
74
74
|
```ts
|
75
|
+
// TODO: [SIW-2209] update documentation in PR #219
|
76
|
+
|
75
77
|
// Retrieve the integrity key tag from the store and create its context
|
76
78
|
const integrityKeyTag = "example"; // Let's assume this is the key tag used to create the wallet instance
|
77
79
|
const integrityContext = getIntegrityContext(integrityKeyTag);
|
@@ -251,11 +253,10 @@ const credentialCryptoContext = createCryptoContextFor(credentialKeyTag);
|
|
251
253
|
// Start the issuance flow
|
252
254
|
const startFlow: Credential.Issuance.StartFlow = () => ({
|
253
255
|
issuerUrl: WALLET_EID_PROVIDER_BASE_URL,
|
254
|
-
|
255
|
-
appFetch,
|
256
|
+
credentialId: "dc_sd_jwt_PersonIdentificationData",
|
256
257
|
});
|
257
258
|
|
258
|
-
const { issuerUrl } = startFlow();
|
259
|
+
const { issuerUrl, credentialId } = startFlow();
|
259
260
|
|
260
261
|
// Evaluate issuer trust
|
261
262
|
const { issuerConf } = await Credential.Issuance.evaluateIssuerTrust(
|
@@ -265,12 +266,16 @@ const { issuerConf } = await Credential.Issuance.evaluateIssuerTrust(
|
|
265
266
|
|
266
267
|
// Start user authorization
|
267
268
|
const { issuerRequestUri, clientId, codeVerifier, credentialDefinition } =
|
268
|
-
await Credential.Issuance.startUserAuthorization(
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
269
|
+
await Credential.Issuance.startUserAuthorization(
|
270
|
+
issuerConf,
|
271
|
+
[credentialId], // Request authorization for one or more credentials
|
272
|
+
{
|
273
|
+
walletInstanceAttestation,
|
274
|
+
redirectUri,
|
275
|
+
wiaCryptoContext,
|
276
|
+
appFetch,
|
277
|
+
}
|
278
|
+
);
|
274
279
|
|
275
280
|
// Complete the authorization process with query mode with the authorizationContext which opens the browser
|
276
281
|
const { code } =
|
@@ -301,12 +306,27 @@ const { accessToken } = await Credential.Issuance.authorizeAccess(
|
|
301
306
|
}
|
302
307
|
);
|
303
308
|
|
309
|
+
|
310
|
+
const [pidCredentialDefinition] = credentialDefinition;
|
311
|
+
|
312
|
+
// Extract the credential_identifier(s) from the access token
|
313
|
+
// For each one of them, a credential can be obtained by calling `obtainCredential`
|
314
|
+
const { credential_configuration_id, credential_identifiers } =
|
315
|
+
accessToken.authorization_details.find(
|
316
|
+
(authDetails) =>
|
317
|
+
authDetails.credential_configuration_id ===
|
318
|
+
pidCredentialDefinition.credential_configuration_id
|
319
|
+
);
|
320
|
+
|
304
321
|
// Obtain che eID credential
|
305
322
|
const { credential, format } = await Credential.Issuance.obtainCredential(
|
306
323
|
issuerConf,
|
307
324
|
accessToken,
|
308
325
|
clientId,
|
309
|
-
|
326
|
+
{
|
327
|
+
credential_configuration_id,
|
328
|
+
credential_identifier: credential_identifiers.at(0),
|
329
|
+
},
|
310
330
|
{
|
311
331
|
credentialCryptoContext,
|
312
332
|
dPopCryptoContext,
|
@@ -318,15 +338,16 @@ const { credential, format } = await Credential.Issuance.obtainCredential(
|
|
318
338
|
const { parsedCredential, issuedAt, expiration } = await Credential.Issuance.verifyAndParseCredential(
|
319
339
|
issuerConf,
|
320
340
|
credential,
|
321
|
-
|
341
|
+
credential_configuration_id,
|
322
342
|
{ credentialCryptoContext }
|
323
343
|
);
|
324
344
|
|
325
345
|
return {
|
326
346
|
parsedCredential,
|
327
347
|
credential,
|
348
|
+
credentialConfigurationId: credential_configuration_id
|
349
|
+
credentialType: "PersonIdentificationData",
|
328
350
|
keyTag: credentialKeyTag,
|
329
|
-
credentialType,
|
330
351
|
issuedAt,
|
331
352
|
expiration
|
332
353
|
};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import * as z from "zod";
|
2
2
|
export const ASSERTION_TYPE = "urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation";
|
3
|
-
export const SupportedCredentialFormat = z.union([z.literal("
|
3
|
+
export const SupportedCredentialFormat = z.union([z.literal("dc+sd-jwt"), z.literal("vc+mdoc-cbor")]);
|
4
4
|
//# sourceMappingURL=const.js.map
|
@@ -1,19 +1,20 @@
|
|
1
|
-
import { AuthorizationDetail } from "../../utils/par";
|
2
1
|
import * as z from "zod";
|
3
|
-
|
2
|
+
export const AuthorizationDetail = z.object({
|
3
|
+
type: z.literal("openid_credential"),
|
4
|
+
credential_configuration_id: z.string(),
|
5
|
+
credential_identifiers: z.array(z.string())
|
6
|
+
});
|
4
7
|
export const TokenResponse = z.object({
|
5
8
|
access_token: z.string(),
|
6
9
|
authorization_details: z.array(AuthorizationDetail),
|
7
|
-
c_nonce: z.string(),
|
8
|
-
c_nonce_expires_in: z.number(),
|
9
10
|
expires_in: z.number(),
|
10
11
|
token_type: z.string()
|
11
12
|
});
|
12
13
|
export const CredentialResponse = z.object({
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
credentials: z.array(z.object({
|
15
|
+
credential: z.string()
|
16
|
+
})),
|
17
|
+
notification_id: z.string().optional()
|
17
18
|
});
|
18
19
|
|
19
20
|
/**
|
@@ -22,4 +23,7 @@ export const CredentialResponse = z.object({
|
|
22
23
|
export const ResponseUriResultShape = z.object({
|
23
24
|
redirect_uri: z.string()
|
24
25
|
});
|
26
|
+
export const NonceResponse = z.object({
|
27
|
+
c_nonce: z.string()
|
28
|
+
});
|
25
29
|
//# sourceMappingURL=types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["z","AuthorizationDetail","object","type","literal","credential_configuration_id","string","credential_identifiers","array","TokenResponse","access_token","authorization_details","expires_in","number","token_type","CredentialResponse","credentials","credential","notification_id","optional","ResponseUriResultShape","redirect_uri","NonceResponse","c_nonce"],"sourceRoot":"../../../../src","sources":["credential/issuance/types.ts"],"mappings":"AAAA,OAAO,KAAKA,CAAC,MAAM,KAAK;AAGxB,OAAO,MAAMC,mBAAmB,GAAGD,CAAC,CAACE,MAAM,CAAC;EAC1CC,IAAI,EAAEH,CAAC,CAACI,OAAO,CAAC,mBAAmB,CAAC;EACpCC,2BAA2B,EAAEL,CAAC,CAACM,MAAM,CAAC,CAAC;EACvCC,sBAAsB,EAAEP,CAAC,CAACQ,KAAK,CAACR,CAAC,CAACM,MAAM,CAAC,CAAC;AAC5C,CAAC,CAAC;AAIF,OAAO,MAAMG,aAAa,GAAGT,CAAC,CAACE,MAAM,CAAC;EACpCQ,YAAY,EAAEV,CAAC,CAACM,MAAM,CAAC,CAAC;EACxBK,qBAAqB,EAAEX,CAAC,CAACQ,KAAK,CAACP,mBAAmB,CAAC;EACnDW,UAAU,EAAEZ,CAAC,CAACa,MAAM,CAAC,CAAC;EACtBC,UAAU,EAAEd,CAAC,CAACM,MAAM,CAAC;AACvB,CAAC,CAAC;AAIF,OAAO,MAAMS,kBAAkB,GAAGf,CAAC,CAACE,MAAM,CAAC;EACzCc,WAAW,EAAEhB,CAAC,CAACQ,KAAK,CAClBR,CAAC,CAACE,MAAM,CAAC;IACPe,UAAU,EAAEjB,CAAC,CAACM,MAAM,CAAC;EACvB,CAAC,CACH,CAAC;EACDY,eAAe,EAAElB,CAAC,CAACM,MAAM,CAAC,CAAC,CAACa,QAAQ,CAAC;AACvC,CAAC,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAGpB,CAAC,CAACE,MAAM,CAAC;EAC7CmB,YAAY,EAAErB,CAAC,CAACM,MAAM,CAAC;AACzB,CAAC,CAAC;AAKF,OAAO,MAAMgB,aAAa,GAAGtB,CAAC,CAACE,MAAM,CAAC;EACpCqB,OAAO,EAAEvB,CAAC,CAACM,MAAM,CAAC;AACpB,CAAC,CAAC"}
|
@@ -20,7 +20,7 @@ const mapCredentialToObject = jwt => {
|
|
20
20
|
const credentialFormat = sdJwt.header.typ;
|
21
21
|
|
22
22
|
// TODO [SIW-2082]: support MDOC credentials
|
23
|
-
if (credentialFormat !== "
|
23
|
+
if (credentialFormat !== "dc+sd-jwt") {
|
24
24
|
throw new Error(`Unsupported credential format: ${credentialFormat}`);
|
25
25
|
}
|
26
26
|
return {
|
@@ -59,7 +59,7 @@ const extractMissingCredentials = (queryResult, originalQuery) => {
|
|
59
59
|
var _credential$meta;
|
60
60
|
let [id] = _ref3;
|
61
61
|
const credential = originalQuery.credentials.find(c => c.id === id);
|
62
|
-
if ((credential === null || credential === void 0 ? void 0 : credential.format) !== "
|
62
|
+
if ((credential === null || credential === void 0 ? void 0 : credential.format) !== "dc+sd-jwt") {
|
63
63
|
throw new Error("Unsupported format"); // TODO [SIW-2082]: support MDOC credentials
|
64
64
|
}
|
65
65
|
|
@@ -91,7 +91,7 @@ export const evaluateDcqlQuery = (credentialsSdJwt, query) => {
|
|
91
91
|
return getDcqlQueryMatches(queryResult).map(_ref5 => {
|
92
92
|
var _queryResult$credenti;
|
93
93
|
let [id, match] = _ref5;
|
94
|
-
if (match.output.credential_format !== "
|
94
|
+
if (match.output.credential_format !== "dc+sd-jwt") {
|
95
95
|
throw new Error("Unsupported format"); // TODO [SIW-2082]: support MDOC credentials
|
96
96
|
}
|
97
97
|
|
@@ -147,7 +147,7 @@ export const prepareRemotePresentations = async (credentials, nonce, clientId) =
|
|
147
147
|
credentialId: item.id,
|
148
148
|
requestedClaims: item.requestedClaims,
|
149
149
|
vpToken: vp_token,
|
150
|
-
format: "
|
150
|
+
format: "dc+sd-jwt"
|
151
151
|
};
|
152
152
|
}));
|
153
153
|
};
|
@@ -231,7 +231,7 @@ export const evaluateInputDescriptors = async (inputDescriptors, credentialsSdJw
|
|
231
231
|
})) || [];
|
232
232
|
return Promise.all(inputDescriptors.map(async descriptor => {
|
233
233
|
var _descriptor$format;
|
234
|
-
if ((_descriptor$format = descriptor.format) !== null && _descriptor$format !== void 0 && _descriptor$format["
|
234
|
+
if ((_descriptor$format = descriptor.format) !== null && _descriptor$format !== void 0 && _descriptor$format["dc+sd-jwt"]) {
|
235
235
|
if (!decodedSdJwtCredentials.length) {
|
236
236
|
throw new CredentialsNotFoundError([{
|
237
237
|
id: descriptor.id,
|
@@ -277,7 +277,7 @@ export const prepareLegacyRemotePresentations = async (credentialAndDescriptors,
|
|
277
277
|
return Promise.all(credentialAndDescriptors.map(async item => {
|
278
278
|
var _descriptor$format2;
|
279
279
|
const descriptor = item.inputDescriptor;
|
280
|
-
if ((_descriptor$format2 = descriptor.format) !== null && _descriptor$format2 !== void 0 && _descriptor$format2["
|
280
|
+
if ((_descriptor$format2 = descriptor.format) !== null && _descriptor$format2 !== void 0 && _descriptor$format2["dc+sd-jwt"]) {
|
281
281
|
const {
|
282
282
|
vp_token
|
283
283
|
} = await prepareVpToken(nonce, client_id, [item.credential, item.requestedClaims, createCryptoContextFor(item.keyTag)]);
|
@@ -285,7 +285,7 @@ export const prepareLegacyRemotePresentations = async (credentialAndDescriptors,
|
|
285
285
|
requestedClaims: item.requestedClaims,
|
286
286
|
inputDescriptor: descriptor,
|
287
287
|
vpToken: vp_token,
|
288
|
-
format: "
|
288
|
+
format: "dc+sd-jwt"
|
289
289
|
};
|
290
290
|
}
|
291
291
|
throw new CredentialsNotFoundError([{
|