@pagopa/io-react-native-wallet 0.5.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. package/README.md +52 -19
  2. package/lib/commonjs/index.js +34 -18
  3. package/lib/commonjs/index.js.map +1 -1
  4. package/lib/commonjs/pid/issuing.js +22 -28
  5. package/lib/commonjs/pid/issuing.js.map +1 -1
  6. package/lib/commonjs/rp/__test__/index.test.js +2 -2
  7. package/lib/commonjs/rp/__test__/index.test.js.map +1 -1
  8. package/lib/commonjs/rp/index.js +5 -19
  9. package/lib/commonjs/rp/index.js.map +1 -1
  10. package/lib/commonjs/rp/types.js +1 -21
  11. package/lib/commonjs/rp/types.js.map +1 -1
  12. package/lib/commonjs/trust/index.js +24 -5
  13. package/lib/commonjs/trust/index.js.map +1 -1
  14. package/lib/commonjs/trust/types.js +95 -4
  15. package/lib/commonjs/trust/types.js.map +1 -1
  16. package/lib/commonjs/wallet-instance-attestation/issuing.js +5 -13
  17. package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
  18. package/lib/module/index.js +3 -5
  19. package/lib/module/index.js.map +1 -1
  20. package/lib/module/pid/issuing.js +16 -23
  21. package/lib/module/pid/issuing.js.map +1 -1
  22. package/lib/module/rp/__test__/index.test.js +2 -2
  23. package/lib/module/rp/__test__/index.test.js.map +1 -1
  24. package/lib/module/rp/index.js +2 -17
  25. package/lib/module/rp/index.js.map +1 -1
  26. package/lib/module/rp/types.js +0 -20
  27. package/lib/module/rp/types.js.map +1 -1
  28. package/lib/module/trust/index.js +19 -5
  29. package/lib/module/trust/index.js.map +1 -1
  30. package/lib/module/trust/types.js +94 -2
  31. package/lib/module/trust/types.js.map +1 -1
  32. package/lib/module/wallet-instance-attestation/issuing.js +5 -13
  33. package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
  34. package/lib/typescript/index.d.ts +3 -5
  35. package/lib/typescript/index.d.ts.map +1 -1
  36. package/lib/typescript/pid/issuing.d.ts +3 -12
  37. package/lib/typescript/pid/issuing.d.ts.map +1 -1
  38. package/lib/typescript/rp/index.d.ts +4 -12
  39. package/lib/typescript/rp/index.d.ts.map +1 -1
  40. package/lib/typescript/rp/types.d.ts +4 -1256
  41. package/lib/typescript/rp/types.d.ts.map +1 -1
  42. package/lib/typescript/trust/index.d.ts +806 -3
  43. package/lib/typescript/trust/index.d.ts.map +1 -1
  44. package/lib/typescript/trust/types.d.ts +8637 -5
  45. package/lib/typescript/trust/types.d.ts.map +1 -1
  46. package/lib/typescript/wallet-instance-attestation/issuing.d.ts +2 -1
  47. package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
  48. package/lib/typescript/wallet-instance-attestation/types.d.ts +4 -4
  49. package/package.json +1 -1
  50. package/src/index.ts +19 -10
  51. package/src/pid/issuing.ts +24 -30
  52. package/src/rp/__test__/index.test.ts +2 -2
  53. package/src/rp/index.ts +8 -22
  54. package/src/rp/types.ts +0 -24
  55. package/src/trust/index.ts +106 -5
  56. package/src/trust/types.ts +114 -3
  57. package/src/wallet-instance-attestation/issuing.ts +10 -15
  58. package/lib/commonjs/pid/metadata.js +0 -52
  59. package/lib/commonjs/pid/metadata.js.map +0 -1
  60. package/lib/module/pid/metadata.js +0 -44
  61. package/lib/module/pid/metadata.js.map +0 -1
  62. package/lib/typescript/pid/metadata.d.ts +0 -1412
  63. package/lib/typescript/pid/metadata.d.ts.map +0 -1
  64. package/src/pid/metadata.ts +0 -51
@@ -1,11 +1,10 @@
1
1
  import { AuthRequestDecodeError, IoWalletError, NoSuitableKeysFoundInEntityConfiguration } from "../utils/errors";
2
2
  import { decode as decodeJwt, decodeBase64, sha256ToBase64, SignJWT, EncryptJwe, verify } from "@pagopa/io-react-native-jwt";
3
- import { QRCodePayload, RequestObject, RpEntityConfiguration } from "./types";
3
+ import { QRCodePayload, RequestObject } from "./types";
4
4
  import uuid from "react-native-uuid";
5
5
  import { disclose } from "../sd-jwt";
6
- import { getEntityConfiguration as getGenericEntityConfiguration } from "../trust";
7
6
  import { createDPopToken } from "../utils/dpop";
8
- import { WalletInstanceAttestation } from "..";
7
+ import * as WalletInstanceAttestation from "../wallet-instance-attestation";
9
8
 
