@pagopa/io-react-native-wallet 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. package/lib/commonjs/client/generated/wallet-provider.js +126 -0
  2. package/lib/commonjs/client/generated/wallet-provider.js.map +1 -0
  3. package/lib/commonjs/client/index.js +41 -0
  4. package/lib/commonjs/client/index.js.map +1 -0
  5. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +6 -6
  6. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  7. package/lib/commonjs/index.js +10 -1
  8. package/lib/commonjs/index.js.map +1 -1
  9. package/lib/commonjs/utils/errors.js +29 -1
  10. package/lib/commonjs/utils/errors.js.map +1 -1
  11. package/lib/commonjs/utils/integrity.js +2 -0
  12. package/lib/commonjs/utils/integrity.js.map +1 -0
  13. package/lib/commonjs/wallet-instance/index.js +29 -0
  14. package/lib/commonjs/wallet-instance/index.js.map +1 -0
  15. package/lib/commonjs/wallet-instance-attestation/issuing.js +48 -66
  16. package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
  17. package/lib/commonjs/wallet-instance-attestation/types.js +1 -1
  18. package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
  19. package/lib/module/client/generated/wallet-provider.js +105 -0
  20. package/lib/module/client/generated/wallet-provider.js.map +1 -0
  21. package/lib/module/client/index.js +34 -0
  22. package/lib/module/client/index.js.map +1 -0
  23. package/lib/module/credential/issuance/07-verify-and-parse-credential.js +6 -6
  24. package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  25. package/lib/module/index.js +3 -1
  26. package/lib/module/index.js.map +1 -1
  27. package/lib/module/sd-jwt/verifier.js.map +1 -1
  28. package/lib/module/utils/errors.js +27 -0
  29. package/lib/module/utils/errors.js.map +1 -1
  30. package/lib/module/utils/integrity.js +2 -0
  31. package/lib/module/utils/integrity.js.map +1 -0
  32. package/lib/module/wallet-instance/index.js +23 -0
  33. package/lib/module/wallet-instance/index.js.map +1 -0
  34. package/lib/module/wallet-instance-attestation/issuing.js +48 -67
  35. package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
  36. package/lib/module/wallet-instance-attestation/types.js +1 -1
  37. package/lib/module/wallet-instance-attestation/types.js.map +1 -1
  38. package/lib/typescript/client/generated/wallet-provider.d.ts +242 -0
  39. package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -0
  40. package/lib/typescript/client/index.d.ts +7 -0
  41. package/lib/typescript/client/index.d.ts.map +1 -0
  42. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
  43. package/lib/typescript/index.d.ts +5 -1
  44. package/lib/typescript/index.d.ts.map +1 -1
  45. package/lib/typescript/utils/errors.d.ts +13 -0
  46. package/lib/typescript/utils/errors.d.ts.map +1 -1
  47. package/lib/typescript/utils/integrity.d.ts +21 -0
  48. package/lib/typescript/utils/integrity.d.ts.map +1 -0
  49. package/lib/typescript/wallet-instance/index.d.ts +7 -0
  50. package/lib/typescript/wallet-instance/index.d.ts.map +1 -0
  51. package/lib/typescript/wallet-instance-attestation/issuing.d.ts +15 -3
  52. package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
  53. package/lib/typescript/wallet-instance-attestation/types.d.ts +5 -5
  54. package/package.json +9 -6
  55. package/src/client/generated/wallet-provider.ts +170 -0
  56. package/src/client/index.ts +58 -0
  57. package/src/credential/issuance/07-verify-and-parse-credential.ts +38 -34
  58. package/src/index.ts +7 -0
  59. package/src/sd-jwt/__test__/converters.test.js +24 -0
  60. package/src/sd-jwt/verifier.js +12 -0
  61. package/src/utils/errors.ts +28 -0
  62. package/src/utils/integrity.ts +23 -0
  63. package/src/wallet-instance/index.ts +29 -0
  64. package/src/wallet-instance-attestation/issuing.ts +68 -101
  65. package/src/wallet-instance-attestation/types.ts +1 -1
