@pagopa/io-react-native-wallet 0.15.4 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. package/lib/commonjs/credential/index.js +3 -1
  2. package/lib/commonjs/credential/index.js.map +1 -1
  3. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +19 -4
  4. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
  5. package/lib/commonjs/credential/issuance/05-authorize-access.js +5 -12
  6. package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
  7. package/lib/commonjs/credential/issuance/06-obtain-credential.js +5 -6
  8. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  9. package/lib/commonjs/credential/issuance/const.js +1 -3
  10. package/lib/commonjs/credential/issuance/const.js.map +1 -1
  11. package/lib/commonjs/credential/status/01-start-flow.js +2 -0
  12. package/lib/commonjs/credential/status/01-start-flow.js.map +1 -0
  13. package/lib/commonjs/credential/status/02-status-attestation.js +72 -0
  14. package/lib/commonjs/credential/status/02-status-attestation.js.map +1 -0
  15. package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js +52 -0
  16. package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js.map +1 -0
  17. package/lib/commonjs/credential/status/errors.js +38 -0
  18. package/lib/commonjs/credential/status/errors.js.map +1 -0
  19. package/lib/commonjs/credential/status/index.js +27 -0
  20. package/lib/commonjs/credential/status/index.js.map +1 -0
  21. package/lib/commonjs/credential/status/types.js +48 -0
  22. package/lib/commonjs/credential/status/types.js.map +1 -0
  23. package/lib/commonjs/utils/errors.js +44 -2
  24. package/lib/commonjs/utils/errors.js.map +1 -1
  25. package/lib/commonjs/utils/misc.js +41 -3
  26. package/lib/commonjs/utils/misc.js.map +1 -1
  27. package/lib/commonjs/utils/par.js +1 -1
  28. package/lib/commonjs/utils/par.js.map +1 -1
  29. package/lib/module/credential/index.js +2 -1
  30. package/lib/module/credential/index.js.map +1 -1
  31. package/lib/module/credential/issuance/04-complete-user-authorization.js +21 -6
  32. package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
  33. package/lib/module/credential/issuance/05-authorize-access.js +6 -13
  34. package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
  35. package/lib/module/credential/issuance/06-obtain-credential.js +5 -6
  36. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  37. package/lib/module/credential/issuance/const.js +0 -1
  38. package/lib/module/credential/issuance/const.js.map +1 -1
  39. package/lib/module/credential/status/01-start-flow.js +2 -0
  40. package/lib/module/credential/status/01-start-flow.js.map +1 -0
  41. package/lib/module/credential/status/02-status-attestation.js +64 -0
  42. package/lib/module/credential/status/02-status-attestation.js.map +1 -0
  43. package/lib/module/credential/status/03-verify-and-parse-status-attestation.js +46 -0
  44. package/lib/module/credential/status/03-verify-and-parse-status-attestation.js.map +1 -0
  45. package/lib/module/credential/status/errors.js +30 -0
  46. package/lib/module/credential/status/errors.js.map +1 -0
  47. package/lib/module/credential/status/index.js +5 -0
  48. package/lib/module/credential/status/index.js.map +1 -0
  49. package/lib/module/credential/status/types.js +40 -0
  50. package/lib/module/credential/status/types.js.map +1 -0
  51. package/lib/module/utils/errors.js +40 -1
  52. package/lib/module/utils/errors.js.map +1 -1
  53. package/lib/module/utils/misc.js +38 -3
  54. package/lib/module/utils/misc.js.map +1 -1
  55. package/lib/module/utils/par.js +1 -1
  56. package/lib/module/utils/par.js.map +1 -1
  57. package/lib/typescript/credential/index.d.ts +2 -1
  58. package/lib/typescript/credential/index.d.ts.map +1 -1
  59. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +3 -1
  60. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
  61. package/lib/typescript/credential/issuance/05-authorize-access.d.ts +2 -1
  62. package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
  63. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +3 -1
  64. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  65. package/lib/typescript/credential/issuance/const.d.ts +0 -1
  66. package/lib/typescript/credential/issuance/const.d.ts.map +1 -1
  67. package/lib/typescript/credential/status/01-start-flow.d.ts +10 -0
  68. package/lib/typescript/credential/status/01-start-flow.d.ts.map +1 -0
  69. package/lib/typescript/credential/status/02-status-attestation.d.ts +20 -0
  70. package/lib/typescript/credential/status/02-status-attestation.d.ts.map +1 -0
  71. package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts +24 -0
  72. package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts.map +1 -0
  73. package/lib/typescript/credential/status/errors.d.ts +14 -0
  74. package/lib/typescript/credential/status/errors.d.ts.map +1 -0
  75. package/lib/typescript/credential/status/index.d.ts +7 -0
  76. package/lib/typescript/credential/status/index.d.ts.map +1 -0
  77. package/lib/typescript/credential/status/types.d.ts +305 -0
  78. package/lib/typescript/credential/status/types.d.ts.map +1 -0
  79. package/lib/typescript/utils/errors.d.ts +31 -0
  80. package/lib/typescript/utils/errors.d.ts.map +1 -1
  81. package/lib/typescript/utils/misc.d.ts +18 -1
  82. package/lib/typescript/utils/misc.d.ts.map +1 -1
  83. package/lib/typescript/utils/par.d.ts +1 -4
  84. package/lib/typescript/utils/par.d.ts.map +1 -1
  85. package/package.json +3 -3
  86. package/src/credential/index.ts +2 -1
  87. package/src/credential/issuance/04-complete-user-authorization.ts +36 -6
  88. package/src/credential/issuance/05-authorize-access.ts +7 -14
  89. package/src/credential/issuance/06-obtain-credential.ts +8 -8
  90. package/src/credential/issuance/const.ts +0 -2
  91. package/src/credential/status/01-start-flow.ts +9 -0
  92. package/src/credential/status/02-status-attestation.ts +101 -0
  93. package/src/credential/status/03-verify-and-parse-status-attestation.ts +60 -0
  94. package/src/credential/status/errors.ts +31 -0
  95. package/src/credential/status/index.ts +22 -0
  96. package/src/credential/status/types.ts +43 -0
  97. package/src/utils/errors.ts +46 -1
  98. package/src/utils/misc.ts +45 -4
  99. package/src/utils/par.ts +2 -2
