@pagopa/io-react-native-wallet 0.4.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. package/README.md +128 -19
  2. package/lib/commonjs/index.js +16 -23
  3. package/lib/commonjs/index.js.map +1 -1
  4. package/lib/commonjs/pid/index.js +3 -8
  5. package/lib/commonjs/pid/index.js.map +1 -1
  6. package/lib/commonjs/pid/issuing.js +153 -176
  7. package/lib/commonjs/pid/issuing.js.map +1 -1
  8. package/lib/commonjs/rp/__test__/index.test.js +7 -5
  9. package/lib/commonjs/rp/__test__/index.test.js.map +1 -1
  10. package/lib/commonjs/rp/index.js +145 -155
  11. package/lib/commonjs/rp/index.js.map +1 -1
  12. package/lib/commonjs/rp/types.js +1 -21
  13. package/lib/commonjs/rp/types.js.map +1 -1
  14. package/lib/commonjs/trust/index.js +24 -5
  15. package/lib/commonjs/trust/index.js.map +1 -1
  16. package/lib/commonjs/trust/types.js +102 -9
  17. package/lib/commonjs/trust/types.js.map +1 -1
  18. package/lib/commonjs/utils/crypto.js +46 -0
  19. package/lib/commonjs/utils/crypto.js.map +1 -0
  20. package/lib/commonjs/utils/dpop.js +14 -7
  21. package/lib/commonjs/utils/dpop.js.map +1 -1
  22. package/lib/commonjs/wallet-instance-attestation/index.js +3 -3
  23. package/lib/commonjs/wallet-instance-attestation/issuing.js +42 -60
  24. package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
  25. package/lib/module/index.js +4 -6
  26. package/lib/module/index.js.map +1 -1
  27. package/lib/module/pid/index.js +1 -1
  28. package/lib/module/pid/index.js.map +1 -1
  29. package/lib/module/pid/issuing.js +152 -180
  30. package/lib/module/pid/issuing.js.map +1 -1
  31. package/lib/module/rp/__test__/index.test.js +3 -3
  32. package/lib/module/rp/__test__/index.test.js.map +1 -1
  33. package/lib/module/rp/index.js +141 -154
  34. package/lib/module/rp/index.js.map +1 -1
  35. package/lib/module/rp/types.js +0 -20
  36. package/lib/module/rp/types.js.map +1 -1
  37. package/lib/module/trust/index.js +19 -5
  38. package/lib/module/trust/index.js.map +1 -1
  39. package/lib/module/trust/types.js +100 -7
  40. package/lib/module/trust/types.js.map +1 -1
  41. package/lib/module/utils/crypto.js +40 -0
  42. package/lib/module/utils/crypto.js.map +1 -0
  43. package/lib/module/utils/dpop.js +13 -5
  44. package/lib/module/utils/dpop.js.map +1 -1
  45. package/lib/module/wallet-instance-attestation/index.js +2 -2
  46. package/lib/module/wallet-instance-attestation/index.js.map +1 -1
  47. package/lib/module/wallet-instance-attestation/issuing.js +40 -58
  48. package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
  49. package/lib/typescript/index.d.ts +4 -6
  50. package/lib/typescript/index.d.ts.map +1 -1
  51. package/lib/typescript/pid/index.d.ts +1 -1
  52. package/lib/typescript/pid/index.d.ts.map +1 -1
  53. package/lib/typescript/pid/issuing.d.ts +43 -88
  54. package/lib/typescript/pid/issuing.d.ts.map +1 -1
  55. package/lib/typescript/rp/index.d.ts +41 -87
  56. package/lib/typescript/rp/index.d.ts.map +1 -1
  57. package/lib/typescript/rp/types.d.ts +10 -906
  58. package/lib/typescript/rp/types.d.ts.map +1 -1
  59. package/lib/typescript/sd-jwt/index.d.ts +1 -1
  60. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  61. package/lib/typescript/trust/index.d.ts +806 -3
  62. package/lib/typescript/trust/index.d.ts.map +1 -1
  63. package/lib/typescript/trust/types.d.ts +9655 -297
  64. package/lib/typescript/trust/types.d.ts.map +1 -1
  65. package/lib/typescript/utils/crypto.d.ts +10 -0
  66. package/lib/typescript/utils/crypto.d.ts.map +1 -0
  67. package/lib/typescript/utils/dpop.d.ts +10 -2
  68. package/lib/typescript/utils/dpop.d.ts.map +1 -1
  69. package/lib/typescript/wallet-instance-attestation/index.d.ts +2 -2
  70. package/lib/typescript/wallet-instance-attestation/index.d.ts.map +1 -1
  71. package/lib/typescript/wallet-instance-attestation/issuing.d.ts +18 -31
  72. package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
  73. package/lib/typescript/wallet-instance-attestation/types.d.ts +4 -4
  74. package/package.json +2 -2
  75. package/src/index.ts +14 -13
  76. package/src/pid/index.ts +1 -1
  77. package/src/pid/issuing.ts +233 -232
  78. package/src/rp/__test__/index.test.ts +3 -3
  79. package/src/rp/index.ts +172 -194
  80. package/src/rp/types.ts +0 -24
  81. package/src/sd-jwt/index.ts +1 -1
  82. package/src/trust/index.ts +106 -5
  83. package/src/trust/types.ts +152 -34
  84. package/src/utils/crypto.ts +41 -0
  85. package/src/utils/dpop.ts +17 -7
  86. package/src/wallet-instance-attestation/index.ts +2 -2
  87. package/src/wallet-instance-attestation/issuing.ts +51 -63
  88. package/lib/commonjs/pid/metadata.js +0 -49
  89. package/lib/commonjs/pid/metadata.js.map +0 -1
  90. package/lib/module/pid/metadata.js +0 -41
  91. package/lib/module/pid/metadata.js.map +0 -1
  92. package/lib/typescript/pid/metadata.d.ts +0 -482
  93. package/lib/typescript/pid/metadata.d.ts.map +0 -1
  94. package/src/pid/metadata.ts +0 -46
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TrustMark = exports.TrustAnchorEntityConfiguration = exports.EntityStatement = exports.EntityConfiguration = void 0;
6
+ exports.WalletProviderEntityConfiguration = exports.TrustMark = exports.TrustAnchorEntityConfiguration = exports.RelyingPartyEntityConfiguration = exports.EntityStatement = exports.EntityConfigurationHeader = exports.EntityConfiguration = exports.CredentialIssuerEntityConfiguration = void 0;
7
7
  var _types = require("../sd-jwt/types");