10
9
  /**
11
10
  * Select a RSA public key from those provided by the RP to encrypt.
@@ -24,20 +23,6 @@ const chooseRSAPublicKeyToEncrypt = entity => {
24
23
  throw new NoSuitableKeysFoundInEntityConfiguration("Encrypt with RP public key");
25
24
  };
26
25
 
27
- /**
28
- * Obtain the relying party entity configuration.
29
- */
30
- export const getEntityConfiguration = function () {
31
- let {
32
- appFetch = fetch
33
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
34
- return async relyingPartyBaseUrl => {
35
- return getGenericEntityConfiguration(relyingPartyBaseUrl, {
36
- appFetch: appFetch
37
- }).then(RpEntityConfiguration.parse);
38
- };
39
- };
40
-
41
26
  /**
42
27
  * Decode a QR code content to an authentication request url.
43
28
  * @function
@@ -1 +1 @@
1
- {"version":3,"names":["AuthRequestDecodeError","IoWalletError","NoSuitableKeysFoundInEntityConfiguration","decode","decodeJwt","decodeBase64","sha256ToBase64","SignJWT","EncryptJwe","verify","QRCodePayload","RequestObject","RpEntityConfiguration","uuid","disclose","getEntityConfiguration","getGenericEntityConfiguration","createDPopToken","WalletInstanceAttestation","chooseRSAPublicKeyToEncrypt","entity","usingRsa256","payload","metadata","wallet_relying_party","jwks","filter","jwk","use","kty","appFetch","fetch","arguments","length","undefined","relyingPartyBaseUrl","then","parse","decodeAuthRequestQR","qrcode","decoded","decodedUrl","URL","protocol","resource","hostname","requestURI","searchParams","get","clientId","result","safeParse","success","data","error","message","getRequestObject","_ref","wiaCryptoContext","walletInstanceAttestation","requestUri","rpEntityConfiguration","signedWalletInstanceDPoP","jti","v4","htm","htu","ath","response","method","headers","Authorization","DPoP","status","responseJson","json","responseEncodedJwt","responseJwt","pubKey","find","_ref2","kid","protectedHeader","requestObject","header","text","prepareVpToken","_ref3","pidCryptoContext","_ref4","_ref5","vc","claims","token","vp","paths","iss","pidKid","getPublicKey","_","vp_token","setProtectedHeader","typ","setPayload","nonce","setAudience","response_uri","setIssuedAt","setExpirationTime","sign","vc_scope","scope","presentation_submission","definition_id","id","descriptor_map","map","p","path","format","sendAuthorizationResponse","_ref6","_ref7","presentation","authzResponsePayload","JSON","stringify","state","encrypted","alg","enc","encrypt","formBody","URLSearchParams","body","toString"],"sourceRoot":"../../../src","sources":["rp/index.ts"],"mappings":"AAAA,SACEA,sBAAsB,EACtBC,aAAa,EACbC,wCAAwC,QACnC,iBAAiB;AACxB,SACEC,MAAM,IAAIC,SAAS,EACnBC,YAAY,EACZC,cAAc,EACdC,OAAO,EACPC,UAAU,EACVC,MAAM,QAED,6BAA6B;AACpC,SACEC,aAAa,EACbC,aAAa,EACbC,qBAAqB,QAEhB,SAAS;AAEhB,OAAOC,IAAI,MAAM,mBAAmB;AAEpC,SAASC,QAAQ,QAAQ,WAAW;AACpC,SAASC,sBAAsB,IAAIC,6BAA6B,QAAQ,UAAU;AAClF,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAASC,yBAAyB,QAAQ,IAAI;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,2BAA2B,GAAIC,MAA6B,IAAU;EAC1E,MAAM,CAACC,WAAW,CAAC,GACjBD,MAAM,CAACE,OAAO,CAACC,QAAQ,CAACC,oBAAoB,CAACC,IAAI,CAACC,MAAM,CACrDC,GAAG,IAAKA,GAAG,CAACC,GAAG,KAAK,KAAK,IAAID,GAAG,CAACE,GAAG,KAAK,KAC5C,CAAC;EAEH,IAAIR,WAAW,EAAE;IACf,OAAOA,WAAW;EACpB;;EAEA;EACA,MAAM,IAAInB,wCAAwC,CAChD,4BACF,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMa,sBAAsB,GACjC,SAAAA,CAAA;EAAA,IAAC;IAAEe,QAAQ,GAAGC;EAA2C,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EA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E;MAC3DK,GAAG,EAAE,cAAc;MACnBC,GAAG,EAAE,eAAe;MACpBjD,GAAG,EAAEtD,GAAG,CAACsD;IACX,CAAC,CAAC,CAACkD,OAAO,CAACxG,GAAG,CAAC;IAEf,MAAMyG,QAAQ,GAAG,IAAIC,eAAe,CAAC;MAAEjE,QAAQ,EAAE4D;IAAU,CAAC,CAAC;IAC7D,MAAMM,IAAI,GAAGF,QAAQ,CAACG,QAAQ,CAAC,CAAC;IAEhC,MAAMnE,QAAQ,GAAG,MAAMtC,QAAQ,CAACqD,aAAa,CAAC7D,OAAO,CAACoF,YAAY,EAAE;MAClErC,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QACP,cAAc,EAAE;MAClB,CAAC;MACDgE;IACF,CAAC,CAAC;IAEF,IAAIlE,QAAQ,CAACK,MAAM,KAAK,GAAG,EAAE;MAC3B,OAAO,MAAML,QAAQ,CAACO,IAAI,CAAC,CAAC;IAC9B;IAEA,MAAM,IAAI1E,aAAa,CACpB,oDAAmD,MAAMmE,QAAQ,CAACiB,IAAI,CAAC,CAAE,eACxEjB,QAAQ,CAACK,MACV,EACH,CAAC;EACH,CAAC;AAAA"}
1
+ {"version":3,"names":["AuthRequestDecodeError","IoWalletError","NoSuitableKeysFoundInEntityConfiguration","decode","decodeJwt","decodeBase64","sha256ToBase64","SignJWT","EncryptJwe","verify","QRCodePayload","RequestObject","uuid","disclose","createDPopToken","WalletInstanceAttestation","chooseRSAPublicKeyToEncrypt","entity","usingRsa256","payload","metadata","wallet_relying_party","jwks","filter","jwk","use","kty","decodeAuthRequestQR","qrcode","decoded","decodedUrl","URL","protocol","resource","hostname","requestURI","searchParams","get","clientId","result","safeParse","success","data","error","message","getRequestObject","_ref","wiaCryptoContext","appFetch","fetch","walletInstanceAttestation","requestUri","rpEntityConfiguration","signedWalletInstanceDPoP","jti","v4","htm","htu","ath","response","method","headers","Authorization","DPoP","status","responseJson","json","responseEncodedJwt","responseJwt","pubKey","find","_ref2","kid","protectedHeader","requestObject","parse","header","text","prepareVpToken","_ref3","pidCryptoContext","_ref4","_ref5","vc","claims","token","vp","paths","iss","pidKid","getPublicKey","then","_","vp_token","setProtectedHeader","typ","setPayload","nonce","setAudience","response_uri","setIssuedAt","setExpirationTime","sign","vc_scope","scope","presentation_submission","definition_id","id","descriptor_map","map","p","path","format","sendAuthorizationResponse","_ref6","_ref7","presentation","authzResponsePayload","JSON","stringify","state","encrypted","alg","enc","encrypt","formBody","URLSearchParams","body","toString"],"sourceRoot":"../../../src","sources":["rp/index.ts"],"mappings":"AAAA,SACEA,sBAAsB,EACtBC,aAAa,EACbC,wCAAwC,QACnC,iBAAiB;AACxB,SACEC,MAAM,IAAIC,SAAS,EACnBC,YAAY,EACZC,cAAc,EACdC,OAAO,EACPC,UAAU,EACVC,MAAM,QAED,6BAA6B;AACpC,SAASC,aAAa,EAAEC,aAAa,QAA2B,SAAS;AAEzE,OAAOC,IAAI,MAAM,mBAAmB;AAEpC,SAASC,QAAQ,QAAQ,WAAW;AACpC,SAASC,eAAe,QAAQ,eAAe;AAE/C,OAAO,KAAKC,yBAAyB,MAAM,gCAAgC;;AAE3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,2BAA2B,GAC/BC,MAAuC,IAC/B;EACR,MAAM,CAACC,WAAW,CAAC,GACjBD,MAAM,CAACE,OAAO,CAACC,QAAQ,CAACC,oBAAoB,CAACC,IAAI,CAACC,MAAM,CACrDC,GAAG,IAAKA,GAAG,CAACC,GAAG,KAAK,KAAK,IAAID,GAAG,CAACE,GAAG,KAAK,KAC5C,CAAC;EAEH,IAAIR,WAAW,EAAE;IACf,OAAOA,WAAW;EACpB;;EAEA;EACA,MAAM,IAAIhB,wCAAwC,CAChD,4BACF,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMyB,mBAAmB,GAAIC,MAAc,IAAoB;EACpE,MAAMC,OAAO,GAAGxB,YAAY,CAACuB,MAAM,CAAC;E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,CAAC0B,aAAa,CAACvD,OAAO,CAACgF,YAAY,EAAE;MAClEvC,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QACP,cAAc,EAAE;MAClB,CAAC;MACDkE;IACF,CAAC,CAAC;IAEF,IAAIpE,QAAQ,CAACK,MAAM,KAAK,GAAG,EAAE;MAC3B,OAAO,MAAML,QAAQ,CAACO,IAAI,CAAC,CAAC;IAC9B;IAEA,MAAM,IAAIjE,aAAa,CACpB,oDAAmD,MAAM0D,QAAQ,CAACkB,IAAI,CAAC,CAAE,eACxElB,QAAQ,CAACK,MACV,EACH,CAAC;EACH,CAAC;AAAA"}
@@ -1,7 +1,5 @@
1
- import { JWK } from "../utils/jwk";
2
1
  import { UnixTime } from "../sd-jwt/types";
3
2
  import * as z from "zod";
4
- import { EntityConfiguration } from "../trust/types";
5
3
  export const RequestObject = z.object({
6
4
  header: z.object({
7
5
  // FIXME: SIW-421 type field must be either required or omitted, optional isn't useful
@@ -24,24 +22,6 @@ export const RequestObject = z.object({
24
22
  scope: z.string()
25
23
  })
26
24
  });
27
-
28
- /**
29
- * EntityConfiguration plus the metadata specific for a Relying Party entity.
30
- */
31
-
32
- export const RpEntityConfiguration = EntityConfiguration.and(z.object({
33
- payload: z.object({
34
- metadata: z.object({
35
- wallet_relying_party: z.object({
36
- application_type: z.string().optional(),
37
- client_id: z.string().optional(),
38
- client_name: z.string().optional(),
39
- jwks: z.array(JWK),
40
- contacts: z.array(z.string()).optional()
41
- }).passthrough()
42
- })
43
- })
44
- }));
45
25
  export const QRCodePayload = z.object({
46
26
  protocol: z.string(),
47
27
  resource: z.string(),
@@ -1 +1 @@
1
- {"version":3,"names":["JWK","UnixTime","z","EntityConfiguration","RequestObject","object","header","typ","literal","optional","alg","string","kid","trust_chain","array","payload","iss","iat","exp","state","nonce","response_uri","response_type","response_mode","client_id","client_id_scheme","scope","RpEntityConfiguration","and","metadata","wallet_relying_party","application_type","client_name","jwks","contacts","passthrough","QRCodePayload","protocol","resource","clientId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B,mBAAmB,CAACyB,GAAG,CAC1D1B,CAAC,CAACG,MAAM,CAAC;EACPU,OAAO,EAAEb,CAAC,CAACG,MAAM,CAAC;IAChBwB,QAAQ,EAAE3B,CAAC,CAACG,MAAM,CAAC;MACjByB,oBAAoB,EAAE5B,CAAC,CACpBG,MAAM,CAAC;QACN0B,gBAAgB,EAAE7B,CAAC,CAACS,MAAM,CAAC,CAAC,CAACF,QAAQ,CAAC,CAAC;QACvCe,SAAS,EAAEtB,CAAC,CAACS,MAAM,CAAC,CAAC,CAACF,QAAQ,CAAC,CAAC;QAChCuB,WAAW,EAAE9B,CAAC,CAACS,MAAM,CAAC,CAAC,CAACF,QAAQ,CAAC,CAAC;QAClCwB,IAAI,EAAE/B,CAAC,CAACY,KAAK,CAACd,GAAG,CAAC;QAClBkC,QAAQ,EAAEhC,CAAC,CAACY,KAAK,CAACZ,CAAC,CAACS,MAAM,CAAC,CAAC,CAAC,CAACF,QAAQ,CAAC;MACzC,CAAC,CAAC,CACD0B,WAAW,CAAC;IACjB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;AAGD,OAAO,MAAMC,aAAa,GAAGlC,CAAC,CAACG,MAAM,CAAC;EACpCgC,QAAQ,EAAEnC,CAAC,CAACS,MAAM,CAAC,CAAC;EACpB2B,QAAQ,EAAEpC,CAAC,CAACS,MAAM,CAAC,CAAC;EAAE;EACtB4B,QAAQ,EAAErC,CAAC,CAACS,MAAM,CAAC,CAAC;EACpB6B,UAAU,EAAEtC,CAAC,CAACS,MAAM,CAAC;AACvB,CAAC,CAAC;;AAEF;AACA;AACA"}
1
+ {"version":3,"names":["UnixTime","z","RequestObject","object","header","typ","literal","optional","alg","string","kid","trust_chain","array","payload","iss","iat","exp","state","nonce","response_uri","response_type","response_mode","client_id","client_id_scheme","scope","QRCodePayload","protocol","resource","clientId","requestURI"],"sourceRoot":"../../../src","sources":["rp/types.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,OAAO,K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AACQ,MAAM,CAAC,CAAC;EACpBoB,UAAU,EAAE5B,CAAC,CAACQ,MAAM,CAAC;AACvB,CAAC,CAAC;;AAEF;AACA;AACA"}
@@ -1,22 +1,31 @@
1
1
  import { decode as decodeJwt } from "@pagopa/io-react-native-jwt";
2
- import { EntityConfiguration } from "./types";
2
+ import { WalletProviderEntityConfiguration, TrustAnchorEntityConfiguration, CredentialIssuerEntityConfiguration, RelyingPartyEntityConfiguration, EntityConfiguration } from "./types";
3
3
  import { IoWalletError } from "../utils/errors";
4
4
  import { verifyTrustChain } from "./chain";
5
5
  export { verifyTrustChain };
6
6
 
7
7
  /**
8
- * Fetch and parse teh entity configuration document for a given federation entity
8
+ * Fetch and parse the entity configuration document for a given federation entity.
9
+ * This is an inner method to serve public interfaces.
10
+ *
11
+ * To add another entity configuration type (example: Foo entity type):
12
+ * - create its zod schema and type by inherit from the base type (example: FooEntityConfiguration = BaseEntityConfiguration.and(...))
13
+ * - add such type to EntityConfiguration union
14
+ * - add an overload to this function
15
+ * - create a public function which use such type (example: getFooEntityConfiguration = (url, options) => Promise<FooEntityConfiguration>)
9
16
  *
10
17
  * @param entityBaseUrl The base url of the entity.
18
+ * @param schema The expected schema of the entity configuration, according to the kind of entity we are fetching from.
11
19
  * @param options.appFetch An optional instance of the http client to be used.
12
20
  * @returns The parsed entity configuration object
13
21
  * @throws {IoWalletError} If the http request fails
14
22
  * @throws Parse error if the document is not in the expected shape.
15
23
  */
16
- export async function getEntityConfiguration(entityBaseUrl) {
24
+
25
+ async function fetchAndParseEntityConfiguration(entityBaseUrl, schema) {
17
26
  let {
18
27
  appFetch = fetch
19
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
28
+ } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
20
29
  const wellKnownUrl = `${entityBaseUrl}/.well-known/openid-federation`;
21
30
  const response = await appFetch(wellKnownUrl, {
22
31
  method: "GET"
@@ -24,11 +33,16 @@ export async function getEntityConfiguration(entityBaseUrl) {
24
33
  if (response.status === 200) {
25
34
  const responseText = await response.text();
26
35
  const responseJwt = decodeJwt(responseText);
27
- return EntityConfiguration.parse({
36
+ return schema.parse({
28
37
  header: responseJwt.protectedHeader,
29
38
  payload: responseJwt.payload
30
39
  });
31
40
  }
32
41
  throw new IoWalletError(`Unable to obtain Entity Configuration at ${wellKnownUrl}. Response code: ${response.status}`);
33
42
  }
43
+ export const getWalletProviderEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, WalletProviderEntityConfiguration, options);
44
+ export const getCredentialIssuerEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, CredentialIssuerEntityConfiguration, options);
45
+ export const getTrustAnchorEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, TrustAnchorEntityConfiguration, options);
46
+ export const getRelyingPartyEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, RelyingPartyEntityConfiguration, options);
47
+ export const getEntityConfiguration = (entityBaseUrl, options) => fetchAndParseEntityConfiguration(entityBaseUrl, EntityConfiguration, options);
34
48
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["decode","decodeJwt","EntityConfiguration","IoWalletError","verifyTrustChain","getEntityConfiguration","entityBaseUrl","appFetch","fetch","arguments","length","undefined","wellKnownUrl","response","method","status","responseText","text","responseJwt","parse","header","protectedHeader","payload"],"sourceRoot":"../../../src","sources":["trust/index.ts"],"mappings":"AAAA,SAASA,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AACjE,SAASC,mBAAmB,QAAQ,SAAS;AAC7C,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,gBAAgB,QAAQ,SAAS;AAE1C,SAASA,gBAAgB;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,sBAAsBA,CAC1CC,aAAqB,EAMS;EAAA,IAL9B;IACEC,QAAQ,GAAGC;EAGb,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAEN,MAAMG,YAAY,GAAI,GAAEN,aAAc,gCAA+B;EAErE,MAAMO,QAAQ,GAAG,MAAMN,QAAQ,CAACK,YAAY,EAAE;IAC5CE,MAAM,EAAE;EACV,CAAC,CAAC;EAEF,IAAID,QAAQ,CAACE,MAAM,KAAK,GAAG,EAAE;IAC3B,MAAMC,YAAY,GAAG,MAAMH,QAAQ,CAACI,IAAI,CAAC,CAAC;IAC1C,MAAMC,WAAW,GAAGjB,SAAS,CAACe,YAAY,CAAC;IAC3C,OAAOd,mBAAmB,CAACiB,KAAK,CAAC;MAC/BC,MAAM,EAAEF,WAAW,CAACG,eAAe;MACnCC,OAAO,EAAEJ,WAAW,CAACI;IACvB,CAAC,CAAC;EACJ;EAEA,MAAM,IAAInB,aAAa,CACpB,4CAA2CS,YAAa,oBAAmBC,QAAQ,CAACE,MAAO,EAC9F,CAAC;AACH"}
1
+ {"version":3,"names":["decode","decodeJwt","WalletProviderEntityConfiguration","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","RelyingPartyEntityConfiguration","EntityConfiguration","IoWalletError","verifyTrustChain","fetchAndParseEntityConfiguration","entityBaseUrl","schema","appFetch","fetch","arguments","length","undefined","wellKnownUrl","response","method","status","responseText","text","responseJwt","parse","header","protectedHeader","payload","getWalletProviderEntityConfiguration","options","getCredentialIssuerEntityConfiguration","getTrustAnchorEntityConfiguration","getRelyingPartyEntityConfiguration","getEntityConfiguration"],"sourceRoot":"../../../src","sources":["trust/index.ts"],"mappings":"AAAA,SAASA,MAAM,IAAIC,SAAS,QAAQ,6BAA6B;AACjE,SACEC,iCAAiC,EACjCC,8BAA8B,EAC9BC,mCAAmC,EACnCC,+BAA+B,EAC/BC,mBAAmB,QACd,SAAS;AAChB,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,g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BAA8B,EAC9B0B,OACF,CAAC;AAEH,OAAO,MAAMG,kCAAkC,GAAGA,CAChDtB,aAAqE,EACrEmB,OAAgE,KAEhEpB,gCAAgC,CAC9BC,aAAa,EACbL,+BAA+B,EAC/BwB,OACF,CAAC;AAEH,OAAO,MAAMI,sBAAsB,GAAGA,CACpCvB,aAAqE,EACrEmB,OAAgE,KAEhEpB,gCAAgC,CAACC,aAAa,EAAEJ,mBAAmB,EAAEuB,OAAO,CAAC"}
@@ -5,6 +5,28 @@ export const TrustMark = z.object({
5
5
  id: z.string(),
6
6
  trust_mark: z.string()
7
7
  });
8
+
9
+ // Display metadata for a credential, used by the issuer to
10
+ // instruct the Wallet Solution on how to render the credential correctly
11
+ const CredentialDisplayMetadata = z.object({
12
+ name: z.string(),
13
+ locale: z.string(),
14
+ logo: z.object({
15
+ url: z.string(),
16
+ alt_text: z.string()
17
+ }),
18
+ background_color: z.string(),
19
+ text_color: z.string()
20
+ });
21
+
22
+ // Metadata for a credentia which i supported by a Issuer
23
+
24
+ const SupportedCredentialMetadata = z.object({
25
+ format: z.literal("vc+sd-jwt"),
26
+ cryptographic_binding_methods_supported: z.array(z.string()),
27
+ cryptographic_suites_supported: z.array(z.string()),
28
+ display: z.array(CredentialDisplayMetadata)
29
+ });
8
30
  export const EntityStatement = z.object({
9
31
  header: z.object({
10
32
  typ: z.literal("entity-statement+jwt"),
@@ -27,7 +49,9 @@ export const EntityConfigurationHeader = z.object({
27
49
  alg: z.string(),
28
50
  kid: z.string()
29
51
  });
30
- export const EntityConfiguration = z.object({
52
+
53
+ // Structuire common to every Entity Configuration document
54
+ const BaseEntityConfiguration = z.object({
31
55
  header: EntityConfigurationHeader,
32
56
  payload: z.object({
33
57
  exp: UnixTime,
@@ -53,5 +77,73 @@ export const EntityConfiguration = z.object({
53
77
  authority_hints: z.array(z.string()).optional()
54
78
  }).passthrough()
55
79
  });
56
- export const TrustAnchorEntityConfiguration = EntityConfiguration;
80
+
81
+ // Entity configuration for a Trust Anchor (it has no specific metadata section)
82
+
83
+ export const TrustAnchorEntityConfiguration = BaseEntityConfiguration;
84
+
85
+ // Entity configuration for a Credential Issuer
86
+
87
+ export const CredentialIssuerEntityConfiguration = BaseEntityConfiguration.and(z.object({
88
+ payload: z.object({
89
+ jwks: z.object({
90
+ keys: z.array(JWK)
91
+ }),
92
+ metadata: z.object({
93
+ openid_credential_issuer: z.object({
94
+ credential_issuer: z.string(),
95
+ authorization_endpoint: z.string(),
96
+ token_endpoint: z.string(),
97
+ pushed_authorization_request_endpoint: z.string(),
98
+ dpop_signing_alg_values_supported: z.array(z.string()),
99
+ credential_endpoint: z.string(),
100
+ credentials_supported: z.array(SupportedCredentialMetadata),
101
+ jwks: z.object({
102
+ keys: z.array(JWK)
103
+ })
104
+ })
105
+ })
106
+ })
107
+ }));
108
+
109
+ // Entity configuration for a Wallet Provider
110
+
111
+ export const WalletProviderEntityConfiguration = BaseEntityConfiguration.and(z.object({
112
+ payload: z.object({
113
+ metadata: z.object({
114
+ wallet_provider: z.object({
115
+ token_endpoint: z.string(),
116
+ attested_security_context_values_supported: z.array(z.string()).optional(),
117
+ grant_types_supported: z.array(z.string()),
118
+ token_endpoint_auth_methods_supported: z.array(z.string()),
119
+ token_endpoint_auth_signing_alg_values_supported: z.array(z.string()),
120
+ jwks: z.object({
121
+ keys: z.array(JWK)
122
+ })
123
+ }).passthrough()
124
+ })
125
+ })
126
+ }));
127
+
128
+ // Entity configuration for a Relying Party
129
+
130
+ export const RelyingPartyEntityConfiguration = BaseEntityConfiguration.and(z.object({
131
+ payload: z.object({
132
+ metadata: z.object({
133
+ wallet_relying_party: z.object({
134
+ application_type: z.string().optional(),
135
+ client_id: z.string().optional(),
136
+ client_name: z.string().optional(),
137
+ jwks: z.array(JWK),
138
+ contacts: z.array(z.string()).optional()
139
+ }).passthrough()
140
+ })
141
+ })
142
+ }));
143
+
144
+ // Maps any entity configuration by the union of every possible shapes
145
+
146
+ export const EntityConfiguration = z.union([WalletProviderEntityConfiguration, CredentialIssuerEntityConfiguration, TrustAnchorEntityConfiguration, RelyingPartyEntityConfiguration], {
147
+ description: "Any kind of Entity Configuration allowed in the ecosystem"
148
+ });
57
149
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["UnixTime","JWK","z","TrustMark","object","id","string","trust_mark","EntityStatement","header","typ","literal","alg","kid","payload","iss","sub","jwks","keys","array","trust_marks","iat","number","exp","EntityConfigurationHeader","EntityConfiguration","metadata","federation_entity","federation_fetch_endpoint","optional","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","homepage_uri","policy_uri","logo_uri","contacts","passthrough","authority_hints","TrustAnchorEntityConfiguration"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,CAAC,MAAM,KAAK;AAExB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAAEC,EAAE,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EAAEC,UAAU,EAAEL,CAAC,CAACI,MAAM,CAAC;AAAE,CAAC,CAAC;AAI7E,OAAO,MAAME,eAAe,GAAGN,CAAC,CAACE,MAAM,CAAC;EACtCK,MAAM,EAAEP,CAAC,CAACE,MAAM,CAAC;IACfM,GAAG,EAAER,CAAC,CAACS,OAAO,CAAC,sBAAsB,CAAC;IACtCC,GAAG,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC;IACfO,GAAG,EAAEX,CAAC,CAACI,MAAM,CAAC;EAChB,CAAC,CAAC;EACFQ,OAAO,EAAEZ,CAAC,CAACE,MAAM,CAAC;IAChBW,GAAG,EAAEb,CAAC,CAACI,MAAM,CAAC,CAAC;IACfU,GAAG,EAAEd,CAAC,CAACI,MAAM,CAAC,CAAC;IACfW,IAAI,EAAEf,CAAC,CAACE,MAAM,CAAC;MAAEc,IAAI,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AqC,EAAE9B,CAAC,CAACI,MAAM,CAAC,CAAC,CAACuB,QAAQ,CAAC,CAAC;QAC5DI,mCAAmC,EAAE/B,CAAC,CAACI,MAAM,CAAC,CAAC,CAACuB,QAAQ,CAAC,CAAC;QAC1DK,YAAY,EAAEhC,CAAC,CAACI,MAAM,CAAC,CAAC,CAACuB,QAAQ,CAAC,CAAC;QACnCM,UAAU,EAAEjC,CAAC,CAACI,MAAM,CAAC,CAAC,CAACuB,QAAQ,CAAC,CAAC;QACjCO,QAAQ,EAAElC,CAAC,CAACI,MAAM,CAAC,CAAC,CAACuB,QAAQ,CAAC,CAAC;QAC/BQ,QAAQ,EAAEnC,CAAC,CAACiB,KAAK,CAACjB,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC,CAACuB,QAAQ,CAAC;MACzC,CAAC,CAAC,CACDS,WAAW,CAAC;IACjB,CAAC,CAAC,CACDA,WAAW,CAAC,CAAC;IAChBC,eAAe,EAAErC,CAAC,CAACiB,KAAK,CAACjB,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC,CAACuB,QAAQ,CAAC;EAChD,CAAC,CAAC,CACDS,WAAW,CAAC;AACjB,CAAC,CAAC;AAKF,OAAO,MAAME,8BAA8B,GAAGf,mBAAmB"}
1
+ {"version":3,"names":["UnixTime","JWK","z","TrustMark","object","id","string","trust_mark","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","SupportedCredentialMetadata","format","literal","cryptographic_binding_methods_supported","array","cryptographic_suites_supported","display","EntityStatement","header","typ","alg","kid","payload","iss","sub","jwks","keys","trust_marks","iat","number","exp","EntityConfigurationHeader","BaseEntityConfiguration","metadata","federation_entity","federation_fetch_endpoint","optional","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","homepage_uri","policy_uri","logo_uri","contacts","passthrough","authority_hints","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","authorization_endpoint","token_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","credential_endpoint","credentials_supported","WalletProviderEntityConfiguration","wallet_provider","attested_security_context_values_supported","grant_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","RelyingPartyEntityConfiguration","wallet_relying_party","application_type","client_id","client_name","EntityConfiguration","union","description"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,CAAC,MAAM,KAAK;AAExB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAAEC,EAAE,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EAAEC,UAAU,EAAEL,CAAC,CAACI,MAAM,CAAC;AAAE,CAAC,CAAC;;AAG7E;AACA;AAEA,MAAME,yBAAyB,GAAGN,CAAC,CAACE,MAAM,CAAC;EACzCK,IAAI,EAAEP,CAAC,CAACI,MAAM,CAAC,CAAC;EAChBI,MAAM,EAAER,CAAC,CAACI,MAAM,CAAC,CAAC;EAClBK,IAAI,EAAET,CAAC,CAACE,MAAM,CAAC;IACbQ,GAAG,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC;IACfO,QAAQ,EAAEX,CAAC,CAACI,MAAM,CAAC;EACrB,CAAC,CAAC;EACFQ,gBAAgB,EAAEZ,CAAC,CAACI,MAAM,CAAC,CAAC;EAC5BS,UAAU,EAAEb,CAAC,CAACI,MAAM,CAAC;AACvB,CAAC,CAAC;;AAEF;;AAEA,MAAMU,2BAA2B,GAAGd,CAAC,CAACE,MAAM,CAAC;EAC3Ca,MAAM,EAAEf,CAAC,CAACgB,OAAO,CAAC,WAAW,CAAC;EAC9BC,uCAAuC,EAAEjB,CAAC,CAACkB,KAAK,CAAClB,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC;EAC5De,8BAA8B,EAAEnB,CAAC,CAACkB,KAAK,CAAClB,CAAC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,CAAC,CAAC;QAClCX,IAAI,EAAE7B,CAAC,CAACkB,KAAK,CAACnB,GAAG,CAAC;QAClBiD,QAAQ,EAAEhD,CAAC,CAACkB,KAAK,CAAClB,CAAC,CAACI,MAAM,CAAC,CAAC,CAAC,CAACoC,QAAQ,CAAC;MACzC,CAAC,CAAC,CACDS,WAAW,CAAC;IACjB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;;AAED;;AAEA,OAAO,MAAMwB,mBAAmB,GAAGzE,CAAC,CAAC0E,KAAK,CACxC,CACEZ,iCAAiC,EACjCV,mCAAmC,EACnCD,8BAA8B,EAC9BiB,+BAA+B,CAChC,EACD;EACEO,WAAW,EAAE;AACf,CACF,CAAC"}
@@ -5,7 +5,7 @@ import { JWK, fixBase64EncodingOnKey } from "../utils/jwk";
5
5
  import { WalletInstanceAttestationRequestJwt } from "./types";
6
6
  import uuid from "react-native-uuid";
7
7
  import { WalletInstanceAttestationIssuingError } from "../utils/errors";
8
- async function getAttestationRequest(wiaCryptoContext, walletProviderBaseUrl) {
8
+ async function getAttestationRequest(wiaCryptoContext, walletProviderEntityConfiguration) {
9
9
  const jwk = await wiaCryptoContext.getPublicKey();
10
10
  const parsedJwk = JWK.parse(jwk);
11
11
  const keyThumbprint = await thumbprint(parsedJwk);
@@ -15,7 +15,7 @@ async function getAttestationRequest(wiaCryptoContext, walletProviderBaseUrl) {
15
15
  };
16
16
  return new SignJWT(wiaCryptoContext).setPayload({
17
17
  iss: keyThumbprint,
18
- aud: walletProviderBaseUrl,
18
+ aud: walletProviderEntityConfiguration.payload.iss,
19
19
  jti: `${uuid.v4()}`,
20
20
  nonce: `${uuid.v4()}`,
21
21
  cnf: {
@@ -24,14 +24,6 @@ async function getAttestationRequest(wiaCryptoContext, walletProviderBaseUrl) {
24
24
  }).setProtectedHeader({
25
25
  kid: publicKey.kid,
26
26
  typ: "wiar+jwt"
27
- }).setPayload({
28
- iss: keyThumbprint,
29
- sub: walletProviderBaseUrl,
30
- jti: `${uuid.v4()}`,
31
- type: "WalletInstanceAttestationRequest",
32
- cnf: {
33
- jwk: fixBase64EncodingOnKey(publicKey)
34
- }
35
27
  }).setIssuedAt().setExpirationTime("1h").sign();
36
28
  }
37
29
 
@@ -48,8 +40,8 @@ export const getAttestation = _ref => {
48
40
  wiaCryptoContext,
49
41
  appFetch = fetch
50
42
  } = _ref;
51
- return async walletProviderBaseUrl => {
52
- const signedAttestationRequest = await getAttestationRequest(wiaCryptoContext, walletProviderBaseUrl);
43
+ return async walletProviderEntityConfiguration => {
44
+ const signedAttestationRequest = await getAttestationRequest(wiaCryptoContext, walletProviderEntityConfiguration);
53
45
  const decodedRequest = decodeJwt(signedAttestationRequest);
54
46
  const parsedRequest = WalletInstanceAttestationRequestJwt.parse({
55
47
  payload: decodedRequest.payload,
@@ -57,7 +49,7 @@ export const getAttestation = _ref => {
57
49
  });
58
50
  const publicKey = parsedRequest.payload.cnf.jwk;
59
51
  await verifyJwt(signedAttestationRequest, publicKey);
60
- const tokenUrl = new URL("token", walletProviderBaseUrl).href;
52
+ const tokenUrl = walletProviderEntityConfiguration.payload.metadata.wallet_provider.token_endpoint;
61
53
  const requestBody = {
62
54
  grant_type: "urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation",
63
55
  assertion: signedAttestationRequest
@@ -1 +1 @@
1
- {"version":3,"names":["decode","decodeJwt","verify","verifyJwt","SignJWT","thumbprint","JWK","fixBase64EncodingOnKey","WalletInstanceAttestationRequestJwt","uuid","WalletInstanceAttestationIssuingError","getAttestationRequest","wiaCryptoContext","walletProviderBaseUrl","jwk","getPublicKey","parsedJwk","parse","keyThumbprint","publicKey","kid","setPayload","iss","aud","jti","v4","nonce","cnf","setProtectedHeader","typ","sub","type","setIssuedAt","setExpirationTime","sign","getAttestation","_ref","appFetch","fetch","signedAttestationRequest","decodedRequest","parsedRequest","payload","header","protectedHeader","tokenUrl","URL","href","requestBody","grant_type","assertion","response","method","headers","body","JSON","stringify","status","text"],"sourceRoot":"../../../src","s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,CAACO,IAAI,CAAC,CAAC;IAC9B;IAEA,MAAM,IAAIhD,qCAAqC,CAC7C,mEAAmE,EAClE,kBAAiByC,QAAQ,CAACM,MAAO,EACpC,CAAC;EACH,CAAC;AAAA"}
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","getAttestation","_ref","appFetch","fetch","signedAttestationRequest","decodedRequest","parsedRequest","header","protectedHeader","tokenUrl","metadata","wallet_provider","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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C,WAAW,GAAG;MAClBC,UAAU,EACR,oEAAoE;MACtEC,SAAS,EAAEX;IACb,CAAC;IACD,MAAMY,QAAQ,GAAG,MAAMd,QAAQ,CAACO,QAAQ,EAAE;MACxCQ,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,OAAO,MAAMN,QAAQ,CAACO,IAAI,CAAC,CAAC;IAC9B;IAEA,MAAM,IAAI/C,qCAAqC,CAC7C,mEAAmE,EAClE,kBAAiBwC,QAAQ,CAACM,MAAO,EACpC,CAAC;EACH,CAAC;AAAA"}
@@ -4,10 +4,8 @@ import * as RP from "./rp";
4
4
  import * as Errors from "./utils/errors";
5
5
  import * as WalletInstanceAttestation from "./wallet-instance-attestation";
6
6
  import * as RelyingPartySolution from "./rp";
7
- import { RpEntityConfiguration } from "./rp/types";
8
- import { verifyTrustChain, getEntityConfiguration } from "./trust";
9
- import { EntityConfiguration, EntityStatement, TrustAnchorEntityConfiguration } from "./trust/types";
7
+ import { verifyTrustChain, getEntityConfiguration, getCredentialIssuerEntityConfiguration, getRelyingPartyEntityConfiguration, getTrustAnchorEntityConfiguration, getWalletProviderEntityConfiguration } from "./trust";
8
+ import { RelyingPartyEntityConfiguration, WalletProviderEntityConfiguration, TrustAnchorEntityConfiguration, CredentialIssuerEntityConfiguration } from "./trust/types";
10
9
  import { createCryptoContextFor } from "./utils/crypto";
11
- import { PidIssuerEntityConfiguration } from "./pid/metadata";
12
- export { PID, RP, WalletInstanceAttestation, Errors, RelyingPartySolution, verifyTrustChain, getEntityConfiguration, EntityConfiguration, EntityStatement, RpEntityConfiguration, PidIssuerEntityConfiguration, TrustAnchorEntityConfiguration, createCryptoContextFor, };
10
+ export { PID, RP, WalletInstanceAttestation, Errors, RelyingPartySolution, verifyTrustChain, getEntityConfiguration, getCredentialIssuerEntityConfiguration, getRelyingPartyEntityConfiguration, getTrustAnchorEntityConfiguration, getWalletProviderEntityConfiguration, createCryptoContextFor, RelyingPartyEntityConfiguration, WalletProviderEntityConfiguration, TrustAnchorEntityConfiguration, CredentialIssuerEntityConfiguration, };
13
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,gCAAgC,CAAC;AAExC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,yBAAyB,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,oBAAoB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,8BAA8B,EAC/B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAE9D,OAAO,EACL,GAAG,EACH,EAAE,EACF,yBAAyB,EACzB,MAAM,EACN,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,4BAA4B,EAC5B,8BAA8B,EAC9B,sBAAsB,GACvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,gCAAgC,CAAC;AAExC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,yBAAyB,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,oBAAoB,MAAM,MAAM,CAAC;AAC7C,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,sCAAsC,EACtC,kCAAkC,EAClC,iCAAiC,EACjC,oCAAoC,EACrC,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,+BAA+B,EAC/B,iCAAiC,EACjC,8BAA8B,EAC9B,mCAAmC,EACpC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EACL,GAAG,EACH,EAAE,EACF,yBAAyB,EACzB,MAAM,EACN,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,sCAAsC,EACtC,kCAAkC,EAClC,iCAAiC,EACjC,oCAAoC,EACpC,sBAAsB,EACtB,+BAA+B,EAC/B,iCAAiC,EACjC,8BAA8B,EAC9B,mCAAmC,GACpC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react-native" />
2
2
  import { type CryptoContext } from "@pagopa/io-react-native-jwt";
3
- import { PidIssuerEntityConfiguration } from "./metadata";
3
+ import { CredentialIssuerEntityConfiguration } from "../trust/types";
4
4
  export type CieData = {
5
5
  birthDate: string;
6
6
  fiscalCode: string;
@@ -21,15 +21,6 @@ export type PidResponse = {
21
21
  c_nonce_expires_in: number;
22
22
  format: string;
23
23
  };
24
- /**
25
- * Obtain the PID provider entity configuration.
26
- */
27
- export declare const getEntityConfiguration: ({ appFetch }?: {
28
- appFetch?: {
29
- (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
30
- (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
31
- } | undefined;
32
- }) => (relyingPartyBaseUrl: string) => Promise<PidIssuerEntityConfiguration>;
33
24
  /**
34
25
  * Start the issuing flow by generating an authorization request to the PID Provider. Obtain from the PID Provider an access token to be used to complete the issuing flow.
35
26
  *
@@ -46,7 +37,7 @@ export declare const authorizeIssuing: ({ wiaCryptoContext, appFetch, }: {
46
37
  (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
47
38
  (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
48
39
  } | undefined;
49
- }) => (walletInstanceAttestation: string, walletProviderBaseUrl: string, pidProviderEntityConfiguration: PidIssuerEntityConfiguration) => Promise<AuthorizationConf>;
40
+ }) => (walletInstanceAttestation: string, walletProviderBaseUrl: string, pidProviderEntityConfiguration: CredentialIssuerEntityConfiguration) => Promise<AuthorizationConf>;
50
41
  /**
51
42
  * Complete the issuing flow and get the PID credential.
52
43
  *
@@ -62,5 +53,5 @@ export declare const getCredential: ({ pidCryptoContext, appFetch, }: {
62
53
  (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
63
54
  (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
64
55
  } | undefined;
65
- }) => ({ nonce, accessToken, clientId, walletProviderBaseUrl }: AuthorizationConf, pidProviderEntityConfiguration: PidIssuerEntityConfiguration, cieData: CieData) => Promise<PidResponse>;
56
+ }) => ({ nonce, accessToken, clientId, walletProviderBaseUrl }: AuthorizationConf, pidProviderEntityConfiguration: CredentialIssuerEntityConfiguration, cieData: CieData) => Promise<PidResponse>;
66
57
  //# sourceMappingURL=issuing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"issuing.d.ts","sourceRoot":"","sources":["../../../src/pid/issuing.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,KAAK,aAAa,EAGnB,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAQ1D,MAAM,MAAM,OAAO,GAAG;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,i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AC;IACjB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAoGF;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB;sBAKP,aAAa;;;;;kCAIJ,MAAM,yBACV,MAAM,kCACG,mCAAmC,KAClE,QAAQ,iBAAiB,CAoE3B,CAAC;AA0BJ;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa;sBAKJ,aAAa;;;;;gEAI0B,iBAAiB,kCAC1C,mCAAmC,WAC1D,OAAO,KACf,QAAQ,WAAW,CAuDrB,CAAC"}
@@ -1,15 +1,7 @@
1
1
  /// <reference types="react-native" />
2
2
  import { type CryptoContext } from "@pagopa/io-react-native-jwt";
3
- import { QRCodePayload, RequestObject, RpEntityConfiguration, type Presentation } from "./types";
4
- /**
5
- * Obtain the relying party entity configuration.
6
- */
7
- export declare const getEntityConfiguration: ({ appFetch }?: {
8
- appFetch?: {
9
- (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
10
- (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
11
- } | undefined;
12
- }) => (relyingPartyBaseUrl: string) => Promise<RpEntityConfiguration>;
3
+ import { QRCodePayload, RequestObject, type Presentation } from "./types";
4
+ import { RelyingPartyEntityConfiguration } from "../trust/types";
13
5
  /**
14
6
  * Decode a QR code content to an authentication request url.
15
7
  * @function
@@ -21,7 +13,7 @@ export declare const getEntityConfiguration: ({ appFetch }?: {
21
13
  export declare const decodeAuthRequestQR: (qrcode: string) => QRCodePayload;
22
14
  export type RequestObjectConf = {
23
15
  requestObject: RequestObject;
24
- rpEntityConfiguration: RpEntityConfiguration;
16
+ rpEntityConfiguration: RelyingPartyEntityConfiguration;
25
17
  walletInstanceAttestation: string;
26
18
  };
27
19
  /**
@@ -34,7 +26,7 @@ export declare const getRequestObject: ({ wiaCryptoContext, appFetch, }: {
34
26
  (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
35
27
  (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
36
28
  } | undefined;
37
- }) => (walletInstanceAttestation: string, requestUri: string, rpEntityConfiguration: RpEntityConfiguration) => Promise<RequestObjectConf>;
29
+ }) => (walletInstanceAttestation: string, requestUri: string, rpEntityConfiguration: RelyingPartyEntityConfiguration) => Promise<RequestObjectConf>;
38
30
  /**
39
31
  * Compose and send an Authorization Response in the context of an authorization request flow.
40
32
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rp/index.ts"],"names":[],"mappings":";AAKA,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,KAAK,YAAY,EAClB,MAAM,SAAS,CAAC;AAgCjB;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;4BAEL,MAAM,KAAG,QAAQ,qBAAqB,CAIjE,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,WAAY,MAAM,KAAG,aAoBpD,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,aAAa,CAAC;IAC7B,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,yBAAyB,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB;sBAKP,aAAa;;;;;kCAIJ,MAAM,cACrB,MAAM,yBACK,qBAAqB,KAC3C,QAAQ,iBAAiB,CAyD3B,CAAC;AA2DJ;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;sBAKhB,aAAa;;;;;6EAQ5B,iBAAiB,iCAEnB,QAAQ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