@agnostack/verifyd 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/CODE_OF_CONDUCT.md +132 -0
  3. package/LICENSE +21 -0
  4. package/README.md +93 -0
  5. package/SECURITY.md +18 -0
  6. package/dist/lib/index.d.ts +4 -0
  7. package/dist/lib/index.d.ts.map +1 -0
  8. package/dist/lib/index.js +20 -0
  9. package/dist/lib/index.js.map +1 -0
  10. package/dist/lib/types.d.ts +1 -0
  11. package/dist/lib/types.d.ts.map +1 -0
  12. package/dist/lib/types.js +1 -0
  13. package/dist/lib/types.js.map +1 -0
  14. package/dist/lib/utils/errors.d.ts +6 -0
  15. package/dist/lib/utils/errors.d.ts.map +1 -0
  16. package/dist/lib/utils/errors.js +26 -0
  17. package/dist/lib/utils/errors.js.map +1 -0
  18. package/dist/lib/utils/index.d.ts +3 -0
  19. package/dist/lib/utils/index.d.ts.map +1 -0
  20. package/dist/lib/utils/index.js +19 -0
  21. package/dist/lib/utils/index.js.map +1 -0
  22. package/dist/lib/utils/rawbody.d.ts +2 -0
  23. package/dist/lib/utils/rawbody.d.ts.map +1 -0
  24. package/dist/lib/utils/rawbody.js +60 -0
  25. package/dist/lib/utils/rawbody.js.map +1 -0
  26. package/dist/lib/verification.d.ts +10 -0
  27. package/dist/lib/verification.d.ts.map +1 -0
  28. package/dist/lib/verification.js +84 -0
  29. package/dist/lib/verification.js.map +1 -0
  30. package/dist/react/hooks/index.d.ts +2 -0
  31. package/dist/react/hooks/index.d.ts.map +1 -0
  32. package/dist/react/hooks/index.js +18 -0
  33. package/dist/react/hooks/index.js.map +1 -0
  34. package/dist/react/hooks/useVerification.d.ts +8 -0
  35. package/dist/react/hooks/useVerification.d.ts.map +1 -0
  36. package/dist/react/hooks/useVerification.js +52 -0
  37. package/dist/react/hooks/useVerification.js.map +1 -0
  38. package/dist/react/index.d.ts +3 -0
  39. package/dist/react/index.d.ts.map +1 -0
  40. package/dist/react/index.js +19 -0
  41. package/dist/react/index.js.map +1 -0
  42. package/dist/react/types.d.ts +1 -0
  43. package/dist/react/types.d.ts.map +1 -0
  44. package/dist/react/types.js +1 -0
  45. package/dist/react/types.js.map +1 -0
  46. package/dist/shared/WebCrypto.d.ts +55 -0
  47. package/dist/shared/WebCrypto.d.ts.map +1 -0
  48. package/dist/shared/WebCrypto.js +342 -0
  49. package/dist/shared/WebCrypto.js.map +1 -0
  50. package/dist/shared/datetime.d.ts +96 -0
  51. package/dist/shared/datetime.d.ts.map +1 -0
  52. package/dist/shared/datetime.js +295 -0
  53. package/dist/shared/datetime.js.map +1 -0
  54. package/dist/shared/display.d.ts +100 -0
  55. package/dist/shared/display.d.ts.map +1 -0
  56. package/dist/shared/display.js +481 -0
  57. package/dist/shared/display.js.map +1 -0
  58. package/dist/shared/index.d.ts +6 -0
  59. package/dist/shared/index.d.ts.map +1 -0
  60. package/dist/shared/index.js +28 -0
  61. package/dist/shared/index.js.map +1 -0
  62. package/dist/shared/request.d.ts +16 -0
  63. package/dist/shared/request.d.ts.map +1 -0
  64. package/dist/shared/request.js +60 -0
  65. package/dist/shared/request.js.map +1 -0
  66. package/dist/shared/types.d.ts +1 -0
  67. package/dist/shared/types.d.ts.map +1 -0
  68. package/dist/shared/types.js +1 -0
  69. package/dist/shared/types.js.map +1 -0
  70. package/dist/shared/verification.d.ts +31 -0
  71. package/dist/shared/verification.d.ts.map +1 -0
  72. package/dist/shared/verification.js +91 -0
  73. package/dist/shared/verification.js.map +1 -0
  74. package/dist/umd/lib/index.js +2204 -0
  75. package/dist/umd/lib/index.js.map +1 -0
  76. package/dist/umd/lib/lib/index.d.ts +4 -0
  77. package/dist/umd/lib/lib/index.d.ts.map +1 -0
  78. package/dist/umd/lib/lib/types.d.ts +1 -0
  79. package/dist/umd/lib/lib/types.d.ts.map +1 -0
  80. package/dist/umd/lib/lib/utils/errors.d.ts +6 -0
  81. package/dist/umd/lib/lib/utils/errors.d.ts.map +1 -0
  82. package/dist/umd/lib/lib/utils/index.d.ts +3 -0
  83. package/dist/umd/lib/lib/utils/index.d.ts.map +1 -0
  84. package/dist/umd/lib/lib/utils/rawbody.d.ts +2 -0
  85. package/dist/umd/lib/lib/utils/rawbody.d.ts.map +1 -0
  86. package/dist/umd/lib/lib/verification.d.ts +10 -0
  87. package/dist/umd/lib/lib/verification.d.ts.map +1 -0
  88. package/dist/umd/lib/react/hooks/index.d.ts +2 -0
  89. package/dist/umd/lib/react/hooks/index.d.ts.map +1 -0
  90. package/dist/umd/lib/react/hooks/useVerification.d.ts +8 -0
  91. package/dist/umd/lib/react/hooks/useVerification.d.ts.map +1 -0
  92. package/dist/umd/lib/react/index.d.ts +3 -0
  93. package/dist/umd/lib/react/index.d.ts.map +1 -0
  94. package/dist/umd/lib/react/types.d.ts +1 -0
  95. package/dist/umd/lib/react/types.d.ts.map +1 -0
  96. package/dist/umd/lib/shared/WebCrypto.d.ts +55 -0
  97. package/dist/umd/lib/shared/WebCrypto.d.ts.map +1 -0
  98. package/dist/umd/lib/shared/datetime.d.ts +96 -0
  99. package/dist/umd/lib/shared/datetime.d.ts.map +1 -0
  100. package/dist/umd/lib/shared/display.d.ts +100 -0
  101. package/dist/umd/lib/shared/display.d.ts.map +1 -0
  102. package/dist/umd/lib/shared/index.d.ts +6 -0
  103. package/dist/umd/lib/shared/index.d.ts.map +1 -0
  104. package/dist/umd/lib/shared/request.d.ts +16 -0
  105. package/dist/umd/lib/shared/request.d.ts.map +1 -0
  106. package/dist/umd/lib/shared/types.d.ts +1 -0
  107. package/dist/umd/lib/shared/types.d.ts.map +1 -0
  108. package/dist/umd/lib/shared/verification.d.ts +31 -0
  109. package/dist/umd/lib/shared/verification.d.ts.map +1 -0
  110. package/node_modules/browser-monads-ts/LICENSE +21 -0
  111. package/node_modules/browser-monads-ts/README.md +46 -0
  112. package/node_modules/browser-monads-ts/dist/browser-monads-ts.cjs.js +2 -0
  113. package/node_modules/browser-monads-ts/dist/browser-monads-ts.cjs.js.map +1 -0
  114. package/node_modules/browser-monads-ts/dist/browser-monads-ts.es.js +12 -0
  115. package/node_modules/browser-monads-ts/dist/browser-monads-ts.es.js.map +1 -0
  116. package/node_modules/browser-monads-ts/dist/index.d.ts +5 -0
  117. package/node_modules/browser-monads-ts/dist/index.d.ts.map +1 -0
  118. package/node_modules/browser-monads-ts/package.json +79 -0
  119. package/node_modules/bytes/History.md +97 -0
  120. package/node_modules/bytes/LICENSE +23 -0
  121. package/node_modules/bytes/Readme.md +152 -0
  122. package/node_modules/bytes/index.js +170 -0
  123. package/node_modules/bytes/package.json +42 -0
  124. package/node_modules/depd/History.md +103 -0
  125. package/node_modules/depd/LICENSE +22 -0
  126. package/node_modules/depd/Readme.md +280 -0
  127. package/node_modules/depd/index.js +538 -0
  128. package/node_modules/depd/lib/browser/index.js +77 -0
  129. package/node_modules/depd/package.json +45 -0
  130. package/node_modules/http-errors/HISTORY.md +180 -0
  131. package/node_modules/http-errors/LICENSE +23 -0
  132. package/node_modules/http-errors/README.md +169 -0
  133. package/node_modules/http-errors/index.js +289 -0
  134. package/node_modules/http-errors/package.json +50 -0
  135. package/node_modules/iconv-lite/Changelog.md +162 -0
  136. package/node_modules/iconv-lite/LICENSE +21 -0
  137. package/node_modules/iconv-lite/README.md +156 -0
  138. package/node_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
  139. package/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
  140. package/node_modules/iconv-lite/encodings/index.js +22 -0
  141. package/node_modules/iconv-lite/encodings/internal.js +188 -0
  142. package/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
  143. package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  144. package/node_modules/iconv-lite/encodings/sbcs-data.js +174 -0
  145. package/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  146. package/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  147. package/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  148. package/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  149. package/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  150. package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  151. package/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
  152. package/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  153. package/node_modules/iconv-lite/encodings/utf16.js +177 -0
  154. package/node_modules/iconv-lite/encodings/utf7.js +290 -0
  155. package/node_modules/iconv-lite/lib/bom-handling.js +52 -0
  156. package/node_modules/iconv-lite/lib/extend-node.js +217 -0
  157. package/node_modules/iconv-lite/lib/index.d.ts +24 -0
  158. package/node_modules/iconv-lite/lib/index.js +153 -0
  159. package/node_modules/iconv-lite/lib/streams.js +121 -0
  160. package/node_modules/iconv-lite/package.json +46 -0
  161. package/node_modules/inherits/LICENSE +16 -0
  162. package/node_modules/inherits/README.md +42 -0
  163. package/node_modules/inherits/inherits.js +9 -0
  164. package/node_modules/inherits/inherits_browser.js +27 -0
  165. package/node_modules/inherits/package.json +29 -0
  166. package/node_modules/nothing-mock/LICENSE +21 -0
  167. package/node_modules/nothing-mock/README.md +266 -0
  168. package/node_modules/nothing-mock/dist/nothing-mock.es.js +2 -0
  169. package/node_modules/nothing-mock/dist/nothing-mock.es.js.map +1 -0
  170. package/node_modules/nothing-mock/dist/nothing-mock.js +2 -0
  171. package/node_modules/nothing-mock/dist/nothing-mock.js.map +1 -0
  172. package/node_modules/nothing-mock/dist/nothing-mock.modern.js +2 -0
  173. package/node_modules/nothing-mock/dist/nothing-mock.modern.js.map +1 -0
  174. package/node_modules/nothing-mock/dist/nothing-mock.umd.js +2 -0
  175. package/node_modules/nothing-mock/dist/nothing-mock.umd.js.map +1 -0
  176. package/node_modules/nothing-mock/index.d.ts +6 -0
  177. package/node_modules/nothing-mock/package.json +29 -0
  178. package/node_modules/nothing-mock/src/index.js +15 -0
  179. package/node_modules/raw-body/HISTORY.md +308 -0
  180. package/node_modules/raw-body/LICENSE +22 -0
  181. package/node_modules/raw-body/README.md +223 -0
  182. package/node_modules/raw-body/SECURITY.md +24 -0
  183. package/node_modules/raw-body/index.d.ts +87 -0
  184. package/node_modules/raw-body/index.js +336 -0
  185. package/node_modules/raw-body/package.json +49 -0
  186. package/node_modules/safer-buffer/LICENSE +21 -0
  187. package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
  188. package/node_modules/safer-buffer/Readme.md +156 -0
  189. package/node_modules/safer-buffer/dangerous.js +58 -0
  190. package/node_modules/safer-buffer/package.json +34 -0
  191. package/node_modules/safer-buffer/safer.js +77 -0
  192. package/node_modules/safer-buffer/tests.js +406 -0
  193. package/node_modules/setprototypeof/LICENSE +13 -0
  194. package/node_modules/setprototypeof/README.md +31 -0
  195. package/node_modules/setprototypeof/index.d.ts +2 -0
  196. package/node_modules/setprototypeof/index.js +17 -0
  197. package/node_modules/setprototypeof/package.json +38 -0
  198. package/node_modules/setprototypeof/test/index.js +24 -0
  199. package/node_modules/statuses/HISTORY.md +82 -0
  200. package/node_modules/statuses/LICENSE +23 -0
  201. package/node_modules/statuses/README.md +136 -0
  202. package/node_modules/statuses/codes.json +65 -0
  203. package/node_modules/statuses/index.js +146 -0
  204. package/node_modules/statuses/package.json +49 -0
  205. package/node_modules/toidentifier/HISTORY.md +9 -0
  206. package/node_modules/toidentifier/LICENSE +21 -0
  207. package/node_modules/toidentifier/README.md +61 -0
  208. package/node_modules/toidentifier/index.js +32 -0
  209. package/node_modules/toidentifier/package.json +38 -0
  210. package/node_modules/unpipe/HISTORY.md +4 -0
  211. package/node_modules/unpipe/LICENSE +22 -0
  212. package/node_modules/unpipe/README.md +43 -0
  213. package/node_modules/unpipe/index.js +69 -0
  214. package/node_modules/unpipe/package.json +27 -0
  215. package/package.json +127 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # 1.0.0 (2023-12-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * initial commit ([150767d](https://github.com/agnostack/verifyd/commit/150767d7f258d18fa87412c45d8ddbb34464f694))