8
8
  var _jwk = require("../utils/jwk");
9
9
  var z = _interopRequireWildcard(require("zod"));
@@ -13,7 +13,29 @@ const TrustMark = z.object({
13
13
  id: z.string(),
14
14
  trust_mark: z.string()
15
15
  });
16
+
17
+ // Display metadata for a credential, used by the issuer to
18
+ // instruct the Wallet Solution on how to render the credential correctly
16
19
  exports.TrustMark = TrustMark;
20
+ const CredentialDisplayMetadata = z.object({
21
+ name: z.string(),
22
+ locale: z.string(),
23
+ logo: z.object({
24
+ url: z.string(),
25
+ alt_text: z.string()
26
+ }),
27
+ background_color: z.string(),
28
+ text_color: z.string()
29
+ });
30
+
31
+ // Metadata for a credentia which i supported by a Issuer
32
+
33
+ const SupportedCredentialMetadata = z.object({
34
+ format: z.literal("vc+sd-jwt"),
35
+ cryptographic_binding_methods_supported: z.array(z.string()),
36
+ cryptographic_suites_supported: z.array(z.string()),
37
+ display: z.array(CredentialDisplayMetadata)
38
+ });
17
39
  const EntityStatement = z.object({
18
40
  header: z.object({
19
41
  typ: z.literal("entity-statement+jwt"),
@@ -32,12 +54,16 @@ const EntityStatement = z.object({
32
54
  })
33
55
  });
34
56
  exports.EntityStatement = EntityStatement;
35
- const EntityConfiguration = z.object({
36
- header: z.object({
37
- typ: z.literal("entity-statement+jwt"),
38
- alg: z.string(),
39
- kid: z.string()
40
- }),
57
+ const EntityConfigurationHeader = z.object({
58
+ typ: z.literal("entity-statement+jwt"),
59
+ alg: z.string(),
60
+ kid: z.string()
61
+ });
62
+
63
+ // Structuire common to every Entity Configuration document
64
+ exports.EntityConfigurationHeader = EntityConfigurationHeader;
65
+ const BaseEntityConfiguration = z.object({
66
+ header: EntityConfigurationHeader,
41
67
  payload: z.object({
42
68
  exp: _types.UnixTime,
43
69
  iat: _types.UnixTime,
@@ -60,9 +86,76 @@ const EntityConfiguration = z.object({
60
86
  }).passthrough()
61
87
  }).passthrough(),
62
88
  authority_hints: z.array(z.string()).optional()
89
+ }).passthrough()
90
+ });
91
+
92
+ // Entity configuration for a Trust Anchor (it has no specific metadata section)
93
+
94
+ const TrustAnchorEntityConfiguration = BaseEntityConfiguration;
95
+
96
+ // Entity configuration for a Credential Issuer
97
+ exports.TrustAnchorEntityConfiguration = TrustAnchorEntityConfiguration;
98
+ const CredentialIssuerEntityConfiguration = BaseEntityConfiguration.and(z.object({
99
+ payload: z.object({
100
+ jwks: z.object({
101
+ keys: z.array(_jwk.JWK)
102
+ }),
103
+ metadata: z.object({
104
+ openid_credential_issuer: z.object({
105
+ credential_issuer: z.string(),
106
+ authorization_endpoint: z.string(),
107
+ token_endpoint: z.string(),
108
+ pushed_authorization_request_endpoint: z.string(),
109
+ dpop_signing_alg_values_supported: z.array(z.string()),
110
+ credential_endpoint: z.string(),
111
+ credentials_supported: z.array(SupportedCredentialMetadata),
112
+ jwks: z.object({
113
+ keys: z.array(_jwk.JWK)
114
+ })
115
+ })
116
+ })
117
+ })
118
+ }));
119
+
120
+ // Entity configuration for a Wallet Provider
121
+ exports.CredentialIssuerEntityConfiguration = CredentialIssuerEntityConfiguration;
122
+ const WalletProviderEntityConfiguration = BaseEntityConfiguration.and(z.object({
123
+ payload: z.object({
124
+ metadata: z.object({
125
+ wallet_provider: z.object({
126
+ token_endpoint: z.string(),
127
+ attested_security_context_values_supported: z.array(z.string()).optional(),
128
+ grant_types_supported: z.array(z.string()),
129
+ token_endpoint_auth_methods_supported: z.array(z.string()),
130
+ token_endpoint_auth_signing_alg_values_supported: z.array(z.string()),
131
+ jwks: z.object({
132
+ keys: z.array(_jwk.JWK)
133
+ })
134
+ }).passthrough()
135
+ })
63
136
  })
137
+ }));
138
+
139
+ // Entity configuration for a Relying Party
140
+ exports.WalletProviderEntityConfiguration = WalletProviderEntityConfiguration;
141
+ const RelyingPartyEntityConfiguration = BaseEntityConfiguration.and(z.object({
142
+ payload: z.object({
143
+ metadata: z.object({
144
+ wallet_relying_party: z.object({
145
+ application_type: z.string().optional(),
146
+ client_id: z.string().optional(),
147
+ client_name: z.string().optional(),
148
+ jwks: z.array(_jwk.JWK),
149
+ contacts: z.array(z.string()).optional()
150
+ }).passthrough()
151
+ })
152
+ })
153
+ }));
154
+
155
+ // Maps any entity configuration by the union of every possible shapes
156
+ exports.RelyingPartyEntityConfiguration = RelyingPartyEntityConfiguration;
157
+ const EntityConfiguration = z.union([WalletProviderEntityConfiguration, CredentialIssuerEntityConfiguration, TrustAnchorEntityConfiguration, RelyingPartyEntityConfiguration], {
158
+ description: "Any kind of Entity Configuration allowed in the ecosystem"
64
159
  });
65
160
  exports.EntityConfiguration = EntityConfiguration;
66
- const TrustAnchorEntityConfiguration = EntityConfiguration;
67
- exports.TrustAnchorEntityConfiguration = TrustAnchorEntityConfiguration;
68
161
  //# sourceMappingURL=types.js.map
@@ -1 +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","TrustMark","object","id","string","trust_mark","exports","EntityStatement","header","typ","literal","alg","kid","payload","iss","sub","jwks","keys","array","JWK","trust_marks","iat","number","exp","EntityConfiguration","UnixTime","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,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,KA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,CAAC2B,MAAM,CAAC,CAAC,CAACyB,QAAQ,CAAC,CAAC;QAC/CE,2BAA2B,EAAEtD,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACyB,QAAQ,CAAC,CAAC;QAClDG,qCAAqC,EAAEvD,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACyB,QAAQ,CAAC,CAAC;QAC5DI,mCAAmC,EAAExD,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACyB,QAAQ,CAAC,CAAC;QAC1DK,YAAY,EAAEzD,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACyB,QAAQ,CAAC,CAAC;QACnCM,UAAU,EAAE1D,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACyB,QAAQ,CAAC,CAAC;QACjCO,QAAQ,EAAE3D,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACyB,QAAQ,CAAC,CAAC;QAC/BQ,QAAQ,EAAE5D,CAAC,CAACyC,KAAK,CAACzC,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAAC,CAACyB,QAAQ,CAAC;MACzC,CAAC,CAAC,CACDS,WAAW,CAAC;IACjB,CAAC,CAAC,CACDA,WAAW,CAAC,CAAC;IAChBC,eAAe,EAAE9D,CAAC,CAACyC,KAAK,CAACzC,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAAC,CAACyB,QAAQ,CAAC;EAChD,CAAC;AACH,CAAC,CAAC;AAACvB,OAAA,CAAAkB,mBAAA,GAAAA,mBAAA;AAKI,MAAMgB,8BAA8B,GAAGhB,mBAAmB;AAAClB,OAAA,CAAAkC,8BAAA,GAAAA,8BAAA"}
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","TrustMark","object","id","string","trust_mark","exports","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","JWK","trust_marks","iat","number","exp","EntityConfigurationHeader","BaseEntityConfiguration","UnixTime","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,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,GAA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ports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createCryptoContextFor = void 0;
7
+ var _ioReactNativeCrypto = require("@pagopa/io-react-native-crypto");
8
+ var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
9
+ var _jwk = require("./jwk");
10
+ /**
11
+ * Create a CryptoContext bound to a key pair.
12
+ * Key pair is supposed to exist already in the device's keychain.
13
+ * It's identified by its unique keytag.
14
+ *
15
+ * @returns the crypto context
16
+ */
17
+ const createCryptoContextFor = keytag => {
18
+ return {
19
+ /**
20
+ * Retrieve the public key of the pair.
21
+ * If the key pair doesn't exist yet, an error is raised
22
+ * @returns The public key.
23
+ */
24
+ async getPublicKey() {
25
+ return (0, _ioReactNativeCrypto.getPublicKey)(keytag).then(_jwk.fixBase64EncodingOnKey).then(async jwk => ({
26
+ ...jwk,
27
+ // Keys in the TEE are not stored with their KID, which is supposed to be assigned when they are included in JWK sets.
28
+ // (that is, KID is not a propoerty of the key itself, but it's property used to identify a key in a set).
29
+ // We assume the convention we use the thumbprint of the public key as KID, thus for easy development we decided to evaluate KID here
30
+ // However the values is an arbitrary string that might be anything
31
+ kid: await (0, _ioReactNativeJwt.thumbprint)(jwk)
32
+ }));
33
+ },
34
+ /**
35
+ * Get a signature for a provided value.
36
+ * If the key pair doesn't exist yet, an error is raised.
37
+ * @param value
38
+ * @returns The signature for the value
39
+ */
40
+ async getSignature(value) {
41
+ return (0, _ioReactNativeCrypto.sign)(value, keytag);
42
+ }
43
+ };
44
+ };
45
+ exports.createCryptoContextFor = createCryptoContextFor;
46
+ //# sourceMappingURL=crypto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_ioReactNativeCrypto","require","_ioReactNativeJwt","_jwk","createCryptoContextFor","keytag","getPublicKey","then","fixBase64EncodingOnKey","jwk","kid","thumbprint","getSignature","value","sign","exports"],"sourceRoot":"../../../src","sources":["utils/crypto.ts"],"mappings":";;;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,sBAAsB,GAAIC,MAAc,IAAoB;EACvE,OAAO;IACL;AACJ;AACA;AACA;AACA;IACI,MAAMC,YAAYA,CAAA,EAAG;MACnB,OAAO,IAAAA,iCAAY,EAACD,MAAM,CAAC,CACxBE,IAAI,CAACC,2BAAsB,CAAC,CAC5BD,IAAI,CAAC,MAAOE,GAAG,KAAM;QACpB,GAAGA,GAAG;QACN;QACA;QACA;QACA;QACAC,GAAG,EAAE,MAAM,IAAAC,4BAAU,EAACF,GAAG;MAC3B,CAAC,CAAC,CAAC;IACP,CAAC;IACD;AACJ;AACA;AACA;AACA;AACA;IACI,MAAMG,YAAYA,CAACC,KAAa,EAAE;MAChC,OAAO,IAAAC,yBAAI,EAACD,KAAK,EAAER,MAAM,CAAC;IAC5B;EACF,CAAC;AACH,CAAC;AAACU,OAAA,CAAAX,sBAAA,GAAAA,sBAAA"}
@@ -3,20 +3,27 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getUnsignedDPop = exports.DPoPPayload = void 0;
6
+ exports.createDPopToken = exports.DPoPPayload = void 0;
7
7
  var z = _interopRequireWildcard(require("zod"));
8
8
  var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
9
9
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
10
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
- const getUnsignedDPop = (jwk, payload) => {
12
- const dPop = new _ioReactNativeJwt.SignJWT(payload).setProtectedHeader({
13
- alg: "ES256",
11
+ /**
12
+ * Create a signed DPoP token
13
+ *
14
+ * @param payload The payload to be included in the token.
15
+ * @param crypto The crypto context that handles the key bound to the DPoP.
16
+ *
17
+ * @returns The signed crypto token.
18
+ */
19
+ const createDPopToken = async (payload, crypto) => {
20
+ const jwk = await crypto.getPublicKey();
21
+ return new _ioReactNativeJwt.SignJWT(crypto).setPayload(payload).setProtectedHeader({
14
22
  typ: "dpop+jwt",
15
23
  jwk
16
- }).setIssuedAt().setExpirationTime("1h").toSign();
17
- return dPop;
24
+ }).setIssuedAt().setExpirationTime("1h").sign();
18
25
  };
19
- exports.getUnsignedDPop = getUnsignedDPop;
26
+ exports.createDPopToken = createDPopToken;
20
27
  const DPoPPayload = z.object({
21
28
  jti: z.string(),
22
29
  htm: z.union([z.literal("POST"), z.literal("GET")]),
@@ -1 +1 @@
1
- {"version":3,"names":["z","_interopRequireWildcard","require","_ioReactNativeJwt","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","getUnsignedDPop","jwk","payload","dPop","SignJWT","setProtectedHeader","alg","typ","setIssuedAt","setExpirationTime","toSign","exports","DPoPPayload","object","jti","string","htm","union","literal","htu","ath","optional"],"sourceRoot":"../../../src","sources":["utils/dpop.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,C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C,yBAAO,CAACF,OAAO,CAAC,CAC9BG,kBAAkB,CAAC;IAClBC,GAAG,EAAE,OAAO;IACZC,GAAG,EAAE,UAAU;IACfN;EACF,CAAC,CAAC,CACDO,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,IAAI,CAAC,CACvBC,MAAM,CAAC,CAAC;EACX,OAAOP,IAAI;AACb,CAAC;AAACQ,OAAA,CAAAX,eAAA,GAAAA,eAAA;AAGK,MAAMY,WAAW,GAAGtC,CAAC,CAACuC,MAAM,CAAC;EAClCC,GAAG,EAAExC,CAAC,CAACyC,MAAM,CAAC,CAAC;EACfC,GAAG,EAAE1C,CAAC,CAAC2C,KAAK,CAAC,CAAC3C,CAAC,CAAC4C,OAAO,CAAC,MAAM,CAAC,EAAE5C,CAAC,CAAC4C,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;EACnDC,GAAG,EAAE7C,CAAC,CAACyC,MAAM,CAAC,CAAC;EACfK,GAAG,EAAE9C,CAAC,CAACyC,MAAM,CAAC,CAAC,CAACM,QAAQ,CAAC;AAC3B,CAAC,CAAC;AAACV,OAAA,CAAAC,WAAA,GAAAA,WAAA"}
1
+ {"version":3,"names":["z","_interopRequireWildcard","require","_ioReactNativeJwt","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","createDPopToken","payload","crypto","jwk","getPublicKey","SignJWT","setPayload","setProtectedHeader","typ","setIssuedAt","setExpirationTime","sign","exports","DPoPPayload","object","jti","string","htm","union","literal","htu","ath","optional"],"sourceRoot":"../../../src","sources":["utils/dpop.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AAA0E,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OA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AM,CAAC,CACvBI,UAAU,CAACL,OAAO,CAAC,CACnBM,kBAAkB,CAAC;IAClBC,GAAG,EAAE,UAAU;IACfL;EACF,CAAC,CAAC,CACDM,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,IAAI,CAAC,CACvBC,IAAI,CAAC,CAAC;AACX,CAAC;AAACC,OAAA,CAAAZ,eAAA,GAAAA,eAAA;AAGK,MAAMa,WAAW,GAAGvC,CAAC,CAACwC,MAAM,CAAC;EAClCC,GAAG,EAAEzC,CAAC,CAAC0C,MAAM,CAAC,CAAC;EACfC,GAAG,EAAE3C,CAAC,CAAC4C,KAAK,CAAC,CAAC5C,CAAC,CAAC6C,OAAO,CAAC,MAAM,CAAC,EAAE7C,CAAC,CAAC6C,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;EACnDC,GAAG,EAAE9C,CAAC,CAAC0C,MAAM,CAAC,CAAC;EACfK,GAAG,EAAE/C,CAAC,CAAC0C,MAAM,CAAC,CAAC,CAACM,QAAQ,CAAC;AAC3B,CAAC,CAAC;AAACV,OAAA,CAAAC,WAAA,GAAAA,WAAA"}
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "Issuing", {
6
+ exports.decode = decode;
7
+ Object.defineProperty(exports, "getAttestation", {
7
8
  enumerable: true,
8
9
  get: function () {
9
- return _issuing.Issuing;
10
+ return _issuing.getAttestation;
10
11
  }
11
12
  });
12
- exports.decode = decode;
13
13
  exports.verify = verify;
14
14
  var _types = require("./types");
15
15
  var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
@@ -3,68 +3,50 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Issuing = void 0;
6
+ exports.getAttestation = void 0;
7
7
  var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
8
8
  var _jwk = require("../utils/jwk");
9
9
  var _types = require("./types");
10
10
  var _reactNativeUuid = _interopRequireDefault(require("react-native-uuid"));
11
11
  var _errors = require("../utils/errors");
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- class Issuing {
14
- constructor(walletProviderBaseUrl) {
15
- let appFetch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : fetch;
16
- this.walletProviderBaseUrl = walletProviderBaseUrl;
17
- this.appFetch = appFetch;
18
- }
19
-
20
- /**
21
- * Get the Wallet Instance Attestation Request to sign
22
- *
23
- * @async @function
24
- *
25
- * @param jwk Public key of the wallet instance
26
- *
27
- * @returns {string} Wallet Instance Attestation Request to sign
28
- *
29
- */
30
- async getAttestationRequestToSign(jwk) {
31
- const parsedJwk = _jwk.JWK.parse(jwk);
32
- const keyThumbprint = await (0, _ioReactNativeJwt.thumbprint)(parsedJwk);
33
- const publicKey = {
34
- ...parsedJwk,
35
- kid: keyThumbprint
36
- };
37
- const walletInstanceAttestationRequest = new _ioReactNativeJwt.SignJWT({
38
- iss: keyThumbprint,
39
- aud: this.walletProviderBaseUrl,
40
- jti: `${_reactNativeUuid.default.v4()}`,
41
- nonce: `${_reactNativeUuid.default.v4()}`,
42
- cnf: {
43
- jwk: (0, _jwk.fixBase64EncodingOnKey)(publicKey)
44
- }
45
- }).setProtectedHeader({
46
- alg: "ES256",
47
- kid: publicKey.kid,
48
- typ: "wiar+jwt"
49
- }).setIssuedAt().setExpirationTime("1h").toSign();
50
- return walletInstanceAttestationRequest;
51
- }
13
+ async function getAttestationRequest(wiaCryptoContext, walletProviderEntityConfiguration) {
14
+ const jwk = await wiaCryptoContext.getPublicKey();
15
+ const parsedJwk = _jwk.JWK.parse(jwk);
16
+ const keyThumbprint = await (0, _ioReactNativeJwt.thumbprint)(parsedJwk);
17
+ const publicKey = {
18
+ ...parsedJwk,
19
+ kid: keyThumbprint
20
+ };
21
+ return new _ioReactNativeJwt.SignJWT(wiaCryptoContext).setPayload({
22
+ iss: keyThumbprint,
23
+ aud: walletProviderEntityConfiguration.payload.iss,
24
+ jti: `${_reactNativeUuid.default.v4()}`,
25
+ nonce: `${_reactNativeUuid.default.v4()}`,
26
+ cnf: {
27
+ jwk: (0, _jwk.fixBase64EncodingOnKey)(publicKey)
28
+ }
29
+ }).setProtectedHeader({
30
+ kid: publicKey.kid,
31
+ typ: "wiar+jwt"
32
+ }).setIssuedAt().setExpirationTime("1h").sign();
33
+ }
52
34
 
53
- /**
54
- * Get the Wallet Instance Attestation given a
55
- * Wallet Instance Attestation Request and signature
56
- *
57
- * @async @function
58
- *
59
- * @param attestationRequest Wallet Instance Attestaion Request
60
- * obtained with {@link getAttestationRequestToSign}
61
- * @param signature Signature of the Wallet Instance Attestaion Request
62
- *
63
- * @returns {string} Wallet Instance Attestation
64
- *
65
- */
66
- async getAttestation(attestationRequest, signature) {
67
- const signedAttestationRequest = await _ioReactNativeJwt.SignJWT.appendSignature(attestationRequest, signature);
35
+ /**
36
+ * Request a Wallet Instance Attestation (WIA) to the Wallet provider
37
+ *
38
+ * @param params.wiaCryptoContext The key pair associated with the WIA. Will be use to prove the ownership of the attestation.
39
+ * @param params.appFetch (optional) Http client
40
+ * @param walletProviderBaseUrl Base url for the Wallet Provider
41
+ * @returns The retrieved Wallet Instance Attestation token
42
+ */
43
+ const getAttestation = _ref => {
44
+ let {
45
+ wiaCryptoContext,
46
+ appFetch = fetch
47
+ } = _ref;
48
+ return async walletProviderEntityConfiguration => {
49
+ const signedAttestationRequest = await getAttestationRequest(wiaCryptoContext, walletProviderEntityConfiguration);
68
50
  const decodedRequest = (0, _ioReactNativeJwt.decode)(signedAttestationRequest);
69
51
  const parsedRequest = _types.WalletInstanceAttestationRequestJwt.parse({
70
52
  payload: decodedRequest.payload,
@@ -72,12 +54,12 @@ class Issuing {
72
54
  });
73
55
  const publicKey = parsedRequest.payload.cnf.jwk;
74
56
  await (0, _ioReactNativeJwt.verify)(signedAttestationRequest, publicKey);
75
- const tokenUrl = new URL("token", this.walletProviderBaseUrl).href;
57
+ const tokenUrl = walletProviderEntityConfiguration.payload.metadata.wallet_provider.token_endpoint;
76
58
  const requestBody = {
77
59
  grant_type: "urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation",
78
60
  assertion: signedAttestationRequest
79
61
  };
80
- const response = await this.appFetch(tokenUrl, {
62
+ const response = await appFetch(tokenUrl, {
81
63
  method: "POST",
82
64
  headers: {
83
65
  "Content-Type": "application/json"
@@ -88,7 +70,7 @@ class Issuing {
88
70
  return await response.text();
89
71
  }
90
72
  throw new _errors.WalletInstanceAttestationIssuingError("Unable to obtain wallet instance attestation from wallet provider", `Response code: ${response.status}`);
91
- }
92
- }
93
- exports.Issuing = Issuing;
73
+ };
74
+ };
75
+ exports.getAttestation = getAttestation;
94
76
  //# sourceMappingURL=issuing.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_ioReactNativeJwt","require","_jwk","_types","_reactNativeUuid","_interopRequireDefault","_errors","obj","__esModule","default","Issuing","constructor","walletProviderBaseUrl","appFetch","arguments","length","undefined","fetch","getAttestationRequestToSign","jwk","parsedJwk","JWK","parse","keyThumbprint","thumbprint","publicKey","kid","walletInstanceAttestationRequest","SignJWT","iss","aud","jti","uuid","v4","nonce","cnf","fixBase64EncodingOnKey","setProtectedHeader","alg","typ","setIssuedAt","setExpirationTime","toSign","getAttestation","attestationRequest","signature","signedAttestationRequest","appendSignature","decodedRequest","decodeJwt","parsedRequest","WalletInstanceAttestationRequestJwt","payload","header","protectedHeader","verifyJwt","tokenUrl","URL","href","requestBody","grant_type","assertion","response","method","headers","body","JSON","stringify","status","text","WalletInstanceAttestationIssuingError","exports"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/issuing.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAGA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAAwE,SAAAI,uBAAAE,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uid","_interopRequireDefault","_errors","obj","__esModule","default","getAttestationRequest","wiaCryptoContext","walletProviderEntityConfiguration","jwk","getPublicKey","parsedJwk","JWK","parse","keyThumbprint","thumbprint","publicKey","kid","SignJWT","setPayload","iss","aud","payload","jti","uuid","v4","nonce","cnf","fixBase64EncodingOnKey","setProtectedHeader","typ","setIssuedAt","setExpirationTime","sign","getAttestation","_ref","appFetch","fetch","signedAttestationRequest","decodedRequest","decodeJwt","parsedRequest","WalletInstanceAttestationRequestJwt","header","protectedHeader","verifyJwt","tokenUrl","metadata","wallet_provider","token_endpoint","requestBody","grant_type","assertion","response","method","headers","body","JSON","stringify","status","text","WalletInstanceAttestationIssuingError","exports"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/issuing.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAMA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAAwE,SAAAI,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGxE,eAAeG,qBAAqBA,CAClCC,gBAA+B,EAC/BC,iCAAoE,EACnD;EACjB,MAAMC,GAAG,GAAG,MAAMF,gBAAgB,CAACG,YAAY,CAAC,CAAC;EACjD,MAAMC,SAAS,GAAGC,QAAG,CAACC,KAAK,CAACJ,GAAG,CAAC;EAChC,MAAMK,aAAa,GAAG,MAAM,IAAAC,4BAAU,EAACJ,SAAS,CAAC;EACjD,MAAMK,SAAS,GAAG;IAAE,GAAGL,SAAS;IAAEM,GAAG,EAAEH;EAAc,CAAC;EAEtD,OAAO,IAAII,yBAAO,CAACX,gBAAgB,CAAC,CACjCY,UAAU,CAAC;IACVC,GAAG,EAAEN,aAAa;IAClBO,GAAG,EAAEb,iCAAiC,CAACc,OA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jB,QAAQ,CAACU,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,IAAIC,6CAAqC,CAC7C,mEAAmE,EAClE,kBAAiBR,QAAQ,CAACM,MAAO,EACpC,CAAC;EACH,CAAC;AAAA;AAACG,OAAA,CAAA5B,cAAA,GAAAA,cAAA"}
@@ -5,10 +5,8 @@ import * as PID from "./pid";
5
5
  import * as RP from "./rp";
6
6
  import * as Errors from "./utils/errors";
7
7
  import * as WalletInstanceAttestation from "./wallet-instance-attestation";
8
- import { getUnsignedDPop } from "./utils/dpop";
9
- import { RelyingPartySolution } from "./rp";
10
- import { RpEntityConfiguration } from "./rp/types";
11
- import { verifyTrustChain, getEntityConfiguration } from "./trust";
12
- import { EntityConfiguration, EntityStatement, TrustAnchorEntityConfiguration } from "./trust/types";
13
- export { PID, RP, WalletInstanceAttestation, Errors, getUnsignedDPop, RelyingPartySolution, verifyTrustChain, getEntityConfiguration, EntityConfiguration, EntityStatement, RpEntityConfiguration, TrustAnchorEntityConfiguration };
8
+ import * as RelyingPartySolution from "./rp";
9
+ import { verifyTrustChain, getEntityConfiguration, getCredentialIssuerEntityConfiguration, getRelyingPartyEntityConfiguration, getTrustAnchorEntityConfiguration, getWalletProviderEntityConfiguration } from "./trust";
10
+ import { createCryptoContextFor } from "./utils/crypto";
11
+ export { PID, RP, WalletInstanceAttestation, Errors, RelyingPartySolution, verifyTrustChain, getEntityConfiguration, getCredentialIssuerEntityConfiguration, getRelyingPartyEntityConfiguration, getTrustAnchorEntityConfiguration, getWalletProviderEntityConfiguration, createCryptoContextFor };
14
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PID","RP","Errors","WalletInstanceAttestation","getUnsignedDPop","RelyingPartySolution","RpEntityConfiguration","verifyTrustChain","getEntityConfiguration","EntityConfiguration","EntityStatement","TrustAnchorEntityConfiguration"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA;AACA;AACA,OAAO,gCAAgC;AAEvC,OAAO,KAAKA,GAAG,MAAM,OAAO;AAC5B,OAAO,KAAKC,EAAE,MAAM,MAAM;AAC1B,OAAO,KAAKC,MAAM,MAAM,gBAAgB;AACxC,OAAO,KAAKC,yBAAyB,MAAM,+BAA+B;AAC1E,SAASC,eAAe,QAAQ,cAAc;AAC9C,SAASC,oBAAoB,QAAQ,MAAM;AAC3C,SAASC,qBAAqB,QAAQ,YAAY;AAClD,SAASC,gBAAgB,EAAEC,sBAAsB,QAAQ,SAAS;AAClE,SACEC,mBAAmB,EACnBC,eAAe,EACfC,8BAA8B,QACzB,eAAe;AAEtB,SACEX,GAAG,EACHC,EAAE,EACFE,yBAAyB,EACzBD,MAAM,EACNE,eAAe,EACfC,oBAAoB,EACpBE,gBAAgB,EAChBC,sBAAsB,EACtBC,mBAAmB,EACnBC,eAAe,EACfJ,qBAAqB,EACrBK,8BAA8B"}
1
+ {"version":3,"names":["PID","RP","Errors","WalletInstanceAttestation","RelyingPartySolution","verifyTrustChain","getEntityConfiguration","getCredentialIssuerEntityConfiguration","getRelyingPartyEntityConfiguration","getTrustAnchorEntityConfiguration","getWalletProviderEntityConfiguration","createCryptoContextFor"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA;AACA;AACA,OAAO,gCAAgC;AAEvC,OAAO,KAAKA,GAAG,MAAM,OAAO;AAC5B,OAAO,KAAKC,EAAE,MAAM,MAAM;AAC1B,OAAO,KAAKC,MAAM,MAAM,gBAAgB;AACxC,OAAO,KAAKC,yBAAyB,MAAM,+BAA+B;AAC1E,OAAO,KAAKC,oBAAoB,MAAM,MAAM;AAC5C,SACEC,gBAAgB,EAChBC,sBAAsB,EACtBC,sCAAsC,EACtCC,kCAAkC,EAClCC,iCAAiC,EACjCC,oCAAoC,QAC/B,SAAS;AAChB,SAASC,sBAAsB,QAAQ,gBAAgB;AAEvD,SACEX,GAAG,EACHC,EAAE,EACFE,yBAAyB,EACzBD,MAAM,EACNE,oBAAoB,EACpBC,gBAAgB,EAChBC,sBAAsB,EACtBC,sCAAsC,EACtCC,kCAAkC,EAClCC,iCAAiC,EACjCC,oCAAoC,EACpCC,sBAAsB"}
@@ -1,4 +1,4 @@
1
1
  import * as SdJwt from "./sd-jwt";
2
- import { Issuing } from "./issuing";
2
+ import * as Issuing from "./issuing";
3
3
  export { SdJwt, Issuing };
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SdJwt","Issuing"],"sourceRoot":"../../../src","sources":["pid/index.ts"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,UAAU;AACjC,SAASC,OAAO,QAAQ,WAAW;AACnC,SAASD,KAAK,EAAEC,OAAO"}
1
+ {"version":3,"names":["SdJwt","Issuing"],"sourceRoot":"../../../src","sources":["pid/index.ts"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,UAAU;AACjC,OAAO,KAAKC,OAAO,MAAM,WAAW;AACpC,SAASD,KAAK,EAAEC,OAAO"}