@@ -0,0 +1,105 @@
1
+ import z from "zod";
2
+ export const ProblemDetail = z.object({
3
+ type: z.string().optional(),
4
+ title: z.string().optional(),
5
+ status: z.number().optional(),
6
+ detail: z.string().optional(),
7
+ instance: z.string().optional()
8
+ });
9
+ export const FiscalCode = z.string();
10
+ export const Id = z.string();
11
+ export const get_GetEntityConfiguration = {
12
+ method: z.literal("GET"),
13
+ path: z.literal("/.well-known/openid-federation"),
14
+ parameters: z.never(),
15
+ response: z.unknown()
16
+ };
17
+ export const get_GetNonce = {
18
+ method: z.literal("GET"),
19
+ path: z.literal("/nonce"),
20
+ parameters: z.never(),
21
+ response: z.object({
22
+ nonce: z.string()
23
+ })
24
+ };
25
+ export const post_CreateWalletInstance = {
26
+ method: z.literal("POST"),
27
+ path: z.literal("/wallet-instances"),
28
+ parameters: z.object({
29
+ body: z.object({
30
+ challenge: z.string(),
31
+ key_attestation: z.string(),
32
+ hardware_key_tag: z.string()
33
+ })
34
+ }),
35
+ response: z.unknown()
36
+ };
37
+ export const post_CreateWalletAttestation = {
38
+ method: z.literal("POST"),
39
+ path: z.literal("/token"),
40
+ parameters: z.object({
41
+ body: z.object({
42
+ grant_type: z.literal("urn:ietf:params:oauth:grant-type:jwt-bearer"),
43
+ assertion: z.string()
44
+ })
45
+ }),
46
+ response: z.unknown()
47
+ };
48
+
49
+ // <EndpointByMethod>
50
+ export const EndpointByMethod = {
51
+ get: {
52
+ "/.well-known/openid-federation": get_GetEntityConfiguration,
53
+ "/nonce": get_GetNonce
54
+ },
55
+ post: {
56
+ "/wallet-instances": post_CreateWalletInstance,
57
+ "/token": post_CreateWalletAttestation
58
+ }
59
+ };
60
+
61
+ // </EndpointByMethod>
62
+ // <EndpointByMethod.Shorthands>
63
+ // </EndpointByMethod.Shorthands>
64
+ // <ApiClientTypes>
65
+ // </ApiClientTypes>
66
+ // <ApiClient>
67
+ export class ApiClient {
68
+ baseUrl = "";
69
+ constructor(fetcher) {
70
+ this.fetcher = fetcher;
71
+ }
72
+ setBaseUrl(baseUrl) {
73
+ this.baseUrl = baseUrl;
74
+ return this;
75
+ }
76
+
77
+ // <ApiClient.get>
78
+ get(path) {
79
+ return this.fetcher("get", this.baseUrl + path, arguments.length <= 1 ? undefined : arguments[1]);
80
+ }
81
+ // </ApiClient.get>
82
+
83
+ // <ApiClient.post>
84
+ post(path) {
85
+ return this.fetcher("post", this.baseUrl + path, arguments.length <= 1 ? undefined : arguments[1]);
86
+ }
87
+ // </ApiClient.post>
88
+ }
89
+
90
+ export function createApiClient(fetcher, baseUrl) {
91
+ return new ApiClient(fetcher).setBaseUrl(baseUrl ?? "");
92
+ }
93
+
94
+ /**
95
+ Example usage:
96
+ const api = createApiClient((method, url, params) =>
97
+ fetch(url, { method, body: JSON.stringify(params) }).then((res) => res.json()),
98
+ );
99
+ api.get("/users").then((users) => console.log(users));
100
+ api.post("/users", { body: { name: "John" } }).then((user) => console.log(user));
101
+ api.put("/users/:id", { path: { id: 1 }, body: { name: "John" } }).then((user) => console.log(user));
102
+ */
103
+
104
+ // </ApiClient
105
+ //# sourceMappingURL=wallet-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["z","ProblemDetail","object","type","string","optional","title","status","number","detail","instance","FiscalCode","Id","get_GetEntityConfiguration","method","literal","path","parameters","never","response","unknown","get_GetNonce","nonce","post_CreateWalletInstance","body","challenge","key_attestation","hardware_key_tag","post_CreateWalletAttestation","grant_type","assertion","EndpointByMethod","get","post","ApiClient","baseUrl","constructor","fetcher","setBaseUrl","arguments","length","undefined","createApiClient"],"sourceRoot":"../../../../src","sources":["client/generated/wallet-provider.ts"],"mappings":"AAAA,OAAOA,CAAC,MAAM,KAAK;AAGnB,OAAO,MAAMC,aAAa,GAAGD,CAAC,CAACE,MAAM,CAAC;EACpCC,IAAI,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC3BC,KAAK,EAAEN,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC5BE,MAAM,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC,CAACH,QAAQ,CAAC,CAAC;EAC7BI,MAAM,EAAET,CAAC,C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N,IAAIA,CACFjB,IAAU,EAE+B;IACzC,OAAO,IAAI,CAACqB,OAAO,CAAC,MAAM,EAAE,IAAI,CAACF,OAAO,GAAGnB,IAAI,EAAAuB,SAAA,CAAAC,MAAA,QAAAC,SAAA,GAAAF,SAAA,GAAW,CAAC;EAC7D;EACA;AACF;;AAEA,OAAO,SAASG,eAAeA,CAACL,OAAgB,EAAEF,OAAgB,EAAE;EAClE,OAAO,IAAID,SAAS,CAACG,OAAO,CAAC,CAACC,UAAU,CAACH,OAAO,IAAI,EAAE,CAAC;AACzD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA"}
@@ -0,0 +1,34 @@
1
+ import { WalletProviderResponseError } from "../utils/errors";
2
+ import { ProblemDetail, createApiClient as createWalletProviderApiClient } from "./generated/wallet-provider";
3
+ const validateResponse = async response => {
4
+ if (!response.ok) {
5
+ let problemDetail = {};
6
+ try {
7
+ problemDetail = ProblemDetail.parse(await response.json());
8
+ } catch {
9
+ problemDetail = {
10
+ title: "Invalid response from Wallet Provider"
11
+ };
12
+ }
13
+ let statusResponse = `Response status code: ${response.status}`;
14
+ throw new WalletProviderResponseError(problemDetail.title ? problemDetail.title : "Invalid response from Wallet Provider", problemDetail.type, problemDetail.detail ? statusResponse : `${statusResponse} with detail: ${problemDetail.detail}`);
15
+ }
16
+ return response;
17
+ };
18
+ export const getWalletProviderClient = context => {
19
+ const {
20
+ walletProviderBaseUrl,
21
+ appFetch = fetch
22
+ } = context;
23
+ return createWalletProviderApiClient((method, url, params) => appFetch(url, {
24
+ method,
25
+ body: params ? JSON.stringify(params.body) : undefined
26
+ }).then(validateResponse).then(res => {
27
+ const contentType = res.headers.get("content-type");
28
+ if (contentType === "application/json") {
29
+ return res.json();
30
+ }
31
+ return res.text();
32
+ }), walletProviderBaseUrl);
33
+ };
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["WalletProviderResponseError","ProblemDetail","createApiClient","createWalletProviderApiClient","validateResponse","response","ok","problemDetail","parse","json","title","statusResponse","status","type","detail","getWalletProviderClient","context","walletProviderBaseUrl","appFetch","fetch","method","url","params","body","JSON","stringify","undefined","then","res","contentType","headers","get","text"],"sourceRoot":"../../../src","sources":["client/index.ts"],"mappings":"AAAA,SAASA,2BAA2B,QAAQ,iBAAiB;AAC7D,SACEC,aAAa,EACbC,eAAe,IAAIC,6BAA6B,QAC3C,6BAA6B;AAKpC,MAAMC,gBAAgB,GAAG,MAAOC,QAAkB,IAAK;EACrD,IAAI,CAACA,QAAQ,CAACC,EAAE,EAAE;IAChB,IAAIC,aAA4B,GAAG,CAAC,CAAC;IACrC,IAAI;MACFA,aAAa,GAAGN,aAAa,CAACO,KAAK,CAAC,MAAMH,QAAQ,CAACI,IAAI,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,MAAM;MACNF,aAAa,GAAG;QACdG,KAAK,EAAE;MACT,CAAC;IACH;IAEA,IAAIC,cAAc,GAAI,yBAAwBN,QAAQ,CAACO,MAAO,EAAC;IAE/D,MAAM,IAAIZ,2BAA2B,CACnCO,aAAa,CAACG,KAAK,GACfH,aAAa,CAACG,KAAK,GACnB,uCAAuC,EAC3CH,aAAa,CAACM,IAAI,EAClBN,aAAa,CAACO,MAAM,GAChBH,cAAc,GACb,GAAEA,cAAe,iBAAgBJ,aAAa,CAACO,MAAO,EAC7D,CAAC;EACH;EACA,OAAOT,QAAQ;AACjB,CAAC;AAED,OAAO,MAAMU,uBAAuB,GAAIC,OAGvC,IAAK;EACJ,MAAM;IAAEC,qBAAqB;IAAEC,QAAQ,GAAGC;EAAM,CAAC,GAAGH,OAAO;EAE3D,OAAOb,6BAA6B,CAClC,CAACiB,MAAM,EAAEC,GAAG,EAAEC,MAAM,KAClBJ,QAAQ,CAACG,GAAG,EAAE;IACZD,MAAM;IACNG,IAAI,EAAED,MAAM,GAAGE,IAAI,CAACC,SAAS,CAACH,MAAM,CAACC,IAAI,CAAC,GAAGG;EAC/C,CAAC,CAAC,CACCC,IAAI,CAACvB,gBAAgB,CAAC,CACtBuB,IAAI,CAAEC,GAAG,IAAK;IACb,MAAMC,WAAW,GAAGD,GAAG,CAACE,OAAO,CAACC,GAAG,CAAC,cAAc,CAAC;IACnD,IAAIF,WAAW,KAAK,kBAAkB,EAAE;MACtC,OAAOD,GAAG,CAACnB,IAAI,CAAC,CAAC;IACnB;IACA,OAAOmB,GAAG,CAACI,IAAI,CAAC,CAAC;EACnB,CAAC,CAAC,EACNf,qBACF,CAAC;AACH,CAAC"}
@@ -50,7 +50,7 @@ const parseCredentialSdJwt = function (credentials_supported, _ref) {
50
50
 
51
51
  // attributes that are defined in the issuer configuration
52
52
  // and are present in the disclosure set
53
- const definedValues = attrDefinitions
53
+ const definedValues = Object.fromEntries(attrDefinitions
54
54
  // retrieve the value from the disclosure set
55
55
  .map(_ref4 => {
56
56
  var _disclosures$find;
@@ -80,21 +80,21 @@ const parseCredentialSdJwt = function (credentials_supported, _ref) {
80
80
  };
81
81
  }, {})
82
82
  }];