7
+ * initial commit ([86ad844](https://github.com/agnostack/verifyd/commit/86ad8442946b5b293299d02f378511565e894d51))
8
+ * initial commit ([1012dc3](https://github.com/agnostack/verifyd/commit/1012dc3806723e721c5786517f78eb6eb8abbf29))
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at info@agnostack.com.
63
+
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available
126
+ at [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021-present agnoStack, Inc. and Adam Grohs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # @agnostack/verifyd
2
+ ![Test](https://github.com/agnostack/verifyd/actions/workflows/test.yml/badge.svg)
3
+ ## Installation
4
+
5
+ ```bash
6
+ yarn add @agnostack/verifyd
7
+ # npm install @agnostack/verifyd
8
+ ```
9
+
10
+ ## Quickstart - TODO
11
+
12
+ Inside of `next.config.js`, add the following:
13
+ ```js
14
+ const { withShopify } = require('@agnostack/verifyd')
15
+
16
+ const manifestTemplate = require('./manifestTemplate.json')
17
+
18
+ const nextConfig = withShopify({
19
+ zendesk: { manifestTemplate },
20
+ })
21
+
22
+ ```
23
+
24
+ Also, create an api route (`pages/api/apps.js`) containing the following:
25
+ ```js
26
+ import getConfig from 'next/config'
27
+ import { withShopify } from '@agnostack/verifyd'
28
+
29
+ const { serverRuntimeConfig } = getConfig() ?? {}
30
+
31
+ export default withShopify(serverRuntimeConfig)
32
+ ```
33
+
34
+
35
+ ## Alternate Option #1
36
+
37
+ Inside of `next.config.js`, add the following:
38
+ ```js
39
+ const { withPlugins } = require('@agnostack/next-plugins')
40
+ const { withShopify } = require('@agnostack/verifyd')
41
+
42
+ const manifest = require('./manifest.json')
43
+
44
+ const nextPlugins = [{
45
+ [withShopify]: {
46
+ manifestTemplate: manifest,
47
+ /* NOTE: add optionale below
48
+ apiRoute: '/api/my-custom-api-json-route', // (defaults to /api/apps)
49
+ interactive: true, // (defaults to false)
50
+ data: {
51
+ plan: 'silver',
52
+ app_id: 123,
53
+ installation_id: 12434234,
54
+ my_token: 'myValue',
55
+ parameters: {
56
+ someToken: 'fksjdhfb231435',
57
+ someSecret: 123,
58
+ },
59
+ },
60
+ routes: {
61
+ background: '/background'
62
+ user_sidebar: '/noTicket',
63
+ organization_sidebar: '/noTicket',
64
+ ticket_sidebar: '/ticket',
65
+ new_ticket_sidebar: '/ticket',
66
+ },
67
+ */
68
+ },
69
+ }]
70
+
71
+ const nextConfig = withPlugins({
72
+ /* NOTE: standard nextConfig goes in here
73
+ reactStrictMode: true,
74
+ experimental: {
75
+ esmExternals: false,
76
+ },
77
+ */
78
+ }, [nextPlugins])
79
+
80
+ ```
81
+
82
+ Also, create an api route (`pages/api/apps.js`) containing the following:
83
+ ```js
84
+ import getConfig from 'next/config'
85
+ import { withShopify } from '@agnostack/verifyd'
86
+
87
+ const { publicRuntimeConfig } = getConfig() ?? {}
88
+
89
+ export default withShopify(publicRuntimeConfig)
90
+ ```
91
+
92
+
93
+ _Contact [Adam Grohs](https://agnostack.com/founding-team/adam-grohs) @ [agnoStack](https://agnostack.com/) for any questions._
package/SECURITY.md ADDED
@@ -0,0 +1,18 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ We release patches for security vulnerabilities. Which versions are eligible
6
+ receiving such patches depend on the CVSS v3.0 Rating:
7
+
8
+ | CVSS v3.0 | Supported Versions |
9
+ | --------- | ----------------------------------------- |
10
+ | X.y.y | Current Major Release |
11
+ | X.y.z | Recent Minor Releases |
12
+
13
+ ## Reporting a Vulnerability
14
+
15
+ Please report (suspected) security vulnerabilities to
16
+ **[info@agnostack.com](mailto:info@agnostack.com)**. If the issue is confirmed,
17
+ we will release a patch as soon as possible depending on complexity but
18
+ historically within a few days.
@@ -0,0 +1,4 @@
1
+ export * from '../shared';
2
+ export * from './utils';
3
+ export * from './verification';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("../shared"), exports);
18
+ __exportStar(require("./utils"), exports);
19
+ __exportStar(require("./verification"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,0CAAuB;AACvB,iDAA8B"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export class VerificationError extends Error {
2
+ constructor(message: any, _data: any);
3
+ code: any;
4
+ data: any;
5
+ }
6
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/errors.js"],"names":[],"mappings":"AAAA;IACE,sCAOC;IAJC,UAAgB;IAChB,UAAgB;CAInB"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.VerificationError = void 0;
15
+ class VerificationError extends Error {
16
+ constructor(message, _data) {
17
+ super(message);
18
+ const _a = _data !== null && _data !== void 0 ? _data : {}, { code = 500 } = _a, data = __rest(_a, ["code"]);
19
+ this.code = code;
20
+ this.data = data;
21
+ this.name = 'VerificationError';
22
+ Object.setPrototypeOf(this, VerificationError.prototype);
23
+ }
24
+ }
25
+ exports.VerificationError = VerificationError;
26
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/lib/utils/errors.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,MAAa,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,OAAO,EAAE,KAAK;QACxB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,MAAM,KAA0B,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,EAArC,EAAE,IAAI,GAAG,GAAG,OAAyB,EAApB,IAAI,cAArB,QAAuB,CAAc,CAAA;QAC3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAA;QAC/B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAA;IAC1D,CAAC;CACF;AATD,8CASC"}
@@ -0,0 +1,3 @@
1
+ export * from "./errors";
2
+ export * from "./rawbody";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./errors"), exports);
18
+ __exportStar(require("./rawbody"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/utils/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,4CAAyB"}
@@ -0,0 +1,2 @@
1
+ export function ensureRawBody(req: any): Promise<any>;
2
+ //# sourceMappingURL=rawbody.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rawbody.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/rawbody.js"],"names":[],"mappings":"AAgBO,sDAON"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.ensureRawBody = void 0;
36
+ const getChunkedRawBody = (readable) => __awaiter(void 0, void 0, void 0, function* () {
37
+ if (readable === null || readable === void 0 ? void 0 : readable.rawBody) {
38
+ return readable.rawBody;
39
+ }
40
+ // TODO: move to req.text() after next 13.5: https://github.com/vercel/next.js/discussions/13405
41
+ try {
42
+ const getRawBody = (yield Promise.resolve().then(() => __importStar(require('raw-body')))).default;
43
+ return getRawBody(readable);
44
+ }
45
+ catch (error) {
46
+ console.error(`Failed to import 'raw-body', please ensure the dependency is installed`);
47
+ throw error;
48
+ }
49
+ });
50
+ // TODO: explore returning mutated request object adding on req.rawBody??
51
+ const ensureRawBody = (req) => __awaiter(void 0, void 0, void 0, function* () {
52
+ return (getChunkedRawBody(req)
53
+ .then((_rawBody) => _rawBody.toString())
54
+ .catch((error) => {
55
+ console.error(`Error getting raw body for '${req === null || req === void 0 ? void 0 : req.url}'`, error);
56
+ throw error;
57
+ }));
58
+ });
59
+ exports.ensureRawBody = ensureRawBody;
60
+ //# sourceMappingURL=rawbody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rawbody.js","sourceRoot":"","sources":["../../../src/lib/utils/rawbody.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,CAAO,QAAQ,EAAE,EAAE;IAC3C,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,EAAE;QACrB,OAAO,QAAQ,CAAC,OAAO,CAAA;KACxB;IAED,gGAAgG;IAChG,IAAI;QACF,MAAM,UAAU,GAAG,CAAC,wDAAa,UAAU,GAAC,CAAC,CAAC,OAAO,CAAA;QACrD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAA;KAC5B;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAA;QACvF,MAAM,KAAK,CAAA;KACZ;AACH,CAAC,CAAA,CAAA;AAED,yEAAyE;AAClE,MAAM,aAAa,GAAG,CAAO,GAAG,EAAE,EAAE;IAAC,OAAA,CAC1C,iBAAiB,CAAC,GAAG,CAAC;SACnB,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;SACvC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,GAAG,GAAG,EAAE,KAAK,CAAC,CAAA;QAChE,MAAM,KAAK,CAAA;IACf,CAAC,CAAC,CACH,CAAA;EAAA,CAAA;AAPY,QAAA,aAAa,iBAOzB"}
@@ -0,0 +1,10 @@
1
+ export function getVerificationHelpers({ keyPairs, crypto: _crypto, util: _util }?: {
2
+ keyPairs: any;
3
+ crypto: any;
4
+ util: any;
5
+ }): (req: any, params: any) => Promise<{
6
+ rawBody: any;
7
+ requestBody: any;
8
+ processResponse: (response: any) => Promise<any>;
9
+ }>;
10
+ //# sourceMappingURL=verification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verification.d.ts","sourceRoot":"","sources":["../../src/lib/verification.js"],"names":[],"mappings":"AAgBO;;;;;;;;GA6FN"}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.getVerificationHelpers = void 0;
16
+ const display_1 = require("../shared/display");
17
+ const request_1 = require("../shared/request");
18
+ const WebCrypto_1 = __importDefault(require("../shared/WebCrypto"));
19
+ const utils_1 = require("./utils");
20
+ const getVerificationHelpers = ({ keyPairs, crypto: _crypto, util: _util } = {}) => {
21
+ const webCrypto = new WebCrypto_1.default({ crypto: _crypto, util: _util });
22
+ return (req, params) => __awaiter(void 0, void 0, void 0, function* () {
23
+ var _a;
24
+ const { 'x-public-key': apiKey, 'x-ephemeral-key': ephemeralPublicKey, 'x-authorization-timestamp': customAuthTimestamp, 'x-authorization': customAuth, } = (_a = req.headers) !== null && _a !== void 0 ? _a : {};
25
+ const { uri: _uri, disableRecryption: _disableRecryption } = params !== null && params !== void 0 ? params : {};
26
+ const uri = _uri !== null && _uri !== void 0 ? _uri : req.url;
27
+ const disableRecryption = (0, display_1.isTrue)(_disableRecryption);
28
+ let isVerifiable;
29
+ try {
30
+ const [authProtocol, authSignature] = (0, display_1.ensureString)(customAuth).split(' ');
31
+ isVerifiable = (0, display_1.isTrue)(apiKey &&
32
+ ephemeralPublicKey &&
33
+ (keyPairs === null || keyPairs === void 0 ? void 0 : keyPairs.shared) &&
34
+ customAuthTimestamp &&
35
+ authSignature &&
36
+ (authProtocol === 'HMAC-SHA256'));
37
+ let verificationKeys;
38
+ const rawBody = yield (0, utils_1.ensureRawBody)(req);
39
+ // NOTE: requestBody should be wind up decrypted when isVerifiable (unless disableRecryption, then will pass through)
40
+ let requestBody = (0, display_1.safeParse)(rawBody);
41
+ // TEMP!!! remove isVerifiable check once webwidget moved to react
42
+ if (isVerifiable) {
43
+ if (!apiKey ||
44
+ !ephemeralPublicKey ||
45
+ !customAuthTimestamp ||
46
+ !authSignature ||
47
+ !(keyPairs === null || keyPairs === void 0 ? void 0 : keyPairs.shared) ||
48
+ (apiKey !== keyPairs.shared.publicKey) ||
49
+ (authProtocol !== 'HMAC-SHA256')) {
50
+ throw new utils_1.VerificationError('Invalid or missing authorization', { code: 401 });
51
+ }
52
+ verificationKeys = yield webCrypto.getVerificationKeys({
53
+ publicKey: ephemeralPublicKey,
54
+ privateKey: keyPairs.shared.privateKey,
55
+ });
56
+ if (!verificationKeys) {
57
+ throw new utils_1.VerificationError('Invalid or missing verification', { code: 412 });
58
+ }
59
+ const verificationPayload = (0, display_1.objectToSortedString)(Object.assign({ method: (0, request_1.getRequestMethod)(rawBody, req.method), timestamp: customAuthTimestamp, body: requestBody }, (0, request_1.normalizeURIParts)(uri)));
60
+ const isValid = yield webCrypto.verifyHMAC(verificationPayload, verificationKeys.derivedHMACKey, authSignature);
61
+ if (!isValid) {
62
+ throw new utils_1.VerificationError('Invalid or missing verification', { code: 412 });
63
+ }
64
+ if (!disableRecryption && requestBody) {
65
+ const decryptedMessage = yield webCrypto.decryptMessage(requestBody, verificationKeys.derivedSecretKey);
66
+ requestBody = (0, display_1.safeParse)(decryptedMessage);
67
+ }
68
+ }
69
+ const processResponse = (response) => __awaiter(void 0, void 0, void 0, function* () {
70
+ if (!response || disableRecryption || !isVerifiable || !(verificationKeys === null || verificationKeys === void 0 ? void 0 : verificationKeys.derivedSecretKey)) {
71
+ return response;
72
+ }
73
+ return webCrypto.encryptMessage(JSON.stringify(response), verificationKeys.derivedSecretKey);
74
+ });
75
+ return { rawBody, requestBody, processResponse };
76
+ }
77
+ catch (error) {
78
+ console.error(`Error handling request verification for '${uri}'`, { error, isVerifiable, disableRecryption });
79
+ throw error;
80
+ }
81
+ });
82
+ };
83
+ exports.getVerificationHelpers = getVerificationHelpers;
84
+ //# sourceMappingURL=verification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verification.js","sourceRoot":"","sources":["../../src/lib/verification.js"],"names":[],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ export * from "./useVerification";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./useVerification"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/hooks/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAiC"}
@@ -0,0 +1,8 @@
1
+ export function useVerification({ publicKey, disableRecryption, ...params }?: {
2
+ publicKey: any;
3
+ disableRecryption: any;
4
+ }): {
5
+ prepareVerification: (requestPath: any, requestOptions: any) => Promise<any[] | undefined>;
6
+ processResponse: (encryptedResponse: any, derivedSecretKey: any) => Promise<any>;
7
+ };
8
+ //# sourceMappingURL=useVerification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVerification.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useVerification.js"],"names":[],"mappings":"AAQO;;;;;;EA8BN"}