@pagopa/io-react-native-wallet 0.28.1 → 0.28.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/04-complete-user-authorization.js +5 -3
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/presentation/01-start-flow.js +6 -7
- package/lib/commonjs/credential/presentation/01-start-flow.js.map +1 -1
- package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js +4 -2
- package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
- package/lib/commonjs/credential/presentation/03-get-request-object.js +2 -2
- package/lib/commonjs/credential/presentation/03-get-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/05-verify-request-object.js +11 -4
- package/lib/commonjs/credential/presentation/05-verify-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js +19 -10
- package/lib/commonjs/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js +10 -3
- package/lib/commonjs/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js +4 -4
- package/lib/commonjs/credential/presentation/08-send-authorization-response.js.map +1 -1
- package/lib/commonjs/credential/presentation/README.md +88 -2
- package/lib/commonjs/credential/presentation/errors.js +5 -6
- package/lib/commonjs/credential/presentation/errors.js.map +1 -1
- package/lib/commonjs/credential/presentation/index.js +27 -2
- package/lib/commonjs/credential/presentation/index.js.map +1 -1
- package/lib/commonjs/credential/presentation/types.js +1 -1
- package/lib/commonjs/credential/presentation/types.js.map +1 -1
- package/lib/module/credential/issuance/04-complete-user-authorization.js +5 -3
- package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/presentation/01-start-flow.js +6 -7
- package/lib/module/credential/presentation/01-start-flow.js.map +1 -1
- package/lib/module/credential/presentation/02-evaluate-rp-trust.js +4 -2
- package/lib/module/credential/presentation/02-evaluate-rp-trust.js.map +1 -1
- package/lib/module/credential/presentation/03-get-request-object.js +2 -2
- package/lib/module/credential/presentation/03-get-request-object.js.map +1 -1
- package/lib/module/credential/presentation/05-verify-request-object.js +11 -4
- package/lib/module/credential/presentation/05-verify-request-object.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js +20 -10
- package/lib/module/credential/presentation/07-evaluate-dcql-query.js.map +1 -1
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js +8 -1
- package/lib/module/credential/presentation/07-evaluate-input-descriptor.js.map +1 -1
- package/lib/module/credential/presentation/08-send-authorization-response.js +4 -4
- package/lib/module/credential/presentation/08-send-authorization-response.js.map +1 -1
- package/lib/module/credential/presentation/README.md +88 -2
- package/lib/module/credential/presentation/errors.js +5 -6
- package/lib/module/credential/presentation/errors.js.map +1 -1
- package/lib/module/credential/presentation/index.js +4 -3
- package/lib/module/credential/presentation/index.js.map +1 -1
- package/lib/module/credential/presentation/types.js +1 -1
- package/lib/module/credential/presentation/types.js.map +1 -1
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +2 -2
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/01-start-flow.d.ts +1 -6
- package/lib/typescript/credential/presentation/01-start-flow.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts +1 -0
- package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/03-get-request-object.d.ts +1 -2
- package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/05-verify-request-object.d.ts +4 -2
- package/lib/typescript/credential/presentation/05-verify-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts +13 -5
- package/lib/typescript/credential/presentation/07-evaluate-dcql-query.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts +7 -2
- package/lib/typescript/credential/presentation/07-evaluate-input-descriptor.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts +3 -3
- package/lib/typescript/credential/presentation/08-send-authorization-response.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/errors.d.ts +3 -4
- package/lib/typescript/credential/presentation/errors.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/index.d.ts +5 -4
- package/lib/typescript/credential/presentation/index.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/types.d.ts +3 -3
- package/package.json +3 -3
- package/src/credential/issuance/04-complete-user-authorization.ts +6 -3
- package/src/credential/presentation/01-start-flow.ts +10 -13
- package/src/credential/presentation/02-evaluate-rp-trust.ts +3 -2
- package/src/credential/presentation/03-get-request-object.ts +2 -3
- package/src/credential/presentation/05-verify-request-object.ts +17 -6
- package/src/credential/presentation/07-evaluate-dcql-query.ts +25 -17
- package/src/credential/presentation/07-evaluate-input-descriptor.ts +32 -30
- package/src/credential/presentation/08-send-authorization-response.ts +9 -7
- package/src/credential/presentation/README.md +88 -2
- package/src/credential/presentation/errors.ts +6 -6
- package/src/credential/presentation/index.ts +22 -4
- package/src/credential/presentation/types.ts +1 -1
@@ -25,16 +25,18 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
25
25
|
* @param issuerRequestUri the URI of the issuer where the request is sent
|
26
26
|
* @param clientId Identifies the current client across all the requests of the issuing flow returned by {@link startUserAuthorization}
|
27
27
|
* @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
|
28
|
-
* @param idpHint Unique identifier of the IDP selected by the user
|
28
|
+
* @param idpHint Unique identifier of the IDP selected by the user (optional)
|
29
29
|
* @returns An object containing the authorization URL
|
30
30
|
*/
|
31
31
|
const buildAuthorizationUrl = async (issuerRequestUri, clientId, issuerConf, idpHint) => {
|
32
32
|
const authzRequestEndpoint = issuerConf.oauth_authorization_server.authorization_endpoint;
|
33
33
|
const params = new URLSearchParams({
|
34
34
|
client_id: clientId,
|
35
|
-
request_uri: issuerRequestUri
|
36
|
-
idphint: idpHint
|
35
|
+
request_uri: issuerRequestUri
|
37
36
|
});
|
37
|
+
if (idpHint) {
|
38
|
+
params.append("idphint", idpHint);
|
39
|
+
}
|
38
40
|
const authUrl = `${authzRequestEndpoint}?${params}`;
|
39
41
|
return {
|
40
42
|
authUrl
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_auth","require","_misc","_parseUrl","_interopRequireDefault","_errors","_ioReactNativeJwt","_types","_uuid","_types2","_decoder","_errors2","obj","__esModule","default","buildAuthorizationUrl","issuerRequestUri","clientId","issuerConf","idpHint","authzRequestEndpoint","oauth_authorization_server","authorization_endpoint","params","URLSearchParams","client_id","request_uri","
|
1
|
+
{"version":3,"names":["_auth","require","_misc","_parseUrl","_interopRequireDefault","_errors","_ioReactNativeJwt","_types","_uuid","_types2","_decoder","_errors2","obj","__esModule","default","buildAuthorizationUrl","issuerRequestUri","clientId","issuerConf","idpHint","authzRequestEndpoint","oauth_authorization_server","authorization_endpoint","params","URLSearchParams","client_id","request_uri","append","authUrl","exports","completeUserAuthorizationWithQueryMode","authRedirectUrl","query","parseUrl","parseAuthorizationResponse","getRequestedCredentialToBePresented","appFetch","arguments","length","undefined","fetch","requestObject","toString","method","then","hasStatusOrThrow","IssuerResponseError","res","text","jws","decode","reqObj","RequestObject","safeParse","payload","success","ValidationFailed","message","reason","error","data","completeUserAuthorizationWithFormPostJwtMode","ctx","wiaCryptoContext","pidCryptoContext","pid","walletInstanceAttestation","wiaWpToken","SignJWT","setProtectedHeader","alg","typ","setPayload","vp","jti","uuidv4","nonce","setIssuedAt","setExpirationTime","setAudience","response_uri","sign","pidWpToken","presentationSubmission","definition_id","id","descriptor_map","path","format","authzResponsePayload","encodeBase64","JSON","stringify","state","presentation_submission","vp_token","body","response","resUriRes","headers","reqUri","json","responseUri","ResponseUriResultShape","redirect_uri","getJwtFromFormPost","cbRes","decodedJwt","authRes","authResParsed","AuthorizationResultShape","authErr","AuthorizationErrorShape","AuthorizationError","AuthorizationIdpError","error_description"],"sourceRoot":"../../../../src","sources":["credential/issuance/04-complete-user-authorization.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,iBAAA,GAAAL,OAAA;AAMA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAAqE,SAAAG,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAErE;AACA;AACA;;AAgCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,qBAA4C,GAAG,MAAAA,CAC1DC,gBAAgB,EAChBC,QAAQ,EACRC,UAAU,EACVC,OAAO,KACJ;EACH,MAAMC,oBAAoB,GACxBF,UAAU,CAACG,0BAA0B,CAACC,sBAAsB;EAE9D,MAAMC,MAAM,GAAG,IAAIC,eAAe,CAAC;IACjCC,SAAS,EAAER,QAAQ;IACnBS,WAAW,EAAEV;EACf,CAAC,CAAC;EAEF,IAAIG,OAAO,EAAE;IACXI,MAAM,CAACI,MAAM,CAAC,SAAS,EAAER,OAAO,CAAC;EACnC;EAEA,MAAMS,OAAO,GAAI,GAAER,oBAAqB,IAAGG,MAAO,EAAC;EAEnD,OAAO;IAAEK;EAAQ,CAAC;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANAC,OAAA,CAAAd,qBAAA,GAAAA,qBAAA;AAOO,MAAMe,sCAA8E,GACz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opRequireWildcard(require("zod"));
|
8
|
-
var _errors = require("
|
8
|
+
var _errors = require("./errors");
|
9
9
|
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); }
|
10
10
|
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; }
|
11
11
|
const PresentationParams = z.object({
|
@@ -31,15 +31,14 @@ const PresentationParams = z.object({
|
|
31
31
|
* @throws If the provided qr code fails to be decoded
|
32
32
|
*/
|
33
33
|
const startFlowFromQR = params => {
|
34
|
-
const result = PresentationParams.safeParse(
|
34
|
+
const result = PresentationParams.safeParse({
|
35
|
+
...params,
|
36
|
+
requestUriMethod: params.requestUriMethod ?? "get"
|
37
|
+
});
|
35
38
|
if (result.success) {
|
36
39
|
return result.data;
|
37
|
-
} else {
|
38
|
-
throw new _errors.ValidationFailed({
|
39
|
-
message: "Invalid parameters provided",
|
40
|
-
reason: result.error.message
|
41
|
-
});
|
42
40
|
}
|
41
|
+
throw new _errors.InvalidQRCodeError(result.error.message);
|
43
42
|
};
|
44
43
|
exports.startFlowFromQR = startFlowFromQR;
|
45
44
|
//# sourceMappingURL=01-start-flow.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["z","_interopRequireWildcard","require","_errors","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","PresentationParams","object","clientId","string","nonempty","requestUri","url","requestUriMethod","enum","state","optional","startFlowFromQR","params","result","safeParse","success","data","
|
1
|
+
{"version":3,"names":["z","_interopRequireWildcard","require","_errors","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","PresentationParams","object","clientId","string","nonempty","requestUri","url","requestUriMethod","enum","state","optional","startFlowFromQR","params","result","safeParse","success","data","InvalidQRCodeError","error","message","exports"],"sourceRoot":"../../../../src","sources":["credential/presentation/01-start-flow.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAA8C,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qB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AM,CAACE,OAAO,EAAE;IAClB,OAAOF,MAAM,CAACG,IAAI;EACpB;EAEA,MAAM,IAAIC,0BAAkB,CAACJ,MAAM,CAACK,KAAK,CAACC,OAAO,CAAC;AACpD,CAAC;AAACC,OAAA,CAAAT,eAAA,GAAAA,eAAA"}
|
@@ -19,13 +19,15 @@ const evaluateRelyingPartyTrust = async function (rpUrl) {
|
|
19
19
|
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
20
20
|
const {
|
21
21
|
payload: {
|
22
|
-
metadata: rpConf
|
22
|
+
metadata: rpConf,
|
23
|
+
sub
|
23
24
|
}
|
24
25
|
} = await (0, _trust.getRelyingPartyEntityConfiguration)(rpUrl, {
|
25
26
|
appFetch
|
26
27
|
});
|
27
28
|
return {
|
28
|
-
rpConf
|
29
|
+
rpConf,
|
30
|
+
subject: sub
|
29
31
|
};
|
30
32
|
};
|
31
33
|
exports.evaluateRelyingPartyTrust = evaluateRelyingPartyTrust;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_trust","require","evaluateRelyingPartyTrust","rpUrl","appFetch","fetch","arguments","length","undefined","payload","metadata","rpConf","getRelyingPartyEntityConfiguration","exports"],"sourceRoot":"../../../../src","sources":["credential/presentation/02-evaluate-rp-trust.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;
|
1
|
+
{"version":3,"names":["_trust","require","evaluateRelyingPartyTrust","rpUrl","appFetch","fetch","arguments","length","undefined","payload","metadata","rpConf","sub","getRelyingPartyEntityConfiguration","subject","exports"],"sourceRoot":"../../../../src","sources":["credential/presentation/02-evaluate-rp-trust.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,yBAAoD,GAAG,eAAAA,CAClEC,KAAK,EAEF;EAAA,IADH;IAAEC,QAAQ,GAAGC;EAAM,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAEzB,MAAM;IACJG,OAAO,EAAE;MAAEC,QAAQ,EAAEC,MAAM;MAAEC;IAAI;EACnC,CAAC,GAAG,MAAM,IAAAC,yCAAkC,EAACV,KAAK,EAAE;IAClDC;EACF,CAAC,CAAC;EACF,OAAO;IAAEO,MAAM;IAAEG,OAAO,EAAEF;EAAI,CAAC;AACjC,CAAC;AAACG,OAAA,CAAAb,yBAAA,GAAAA,yBAAA"}
|
@@ -16,11 +16,11 @@ var _types = require("./types");
|
|
16
16
|
* @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
|
17
17
|
* @returns The Request Object that describes the presentation
|
18
18
|
*/
|
19
|
-
const getRequestObject = async (requestUri
|
19
|
+
const getRequestObject = async function (requestUri) {
|
20
20
|
let {
|
21
21
|
appFetch = fetch,
|
22
22
|
walletCapabilities
|
23
|
-
} =
|
23
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
24
24
|
if (walletCapabilities) {
|
25
25
|
// Validate external input
|
26
26
|
const {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_misc","require","_types","getRequestObject","requestUri","
|
1
|
+
{"version":3,"names":["_misc","require","_types","getRequestObject","requestUri","appFetch","fetch","walletCapabilities","arguments","length","undefined","wallet_metadata","wallet_nonce","RequestObjectWalletCapabilities","parse","formUrlEncodedBody","URLSearchParams","JSON","stringify","requestObjectEncodedJwt","method","headers","body","toString","then","hasStatusOrThrow","res","text","exports"],"sourceRoot":"../../../../src","sources":["credential/presentation/03-get-request-object.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,gBAAkC,GAAG,eAAAA,CAChDC,UAAU,EAEP;EAAA,IADH;IAAEC,QAAQ,GAAGC,KAAK;IAAEC;EAAmB,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAE7C,IAAID,kBAAkB,EAAE;IACtB;IACA,MAAM;MAAEI,eAAe;MAAEC;IAAa,CAAC,GACrCC,sCAA+B,CAACC,KAAK,CAACP,kBAAkB,CAAC;IAE3D,MAAMQ,kBAAkB,GAAG,IAAIC,eAAe,CAAC;MAC7CL,eAAe,EAAEM,IAAI,CAACC,SAAS,CAACP,eAAe,CAAC;MAChD,IAAIC,YAAY,IAAI;QAAEA;MAAa,CAAC;IACtC,CAAC,CAAC;IAEF,MAAMO,uBAAuB,GAAG,MAAMd,QAAQ,CAACD,UAAU,EAAE;MACzDgB,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QACP,cAAc,EAAE;MAClB,CAAC;MACDC,IAAI,EAAEP,kBAAkB,CAACQ,QAAQ,CAAC;IACpC,CAAC,CAAC,CACCC,IAAI,CAAC,IAAAC,sBAAgB,EAAC,GAAG,CAAC,CAAC,CAC3BD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC;IAE5B,OAAO;MACLR;IACF,CAAC;EACH;EAEA,MAAMA,uBAAuB,GAAG,MAAMd,QAAQ,CAACD,UAAU,EAAE;IACzDgB,MAAM,EAAE;EACV,CAAC,CAAC,CACCI,IAAI,CAAC,IAAAC,sBAAgB,EAAC,GAAG,CAAC,CAAC,CAC3BD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC;EAE5B,OAAO;IACLR;EACF,CAAC;AACH,CAAC;AAACS,OAAA,CAAAzB,gBAAA,GAAAA,gBAAA"}
|
@@ -12,19 +12,21 @@ var _retrieveRpJwks = require("./04-retrieve-rp-jwks");
|
|
12
12
|
* Function to verify the Request Object's signature and the client ID.
|
13
13
|
* @param requestObjectEncodedJwt The Request Object in JWT format
|
14
14
|
* @param context.clientId The client ID to verify
|
15
|
-
* @param context.jwkKeys The set of keys to verify the signature
|
16
15
|
* @param context.rpConf The Entity Configuration of the Relying Party
|
16
|
+
* @param context.state Optional state
|
17
17
|
* @returns The verified Request Object
|
18
18
|
*/
|
19
19
|
const verifyRequestObject = async (requestObjectEncodedJwt, _ref) => {
|
20
20
|
let {
|
21
21
|
clientId,
|
22
|
-
rpConf
|
22
|
+
rpConf,
|
23
|
+
rpSubject,
|
24
|
+
state
|
23
25
|
} = _ref;
|
24
26
|
const requestObjectJwt = (0, _ioReactNativeJwt.decode)(requestObjectEncodedJwt);
|
25
27
|
const {
|
26
28
|
keys
|
27
|
-
} = (0, _retrieveRpJwks.getJwksFromConfig)(rpConf
|
29
|
+
} = (0, _retrieveRpJwks.getJwksFromConfig)(rpConf);
|
28
30
|
|
29
31
|
// Verify token signature to ensure the request object is authentic
|
30
32
|
const pubKey = keys === null || keys === void 0 ? void 0 : keys.find(_ref2 => {
|
@@ -42,9 +44,14 @@ const verifyRequestObject = async (requestObjectEncodedJwt, _ref) => {
|
|
42
44
|
issuer: clientId
|
43
45
|
});
|
44
46
|
const requestObject = _types.RequestObject.parse(requestObjectJwt.payload);
|
45
|
-
|
47
|
+
const isClientIdMatch = clientId === requestObject.client_id && clientId === rpSubject;
|
48
|
+
if (!isClientIdMatch) {
|
46
49
|
throw new _errors.UnverifiedEntityError("Client ID does not match Request Object or Entity Configuration");
|
47
50
|
}
|
51
|
+
const isStateMatch = state && requestObject.state ? state === requestObject.state : true;
|
52
|
+
if (!isStateMatch) {
|
53
|
+
throw new _errors.UnverifiedEntityError("State does not match Request Object");
|
54
|
+
}
|
48
55
|
return {
|
49
56
|
requestObject
|
50
57
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_ioReactNativeJwt","require","_errors","_types","_retrieveRpJwks","verifyRequestObject","requestObjectEncodedJwt","_ref","clientId","rpConf","requestObjectJwt","decodeJwt","keys","getJwksFromConfig","
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_errors","_types","_retrieveRpJwks","verifyRequestObject","requestObjectEncodedJwt","_ref","clientId","rpConf","rpSubject","state","requestObjectJwt","decodeJwt","keys","getJwksFromConfig","pubKey","find","_ref2","kid","protectedHeader","UnverifiedEntityError","verify","issuer","requestObject","RequestObject","parse","payload","isClientIdMatch","client_id","isStateMatch","exports"],"sourceRoot":"../../../../src","sources":["credential/presentation/05-verify-request-object.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,mBAAwC,GAAG,MAAAA,CACtDC,uBAAuB,EAAAC,IAAA,KAEpB;EAAA,IADH;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,SAAS;IAAEC;EAAM,CAAC,GAAAJ,IAAA;EAEtC,MAAMK,gBAAgB,GAAG,IAAAC,wBAAS,EAACP,uBAAuB,CAAC;EAC3D,MAAM;IAAEQ;EAAK,CAAC,GAAG,IAAAC,iCAAiB,EAACN,MAAM,CAAC;;EAE1C;EACA,MAAMO,MAAM,GAAGF,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEG,IAAI,CACvBC,KAAA;IAAA,IAAC;MAAEC;IAAI,CAAC,GAAAD,KAAA;IAAA,OAAKC,GAAG,KAAKP,gBAAgB,CAACQ,eAAe,CAACD,GAAG;EAAA,CAC3D,CAAC;EAED,IAAI,CAACH,MAAM,EAAE;IACX,MAAM,IAAIK,6BAAqB,CAAC,wCAAwC,CAAC;EAC3E;;EAEA;EACA,MAAM,IAAAC,wBAAM,EAAChB,uBAAuB,EAAEU,MAAM,EAAE;IAAEO,MAAM,EAAEf;EAAS,CAAC,CAAC;EAEnE,MAAMgB,aAAa,GAAGC,oBAAa,CAACC,KAAK,CAACd,gBAAgB,CAACe,OAAO,CAAC;EAEnE,MAAMC,eAAe,GACnBpB,QAAQ,KAAKgB,aAAa,CAACK,SAAS,IAAIrB,QAAQ,KAAKE,SAAS;EAEhE,IAAI,CAACkB,eAAe,EAAE;IACpB,MAAM,IAAIP,6BAAqB,CAC7B,iEACF,CAAC;EACH;EAEA,MAAMS,YAAY,GAChBnB,KAAK,IAAIa,aAAa,CAACb,KAAK,GAAGA,KAAK,KAAKa,aAAa,CAACb,KAAK,GAAG,IAAI;EAErE,IAAI,CAACmB,YAAY,EAAE;IACjB,MAAM,IAAIT,6BAAqB,CAAC,qCAAqC,CAAC;EACxE;EAEA,OAAO;IAAEG;EAAc,CAAC;AAC1B,CAAC;AAACO,OAAA,CAAA1B,mBAAA,GAAAA,mBAAA"}
|
@@ -9,6 +9,10 @@ var _valibot = require("valibot");
|
|
9
9
|
var _sdJwt = require("../../sd-jwt");
|
10
10
|
var _errors = require("../../utils/errors");
|
11
11
|
var _crypto = require("../../utils/crypto");
|
12
|
+
/**
|
13
|
+
* The purpose for the credential request by the RP.
|
14
|
+
*/
|
15
|
+
|
12
16
|
/**
|
13
17
|
* Convert a credential in JWT format to an object with claims
|
14
18
|
* for correct parsing by the `dcql` library.
|
@@ -54,7 +58,6 @@ const evaluateDcqlQuery = (credentialsSdJwt, query) => {
|
|
54
58
|
if (!queryResult.canBeSatisfied) {
|
55
59
|
throw new Error("No credential can satisfy the provided DCQL query");
|
56
60
|
}
|
57
|
-
|
58
61
|
// Build an object vct:credentialJwt to map matched credentials to their JWT
|
59
62
|
const credentialsSdJwtByVct = credentials.reduce((acc, c, i) => ({
|
60
63
|
...acc,
|
@@ -71,23 +74,29 @@ const evaluateDcqlQuery = (credentialsSdJwt, query) => {
|
|
71
74
|
vct,
|
72
75
|
claims
|
73
76
|
} = match.output;
|
74
|
-
|
75
|
-
// Find a matching credential set to see whether the credential is optional
|
76
|
-
// If no credential set is found, then the credential is required by default
|
77
|
-
// NOTE: This is an extra, it might not be necessary
|
78
|
-
const credentialSet = (_queryResult$credenti = queryResult.credential_sets) === null || _queryResult$credenti === void 0 ? void 0 : _queryResult$credenti.find(set => {
|
77
|
+
const purposes = (_queryResult$credenti = queryResult.credential_sets) === null || _queryResult$credenti === void 0 || (_queryResult$credenti = _queryResult$credenti.filter(set => {
|
79
78
|
var _set$matching_options;
|
80
|
-
return (_set$matching_options = set.matching_options) === null || _set$matching_options === void 0 ? void 0 : _set$matching_options.flat().includes(
|
79
|
+
return (_set$matching_options = set.matching_options) === null || _set$matching_options === void 0 ? void 0 : _set$matching_options.flat().includes(id);
|
80
|
+
})) === null || _queryResult$credenti === void 0 ? void 0 : _queryResult$credenti.map(credentialSet => {
|
81
|
+
var _credentialSet$purpos;
|
82
|
+
return {
|
83
|
+
description: (_credentialSet$purpos = credentialSet.purpose) === null || _credentialSet$purpos === void 0 ? void 0 : _credentialSet$purpos.toString(),
|
84
|
+
required: Boolean(credentialSet.required)
|
85
|
+
};
|
81
86
|
});
|
82
|
-
const isOptional = credentialSet ? !credentialSet.required : false;
|
83
87
|
const [keyTag, credential] = credentialsSdJwtByVct[vct];
|
84
88
|
const requiredDisclosures = Object.values(claims);
|
85
89
|
return {
|
86
90
|
id,
|
91
|
+
vct,
|
87
92
|
keyTag,
|
88
93
|
credential,
|
89
|
-
|
90
|
-
|
94
|
+
requiredDisclosures,
|
95
|
+
// When it is a match but no credential_sets are found, the credential is required by default
|
96
|
+
// See https://openid.net/specs/openid-4-verifiable-presentations-1_0-24.html#section-6.3.1.2-2.1
|
97
|
+
purposes: purposes ?? [{
|
98
|
+
required: true
|
99
|
+
}]
|
91
100
|
};
|
92
101
|
});
|
93
102
|
} catch (error) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_dcql","require","_valibot","_sdJwt","_errors","_crypto","mapCredentialToObject","jwt","sdJwt","disclosures","decode","credentialFormat","header","typ","Error","vct","payload","credential_format","claims","reduce","acc","disclosure","decoded","getDcqlQueryMatches","result","Object","entries","credential_matches","filter","_ref","match","success","evaluateDcqlQuery","credentialsSdJwt","query","credentials","map","_ref2","credential","parsedQuery","DcqlQuery","parse","validate","queryResult","canBeSatisfied","credentialsSdJwtByVct","c","i","_ref3","_queryResult$credenti","id","output","
|
1
|
+
{"version":3,"names":["_dcql","require","_valibot","_sdJwt","_errors","_crypto","mapCredentialToObject","jwt","sdJwt","disclosures","decode","credentialFormat","header","typ","Error","vct","payload","credential_format","claims","reduce","acc","disclosure","decoded","getDcqlQueryMatches","result","Object","entries","credential_matches","filter","_ref","match","success","evaluateDcqlQuery","credentialsSdJwt","query","credentials","map","_ref2","credential","parsedQuery","DcqlQuery","parse","validate","queryResult","canBeSatisfied","credentialsSdJwtByVct","c","i","_ref3","_queryResult$credenti","id","output","purposes","credential_sets","set","_set$matching_options","matching_options","flat","includes","credentialSet","_credentialSet$purpos","description","purpose","toString","required","Boolean","keyTag","requiredDisclosures","values","error","isValiError","ValidationFailed","message","reason","issues","issue","join","DcqlError","DcqlCredentialSetError","exports","prepareRemotePresentations","nonce","clientId","Promise","all","item","vp_token","prepareVpToken","requestedClaims","createCryptoContextFor","credentialId","vpToken","format"],"sourceRoot":"../../../../src","sources":["credential/presentation/07-evaluate-dcql-query.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAGA;AACA;AACA;;AAkCA;AACA;AACA;AACA;AACA,MAAMK,qBAAqB,GAAIC,GAAW,IAAK;EAC7C,MAAM;IAAEC,KAAK;IAAEC;EAAY,CAAC,GAAG,IAAAC,aAAM,EAACH,GAAG,CAAC;EAC1C,MAAMI,gBAAgB,GAAGH,KAAK,CAACI,MAAM,CAACC,GAAG;;EAEzC;EACA,IAAIF,gBAAgB,KAAK,WAAW,EAAE;IACpC,MAAM,IAAIG,KAAK,CAAE,kCAAiCH,gBAAiB,EAAC,CAAC;EACvE;EAEA,OAAO;IACLI,G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
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.prepareLegacyRemotePresentations = exports.findCredentialSdJwt = exports.evaluateInputDescriptors = exports.evaluateInputDescriptorForSdJwt4VC = void 0;
|
7
7
|
var _sdJwt = require("../../sd-jwt");
|
8
8
|
var _crypto = require("../../utils/crypto");
|
9
9
|
var _jsonpathPlus = require("jsonpath-plus");
|
@@ -14,6 +14,11 @@ const ajv = new _ajv.default({
|
|
14
14
|
allErrors: true
|
15
15
|
});
|
16
16
|
const INDEX_CLAIM_NAME = 1;
|
17
|
+
|
18
|
+
/**
|
19
|
+
* @deprecated Use `prepareRemotePresentations` from DCQL
|
20
|
+
*/
|
21
|
+
|
17
22
|
/**
|
18
23
|
* Transforms an array of DisclosureWithEncoded objects into a key-value map.
|
19
24
|
* @param disclosures - An array of DisclosureWithEncoded, each containing a decoded property with [?, claimName, claimValue].
|
@@ -259,6 +264,8 @@ const evaluateInputDescriptors = async (inputDescriptors, credentialsSdJwt) => {
|
|
259
264
|
* - Validates the credential format.
|
260
265
|
* - Generates a verifiable presentation token (vpToken) using the provided nonce and client identifier.
|
261
266
|
*
|
267
|
+
* @deprecated Use `prepareRemotePresentations` from DCQL
|
268
|
+
*
|
262
269
|
* @param credentialAndDescriptors - An array containing objects with requested claims,
|
263
270
|
* input descriptor, credential, and keyTag.
|
264
271
|
* @param nonce - A unique nonce for the verifiable presentation token.
|
@@ -267,7 +274,7 @@ const evaluateInputDescriptors = async (inputDescriptors, credentialsSdJwt) => {
|
|
267
274
|
* @throws {CredentialNotFoundError} When the credential format is unsupported.
|
268
275
|
*/
|
269
276
|
exports.evaluateInputDescriptors = evaluateInputDescriptors;
|
270
|
-
const
|
277
|
+
const prepareLegacyRemotePresentations = async (credentialAndDescriptors, nonce, client_id) => {
|
271
278
|
return Promise.all(credentialAndDescriptors.map(async item => {
|
272
279
|
var _descriptor$format2;
|
273
280
|
const descriptor = item.inputDescriptor;
|
@@ -285,5 +292,5 @@ const prepareRemotePresentations = async (credentialAndDescriptors, nonce, clien
|
|
285
292
|
throw new _errors.CredentialNotFoundError(`${descriptor.format} format is not supported.`);
|
286
293
|
}));
|
287
294
|
};
|
288
|
-
exports.
|
295
|
+
exports.prepareLegacyRemotePresentations = prepareLegacyRemotePresentations;
|
289
296
|
//# sourceMappingURL=07-evaluate-input-descriptor.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_sdJwt","require","_crypto","_jsonpathPlus","_errors","_ajv","_interopRequireDefault","obj","__esModule","default","ajv","Ajv","allErrors","INDEX_CLAIM_NAME","mapDisclosuresToObject","disclosures","reduce","_ref","decoded","claimName","claimValue","findMatchedClaim","paths","payload","matchedPath","matchedValue","some","singlePath","result","JSONPath","path","json","length","error","MissingDataError","extractClaimName","regex","match","Error","evaluateInputDescriptorForSdJwt4VC","inputDescriptor","payloadCredential","_inputDescriptor$cons","constraints","fields","requiredDisclosures","optionalDisclosures","unrequestedDisclosures","requiredClaimNames","optionalClaimNames","disclosuresAsPayload","allFieldsValid","every","field","optional","push","filter","validateSchema","compile","disclosure","includes","isNotLimitDisclosure","limit_disclosure","exports","findCredentialSdJwt","decodedSdJwtCredentials","keyTag","credential","sdJwt","evaluatedDisclosure","matchedEvaluation","matchedKeyTag","matchedCredential","CredentialNotFoundError","evaluateInputDescriptors","inputDescriptors","credentialsSdJwt","map","_ref2","decode","Promise","all","descriptor","_descriptor$format","format","
|
1
|
+
{"version":3,"names":["_sdJwt","require","_crypto","_jsonpathPlus","_errors","_ajv","_interopRequireDefault","obj","__esModule","default","ajv","Ajv","allErrors","INDEX_CLAIM_NAME","mapDisclosuresToObject","disclosures","reduce","_ref","decoded","claimName","claimValue","findMatchedClaim","paths","payload","matchedPath","matchedValue","some","singlePath","result","JSONPath","path","json","length","error","MissingDataError","extractClaimName","regex","match","Error","evaluateInputDescriptorForSdJwt4VC","inputDescriptor","payloadCredential","_inputDescriptor$cons","constraints","fields","requiredDisclosures","optionalDisclosures","unrequestedDisclosures","requiredClaimNames","optionalClaimNames","disclosuresAsPayload","allFieldsValid","every","field","optional","push","filter","validateSchema","compile","disclosure","includes","isNotLimitDisclosure","limit_disclosure","exports","findCredentialSdJwt","decodedSdJwtCredentials","keyTag","credential","sdJwt","evaluatedDisclosure","matchedEvaluation","matchedKeyTag","matchedCredential","CredentialNotFoundError","evaluateInputDescriptors","inputDescriptors","credentialsSdJwt","map","_ref2","decode","Promise","all","descriptor","_descriptor$format","format","prepareLegacyRemotePresentations","credentialAndDescriptors","nonce","client_id","item","_descriptor$format2","vp_token","prepareVpToken","requestedClaims","createCryptoContextFor","vpToken"],"sourceRoot":"../../../../src","sources":["credential/presentation/07-evaluate-input-descriptor.ts"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAsB,SAAAK,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEtB,MAAMG,GAAG,GAAG,IAAIC,YAAG,CAAC;EAAEC,SAAS,EAAE;AAAK,CAAC,CAAC;AACxC,MAAMC,gBAAgB,GAAG,CAAC;;AA0B1B;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAC1BC,WAAoC,IACR;EAC5B,OAAOA,WAAW,CAACC,MAAM,CACvB,CAACT,GAAG,EAAAU,IAAA,KAAkB;IAAA,IAAhB;MAAEC;IAAQ,CAAC,GAAAD,IAAA;IACf,MAAM,GAAGE,SAAS,EAAEC,UAAU,CAAC,GAAGF,OAAO;IACzCX,GAAG,CAACY,SAAS,CAAC,GAAGC,UAAU;IAC3B,OAAOb,GAAG;EACZ,CAAC,EACD,CAAC,CACH,C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CAAAsB,gCAAA,GAAAA,gCAAA"}
|
@@ -57,20 +57,20 @@ const buildDirectPostJwtBody = async (requestObject, rpConf, payload) => {
|
|
57
57
|
state: requestObject.state,
|
58
58
|
...payload
|
59
59
|
});
|
60
|
-
|
61
60
|
// Choose a suitable public key for encryption
|
62
61
|
const {
|
63
62
|
keys
|
64
|
-
} = (0, _retrieveRpJwks.getJwksFromConfig)(rpConf
|
63
|
+
} = (0, _retrieveRpJwks.getJwksFromConfig)(rpConf);
|
65
64
|
const encPublicJwk = choosePublicKeyToEncrypt(keys);
|
66
65
|
|
67
66
|
// Encrypt the authorization payload
|
68
67
|
const {
|
69
68
|
authorization_encrypted_response_alg,
|
70
69
|
authorization_encrypted_response_enc
|
71
|
-
} = rpConf.
|
70
|
+
} = rpConf.openid_credential_verifier;
|
71
|
+
const defaultAlg = encPublicJwk.kty === "EC" ? "ECDH-ES" : "RSA-OAEP-256";
|
72
72
|
const encryptedResponse = await new _ioReactNativeJwt.EncryptJwe(authzResponsePayload, {
|
73
|
-
alg: authorization_encrypted_response_alg ||
|
73
|
+
alg: authorization_encrypted_response_alg || defaultAlg,
|
74
74
|
enc: authorization_encrypted_response_enc || "A256CBC-HS512",
|
75
75
|
kid: encPublicJwk.kid
|
76
76
|
}).encrypt(encPublicJwk);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_ioReactNativeJwt","require","_reactNativeUuid","_interopRequireDefault","_retrieveRpJwks","_errors","_misc","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","AuthorizationResponse","object","status","string","optional","response_code","redirect_uri","exports","choosePublicKeyToEncrypt","rpJwkKeys","encKey","find","jwk","use","NoSuitableKeysFoundInEntityConfiguration","buildDirectPostJwtBody","requestObject","rpConf","payload","authzResponsePayload","JSON","stringify","state","keys","getJwksFromConfig","
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_reactNativeUuid","_interopRequireDefault","_retrieveRpJwks","_errors","_misc","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","AuthorizationResponse","object","status","string","optional","response_code","redirect_uri","exports","choosePublicKeyToEncrypt","rpJwkKeys","encKey","find","jwk","use","NoSuitableKeysFoundInEntityConfiguration","buildDirectPostJwtBody","requestObject","rpConf","payload","authzResponsePayload","JSON","stringify","state","keys","getJwksFromConfig","encPublicJwk","authorization_encrypted_response_alg","authorization_encrypted_response_enc","openid_credential_verifier","defaultAlg","kty","encryptedResponse","EncryptJwe","alg","enc","kid","encrypt","formBody","URLSearchParams","response","toString","sendLegacyAuthorizationResponse","presentationDefinitionId","remotePresentations","_remotePresentations$","appFetch","fetch","arguments","length","undefined","vp_token","vpToken","map","remotePresentation","descriptor_map","index","id","inputDescriptor","path","format","presentation_submission","uuid","v4","definition_id","requestBody","response_uri","method","headers","body","then","hasStatusOrThrow","res","json","parse","sendAuthorizationResponse","reduce","acc","presentation","credentialId"],"sourceRoot":"../../../../src","sources":["credential/presentation/08-send-authorization-response.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAOA,IAAAM,CAAA,GAAAC,uBAAA,CAAAP,OAAA;AAAyB,SAAAQ,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAA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AAC,CAAC,EACF,CAAC,CACH;EACF,CAAC,CAAC;;EAEF;EACA,OAAO,MAAMN,QAAQ,CAAC7B,aAAa,CAACiD,YAAY,EAAE;IAChDC,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MACP,cAAc,EAAE;IAClB,CAAC;IACDC,IAAI,EAAEJ;EACR,CAAC,CAAC,CACCK,IAAI,CAAC,IAAAC,sBAAgB,EAAC,GAAG,CAAC,CAAC,CAC3BD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAACrE,qBAAqB,CAACyE,KAAK,CAAC;AACtC,CAAC;AAAClE,OAAA,CAAAmE,yBAAA,GAAAA,yBAAA"}
|
@@ -1,3 +1,89 @@
|
|
1
|
-
# Credential
|
1
|
+
# Credential Presentation
|
2
2
|
|
3
|
-
|
3
|
+
This flow is used for remote presentation, allowing a user with a valid Wallet Instance to remotely present credentials to a Relying Party (Verifier). The presentation flow adheres to the [IT Wallet 0.9.x specification](https://italia.github.io/eid-wallet-it-docs/v0.9.3/en/relying-party-solution.html).
|
4
|
+
|
5
|
+
The Relying Party provides the Wallet with a Request Object that contains the requested credentials and claims. The Wallet validates the Request Object and asks the user for consent. Then the Wallet creates an encrypted Authorization Response that contains the Verifiable Presentation with the requested data (`vp_token`) and sends it to the Relying Party.
|
6
|
+
|
7
|
+
## Sequence Diagram
|
8
|
+
|
9
|
+
```mermaid
|
10
|
+
sequenceDiagram
|
11
|
+
autonumber
|
12
|
+
participant I as User (Wallet Instance)
|
13
|
+
participant O as Relying Party (Verifier)
|
14
|
+
|
15
|
+
O->>+I: QR-CODE: Authorization Request (`request_uri`)
|
16
|
+
I->>+O: GET: Verifier's Entity Configuration
|
17
|
+
O->>+I: Respond with metadata (including public keys)
|
18
|
+
I->>+O: GET: Request Object, resolved from the `request_uri`
|
19
|
+
O->>+I: Respond with the Request Object
|
20
|
+
I->>+O: POST: VP token encrypted response
|
21
|
+
O->>+I: Redirect: Authorization Response
|
22
|
+
```
|
23
|
+
|
24
|
+
|
25
|
+
## Examples
|
26
|
+
|
27
|
+
<details>
|
28
|
+
<summary>Remote Presentation flow</summary>
|
29
|
+
|
30
|
+
**Note:** To successfully complete a remote presentation, the Wallet Instance must be in a valid state with a valid Wallet Instance Attestation.
|
31
|
+
|
32
|
+
```ts
|
33
|
+
// Retrieve and scan the qr-code, decode it and get its parameters
|
34
|
+
const qrCodeParams = decodeQrCode(qrCode)
|
35
|
+
|
36
|
+
// Start the issuance flow
|
37
|
+
const {
|
38
|
+
requestUri,
|
39
|
+
clientId,
|
40
|
+
requestUriMethod,
|
41
|
+
state
|
42
|
+
} = Credential.Presentation.startFlowFromQR(qrCodeParams);
|
43
|
+
|
44
|
+
// Get the Relying Party's Entity Configuration and evaluate trust
|
45
|
+
const { rpConf } = await Credential.Presentation.evaluateRelyingPartyTrust(clientId);
|
46
|
+
|
47
|
+
// Get the Request Object from the RP
|
48
|
+
const { requestObjectEncodedJwt } =
|
49
|
+
await Credential.Presentation.getRequestObject(requestUri);
|
50
|
+
|
51
|
+
// Validate the Request Object
|
52
|
+
const { requestObject } = await Credential.Presentation.verifyRequestObject(
|
53
|
+
requestObjectEncodedJwt,
|
54
|
+
{ clientId, rpConf }
|
55
|
+
);
|
56
|
+
|
57
|
+
// All the credentials that might be requested by the Relying Party
|
58
|
+
const credentialsSdJwt = [
|
59
|
+
["credential1_keytag", "eyJraWQiOiItRl82VWdhOG4zVmVnalkyVTdZVUhLMXpMb2FELU5QVGM2M1JNSVNuTGF3IiwidHlwIjoidmMrc2Qtand0IiwiYWxnIjoiRVMyNTYifQ.eyJfc2"],
|
60
|
+
["credential2_keytag", "eyJ0eXAiOiJ2YytzZC1qd3QiLCJhbGciOiJFUzI1NiIsImtpZCI6Ii1GXzZVZ2E4bjNWZWdqWTJVN1lVSEsxekxvYUQtTlBUYzYzUk1JU25MYXcifQ.ew0KIC"]
|
61
|
+
];
|
62
|
+
|
63
|
+
const result = Credential.Presentation.evaluateDcqlQuery(
|
64
|
+
credentialsSdJwt,
|
65
|
+
requestObject.dcql_query as DcqlQuery
|
66
|
+
);
|
67
|
+
|
68
|
+
const credentialsToPresent = result.map(
|
69
|
+
({ requiredDisclosures, ...rest }) => ({
|
70
|
+
...rest,
|
71
|
+
requestedClaims: requiredDisclosures.map(([, claimName]) => claimName),
|
72
|
+
})
|
73
|
+
);
|
74
|
+
|
75
|
+
const remotePresentations =
|
76
|
+
await Credential.Presentation.prepareRemotePresentations(
|
77
|
+
credentialsToPresent,
|
78
|
+
requestObject.nonce,
|
79
|
+
requestObject.client_id
|
80
|
+
);
|
81
|
+
|
82
|
+
const authResponse = await Credential.Presentation.sendAuthorizationResponse(
|
83
|
+
requestObject,
|
84
|
+
remotePresentations,
|
85
|
+
rpConf
|
86
|
+
);
|
87
|
+
```
|
88
|
+
|
89
|
+
</details>
|
@@ -54,12 +54,11 @@ exports.NoSuitableKeysFoundInEntityConfiguration = NoSuitableKeysFoundInEntityCo
|
|
54
54
|
class InvalidQRCodeError extends _errors.IoWalletError {
|
55
55
|
code = "ERR_INVALID_QR_CODE";
|
56
56
|
|
57
|
-
/**
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
super(message);
|
57
|
+
/** Detailed reason for the QR code validation failure. */
|
58
|
+
|
59
|
+
constructor(reason) {
|
60
|
+
super("Invalid QR code");
|
61
|
+
this.reason = reason;
|
63
62
|
}
|
64
63
|
}
|
65
64
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_errors","require","AuthRequestDecodeError","IoWalletError","code","constructor","message","claim","arguments","length","undefined","reason","serializeAttrs","exports","NoSuitableKeysFoundInEntityConfiguration","scenario","InvalidQRCodeError","
|
1
|
+
{"version":3,"names":["_errors","require","AuthRequestDecodeError","IoWalletError","code","constructor","message","claim","arguments","length","undefined","reason","serializeAttrs","exports","NoSuitableKeysFoundInEntityConfiguration","scenario","InvalidQRCodeError","UnverifiedEntityError","MissingDataError","missingAttributes","CredentialNotFoundError","credentialId"],"sourceRoot":"../../../../src","sources":["credential/presentation/errors.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACO,MAAMC,sBAAsB,SAASC,qBAAa,CAAC;EACxDC,IAAI,GAAG,oDAAoD;;EAE3D;;EAGA;;EAGAC,WAAWA,CACTC,OAAe,EAGf;IAAA,IAFAC,KAAa,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IAAA,IAC7BG,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IAE9B,KAAK,CAAC,IAAAI,sBAAc,EAAC;MAAEN,OAAO;MAAEC,KAAK;MAAEI;IAAO,CAAC,CAAC,CAAC;IACjD,IAAI,CAACJ,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACI,MAAM,GAAGA,MAAM;EACtB;AACF;;AAEA;AACA;AACA;AACA;AAHAE,OAAA,CAAAX,sBAAA,GAAAA,sBAAA;AAIO,MAAMY,wCAAwC,SAASX,qBAAa,CAAC;EAC1EC,IAAI,GAAG,gCAAgC;;EAEvC;AACF;AACA;EACEC,WAAWA,CAACU,QAAgB,EAAE;IAC5B,MAAMT,OAAO,GAAI,0DAAyDS,QAAS,IAAG;IACtF,KAAK,CAACT,OAAO,CAAC;EAChB;AACF;;AAEA;AACA;AACA;AACA;AAHAO,OAAA,CAAAC,wCAAA,GAAAA,wCAAA;AAIO,MAAME,kBAAkB,SAASb,qBAAa,CAAC;EACpDC,IAAI,GAAG,qBAAqB;;EAE5B;;EAGAC,WAAWA,CAACM,MAAc,EAAE;IAC1B,KAAK,CAAC,iBAAiB,CAAC;IACxB,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF;;AAEA;AACA;AACA;AACA;AAHAE,OAAA,CAAAG,kBAAA,GAAAA,kBAAA;AAIO,MAAMC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