83
- });
83
+ }));
84
84
 
85
85
  // attributes that are in the disclosure set
86
86
  // but are not defined in the issuer configuration
87
- const undefinedValues = disclosures.filter(_ => !Object.keys(definedValues).includes(_[1])).map(_ref7 => {
87
+ const undefinedValues = Object.fromEntries(disclosures.filter(_ => !Object.keys(definedValues).includes(_[1])).map(_ref7 => {
88
88
  let [, key, value] = _ref7;
89
89
  return [key, {
90
90
  value,
91
91
  mandatory: false,
92
92
  name: key
93
93
  }];
94
- });
94
+ }));
95
95
  return {
96
- ...Object.fromEntries(definedValues),
97
- ...Object.fromEntries(undefinedValues)
96
+ ...definedValues,
97
+ ...undefinedValues
98
98
  };
99
99
  };
100
100
 
@@ -1 +1 @@
1
- {"version":3,"names":["IoWalletError","SdJwt4VC","verify","verifySdJwt","parseCredentialSdJwt","credentials_supported","_ref","_credentials_supporte","sdJwt","disclosures","ignoreMissingAttributes","arguments","length","undefined","credentialSubject","find","c","format","credential_definition","type","includes","payload","expected","flatMap","_","join","attrDefinitions","Object","entries","attrsNotInDisclosures","filter","_ref2","attrKey","mandatory","some","_ref3","name","missing","map","received","definedValues","_ref4","_disclosures$find","definition","value","_ref5","display","reduce","names","_ref6","locale","undefinedValues","keys","_ref7","key","fromEntries","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","getPublicKey","cnf","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","_ref8","credentialCryptoContext","decoded","openid_credential_issuer","jwks","parsedCredential","verifyAndParseCredentialMdoc","_issuerConf","_credential","_ctx","Error","verifyAndParseCredential","context"],"sourceRoot":"../../../../src","sources":["credential/issuance/07-verify-and-parse-credential.ts"],"mappings":"AAGA,SAASA,aAAa,QAAQ,oBAAoB;AAClD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,MAAM,IAAIC,WAAW,QAAQ,cAAc;;AAcpD;;AAmBA;;AAKA,MAAMC,oBAAoB,GAAG,SAAAA,CAE3BC,qBAAkH,EAAAC,IAAA,EAG7F;EAAA,IAAAC,qBAAA;EAAA,IAFrB;IAAEC,KAAK;IAAEC;EAAoC,CAAC,GAAAH,IAAA;EAAA,IAC9CI,uBAAgC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAExC;EACA;EACA,MAAMG,iBAAiB,IAAAP,qBAAA,GAAGF,qBAAqB,CAACU,IAAI,CACjDC,CAAC,IACAA,CAAC,CAACC,MAAM,KAAK,WAAW,IACxBD,CAAC,CAACE,qBAAqB,CAACC,IAAI,CAACC,QAAQ,CAACZ,KAAK,CAACa,OAAO,CAACF,IAAI,CAC5D,CAAC,cAAAZ,qBAAA,uBAJyBA,qBAAA,CAIvBW,qBAAqB,CAACJ,iBAAiB;;EAE1C;EACA,IAAI,CAACA,iBAAiB,EAAE;IACtB,MAAMQ,QAAQ,GAAGjB,qBAAqB,CACnCkB,OAAO,CAAEC,CAAC,IAAKA,C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AACrE,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAkD,GAAG,MAAAA,CAChEb,UAAU,EACVC,UAAU,EACVrD,MAAM,EACNkE,OAAO,KACJ;EACH,IAAIlE,MAAM,KAAK,WAAW,EAAE;IAC1B,OAAOmD,6BAA6B,CAClCC,UAAU,EACVC,UAAU,EACVrD,MAAM,EACNkE,OACF,CAAC;EACH,CAAC,MAAM,IAAIlE,MAAM,KAAK,cAAc,EAAE;IACpC,OAAO4D,4BAA4B,CACjCR,UAAU,EACVC,UAAU,EACVrD,MAAM,EACNkE,OACF,CAAC;EACH;EAEA,MAAM3D,CAAQ,GAAGP,MAAM;EACvB,MAAM,IAAIjB,aAAa,CAAE,kCAAiCwB,CAAE,EAAC,CAAC;AAChE,CAAC"}
1
+ {"version":3,"names":["IoWalletError","SdJwt4VC","verify","verifySdJwt","parseCredentialSdJwt","credentials_supported","_ref","_credentials_supporte","sdJwt","disclosures","ignoreMissingAttributes","arguments","length","undefined","credentialSubject","find","c","format","credential_definition","type","includes","payload","expected","flatMap","_","join","attrDefinitions","Object","entries","attrsNotInDisclosures","filter","_ref2","attrKey","mandatory","some","_ref3","name","missing","map","received","definedValues","fromEntries","_ref4","_disclosures$find","definition","value","_ref5","display","reduce","names","_ref6","locale","undefinedValues","keys","_ref7","key","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","getPublicKey","cnf","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","_ref8","credentialCryptoContext","decoded","openid_credential_issuer","jwks","parsedCredential","verifyAndParseCredentialMdoc","_issuerConf","_credential","_ctx","Error","verifyAndParseCredential","context"],"sourceRoot":"../../../../src","sources":["credential/issuance/07-verify-and-parse-credential.ts"],"mappings":"AAGA,SAASA,aAAa,QAAQ,oBAAoB;AAClD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,MA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"}
@@ -1,3 +1,4 @@
1
+ import { fixBase64EncodingOnKey } from "./utils/jwk";
1
2
  // polyfill due to known bugs on URL implementation for react native