@@ -3,11 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Presentation = exports.Issuance = void 0;
6
+ exports.Status = exports.Presentation = exports.Issuance = void 0;
7
7
  var Issuance = _interopRequireWildcard(require("./issuance"));
8
8
  exports.Issuance = Issuance;
9
9
  var Presentation = _interopRequireWildcard(require("./presentation"));
10
10
  exports.Presentation = Presentation;
11
+ var Status = _interopRequireWildcard(require("./status"));
12
+ exports.Status = Status;
11
13
  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); }
12
14
  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; }
13
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Issuance","_interopRequireWildcard","require","exports","Presentation","_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":["credential/index.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;A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,"names":["Issuance","_interopRequireWildcard","require","exports","Presentation","Status","_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":["credential/index.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAuCC,OAAA,CAAAH,QAAA,GAAAA,QAAA;AACvC,IAAAI,YAAA,GAAAH,uBAAA,CAAAC,OAAA;AAA+CC,OAAA,CAAAC,YAAA,GAAAA,YAAA;AAC/C,IAAAC,MAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAAmCC,OAAA,CAAAE,MAAA,GAAAA,MAAA;AAAA,SAAAC,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,SAAAN,wBAAAU,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,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,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"}
@@ -32,11 +32,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
32
32
  * If not specified, the default browser is used
33
33
  * @param idphint Unique identifier of the SPID IDP selected by the user
34
34
  * @param redirectUri The url to reach to complete the user authorization which is the custom URL scheme that the Wallet Instance is registered to handle, usually a custom URL or deeplink
35
+ * @param signal An optional {@link AbortSignal} to abort the operation when using the default browser
35
36
  * @throws {AuthorizationError} if an error occurs during the authorization process
36
37
  * @throws {AuthorizationIdpError} if an error occurs during the authorization process and the error is related to the IDP
38
+ * @throws {OperationAbortedError} if the caller aborts the operation via the provided signal
37
39
  * @returns the authorization response which contains code, state and iss
38
40
  */
39
- const completeUserAuthorizationWithQueryMode = async (issuerRequestUri, clientId, issuerConf, idpHint, redirectUri, authorizationContext) => {
41
+ const completeUserAuthorizationWithQueryMode = async (issuerRequestUri, clientId, issuerConf, idpHint, redirectUri, authorizationContext, signal) => {
40
42
  const authzRequestEndpoint = issuerConf.oauth_authorization_server.authorization_endpoint;
41
43
  const params = new URLSearchParams({
42
44
  client_id: clientId,
@@ -52,7 +54,7 @@ const completeUserAuthorizationWithQueryMode = async (issuerRequestUri, clientId
52
54
  });
53
55
  } else {
54
56
  // handler for redirectUri
55
- _reactNative.Linking.addEventListener("url", _ref => {
57
+ const urlEventListener = _reactNative.Linking.addEventListener("url", _ref => {
56
58
  let {
57
59
  url
58
60
  } = _ref;
@@ -60,14 +62,27 @@ const completeUserAuthorizationWithQueryMode = async (issuerRequestUri, clientId
60
62
  authRedirectUrl = url;
61
63
  }
62
64
  });
63
- const openAuthUrlInBrowser = _reactNative.Linking.openURL(authUrl);
65
+ const operationIsAborted = signal ? (0, _misc.createAbortPromiseFromSignal)(signal) : undefined;
66
+ await _reactNative.Linking.openURL(authUrl);
64
67
 
65
68
  /*
66
69
  * Waits for 120 seconds for the identificationRedirectUrl variable to be set
67
70
  * by the custom url handler. If the timeout is exceeded, throw an exception
68
71
  */
69
72
  const unitAuthRedirectIsNotUndefined = (0, _misc.until)(() => authRedirectUrl !== undefined, 120);
70
- await Promise.all([openAuthUrlInBrowser, unitAuthRedirectIsNotUndefined]);
73
+
74
+ /**
75
+ * Simultaneously listen for the abort signal (when provided) and the redirect url.
76
+ * The first event that occurs will resolve the promise.
77
+ * This is useful to properly cleanup when the caller aborts this operation.
78
+ */
79
+ const winner = await Promise.race([operationIsAborted === null || operationIsAborted === void 0 ? void 0 : operationIsAborted.listen(), unitAuthRedirectIsNotUndefined].filter(_misc.isDefined)).finally(() => {
80
+ urlEventListener.remove();
81
+ operationIsAborted === null || operationIsAborted === void 0 ? void 0 : operationIsAborted.remove();
82
+ });
83
+ if (winner === "OPERATION_ABORTED") {
84
+ throw new _errors.OperationAbortedError("DefaultQueryModeAuthorization");
85
+ }
71
86
  if (authRedirectUrl === undefined) {
72
87
  throw new _errors.AuthorizationError("Invalid authentication redirect url");
73
88
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_auth","require","_misc","_parseUrl","_interopRequireDefault","_errors","_reactNative","_ioReactNativeJwt","_types","_reactNativeUuid","_types2","_decoder","obj","__esModule","default","completeUserAuthorizationWithQueryMode","issuerRequestUri","clientId","issuerConf","idpHint","redirectUri","authorizationContext","authzRequestEndpoint","oauth_authorization_server","authorization_endpoint","params","URLSearchParams","client_id","request_uri","idphint","authUrl","authRedirectUrl","redirectSchema","URL","protocol","replace","authorize","catch","e","AuthorizationError","message","Linking","addEventListener","_ref","url","includes","openAuthUrlInBrowser","openURL","unitAuthRedirectIsNotUndefined","until","undefined","Promise","all","query","parseUrl","parseAuthroizationResponse","exports","getRequestedCredentialToBePresented","appFetch","arguments","length","fetch","requestObject","toString","method","then","hasStatus","res","text","jws","decode","reqObj","RequestObject","safeParse","payload","success","ValidationFailed","error","data","completeUserAuthorizationWithFormPostJwtMode","ctx","wiaCryptoContext","pidCryptoContext","pid","walletInstanceAttestation","wiaWpToken","SignJWT","setProtectedHeader","alg","typ","setPayload","vp","jti","uuid","v4","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","AuthorizationIdpError","error_description"],"sourceRoot":"../../../../src","sources":["credential/issuance/04-complete-user-authorization.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAMA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AAMA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,gBAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAAyD,SAAAG,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEzD;AACA;AACA;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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,OAAO,EAAE;IACxB,MAAM,IAAIC,wBAAgB,CACxB,gCAAgC,EAChC6C,WAAW,CAAC5C,KAAK,CAACrC,OACpB,CAAC;EACH;EAEA,OAAO,MAAMkB,QAAQ,CAAC+D,WAAW,CAAC3C,IAAI,CAAC6C,YAAY,CAAC,CACjD1D,IAAI,CAAC,IAAAC,eAAS,EAAC,GAAG,CAAC,CAAC,CACpBD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAAC2D,2BAAkB,CAAC,CACxB3D,IAAI,CAAE4D,KAAK,IAAKtE,0BAA0B,CAACsE,KAAK,CAACC,UAAU,CAACpD,OAAO,CAAC,CAAC;AAC1E,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AANAlB,OAAA,CAAAuB,4CAAA,GAAAA,4CAAA;AAOO,MAAMxB,0BAA0B,GACrCwE,OAAgB,IACQ;EACxB,MAAMC,aAAa,GAAGC,8BAAwB,CAACxD,SAAS,CAACsD,OAAO,CAAC;EACjE,IAAI,CAACC,aAAa,CAACrD,OAAO,EAAE;IAC1B,MAAMuD,OAAO,GAAGC,6BAAuB,CAAC1D,SAAS,CAACsD,OAAO,CAAC;IAC1D,IAAI,CAACG,OAAO,CAACvD,OAAO,EAAE;MACpB,MAAM,IAAIpC,0BAAkB,CAACyF,aAAa,CAACnD,KAAK,CAACrC,OAAO,CAAC,CAAC,CAAC;IAC7D;;IACA,MAAM,IAAI4F,6BAAqB,CAC7BF,OAAO,CAACpD,IAAI,CAACD,KAAK,EAClBqD,OAAO,CAACpD,IAAI,CAACuD,iBACf,CAAC;EACH;EACA,OAAOL,aAAa,CAAClD,IAAI;AAC3B,CAAC;AAACtB,OAAA,CAAAD,0BAAA,GAAAA,0BAAA"}
1
+ {"version":3,"names":["_auth","require","_misc","_parseUrl","_interopRequireDefault","_errors","_reactNative","_ioReactNativeJwt","_types","_reactNativeUuid","_types2","_decoder","obj","__esModule","default","completeUserAuthorizationWithQueryMode","issuerRequestUri","clientId","issuerConf","idpHint","redirectUri","authorizationContext","signal","authzRequestEndpoint","oauth_authorization_server","authorization_endpoint","params","URLSearchParams","client_id","request_uri","idphint","authUrl","authRedirectUrl","redirectSchema","URL","protocol","replace","authorize","catch","e","AuthorizationError","message","urlEventListener","Linking","addEventListener","_ref","url","includes","operationIsAborted","createAbortPromiseFromSignal","undefined","openURL","unitAuthRedirectIsNotUndefined","until","winner","Promise","race","listen","filter","isDefined","finally","remove","OperationAbortedError","query","parseUrl","parseAuthroizationResponse","exports","getRequestedCredentialToBePresented","appFetch","arguments","length","fetch","requestObject","toString","method","then","hasStatus","res","text","jws","decode","reqObj","RequestObject","safeParse","payload","success","ValidationFailed","error","data","completeUserAuthorizationWithFormPostJwtMode","ctx","wiaCryptoContext","pidCryptoContext","pid","walletInstanceAttestation","wiaWpToken","SignJWT","setProtectedHeader","alg","typ","setPayload","vp","jti","uuid","v4","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","AuthorizationIdpError","error_description"],"sourceRoot":"../../../../src","sources":["credential/issuance/04-complete-user-authorization.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AAQA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAOA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AAMA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,gBAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,OAAA,GAAAT,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ACA;AACA;AACA;AACA;AACA;AACA;AANAlB,OAAA,CAAAuB,4CAAA,GAAAA,4CAAA;AAOO,MAAMxB,0BAA0B,GACrCwE,OAAgB,IACQ;EACxB,MAAMC,aAAa,GAAGC,8BAAwB,CAACxD,SAAS,CAACsD,OAAO,CAAC;EACjE,IAAI,CAACC,aAAa,CAACrD,OAAO,EAAE;IAC1B,MAAMuD,OAAO,GAAGC,6BAAuB,CAAC1D,SAAS,CAACsD,OAAO,CAAC;IAC1D,IAAI,CAACG,OAAO,CAACvD,OAAO,EAAE;MACpB,MAAM,IAAI7C,0BAAkB,CAACkG,aAAa,CAACnD,KAAK,CAAC9C,OAAO,CAAC,CAAC,CAAC;IAC7D;;IACA,MAAM,IAAIqG,6BAAqB,CAC7BF,OAAO,CAACpD,IAAI,CAACD,KAAK,EAClBqD,OAAO,CAACpD,IAAI,CAACuD,iBACf,CAAC;EACH;EACA,OAAOL,aAAa,CAAClD,IAAI;AAC3B,CAAC;AAACtB,OAAA,CAAAD,0BAAA,GAAAA,0BAAA"}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.authorizeAccess = void 0;
7
7
  var _misc = require("../../utils/misc");
8
- var _crypto = require("../../utils/crypto");
9
8
  var _dpop = require("../../utils/dpop");
10
9
  var _reactNativeUuid = _interopRequireDefault(require("react-native-uuid"));
11
10
  var _pop = require("../../utils/pop");
@@ -13,7 +12,6 @@ var WalletInstanceAttestation = _interopRequireWildcard(require("../../wallet-in
13
12
  var _const = require("./const");
14
13
  var _types = require("./types");
15
14
  var _errors = require("../../utils/errors");
16
- var _ioReactNativeCrypto = require("@pagopa/io-react-native-crypto");
17
15
  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); }
18
16
  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; }
19
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -29,6 +27,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
29
27
  * @param codeVerifier The code verifier returned by {@link startUserAuthorization}
30
28
  * @param context.walletInstanceAttestation The Wallet Instance's attestation
31
29
  * @param context.wiaCryptoContext The Wallet Instance's crypto context
30
+ * @param context.dPopCryptoContext The DPoP crypto context
32
31
  * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
33
32
  * @throws {ValidationFailed} if an error occurs while parsing the token response
34
33
  * @return The token response containing the access token along with the token request signed with DPoP which has to be used in the {@link obtainCredential} step.
@@ -37,24 +36,19 @@ const authorizeAccess = async (issuerConf, code, clientId, redirectUri, codeVeri
37
36
  const {
38
37
  appFetch = fetch,
39
38
  walletInstanceAttestation,
40
- wiaCryptoContext
39
+ wiaCryptoContext,
40
+ dPopCryptoContext
41
41
  } = context;
42
42
  const parEndpoint = issuerConf.oauth_authorization_server.pushed_authorization_request_endpoint;
43
43
  const parUrl = new URL(parEndpoint);
44
44
  const aud = `${parUrl.protocol}//${parUrl.hostname}`;
45
45
  const iss = WalletInstanceAttestation.decode(walletInstanceAttestation).payload.cnf.jwk.kid;
46
46
  const tokenUrl = issuerConf.oauth_authorization_server.token_endpoint;
47
- try {
48
- await (0, _ioReactNativeCrypto.generate)(_const.DPOP_KET_TAG);
49
- } catch {
50
- console.log("DPoP key already exist");
51
- }
52
- const dPoPContext = (0, _crypto.createCryptoContextFor)(_const.DPOP_KET_TAG);
53
47
  const tokenRequestSignedDPop = await (0, _dpop.createDPopToken)({
54
48
  htm: "POST",
55
49
  htu: tokenUrl,
56
50
  jti: `${_reactNativeUuid.default.v4()}`
57
- }, dPoPContext);
51
+ }, dPopCryptoContext);
58
52
  const signedWiaPoP = await (0, _pop.createPopToken)({
59
53
  jti: `${_reactNativeUuid.default.v4()}`,
60
54
  aud,
@@ -82,8 +76,7 @@ const authorizeAccess = async (issuerConf, code, clientId, redirectUri, codeVeri
82
76
  throw new _errors.ValidationFailed(tokenRes.error.message);
83
77
  }
84
78
  return {
85
- accessToken: tokenRes.data,
86
- dPoPContext
79
+ accessToken: tokenRes.data
87
80
  };
88
81
  };
89
82
  exports.authorizeAccess = authorizeAccess;
@@ -1 +1 @@
1
- {"version":3,"names":["_misc","require","_crypto","_dpop","_reactNativeUuid","_interopRequireDefault","_pop","WalletInstanceAttestation","_interopRequireWildcard","_const","_types","_errors","_ioReactNativeCrypto","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","authorizeAccess","issuerConf","code","clientId","redirectUri","codeVerifier","context","appFetch","fetch","walletInstanceAttestation","wiaCryptoContext","parEndpoint","oauth_authorization_server","pushed_authorization_request_endpoint","parUrl","URL","aud","protocol","hostname","iss","decode","payload","cnf","jwk","kid","tokenUrl","token_endpoint","generate","DPOP_KET_TAG","console","log","dPoPContext","createCryptoContextFor","tokenRequestSignedDPop","createDPopToken","htm","htu","jti","uuid","v4","signedWiaPoP","createPopToken","requestBody","grant_type","client_id","redirect_uri","code_verifier","client_assertion_type","ASSERTION_TYPE","client_assertion","authorizationRequestFormBody","URLSearchParams","tokenRes","method","headers","DPoP","body","toString","then","hasStatus","res","json","TokenResponse","safeParse","success","ValidationFailed","error","message","accessToken","data","exports"],"sourceRoot":"../../../../src","sources":["credential/issuance/05-authorize-access.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AACA,IAAAM,yBAAA,GAAAC,uBAAA,CAAAP,OAAA;AAEA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAEA,IAAAW,oBAAA,GAAAX,OAAA;AAA0D,SAAAY,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,SAAAN,wBAAAU,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,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,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AAO,EAAE;IACrB,MAAM,IAAIC,wBAAgB,CAACb,QAAQ,CAACc,KAAK,CAACC,OAAO,CAAC;EACpD;EAEA,OAAO;IAAEC,WAAW,EAAEhB,QAAQ,CAACiB,IAAI;IAAEtC;EAAY,CAAC;AACpD,CAAC;AAACuC,OAAA,CAAAtE,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"names":["_misc","require","_dpop","_reactNativeUuid","_interopRequireDefault","_pop","WalletInstanceAttestation","_interopRequireWildcard","_const","_types","_errors","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","authorizeAccess","issuerConf","code","clientId","redirectUri","codeVerifier","context","appFetch","fetch","walletInstanceAttestation","wiaCryptoContext","dPopCryptoContext","parEndpoint","oauth_authorization_server","pushed_authorization_request_endpoint","parUrl","URL","aud","protocol","hostname","iss","decode","payload","cnf","jwk","kid","tokenUrl","token_endpoint","tokenRequestSignedDPop","createDPopToken","htm","htu","jti","uuid","v4","signedWiaPoP","createPopToken","requestBody","grant_type","client_id","redirect_uri","code_verifier","client_assertion_type","ASSERTION_TYPE","client_assertion","authorizationRequestFormBody","URLSearchParams","tokenRes","method","headers","DPoP","body","toString","then","hasStatus","res","json","TokenResponse","safeParse","success","ValidationFailed","error","message","accessToken","data","exports"],"sourceRoot":"../../../../src","sources":["credential/issuance/05-authorize-access.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,yBAAA,GAAAC,uBAAA,CAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,O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GAAG,GAAG,GAAG0B;EACtD,CAAC;EAED,MAAMU,4BAA4B,GAAG,IAAIC,eAAe,CAACT,WAAW,CAAC;EACrE,MAAMU,QAAQ,GAAG,MAAMxC,QAAQ,CAACmB,QAAQ,EAAE;IACxCsB,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MACP,cAAc,EAAE,mCAAmC;MACnDC,IAAI,EAAEtB;IACR,CAAC;IACDuB,IAAI,EAAEN,4BAA4B,CAACO,QAAQ,CAAC;EAC9C,CAAC,CAAC,CACCC,IAAI,CAAC,IAAAC,eAAS,EAAC,GAAG,CAAC,CAAC,CACpBD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAAEF,IAAI,IAAKM,oBAAa,CAACC,SAAS,CAACP,IAAI,CAAC,CAAC;EAEhD,IAAI,CAACJ,QAAQ,CAACY,OAAO,EAAE;IACrB,MAAM,IAAIC,wBAAgB,CAACb,QAAQ,CAACc,KAAK,CAACC,OAAO,CAAC;EACpD;EAEA,OAAO;IAAEC,WAAW,EAAEhB,QAAQ,CAACiB;EAAK,CAAC;AACvC,CAAC;AAACC,OAAA,CAAAjE,eAAA,GAAAA,eAAA"}
@@ -10,8 +10,6 @@ var _errors = require("../../utils/errors");
10
10
  var _types = require("./types");
11
11
  var _dpop = require("../../utils/dpop");
12
12
  var _reactNativeUuid = _interopRequireDefault(require("react-native-uuid"));
13
- var _ioReactNativeCrypto = require("@pagopa/io-react-native-crypto");
14
- var _const = require("./const");
15
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
14
  const createNonceProof = async (nonce, issuer, audience, ctx) => {
17
15
  const jwk = await ctx.getPublicKey();
@@ -35,14 +33,16 @@ const createNonceProof = async (nonce, issuer, audience, ctx) => {
35
33
  * @param credentialDefinition The credential definition of the credential to be obtained returned by {@link startUserAuthorization}
36
34
  * @param tokenRequestSignedDPop The DPoP signed token request returned by {@link authorizeAccess}
37
35
  * @param context.credentialCryptoContext The crypto context used to obtain the credential
36
+ * @param context.dPopCryptoContext The DPoP crypto context
38
37
  * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
39
38
  * @returns The credential response containing the credential
40
39
  */
41
40
  exports.createNonceProof = createNonceProof;
42
- const obtainCredential = async (issuerConf, accessToken, clientId, credentialDefinition, dPoPContext, context) => {
41
+ const obtainCredential = async (issuerConf, accessToken, clientId, credentialDefinition, context) => {
43
42
  const {
44
43
  credentialCryptoContext,
45
- appFetch = fetch
44
+ appFetch = fetch,
45
+ dPopCryptoContext
46
46
  } = context;
47
47
  const credentialUrl = issuerConf.openid_credential_issuer.credential_endpoint;
48
48
 
@@ -75,8 +75,7 @@ const obtainCredential = async (issuerConf, accessToken, clientId, credentialDef
75
75
  htu: credentialUrl,
76
76
  jti: `${_reactNativeUuid.default.v4()}`,
77
77
  ath: await (0, _ioReactNativeJwt.sha256ToBase64)(accessToken.access_token)
78
- }, dPoPContext);
79
- await (0, _ioReactNativeCrypto.deleteKey)(_const.DPOP_KET_TAG);
78
+ }, dPopCryptoContext);
80
79
  const credentialRes = await appFetch(credentialUrl, {
81
80
  method: "POST",
82
81
  headers: {
@@ -1 +1 @@
1
- {"version":3,"names":["_ioReactNativeJwt","require","_misc","_errors","_types","_dpop","_reactNativeUuid","_interopRequireDefault","_ioReactNativeCrypto","_const","obj","__esModule","default","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","SignJWT","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","exports","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","dPoPContext","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","tokenRequestSignedDPop","createDPopToken","htm","htu","jti","uuid","v4","ath","sha256ToBase64","access_token","deleteKey","DPOP_KET_TAG","credentialRes","method","headers","DPoP","Authorization","token_type","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;AAOA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAAuC,SAAAM,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAchC,MAAMG,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,CACDM,WAAW,CAACR,QAAQ,CAAC,CACrBS,SAAS,CAACV,MAAM,CAAC,CACjBW,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,MAAM,CAAC,CACzBC,IAAI,CAAC,CAAC;AACX,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdAC,OAAA,CAAAhB,gBAAA,GAAAA,gBAAA;AAeO,MAAMiB,gBAAkC,GAAG,MAAAA,CAChDC,UAAU,EACVC,WAAW,EACXC,QAAQ,EACRC,oBAAoB,EACpB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C,QAAQ,CAACE,aAAa,EAAE;IAClD+B,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MACP,cAAc,EAAE,kBAAkB;MAClCC,IAAI,EAAEf,sBAAsB;MAC5BgB,aAAa,EAAG,GAAE1C,WAAW,CAAC2C,UAAW,IAAG3C,WAAW,CAACmC,YAAa;IACvE,CAAC;IACDS,IAAI,EAAEC,IAAI,CAACC,SAAS,CAACzB,yBAAyB;EAChD,CAAC,CAAC,CACC0B,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,CAACN,aAAa,CAACe,OAAO,EAAE;IAC1B,MAAM,IAAIjC,wBAAgB,CAACkB,aAAa,CAACgB,KAAK,CAACC,OAAO,CAAC;EACzD;EAEA,OAAOjB,aAAa,CAACkB,IAAI;AAC3B,CAAC;AAAC3D,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["_ioReactNativeJwt","require","_misc","_errors","_types","_dpop","_reactNativeUuid","_interopRequireDefault","obj","__esModule","default","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","SignJWT","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","exports","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","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","tokenRequestSignedDPop","createDPopToken","htm","htu","jti","uuid","v4","ath","sha256ToBase64","access_token","credentialRes","method","headers","DPoP","Authorization","token_type","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;AAOA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAC,sBAAA,CAAAN,OAAA;AAAqC,SAAAM,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAc9B,MAAMG,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,CACDM,WAAW,CAACR,QAAQ,CAAC,CACrBS,SAAS,CAACV,MAAM,CAAC,CACjBW,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,MAAM,CAAC,CACzBC,IAAI,CAAC,CAAC;AACX,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfAC,OAAA,CAAAhB,gBAAA,GAAAA,gBAAA;AAgBO,MAAMiB,gBAAkC,GAAG,MAAAA,CAChDC,UAAU,EACVC,WAAW,EACXC,QAAQ,EACRC,oBAAoB,EACpBC,OAAO,KACJ;EACH,MAAM;IACJC,uBAAuB;IACvBC,QAAQ,GAAGC,KAAK;IAChBC;EACF,CAAC,GAAGJ,OAAO;EAEX,MAAMK,aAAa,GAAGT,UAAU,CAACU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AAW,CAACmC,YAAa;IACvE,CAAC;IACDO,IAAI,EAAEC,IAAI,CAACC,SAAS,CAACvB,yBAAyB;EAChD,CAAC,CAAC,CACCwB,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,CAACN,aAAa,CAACe,OAAO,EAAE;IAC1B,MAAM,IAAI/B,wBAAgB,CAACgB,aAAa,CAACgB,KAAK,CAACC,OAAO,CAAC;EACzD;EAEA,OAAOjB,aAAa,CAACkB,IAAI;AAC3B,CAAC;AAACzD,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
@@ -3,14 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SupportedCredentialFormat = exports.DPOP_KET_TAG = exports.ASSERTION_TYPE = void 0;
6
+ exports.SupportedCredentialFormat = exports.ASSERTION_TYPE = void 0;
7
7
  var z = _interopRequireWildcard(require("zod"));
8
8
  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); }
9
9
  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; }
10
10
  const ASSERTION_TYPE = "urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation";
11
11
  exports.ASSERTION_TYPE = ASSERTION_TYPE;
12
- const DPOP_KET_TAG = `dpop`;
13
- exports.DPOP_KET_TAG = DPOP_KET_TAG;
14
12
  const SupportedCredentialFormat = z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]);
15
13
  exports.SupportedCredentialFormat = SupportedCredentialFormat;
16
14
  //# sourceMappingURL=const.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["z","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ASSERTION_TYPE","exports","DPOP_KET_TAG","SupportedCredentialFormat","union","literal"],"sourceRoot":"../../../../src","sources":["credential/issuance/const.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAyB,SAAAC,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,SAAAH,wBAAAO,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,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,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;AAClB,MAAMW,cAAc,GACzB,oEAAoE;AAACC,OAAA,CAAAD,cAAA,GAAAA,cAAA;AAEhE,MAAME,YAAY,GAAI,MAAK;AAACD,OAAA,CAAAC,YAAA,GAAAA,YAAA;AAK5B,MAAMC,yBAAyB,GAAG5B,CAAC,CAAC6B,KAAK,CAAC,CAC/C7B,CAAC,CAAC8B,OAAO,CAAC,WAAW,CAAC,EACtB9B,CAAC,CAAC8B,OAAO,CAAC,cAAc,CAAC,CAC1B,CAAC;AAACJ,OAAA,CAAAE,yBAAA,GAAAA,yBAAA"}
1
+ {"version":3,"names":["z","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ASSERTION_TYPE","exports","SupportedCredentialFormat","union","literal"],"sourceRoot":"../../../../src","sources":["credential/issuance/const.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hE,MAAME,yBAAyB,GAAG3B,CAAC,CAAC4B,KAAK,CAAC,CAC/C5B,CAAC,CAAC6B,OAAO,CAAC,WAAW,CAAC,EACtB7B,CAAC,CAAC6B,OAAO,CAAC,cAAc,CAAC,CAC1B,CAAC;AAACH,OAAA,CAAAC,yBAAA,GAAAA,yBAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=01-start-flow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["credential/status/01-start-flow.ts"],"mappings":""}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.statusAttestation = void 0;
7
+ var _misc = require("../../utils/misc");
8
+ var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
9
+ var _reactNativeUuid = _interopRequireDefault(require("react-native-uuid"));
10
+ var _types = require("./types");
11
+ var _errors = require("../../utils/errors");
12
+ var _errors2 = require("./errors");
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ /**
15
+ * WARNING: This function must be called after {@link startFlow}.
16
+ * Verify the status of the credential attestation.
17
+ * @param issuerConf - The issuer's configuration
18
+ * @param credential - The credential to be verified
19
+ * @param credentialCryptoContext - The credential's crypto context
20
+ * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
21
+ * @throws {@link StatusAttestationInvalid} if the status attestation is invalid and thus the credential is not valid
22
+ * @throws {@link StatusAttestationError} if an error occurs during the status attestation
23
+ * @returns The credential status attestation
24
+ */
25
+ const statusAttestation = async function (issuerConf, credential, credentialCryptoContext) {
26
+ let appFetch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : fetch;
27
+ const jwk = await credentialCryptoContext.getPublicKey();
28
+ const credentialHash = await (0, _misc.getCredentialHashWithouDiscloures)(credential);
29
+ const statusAttUrl = issuerConf.openid_credential_issuer.status_attestation_endpoint;
30
+ const credentialPop = await new _ioReactNativeJwt.SignJWT(credentialCryptoContext).setPayload({
31
+ aud: statusAttUrl,
32
+ jti: _reactNativeUuid.default.v4().toString(),
33
+ credential_hash: credentialHash,
34
+ credential_hash_alg: "S256"
35
+ }).setProtectedHeader({
36
+ alg: "ES256",
37
+ typ: "status-attestation-request+jwt",
38
+ kid: jwk.kid
39
+ }).setIssuedAt().setExpirationTime("5m").sign();
40
+ const body = {
41
+ credential_pop: credentialPop
42
+ };
43
+ const result = await appFetch(statusAttUrl, {
44
+ method: "POST",
45
+ headers: {
46
+ "Content-Type": "application/json"
47
+ },
48
+ body: JSON.stringify(body)
49
+ }).then((0, _misc.hasStatus)(201)).then(raw => raw.json()).then(json => _types.StatusAttestationResponse.parse(json)).catch(handleStatusAttestationError);
50
+ return {
51
+ statusAttestation: result.status_attestation
52
+ };
53
+ };
54
+
55
+ /**
56
+ * Handle the status attestation error by mapping it to a custom exception.
57
+ * If the error is not an instance of {@link UnexpectedStatusCodeError}, it is thrown as is.
58
+ * @param e - The error to be handled
59
+ * @throws {@link StatusAttestationError} if the status code is different from 404
60
+ * @throws {@link StatusAttestationInvalid} if the status code is 404 (meaning the credential is invalid)
61
+ */
62
+ exports.statusAttestation = statusAttestation;
63
+ const handleStatusAttestationError = e => {
64
+ if (!(e instanceof _errors.UnexpectedStatusCodeError)) {
65
+ throw e;
66
+ }
67
+ if (e.statusCode === 404) {
68
+ throw new _errors2.StatusAttestationInvalid("Invalid status found for the given credential", e.message);
69
+ }
70
+ throw new _errors2.StatusAttestationError(`Unable to obtain the status attestation for the given credential [response status code: ${e.statusCode}]`, e.message);
71
+ };
72
+ //# sourceMappingURL=02-status-attestation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_misc","require","_ioReactNativeJwt","_reactNativeUuid","_interopRequireDefault","_types","_errors","_errors2","obj","__esModule","default","statusAttestation","issuerConf","credential","credentialCryptoContext","appFetch","arguments","length","undefined","fetch","jwk","getPublicKey","credentialHash","getCredentialHashWithouDiscloures","statusAttUrl","openid_credential_issuer","status_attestation_endpoint","credentialPop","SignJWT","setPayload","aud","jti","uuid","v4","toString","credential_hash","credential_hash_alg","setProtectedHeader","alg","typ","kid","setIssuedAt","setExpirationTime","sign","body","credential_pop","result","method","headers","JSON","stringify","then","hasStatus","raw","json","StatusAttestationResponse","parse","catch","handleStatusAttestationError","status_attestation","exports","e","UnexpectedStatusCodeError","statusCode","StatusAttestationInvalid","message","StatusAttestationError"],"sourceRoot":"../../../../src","sources":["credential/status/02-status-attestation.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAA4E,SAAAG,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAW5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,iBAAoC,GAAG,eAAAA,CAClDC,UAAU,EACVC,UAAU,EACVC,uBAAuB,EAEpB;EAAA,IADHC,QAA8B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGG,KAAK;EAEtC,MAAMC,GAAG,GAAG,MAAMN,uBAAuB,CAACO,YAAY,CAAC,CAAC;EACxD,MAAMC,cAAc,GAAG,MAAM,IAAAC,uCAAiC,EAACV,UAAU,CAAC;EAC1E,MAAMW,YAAY,GAChBZ,UAAU,CAACa,wBAAwB,CAACC,2BAA2B;EACjE,MAAMC,aAAa,GAAG,MAAM,IAAIC,yBAAO,CAACd,uBAAuB,CAAC,CAC7De,UAAU,CAAC;IACVC,GAAG,EAAEN,YAAY;IACjBO,GAAG,EAAEC,wBAAI,CAACC,EAAE,C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sB,CAC7B,2FAA0FL,CAAC,CAACE,UAAW,GAAE,EAC1GF,CAAC,CAACI,OACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.verifyAndParseStatusAttestation = void 0;
7
+ var _errors = require("../../utils/errors");
8
+ var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
9
+ var _types = require("./types");
10
+ /**
11
+ * Given a status attestation, verifies that:
12
+ * - It's in the supported format;
13
+ * - The attestation is correctly signed;
14
+ * - It's bound to the given key.
15
+ * @param issuerConf The Issuer configuration returned by {@link evaluateIssuerTrust}
16
+ * @param statusAttestation The encoded status attestation returned by {@link statusAttestation}
17
+ * @param context.credentialCryptoContext The crypto context used to obtain the credential in {@link obtainCredential}
18
+ * @returns A parsed status attestation
19
+ * @throws {IoWalletError} If the credential signature is not verified with the Issuer key set
20
+ * @throws {IoWalletError} If the credential is not bound to the provided user key
21
+ * @throws {IoWalletError} If the credential data fail to parse
22
+ */
23
+ const verifyAndParseStatusAttestation = async (issuerConf, rawStatusAttestation, context) => {
24
+ try {
25
+ const {
26
+ statusAttestation
27
+ } = rawStatusAttestation;
28
+ const {
29
+ credentialCryptoContext
30
+ } = context;
31
+ await (0, _ioReactNativeJwt.verify)(statusAttestation, issuerConf.openid_credential_issuer.jwks.keys);
32
+ const decodedJwt = (0, _ioReactNativeJwt.decode)(statusAttestation);
33
+ const parsedStatusAttestation = _types.ParsedStatusAttestation.parse({
34
+ header: decodedJwt.protectedHeader,
35
+ payload: decodedJwt.payload
36
+ });
37
+ const holderBindingKey = await credentialCryptoContext.getPublicKey();
38
+ const {
39
+ cnf
40
+ } = parsedStatusAttestation.payload;
41
+ if (!cnf.jwk.kid || cnf.jwk.kid !== holderBindingKey.kid) {
42
+ throw new _errors.IoWalletError(`Failed to verify holder binding for status attestation, expected kid: ${holderBindingKey.kid}, got: ${parsedStatusAttestation.payload.cnf.jwk.kid}`);
43
+ }
44
+ return {
45
+ parsedStatusAttestation
46
+ };
47
+ } catch (e) {
48
+ throw new _errors.IoWalletError(`Failed to verify status attestation: ${JSON.stringify(e)}`);
49
+ }
50
+ };
51
+ exports.verifyAndParseStatusAttestation = verifyAndParseStatusAttestation;
52
+ //# sourceMappingURL=03-verify-and-parse-status-attestation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_errors","require","_ioReactNativeJwt","_types","verifyAndParseStatusAttestation","issuerConf","rawStatusAttestation","context","statusAttestation","credentialCryptoContext","verify","openid_credential_issuer","jwks","keys","decodedJwt","decodeJwt","parsedStatusAttestation","ParsedStatusAttestation","parse","header","protectedHeader","payload","holderBindingKey","getPublicKey","cnf","jwk","kid","IoWalletError","e","JSON","stringify","exports"],"sourceRoot":"../../../../src","sources":["credential/status/03-verify-and-parse-status-attestation.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,+BAAgE,GAC3E,MAAAA,CAAOC,UAAU,EAAEC,oBAAoB,EAAEC,OAAO,KAAK;EACnD,IAAI;IACF,MAAM;MAAEC;IAAkB,CAAC,GAAGF,oBAAoB;IAClD,MAAM;MAAEG;IAAwB,CAAC,GAAGF,OAAO;IAE3C,MAAM,IAAAG,wBAAM,EACVF,iBAAiB,EACjBH,UAAU,CAACM,wBAAwB,CAACC,IAAI,CAACC,IAC3C,CAAC;IAED,MAAMC,UAAU,GAAG,IAAAC,wBAAS,EAACP,iBAAiB,CAAC;IAC/C,MAAMQ,uBAAuB,GAAGC,8BAAuB,CAACC,KAAK,CAAC;MAC5DC,MAAM,EAAEL,UAAU,CAACM,eAAe;MAClCC,OAAO,EAAEP,UAAU,CAACO;IACtB,CAAC,CAAC;IAEF,MAAMC,gBAAgB,GAAG,MAAMb,uBAAuB,CAACc,YAAY,CAAC,CAAC;IACrE,MAAM;MAAEC;IAAI,CAAC,GAAGR,uBAAuB,CAACK,OAAO;IAC/C,IAAI,CAACG,GAAG,CAACC,GAAG,CAACC,GAAG,IAAIF,GAAG,CAACC,GAAG,CAACC,GAAG,KAAKJ,gBAAgB,CAACI,GAAG,EAAE;MACxD,MAAM,IAAIC,qBAAa,CACpB,yEAAwEL,gBAAgB,CAACI,GAAI,UAASV,uBAAuB,CAACK,OAAO,CAACG,GAAG,CAACC,GAAG,CAACC,GAAI,EACrJ,CAAC;IACH;IAEA,OAAO;MAAEV;IAAwB,CAAC;EACpC,CAAC,CAAC,OAAOY,CAAC,EAAE;IACV,MAAM,IAAID,qBAAa,CACpB,wCAAuCE,IAAI,CAACC,SAAS,CAACF,CAAC,CAAE,EAC5D,CAAC;EACH;AACF,CAAC;AAACG,OAAA,CAAA3B,+BAAA,GAAAA,+BAAA"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StatusAttestationInvalid = exports.StatusAttestationError = void 0;
7
+ var _errors = require("../../utils/errors");
8
+ class StatusAttestationInvalid extends _errors.IoWalletError {
9
+ static get code() {
10
+ return "ERR_STATUS_ATTESTATION_INVALID";
11
+ }
12
+ code = "ERR_STATUS_ATTESTATION_INVALID";
13
+ constructor(message) {
14
+ let reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
15
+ super((0, _errors.serializeAttrs)({
16
+ message,
17
+ reason
18
+ }));
19
+ this.reason = reason;
20
+ }
21
+ }
22
+ exports.StatusAttestationInvalid = StatusAttestationInvalid;
23
+ class StatusAttestationError extends _errors.IoWalletError {
24
+ static get code() {
25
+ return "ERR_STATUS_ATTESTATION_ERROR";
26
+ }
27
+ code = "ERR_STATUS_ATTESTATION_ERROR";
28
+ constructor(message) {
29
+ let reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
30
+ super((0, _errors.serializeAttrs)({
31
+ message,
32
+ reason
33
+ }));
34
+ this.reason = reason;
35
+ }
36
+ }
37
+ exports.StatusAttestationError = StatusAttestationError;
38
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_errors","require","StatusAttestationInvalid","IoWalletError","code","constructor","message","reason","arguments","length","undefined","serializeAttrs","exports","StatusAttestationError"],"sourceRoot":"../../../../src","sources":["credential/status/errors.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,wBAAwB,SAASC,qBAAa,CAAC;EAC1D,WAAWC,IAAIA,CAAA,EAAqC;IAClD,OAAO,gCAAgC;EACzC;EAEAA,IAAI,GAAG,gCAAgC;EAIvCC,WAAWA,CAACC,OAAe,EAAkC;IAAA,IAAhCC,MAAc,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACzD,KAAK,CAAC,IAAAG,sBAAc,EAAC;MAAEL,OAAO;MAAEC;IAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF;AAACK,OAAA,CAAAV,wBAAA,GAAAA,wBAAA;AAEM,MAAMW,sBAAsB,SAASV,qBAAa,CAAC;EACxD,WAAWC,IAAIA,CAAA,EAAmC;IAChD,OAAO,8BAA8B;EACvC;EAEAA,IAAI,GAAG,8BAA8B;EAIrCC,WAAWA,CAACC,OAAe,EAAkC;IAAA,IAAhCC,MAAc,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACzD,KAAK,CAAC,IAAAG,sBAAc,EAAC;MAAEL,OAAO;MAAEC;IAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF;AAACK,OAAA,CAAAC,sBAAA,GAAAA,sBAAA"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "evaluateIssuerTrust", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _issuance.evaluateIssuerTrust;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "statusAttestation", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _statusAttestation.statusAttestation;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "verifyAndParseStatusAttestation", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _verifyAndParseStatusAttestation.verifyAndParseStatusAttestation;
22
+ }
23
+ });
24
+ var _statusAttestation = require("./02-status-attestation");
25
+ var _issuance = require("../issuance");
26
+ var _verifyAndParseStatusAttestation = require("./03-verify-and-parse-status-attestation");
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_statusAttestation","require","_issuance","_verifyAndParseStatusAttestation"],"sourceRoot":"../../../../src","sources":["credential/status/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,kBAAA,GAAAC,OAAA;AAIA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,gCAAA,GAAAF,OAAA"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StatusAttestationResponse = exports.ParsedStatusAttestation = void 0;
7
+ var _types = require("../../sd-jwt/types");
8
+ var _jwk = require("../../utils/jwk");
9
+ var z = _interopRequireWildcard(require("zod"));
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
+ /**
13
+ * Shape from parsing a status attestation response in case of 201.
14
+ */
15
+ const StatusAttestationResponse = z.object({
16
+ status_attestation: z.string()
17
+ });
18
+
19
+ /**
20
+ * Type from parsing a status attestation response in case of 201.
21
+ * Inferred from {@link StatusAttestationResponse}.
22
+ */
23
+
24
+ /**
25
+ * Type for a parsed status attestation.
26
+ */
27
+ exports.StatusAttestationResponse = StatusAttestationResponse;
28
+ /**
29
+ * Shape for parsing a status attestation in a JWT.
30
+ */
31
+ const ParsedStatusAttestation = z.object({
32
+ header: z.object({
33
+ typ: z.literal("status-attestation+jwt"),
34
+ alg: z.string(),
35
+ kid: z.string().optional()
36
+ }),
37
+ payload: z.object({
38
+ credential_hash_alg: z.string(),
39
+ credential_hash: z.string(),
40
+ cnf: z.object({
41
+ jwk: _jwk.JWK
42
+ }),
43
+ exp: _types.UnixTime,
44
+ iat: _types.UnixTime
45
+ })
46
+ });
47
+ exports.ParsedStatusAttestation = ParsedStatusAttestation;
48
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StatusAttestationResponse","object","status_attestation","string","exports","ParsedStatusAttestation","header","typ","literal","alg","kid","optional","payload","credential_hash_alg","credential_hash","cnf","jwk","JWK","exp","UnixTime","iat"],"sourceRoot":"../../../../src","sources":["credential/status/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAyB,SAAAI,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,SAAAF,wBAAAM,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,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,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,O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