2
3
  // https://github.com/facebook/react-native/issues/24428
3
4
  import "react-native-url-polyfill/auto";
@@ -7,7 +8,8 @@ import * as SdJwt from "./sd-jwt";
7
8
  import * as Errors from "./utils/errors";
8
9
  import * as WalletInstanceAttestation from "./wallet-instance-attestation";
9
10
  import * as Trust from "./trust";
11
+ import * as WalletInstance from "./wallet-instance";
10
12
  import { AuthorizationDetail, AuthorizationDetails } from "./utils/par";
11
13
  import { createCryptoContextFor } from "./utils/crypto";
12
- export { SdJwt, PID, Credential, WalletInstanceAttestation, Errors, Trust, createCryptoContextFor, AuthorizationDetail, AuthorizationDetails };
14
+ export { SdJwt, PID, Credential, WalletInstanceAttestation, WalletInstance, Errors, Trust, createCryptoContextFor, AuthorizationDetail, AuthorizationDetails, fixBase64EncodingOnKey };
13
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Credential","PID","SdJwt","Errors","WalletInstanceAttestation","Trust","AuthorizationDetail","AuthorizationDetails","createCryptoContextFor"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA;AACA;AACA,OAAO,gCAAgC;AAEvC,OAAO,KAAKA,UAAU,MAAM,cAAc;AAC1C,OAAO,KAAKC,GAAG,MAAM,OAAO;AAC5B,OAAO,KAAKC,KAAK,MAAM,UAAU;AACjC,OAAO,KAAKC,MAAM,MAAM,gBAAgB;AACxC,OAAO,KAAKC,yBAAyB,MAAM,+BAA+B;AAC1E,OAAO,KAAKC,KAAK,MAAM,SAAS;AAChC,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,aAAa;AACvE,SAASC,sBAAsB,QAAQ,gBAAgB;AAEvD,SACEN,KAAK,EACLD,GAAG,EACHD,UAAU,EACVI,yBAAyB,EACzBD,MAAM,EACNE,KAAK,EACLG,sBAAsB,EACtBF,mBAAmB,EACnBC,oBAAoB"}
1
+ {"version":3,"names":["fixBase64EncodingOnKey","Credential","PID","SdJwt","Errors","WalletInstanceAttestation","Trust","WalletInstance","AuthorizationDetail","AuthorizationDetails","createCryptoContextFor"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAASA,sBAAsB,QAAQ,aAAa;AACpD;AACA;AACA,OAAO,gCAAgC;AAEvC,OAAO,KAAKC,UAAU,MAAM,cAAc;AAC1C,OAAO,KAAKC,GAAG,MAAM,OAAO;AAC5B,OAAO,KAAKC,KAAK,MAAM,UAAU;AACjC,OAAO,KAAKC,MAAM,MAAM,gBAAgB;AACxC,OAAO,KAAKC,yBAAyB,MAAM,+BAA+B;AAC1E,OAAO,KAAKC,KAAK,MAAM,SAAS;AAChC,OAAO,KAAKC,cAAc,MAAM,mBAAmB;AACnD,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,aAAa;AACvE,SAASC,sBAAsB,QAAQ,gBAAgB;AAGvD,SACEP,KAAK,EACLD,GAAG,EACHD,UAAU,EACVI,yBAAyB,EACzBE,cAAc,EACdH,MAAM,EACNE,KAAK,EACLI,sBAAsB,EACtBF,mBAAmB,EACnBC,oBAAoB,EACpBT,sBAAsB"}
@@ -1 +1 @@
1
- {"version":3,"names":["sha256ToBase64","ValidationFailed","verifyDisclosure","_ref","claims","encoded","decoded","hash","includes"],"sourceRoot":"../../../src","sources":["sd-jwt/verifier.ts"],"mappings":"AAAA,SAASA,cAAc,QAAQ,6BAA6B;AAE5D,SAASC,gBAAgB,QAAQ,iBAAiB;AAGlD,OAAO,MAAMC,gBAAgB,GAAG,MAAAA,CAAAC,IAAA,EAE9BC,MAAoC,KACjC;EAAA,IAFH;IAAEC,OAAO;IAAEC;EAA+B,CAAC,GAAAH,IAAA;EAG3C,IAAII,IAAI,GAAG,MAAMP,cAAc,CAACK,OAAO,CAAC;EACxC,IAAI,CAACD,MAAM,CAACI,QAAQ,CAACD,IAAI,CAAC,EAAE;IAC1B,MAAM,IAAIN,gBAAgB,CACxB,iCAAiC,EAChC,GAAEK,OAAQ,EAAC,EACZ,qCACF,CAAC;EACH;AACF,CAAC"}
1
+ {"version":3,"names":["sha256ToBase64","ValidationFailed","verifyDisclosure","_ref","claims","encoded","decoded","hash","includes"],"sourceRoot":"../../../src","sources":["sd-jwt/verifier.js"],"mappings":"AAAA,SAASA,cAAc,QAAQ,6BAA6B;AAC5D,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,OAAO,MAAMC,gBAAgB,GAAG,MAAAA,CAAAC,IAAA,EAA6BC,MAAM,KAAK;EAAA,IAAjC;IAAEC,OAAO;IAAEC;EAAQ,CAAC,GAAAH,IAAA;EACzD,IAAII,IAAI,GAAG,MAAMP,cAAc,CAACK,OAAO,CAAC;EACxC,IAAI,CAACD,MAAM,CAACI,QAAQ,CAACD,IAAI,CAAC,EAAE;IAC1B,MAAM,IAAIN,gBAAgB,CACxB,iCAAiC,EAChC,GAAEK,OAAQ,EAAC,EACZ,qCACF,CAAC;EACH;AACF,CAAC"}
@@ -218,4 +218,31 @@ export class PidMetadataError extends Error {
218
218
  super(message);
219
219
  }
220
220
  }
221
+
222
+ /**
223
+ * An error subclass thrown when a Wallet Provider http request fail
224
+ *
225
+ */
226
+ export class WalletProviderResponseError extends IoWalletError {
227
+ static get code() {
228
+ return "ERR_IO_WALLET_PROVIDER_RESPONSE_FAILED";
229
+ }
230
+ code = "ERR_IO_WALLET_PROVIDER_RESPONSE_FAILED";
231
+
232
+ /** The Claim for which the validation failed. */
233
+
234
+ /** Reason code for the validation failure. */
235
+
236
+ constructor(message) {
237
+ let claim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
238
+ let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
239
+ super(serializeAttrs({
240
+ message,
241
+ claim,
242
+ reason
243
+ }));
244
+ this.claim = claim;
245
+ this.reason = reason;
246
+ }
247
+ }
221
248
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAc,GAAIC,KAAsC,IAC5DC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAClBG,GAAG,CAACC,IAAA;EAAA,IAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,GAAAF,IAAA;EAAA,OAAK,CAACC,CAAC,EAAEE,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,GAAI,IAAGA,CAAC,CAACG,IAAI,CAAC,IAAI,CAAE,GAAE,GAAGH,CAAC,CAAC;AAAA,EAAC,CAChEH,GAAG,CAAEO,CAAC,IAAKA,CAAC,CAACD,IAAI,CAAC,GAAG,CAAC,CAAC,CACvBA,IAAI,CAAC,GAAG,CAAC;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,aAAa,SAASC,KAAK,CAAC;EACvC;EACA,WAAWC,IAAIA,CAAA,EAAW;IACxB,OAAO,uBAAuB;EAChC;;EAEA;EACAA,IAAI,GAAW,uBAAuB;EAEtCC,WAAWA,CAACC,OAAgB,EAAE;IAAA,IAAAC,qBAAA;IAC5B,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,IAAI,CAACH,WAAW,CAACG,IAAI;IACjC;IACA,CAAAD,qBAAA,GAAAJ,KAAK,CAACM,iBAAiB,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,KAAK,EAAqB,IAAI,EAAE,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WA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;EAChB;AACF"}
1
+ {"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError","WalletProviderResponseError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAc,GAAIC,KAAsC,IAC5DC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAClBG,GAAG,CAACC,IAAA;EAAA,IAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,GAAAF,IAAA;EAAA,OAAK,CAACC,CAAC,EAAEE,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,GAAI,IAAGA,CAAC,CAACG,IAAI,CAAC,IAAI,CAAE,GAAE,GAAGH,CAAC,CAAC;AAAA,EAAC,CAChEH,GAAG,CAAEO,CAAC,IAAKA,CAAC,CAACD,IAAI,CAAC,GAAG,CAAC,CAAC,CACvBA,IAAI,CAAC,GAAG,CAAC;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,aAAa,SAASC,KAAK,CAAC;EACvC;EACA,WAAWC,IAAIA,CAAA,EAAW;IACxB,OAAO,uBAAuB;EAChC;;EAEA;EACAA,IAAI,GAAW,uBAAuB;EAEtCC,WAAWA,CAACC,OAAgB,EAAE;IAAA,IAAAC,qBAAA;IAC5B,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,IAAI,CAACH,WAAW,CAACG,IAAI;IACjC;IACA,CAAAD,qBAAA,GAA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,gBAAgB,SAASvB,KAAK,CAAC;EAC1C,WAAWC,IAAIA,CAAA,EAAyB;IACtC,OAAO,oBAAoB;EAC7B;EAEAC,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;EAChB;AACF;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMqB,2BAA2B,SAASzB,aAAa,CAAC;EAC7D,WAAWE,IAAIA,CAAA,EAA6C;IAC1D,OAAO,wCAAwC;EACjD;EAEAA,IAAI,GAAG,wCAAwC;;EAE/C;;EAGA;;EAGAC,WAAWA,CACTC,OAAe,EAGf;IAAA,IAFAM,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,CAACvB,cAAc,CAAC;MAAEgB,OAAO;MAAEM,KAAK;MAAEI;IAAO,CAAC,CAAC,CAAC;IACjD,IAAI,CAACJ,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACI,MAAM,GAAGA,MAAM;EACtB;AACF"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=integrity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["utils/integrity.ts"],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import { getWalletProviderClient } from "../client";
2
+ export async function createWalletInstance(context) {
3
+ const {
4
+ integrityContext
5
+ } = context;
6
+ const api = getWalletProviderClient(context);
7
+
8
+ //1. Obtain nonce
9
+ const challenge = await api.get("/nonce").then(response => response.nonce);
10
+ const keyAttestation = await integrityContext.getAttestation(challenge);
11
+ const hardwareKeyTag = integrityContext.getHardwareKeyTag();
12
+
13
+ //2. Create Wallet Instance
14
+ await api.post("/wallet-instances", {
15
+ body: {
16
+ challenge,
17
+ key_attestation: keyAttestation,
18
+ hardware_key_tag: hardwareKeyTag
19
+ }
20
+ });
21
+ return hardwareKeyTag;
22
+ }
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getWalletProviderClient","createWalletInstance","context","integrityContext","api","challenge","get","then","response","nonce","keyAttestation","getAttestation","hardwareKeyTag","getHardwareKeyTag","post","body","key_attestation","hardware_key_tag"],"sourceRoot":"../../../src","sources":["wallet-instance/index.ts"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,WAAW;AAGnD,OAAO,eAAeC,oBAAoBA,CAACC,OAI1C,EAAE;EACD,MAAM;IAAEC;EAAiB,CAAC,GAAGD,OAAO;EAEpC,MAAME,GAAG,GAAGJ,uBAAuB,CAACE,OAAO,CAAC;;EAE5C;EACA,MAAMG,SAAS,GAAG,MAAMD,GAAG,CAACE,GAAG,CAAC,QAAQ,CAAC,CAACC,IAAI,CAAEC,QAAQ,IAAKA,QAAQ,CAACC,KAAK,CAAC;EAE5E,MAAMC,cAAc,GAAG,MAAMP,gBAAgB,CAACQ,cAAc,CAACN,SAAS,CAAC;EACvE,MAAMO,cAAc,GAAGT,gBAAgB,CAACU,iBAAiB,CAAC,CAAC;;EAE3D;EACA,MAAMT,GAAG,CAACU,IAAI,CAAC,mBAAmB,EAAE;IAClCC,IAAI,EAAE;MACJV,SAAS;MACTW,eAAe,EAAEN,cAAc;MAC/BO,gBAAgB,EAAEL;IACpB;EACF,CAAC,CAAC;EAEF,OAAOA,cAAc;AACvB"}
@@ -1,11 +1,18 @@
1
- import { decode as decodeJwt } from "@pagopa/io-react-native-jwt";
2
- import { verify as verifyJwt } from "@pagopa/io-react-native-jwt";
3
1
  import { SignJWT, thumbprint } from "@pagopa/io-react-native-jwt";
4
2
  import { JWK, fixBase64EncodingOnKey } from "../utils/jwk";
5
- import { WalletInstanceAttestationRequestJwt } from "./types";
6
- import uuid from "react-native-uuid";
7
- import { WalletInstanceAttestationIssuingError } from "../utils/errors";
8
- async function getAttestationRequest(wiaCryptoContext, walletProviderEntityConfiguration) {
3
+ import { getWalletProviderClient } from "../client";
4
+ import { z } from "zod";
5
+
6
+ /**
7
+ * Getter for an attestation request. The attestation request is a JWT that will be sent to the Wallet Provider to request a Wallet Instance Attestation.
8
+ *
9
+ * @param challenge - The nonce received from the Wallet Provider which is part of the signed clientData
10
+ * @param wiaCryptoContext - The key pair associated with the WIA. Will be use to prove the ownership of the attestation
11
+ * @param integrityContext - The integrity context which exposes a set of functions to interact with the device integrity service
12
+ * @param walletProviderBaseUrl - Base url for the Wallet Provider
13
+ * @returns A JWT containing the attestation request
14
+ */
15
+ export async function getAttestationRequest(challenge, wiaCryptoContext, integrityContext, walletProviderBaseUrl) {
9
16
  const jwk = await wiaCryptoContext.getPublicKey();
10
17
  const parsedJwk = JWK.parse(jwk);
11
18
  const keyThumbprint = await thumbprint(parsedJwk);
@@ -13,50 +20,31 @@ async function getAttestationRequest(wiaCryptoContext, walletProviderEntityConfi
13
20
  ...parsedJwk,
14
21
  kid: keyThumbprint
15
22
  };
23
+ const clientData = {
24
+ challenge,
25
+ jwk_thumbprint: keyThumbprint
26
+ };
27
+ const hardwareKeyTag = integrityContext.getHardwareKeyTag();
28
+ const {
29
+ signature,
30
+ authenticatorData
31
+ } = await integrityContext.getHardwareSignatureWithAuthData(JSON.stringify(clientData));
16
32
  return new SignJWT(wiaCryptoContext).setPayload({
17
33
  iss: keyThumbprint,
18
- aud: walletProviderEntityConfiguration.payload.iss,
19
- jti: `${uuid.v4()}`,
20
- nonce: `${uuid.v4()}`,
34
+ sub: walletProviderBaseUrl,
35
+ challenge,
36
+ hardware_signature: signature,
37
+ integrity_assertion: authenticatorData,
38
+ hardware_key_tag: hardwareKeyTag,
21
39
  cnf: {
22
40
  jwk: fixBase64EncodingOnKey(publicKey)
23
41
  }
24
42
  }).setProtectedHeader({
25
43
  kid: publicKey.kid,
26
- typ: "wiar+jwt"
44
+ typ: "war+jwt"
27
45
  }).setIssuedAt().setExpirationTime("1h").sign();
28
46
  }
29
47
 
30
- /**
31
- * Validate a Wallet Instance Attestation token.
32
- * Either return true or throw an exception.
33
- *
34
- * @param wia Signed Wallet Instance Attestation token
35
- * @param walletProviderEntityConfiguration Entity Configuration object for the issuing Wallet Provider
36
- * @returns The token is valid
37
- * @throws {WalletInstanceAttestationIssuingError} When the received token fails to validate. This can happen due to invalid signature, expired token or malformed JWT token.
38
- */
39
- async function verifyWalletInstanceAttestation(wia, walletProviderEntityConfiguration) {
40
- const {
41
- payload: {
42
- sub,
43
- metadata: {
44
- wallet_provider: {
45
- jwks: {
46
- keys
47
- }
48
- }
49
- }
50
- }
51
- } = walletProviderEntityConfiguration;
52
- return verifyJwt(wia, keys, {
53
- issuer: sub
54
- }).then(_ => true).catch(ex => {
55
- const reason = ex && ex instanceof Error ? ex.message : "unknown reason";
56
- throw new WalletInstanceAttestationIssuingError("Unable to validate received wallet instance attestation", reason);
57
- });
58
- }
59
-
60
48
  /**
61
49
  * Request a Wallet Instance Attestation (WIA) to the Wallet provider
62
50
  *
@@ -65,38 +53,31 @@ async function verifyWalletInstanceAttestation(wia, walletProviderEntityConfigur
65
53
  * @param walletProviderBaseUrl Base url for the Wallet Provider
66
54
  * @returns The retrieved Wallet Instance Attestation token
67
55
  */
68
- export const getAttestation = _ref => {
56
+ export const getAttestation = async _ref => {
69
57
  let {
70
58
  wiaCryptoContext,
59
+ integrityContext,
60
+ walletProviderBaseUrl,
71
61
  appFetch = fetch
72
62
  } = _ref;
73
- return async walletProviderEntityConfiguration => {
74
- const signedAttestationRequest = await getAttestationRequest(wiaCryptoContext, walletProviderEntityConfiguration);
75
- const decodedRequest = decodeJwt(signedAttestationRequest);
76
- const parsedRequest = WalletInstanceAttestationRequestJwt.parse({
77
- payload: decodedRequest.payload,
78
- header: decodedRequest.protectedHeader
79
- });
80
- const publicKey = parsedRequest.payload.cnf.jwk;
81
- await verifyJwt(signedAttestationRequest, publicKey);
82
- const tokenUrl = walletProviderEntityConfiguration.payload.metadata.wallet_provider.token_endpoint;
83
- const requestBody = {
84
- grant_type: "urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation",
63
+ const api = getWalletProviderClient({
64
+ walletProviderBaseUrl,
65
+ appFetch
66
+ });
67
+
68
+ // 1. Get nonce from backend
69
+ const challenge = await api.get("/nonce").then(response => response.nonce);
70
+
71
+ // 2. Get a signed attestation request
72
+ const signedAttestationRequest = await getAttestationRequest(challenge, wiaCryptoContext, integrityContext, walletProviderBaseUrl);
73
+
74
+ // 3. Request WIA
75
+ const wia = await api.post("/token", {
76
+ body: {
77
+ grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer",
85
78
  assertion: signedAttestationRequest
86
- };
87
- const response = await appFetch(tokenUrl, {
88
- method: "POST",
89
- headers: {
90
- "Content-Type": "application/json"
91
- },
92
- body: JSON.stringify(requestBody)
93
- });
94
- if (response.status !== 201) {
95
- throw new WalletInstanceAttestationIssuingError("Unable to obtain wallet instance attestation from wallet provider", `Response code: ${response.status}`);
96
79
  }
97
- const wia = await response.text();
98
- await verifyWalletInstanceAttestation(wia, walletProviderEntityConfiguration);
99
- return wia;
100
- };
80
+ }).then(result => z.string().parse(result));
81
+ return wia;
101
82
  };
102
83
  //# sourceMappingURL=issuing.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["decode","decodeJwt","verify","verifyJwt","SignJWT","thumbprint","JWK","fixBase64EncodingOnKey","WalletInstanceAttestationRequestJwt","uuid","WalletInstanceAttestationIssuingError","getAttestationRequest","wiaCryptoContext","walletProviderEntityConfiguration","jwk","getPublicKey","parsedJwk","parse","keyThumbprint","publicKey","kid","setPayload","iss","aud","payload","jti","v4","nonce","cnf","setProtectedHeader","typ","setIssuedAt","setExpirationTime","sign","verifyWalletInstanceAttestation","wia","sub","metadata","wallet_provider","jwks","keys","issuer","then","_","catch","ex","reason","Error","message","getAttestation","_ref","appFetch","fetch","signedAttestationRequest","decodedRequest","parsedRequest","header","protectedHeader","tokenUrl","token_endpoint","requestBody","grant_type","assertion","response","method","headers","body","JSON","stringify","status","text"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/issuing.ts"],"mappings":"AAAA,SAEEA,MAAM,IAAIC,SAAS,QACd,6BAA6B;AACpC,SAASC,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AACjE,SAASC,OAAO,EAAEC,UAAU,QAAQ,6BAA6B;AACjE,SAASC,GAAG,EAAEC,sBAAsB,QAAQ,cAAc;AAC1D,SAASC,mCAAmC,QAAQ,SAAS;AAC7D,OAAOC,IAAI,MAAM,mBAAmB;AACpC,SAASC,qCAAqC,QAAQ,iBAAiB;AAGvE,eAAeC,qBAAqBA,CAClCC,gBAA+B,EAC/BC,iCAAoE,EACnD;EACjB,MAAMC,GAAG,GAAG,MAAMF,gBAAgB,CAACG,YAAY,CAAC,CAAC;EACjD,MAAMC,SAAS,GAAGV,GAAG,CAACW,KAAK,CAACH,GAAG,CAAC;EAChC,MAAMI,aAAa,GAAG,MAAMb,UAAU,CAACW,SAAS,CAAC;EACjD,MAAMG,SAAS,GAAG;IAAE,GAAGH,SAAS;IAAEI,GAAG,EAAEF;EAAc,CAAC;EAEtD,OAAO,IAAId,OAAO,CAACQ,gBAAgB,CAAC,CACjCS,UAAU,CAAC;IACVC,GAAG,EAAEJ,aAAa;IAClBK,GAAG,EAAEV,iCAAiC,CAACW,OAAO,CAACF,GAAG;IAClDG,GAAG,EAAG,GAAEhB,IAAI,CAACiB,EAAE,CAAC,CAAE,EAAC;IACnBC,KAAK,EAAG,GAAElB,IAAI,CAACiB,EAAE,CAAC,CAAE,EAAC;IACrBE,GAAG,EAAE;MACHd,GAAG,EAAEP,sBAAsB,CAACY,SAAS;IACvC;EACF,CAAC,CAAC,CACDU,kBAAkB,CAAC;IAClBT,GAAG,EAAED,SAAS,CAACC,GAAG;IAClBU,GAAG,EAAE;EACP,CAAC,CAAC,CACDC,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,IAAI,CAAC,CACvBC,IAAI,CAAC,CAAC;AACX;;AAEA;AACA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C,CAACW,OAAO,CAACa,QAAQ,CAACC,eAAe,CAC/DqB,cAAc;IACnB,MAAMC,WAAW,GAAG;MAClBC,UAAU,EACR,oEAAoE;MACtEC,SAAS,EAAET;IACb,CAAC;IACD,MAAMU,QAAQ,GAAG,MAAMZ,QAAQ,CAACO,QAAQ,EAAE;MACxCM,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QACP,cAAc,EAAE;MAClB,CAAC;MACDC,IAAI,EAAEC,IAAI,CAACC,SAAS,CAACR,WAAW;IAClC,CAAC,CAAC;IAEF,IAAIG,QAAQ,CAACM,MAAM,KAAK,GAAG,EAAE;MAC3B,MAAM,IAAI3D,qCAAqC,CAC7C,mEAAmE,EAClE,kBAAiBqD,QAAQ,CAACM,MAAO,EACpC,CAAC;IACH;IAEA,MAAMlC,GAAG,GAAG,MAAM4B,QAAQ,CAACO,IAAI,CAAC,CAAC;IAEjC,MAAMpC,+BAA+B,CACnCC,GAAG,EACHtB,iCACF,CAAC;IAED,OAAOsB,GAAG;EACZ,CAAC;AAAA"}
1
+ {"version":3,"names":["SignJWT","thumbprint","JWK","fixBase64EncodingOnKey","getWalletProviderClient","z","getAttestationRequest","challenge","wiaCryptoContext","integrityContext","walletProviderBaseUrl","jwk","getPublicKey","parsedJwk","parse","keyThumbprint","publicKey","kid","clientData","jwk_thumbprint","hardwareKeyTag","getHardwareKeyTag","signature","authenticatorData","getHardwareSignatureWithAuthData","JSON","stringify","setPayload","iss","sub","hardware_signature","integrity_assertion","hardware_key_tag","cnf","setProtectedHeader","typ","setIssuedAt","setExpirationTime","sign","getAttestation","_ref","appFetch","fetch","api","get","then","response","nonce","signedAttestationRequest","wia","post","body","grant_type","assertion","result","string"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/issuing.ts"],"mappings":"AACA,SAASA,OAAO,EAAEC,UAAU,QAAQ,6BAA6B;AACjE,SAASC,GAAG,EAAEC,sBAAsB,QAAQ,cAAc;AAC1D,SAASC,uBAAuB,QAAQ,WAAW;A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ACA;AACA,OAAO,MAAMC,cAAc,GAAG,MAAAC,IAAA,IAUP;EAAA,IAVc;IACnChC,gBAAgB;IAChBC,gBAAgB;IAChBC,qBAAqB;IACrB+B,QAAQ,GAAGC;EAMb,CAAC,GAAAF,IAAA;EACC,MAAMG,GAAG,GAAGvC,uBAAuB,CAAC;IAClCM,qBAAqB;IACrB+B;EACF,CAAC,CAAC;;EAEF;EACA,MAAMlC,SAAS,GAAG,MAAMoC,GAAG,CAACC,GAAG,CAAC,QAAQ,CAAC,CAACC,IAAI,CAAEC,QAAQ,IAAKA,QAAQ,CAACC,KAAK,CAAC;;EAE5E;EACA,MAAMC,wBAAwB,GAAG,MAAM1C,qBAAqB,CAC1DC,SAAS,EACTC,gBAAgB,EAChBC,gBAAgB,EAChBC,qBACF,CAAC;;EAED;EACA,MAAMuC,GAAG,GAAG,MAAMN,GAAG,CAClBO,IAAI,CAAC,QAAQ,EAAE;IACdC,IAAI,EAAE;MACJC,UAAU,EAAE,6CAA6C;MACzDC,SAAS,EAAEL;IACb;EACF,CAAC,CAAC,CACDH,IAAI,CAAES,MAAM,IAAKjD,CAAC,CAACkD,MAAM,CAAC,CAAC,CAACzC,KAAK,CAACwC,MAAM,CAAC,CAAC;EAE7C,OAAOL,GAAG;AACZ,CAAC"}
@@ -24,7 +24,7 @@ const Jwt = z.object({
24
24
  });
25
25
  export const WalletInstanceAttestationRequestJwt = z.object({
26
26
  header: z.intersection(Jwt.shape.header, z.object({
27
- typ: z.literal("wiar+jwt")
27
+ typ: z.literal("war+jwt")
28
28
  })),
29
29
  payload: z.intersection(Jwt.shape.payload, z.object({
30
30
  aud: z.string(),
@@ -1 +1 @@
1
- {"version":3,"names":["JWK","z","UnixTime","number","min","max","Jwt","object","header","alg","string","kid","typ","x5c","array","optional","trust_chain","payload","iss","iat","exp","cnf","jwk","intersection","WalletInstanceAttestationRequestJwt","shape","literal","aud","jti","nonce","WalletInstanceAttestationJwt","sub","attested_security_context","authorization_endpoint","response_types_supported","vp_formats_supported","jwt_vp_json","alg_values_supported","jwt_vc_json","request_object_signing_alg_values_supported","presentation_definition_uri_supported","boolean"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/types.ts"],"mappings":"AAAA,SAASA,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,CAAC,MAAM,KAAK;AAExB,MAAMC,QAAQ,GAAGD,CAAC,CAACE,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,aAAa,CAAC;AAGrD,MAAMC,GAAG,GAAGL,CAAC,CAACM,MAAM,CAAC;EACnBC,MAAM,EAAEP,CAAC,CAACM,MAAM,CAAC;IACfE,GAAG,EAAER,CAAC,CAACS,MAAM,CAAC,CAAC;IACfC,GAAG,EAAEV,CAAC,CAACS,MAAM,CAAC,CAAC;IACfE,GAAG,EAAEX,CAAC,CAACS,MAAM,CAAC,CAAC;IACfG,GAAG,EAAEZ,CAAC,CAACa,KAAK,CAACb,CAAC,CAACS,MAAM,CAAC,CAAC,CAAC,CAACK,QAAQ,CAAC,CAAC;IACnCC,WAAW,EAAEf,CAAC,CAACa,KAAK,CAACb,CAAC,CAACS,MAAM,CAAC,CAAC,CAAC,CAACK,QAAQ,CAAC;EAC5C,CAAC,CAAC;EACFE,OAAO,EAAEhB,CAAC,CAACM,MAAM,CAAC;IAChBW,GAAG,EAAEjB,CAAC,CAACS,MAAM,CAAC,CAAC;IACfS,GAAG,EAAEjB,QAAQ;IACbkB,GAAG,EAAElB,QAAQ;IACbmB,GAAG,EAAEpB,CAAC,CAACM,MAAM,CAAC;MACZe,GAAG,EAAErB,CAAC,CAACsB,YAAY,CACjBvB,GAAG;MACH;MACAC,CAAC,CAACM,MAAM,CAAC;QAAEI,GAAG,EAAEV,CAAC,CAACS,MAAM,CAAC;MAAE,CAAC,CAC9B;IACF,CAAC;EACH,CAAC;AACH,CAAC,CAAC;AAKF,OAAO,MAAMc,mCAAmC,GAAGvB,CAAC,CAACM,MAAM,CAAC;EA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b,CAAC,CAACS,MAAM,CAAC,CAAC;MAC1C,CAAC,CAAC;MACF4B,WAAW,EAAErC,CAAC,CAACM,MAAM,CAAC;QACpB8B,oBAAoB,EAAEpC,CAAC,CAACa,KAAK,CAACb,CAAC,CAACS,MAAM,CAAC,CAAC;MAC1C,CAAC;IACH,CAAC,CAAC;IACF6B,2CAA2C,EAAEtC,CAAC,CAACa,KAAK,CAACb,CAAC,CAACS,MAAM,CAAC,CAAC,CAAC;IAChE8B,qCAAqC,EAAEvC,CAAC,CAACwC,OAAO,CAAC;EACnD,CAAC,CACH;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["JWK","z","UnixTime","number","min","max","Jwt","object","header","alg","string","kid","typ","x5c","array","optional","trust_chain","payload","iss","iat","exp","cnf","jwk","intersection","WalletInstanceAttestationRequestJwt","shape","literal","aud","jti","nonce","WalletInstanceAttestationJwt","sub","attested_security_context","authorization_endpoint","response_types_supported","vp_formats_supported","jwt_vp_json","alg_values_supported","jwt_vc_json","request_object_signing_alg_values_supported","presentation_definition_uri_supported","boolean"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/types.ts"],"mappings":"AAAA,SAASA,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,CAAC,MAAM,KAAK;AAExB,MAAMC,QAAQ,GAAGD,CAAC,CAACE,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,aAAa,CAAC;AAGrD,MAAMC,GAAG,GAAGL,CAAC,CAACM,MAAM,CAAC;EACnBC,MAAM,EAAEP,CAAC,CAACM,MAAM,CAAC;IACfE,GAAG,EAAER,CAAC,CAACS,MAAM,CAAC,CAAC;IACfC,GAAG,EAAEV,CAAC,CAACS,MAAM,CAAC,CAAC;IACfE,GAAG,EAAEX,CAAC,CAACS,MAAM,CAAC,CAAC;IACfG,GAAG,EAAEZ,CAAC,CAACa,KAAK,CAACb,CAAC,CAACS,MAAM,CAAC,CAAC,CAAC,CAACK,QAAQ,C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