@fntio/infra-client 0.0.0-stage → 0.5.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 (940) hide show
  1. package/CHANGELOG.md +193 -0
  2. package/LICENSE +93 -0
  3. package/README.md +875 -2
  4. package/assets/acl-reconciler/index.js +1604 -0
  5. package/assets/api/index.js +9857 -0
  6. package/assets/api/package.json +9 -0
  7. package/assets/api/vendor_modules/.package-lock.json +857 -0
  8. package/assets/api/vendor_modules/accepts/HISTORY.md +243 -0
  9. package/assets/api/vendor_modules/accepts/LICENSE +23 -0
  10. package/assets/api/vendor_modules/accepts/README.md +140 -0
  11. package/assets/api/vendor_modules/accepts/index.js +238 -0
  12. package/assets/api/vendor_modules/accepts/package.json +47 -0
  13. package/assets/api/vendor_modules/array-flatten/LICENSE +21 -0
  14. package/assets/api/vendor_modules/array-flatten/README.md +43 -0
  15. package/assets/api/vendor_modules/array-flatten/array-flatten.js +64 -0
  16. package/assets/api/vendor_modules/array-flatten/package.json +39 -0
  17. package/assets/api/vendor_modules/aws-jwt-verify/LICENSE +175 -0
  18. package/assets/api/vendor_modules/aws-jwt-verify/README.md +1033 -0
  19. package/assets/api/vendor_modules/aws-jwt-verify/asn1.d.ts +20 -0
  20. package/assets/api/vendor_modules/aws-jwt-verify/assert.d.ts +41 -0
  21. package/assets/api/vendor_modules/aws-jwt-verify/cognito-verifier.d.ts +183 -0
  22. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/asn1.js +301 -0
  23. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/assert.js +108 -0
  24. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/cognito-verifier.js +158 -0
  25. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/error.js +131 -0
  26. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/https-common.js +29 -0
  27. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/https-node.js +89 -0
  28. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/https.js +52 -0
  29. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/index.js +9 -0
  30. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/jwk.js +221 -0
  31. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/jwt-model.js +10 -0
  32. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/jwt-rsa.js +397 -0
  33. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/jwt.js +161 -0
  34. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/node-web-compat-node.js +48 -0
  35. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/node-web-compat-web.js +78 -0
  36. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/node-web-compat.js +11 -0
  37. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/package.json +1 -0
  38. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/safe-json-parse.js +34 -0
  39. package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/typing-util.js +6 -0
  40. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/asn1.js +296 -0
  41. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/assert.js +101 -0
  42. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/cognito-verifier.js +153 -0
  43. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/error.js +101 -0
  44. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/https-common.js +25 -0
  45. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/https-node.js +85 -0
  46. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/https.js +48 -0
  47. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/index.js +4 -0
  48. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/jwk.js +208 -0
  49. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/jwt-model.js +7 -0
  50. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/jwt-rsa.js +389 -0
  51. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/jwt.js +156 -0
  52. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/node-web-compat-node.js +45 -0
  53. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/node-web-compat-web.js +75 -0
  54. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/node-web-compat.js +10 -0
  55. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/package.json +1 -0
  56. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/safe-json-parse.js +29 -0
  57. package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/typing-util.js +5 -0
  58. package/assets/api/vendor_modules/aws-jwt-verify/error.d.ts +108 -0
  59. package/assets/api/vendor_modules/aws-jwt-verify/https-common.d.ts +9 -0
  60. package/assets/api/vendor_modules/aws-jwt-verify/https-node.d.ts +20 -0
  61. package/assets/api/vendor_modules/aws-jwt-verify/https.d.ts +35 -0
  62. package/assets/api/vendor_modules/aws-jwt-verify/index.d.ts +2 -0
  63. package/assets/api/vendor_modules/aws-jwt-verify/jwk.d.ts +76 -0
  64. package/assets/api/vendor_modules/aws-jwt-verify/jwt-model.d.ts +78 -0
  65. package/assets/api/vendor_modules/aws-jwt-verify/jwt-rsa.d.ts +348 -0
  66. package/assets/api/vendor_modules/aws-jwt-verify/jwt.d.ts +51 -0
  67. package/assets/api/vendor_modules/aws-jwt-verify/package.json +136 -0
  68. package/assets/api/vendor_modules/aws-jwt-verify/safe-json-parse.d.ts +18 -0
  69. package/assets/api/vendor_modules/aws-jwt-verify/typing-util.d.ts +38 -0
  70. package/assets/api/vendor_modules/body-parser/HISTORY.md +703 -0
  71. package/assets/api/vendor_modules/body-parser/LICENSE +23 -0
  72. package/assets/api/vendor_modules/body-parser/README.md +476 -0
  73. package/assets/api/vendor_modules/body-parser/index.js +156 -0
  74. package/assets/api/vendor_modules/body-parser/lib/read.js +205 -0
  75. package/assets/api/vendor_modules/body-parser/lib/types/json.js +247 -0
  76. package/assets/api/vendor_modules/body-parser/lib/types/raw.js +105 -0
  77. package/assets/api/vendor_modules/body-parser/lib/types/text.js +125 -0
  78. package/assets/api/vendor_modules/body-parser/lib/types/urlencoded.js +303 -0
  79. package/assets/api/vendor_modules/body-parser/node_modules/qs/.editorconfig +46 -0
  80. package/assets/api/vendor_modules/body-parser/node_modules/qs/.github/FUNDING.yml +12 -0
  81. package/assets/api/vendor_modules/body-parser/node_modules/qs/.github/SECURITY.md +11 -0
  82. package/assets/api/vendor_modules/body-parser/node_modules/qs/.github/THREAT_MODEL.md +80 -0
  83. package/assets/api/vendor_modules/body-parser/node_modules/qs/.nycrc +13 -0
  84. package/assets/api/vendor_modules/body-parser/node_modules/qs/CHANGELOG.md +872 -0
  85. package/assets/api/vendor_modules/body-parser/node_modules/qs/LICENSE.md +29 -0
  86. package/assets/api/vendor_modules/body-parser/node_modules/qs/README.md +804 -0
  87. package/assets/api/vendor_modules/body-parser/node_modules/qs/dist/qs.js +141 -0
  88. package/assets/api/vendor_modules/body-parser/node_modules/qs/eslint.config.mjs +57 -0
  89. package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/formats.js +23 -0
  90. package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/index.js +11 -0
  91. package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/parse.js +503 -0
  92. package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/stringify.js +378 -0
  93. package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/utils.js +512 -0
  94. package/assets/api/vendor_modules/body-parser/node_modules/qs/package.json +95 -0
  95. package/assets/api/vendor_modules/body-parser/node_modules/qs/test/empty-keys-cases.js +267 -0
  96. package/assets/api/vendor_modules/body-parser/node_modules/qs/test/parse.js +2296 -0
  97. package/assets/api/vendor_modules/body-parser/node_modules/qs/test/stringify.js +1995 -0
  98. package/assets/api/vendor_modules/body-parser/node_modules/qs/test/utils.js +822 -0
  99. package/assets/api/vendor_modules/body-parser/package.json +55 -0
  100. package/assets/api/vendor_modules/bytes/History.md +97 -0
  101. package/assets/api/vendor_modules/bytes/LICENSE +23 -0
  102. package/assets/api/vendor_modules/bytes/Readme.md +152 -0
  103. package/assets/api/vendor_modules/bytes/index.js +170 -0
  104. package/assets/api/vendor_modules/bytes/package.json +42 -0
  105. package/assets/api/vendor_modules/call-bind-apply-helpers/.eslintrc +17 -0
  106. package/assets/api/vendor_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
  107. package/assets/api/vendor_modules/call-bind-apply-helpers/.nycrc +9 -0
  108. package/assets/api/vendor_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
  109. package/assets/api/vendor_modules/call-bind-apply-helpers/LICENSE +21 -0
  110. package/assets/api/vendor_modules/call-bind-apply-helpers/README.md +62 -0
  111. package/assets/api/vendor_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
  112. package/assets/api/vendor_modules/call-bind-apply-helpers/actualApply.js +10 -0
  113. package/assets/api/vendor_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
  114. package/assets/api/vendor_modules/call-bind-apply-helpers/applyBind.js +10 -0
  115. package/assets/api/vendor_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
  116. package/assets/api/vendor_modules/call-bind-apply-helpers/functionApply.js +4 -0
  117. package/assets/api/vendor_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
  118. package/assets/api/vendor_modules/call-bind-apply-helpers/functionCall.js +4 -0
  119. package/assets/api/vendor_modules/call-bind-apply-helpers/index.d.ts +64 -0
  120. package/assets/api/vendor_modules/call-bind-apply-helpers/index.js +15 -0
  121. package/assets/api/vendor_modules/call-bind-apply-helpers/package.json +85 -0
  122. package/assets/api/vendor_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
  123. package/assets/api/vendor_modules/call-bind-apply-helpers/reflectApply.js +4 -0
  124. package/assets/api/vendor_modules/call-bind-apply-helpers/test/index.js +63 -0
  125. package/assets/api/vendor_modules/call-bind-apply-helpers/tsconfig.json +9 -0
  126. package/assets/api/vendor_modules/call-bound/.eslintrc +13 -0
  127. package/assets/api/vendor_modules/call-bound/.github/FUNDING.yml +12 -0
  128. package/assets/api/vendor_modules/call-bound/.nycrc +9 -0
  129. package/assets/api/vendor_modules/call-bound/CHANGELOG.md +42 -0
  130. package/assets/api/vendor_modules/call-bound/LICENSE +21 -0
  131. package/assets/api/vendor_modules/call-bound/README.md +53 -0
  132. package/assets/api/vendor_modules/call-bound/index.d.ts +94 -0
  133. package/assets/api/vendor_modules/call-bound/index.js +19 -0
  134. package/assets/api/vendor_modules/call-bound/package.json +99 -0
  135. package/assets/api/vendor_modules/call-bound/test/index.js +61 -0
  136. package/assets/api/vendor_modules/call-bound/tsconfig.json +10 -0
  137. package/assets/api/vendor_modules/content-disposition/HISTORY.md +60 -0
  138. package/assets/api/vendor_modules/content-disposition/LICENSE +22 -0
  139. package/assets/api/vendor_modules/content-disposition/README.md +142 -0
  140. package/assets/api/vendor_modules/content-disposition/index.js +458 -0
  141. package/assets/api/vendor_modules/content-disposition/package.json +44 -0
  142. package/assets/api/vendor_modules/content-type/HISTORY.md +29 -0
  143. package/assets/api/vendor_modules/content-type/LICENSE +22 -0
  144. package/assets/api/vendor_modules/content-type/README.md +94 -0
  145. package/assets/api/vendor_modules/content-type/index.js +225 -0
  146. package/assets/api/vendor_modules/content-type/package.json +42 -0
  147. package/assets/api/vendor_modules/cookie/LICENSE +24 -0
  148. package/assets/api/vendor_modules/cookie/README.md +317 -0
  149. package/assets/api/vendor_modules/cookie/SECURITY.md +25 -0
  150. package/assets/api/vendor_modules/cookie/index.js +335 -0
  151. package/assets/api/vendor_modules/cookie/package.json +44 -0
  152. package/assets/api/vendor_modules/cookie-signature/History.md +42 -0
  153. package/assets/api/vendor_modules/cookie-signature/Readme.md +42 -0
  154. package/assets/api/vendor_modules/cookie-signature/index.js +51 -0
  155. package/assets/api/vendor_modules/cookie-signature/package.json +18 -0
  156. package/assets/api/vendor_modules/debug/.coveralls.yml +1 -0
  157. package/assets/api/vendor_modules/debug/.eslintrc +11 -0
  158. package/assets/api/vendor_modules/debug/.travis.yml +14 -0
  159. package/assets/api/vendor_modules/debug/CHANGELOG.md +362 -0
  160. package/assets/api/vendor_modules/debug/LICENSE +19 -0
  161. package/assets/api/vendor_modules/debug/Makefile +50 -0
  162. package/assets/api/vendor_modules/debug/README.md +312 -0
  163. package/assets/api/vendor_modules/debug/component.json +19 -0
  164. package/assets/api/vendor_modules/debug/karma.conf.js +70 -0
  165. package/assets/api/vendor_modules/debug/node.js +1 -0
  166. package/assets/api/vendor_modules/debug/package.json +49 -0
  167. package/assets/api/vendor_modules/debug/src/browser.js +185 -0
  168. package/assets/api/vendor_modules/debug/src/debug.js +202 -0
  169. package/assets/api/vendor_modules/debug/src/index.js +10 -0
  170. package/assets/api/vendor_modules/debug/src/inspector-log.js +15 -0
  171. package/assets/api/vendor_modules/debug/src/node.js +248 -0
  172. package/assets/api/vendor_modules/depd/History.md +103 -0
  173. package/assets/api/vendor_modules/depd/LICENSE +22 -0
  174. package/assets/api/vendor_modules/depd/Readme.md +280 -0
  175. package/assets/api/vendor_modules/depd/index.js +538 -0
  176. package/assets/api/vendor_modules/depd/lib/browser/index.js +77 -0
  177. package/assets/api/vendor_modules/depd/package.json +45 -0
  178. package/assets/api/vendor_modules/destroy/LICENSE +23 -0
  179. package/assets/api/vendor_modules/destroy/README.md +63 -0
  180. package/assets/api/vendor_modules/destroy/index.js +209 -0
  181. package/assets/api/vendor_modules/destroy/package.json +48 -0
  182. package/assets/api/vendor_modules/dunder-proto/.eslintrc +5 -0
  183. package/assets/api/vendor_modules/dunder-proto/.github/FUNDING.yml +12 -0
  184. package/assets/api/vendor_modules/dunder-proto/.nycrc +13 -0
  185. package/assets/api/vendor_modules/dunder-proto/CHANGELOG.md +24 -0
  186. package/assets/api/vendor_modules/dunder-proto/LICENSE +21 -0
  187. package/assets/api/vendor_modules/dunder-proto/README.md +54 -0
  188. package/assets/api/vendor_modules/dunder-proto/get.d.ts +5 -0
  189. package/assets/api/vendor_modules/dunder-proto/get.js +30 -0
  190. package/assets/api/vendor_modules/dunder-proto/package.json +76 -0
  191. package/assets/api/vendor_modules/dunder-proto/set.d.ts +5 -0
  192. package/assets/api/vendor_modules/dunder-proto/set.js +35 -0
  193. package/assets/api/vendor_modules/dunder-proto/test/get.js +34 -0
  194. package/assets/api/vendor_modules/dunder-proto/test/index.js +4 -0
  195. package/assets/api/vendor_modules/dunder-proto/test/set.js +50 -0
  196. package/assets/api/vendor_modules/dunder-proto/tsconfig.json +9 -0
  197. package/assets/api/vendor_modules/ee-first/LICENSE +22 -0
  198. package/assets/api/vendor_modules/ee-first/README.md +80 -0
  199. package/assets/api/vendor_modules/ee-first/index.js +95 -0
  200. package/assets/api/vendor_modules/ee-first/package.json +29 -0
  201. package/assets/api/vendor_modules/encodeurl/LICENSE +22 -0
  202. package/assets/api/vendor_modules/encodeurl/README.md +109 -0
  203. package/assets/api/vendor_modules/encodeurl/index.js +60 -0
  204. package/assets/api/vendor_modules/encodeurl/package.json +40 -0
  205. package/assets/api/vendor_modules/es-define-property/.eslintrc +13 -0
  206. package/assets/api/vendor_modules/es-define-property/.github/FUNDING.yml +12 -0
  207. package/assets/api/vendor_modules/es-define-property/.nycrc +9 -0
  208. package/assets/api/vendor_modules/es-define-property/CHANGELOG.md +29 -0
  209. package/assets/api/vendor_modules/es-define-property/LICENSE +21 -0
  210. package/assets/api/vendor_modules/es-define-property/README.md +49 -0
  211. package/assets/api/vendor_modules/es-define-property/index.d.ts +3 -0
  212. package/assets/api/vendor_modules/es-define-property/index.js +14 -0
  213. package/assets/api/vendor_modules/es-define-property/package.json +81 -0
  214. package/assets/api/vendor_modules/es-define-property/test/index.js +56 -0
  215. package/assets/api/vendor_modules/es-define-property/tsconfig.json +10 -0
  216. package/assets/api/vendor_modules/es-errors/.eslintrc +5 -0
  217. package/assets/api/vendor_modules/es-errors/.github/FUNDING.yml +12 -0
  218. package/assets/api/vendor_modules/es-errors/CHANGELOG.md +40 -0
  219. package/assets/api/vendor_modules/es-errors/LICENSE +21 -0
  220. package/assets/api/vendor_modules/es-errors/README.md +55 -0
  221. package/assets/api/vendor_modules/es-errors/eval.d.ts +3 -0
  222. package/assets/api/vendor_modules/es-errors/eval.js +4 -0
  223. package/assets/api/vendor_modules/es-errors/index.d.ts +3 -0
  224. package/assets/api/vendor_modules/es-errors/index.js +4 -0
  225. package/assets/api/vendor_modules/es-errors/package.json +80 -0
  226. package/assets/api/vendor_modules/es-errors/range.d.ts +3 -0
  227. package/assets/api/vendor_modules/es-errors/range.js +4 -0
  228. package/assets/api/vendor_modules/es-errors/ref.d.ts +3 -0
  229. package/assets/api/vendor_modules/es-errors/ref.js +4 -0
  230. package/assets/api/vendor_modules/es-errors/syntax.d.ts +3 -0
  231. package/assets/api/vendor_modules/es-errors/syntax.js +4 -0
  232. package/assets/api/vendor_modules/es-errors/test/index.js +19 -0
  233. package/assets/api/vendor_modules/es-errors/tsconfig.json +49 -0
  234. package/assets/api/vendor_modules/es-errors/type.d.ts +3 -0
  235. package/assets/api/vendor_modules/es-errors/type.js +4 -0
  236. package/assets/api/vendor_modules/es-errors/uri.d.ts +3 -0
  237. package/assets/api/vendor_modules/es-errors/uri.js +4 -0
  238. package/assets/api/vendor_modules/es-object-atoms/.eslintrc +16 -0
  239. package/assets/api/vendor_modules/es-object-atoms/.github/FUNDING.yml +12 -0
  240. package/assets/api/vendor_modules/es-object-atoms/CHANGELOG.md +44 -0
  241. package/assets/api/vendor_modules/es-object-atoms/LICENSE +21 -0
  242. package/assets/api/vendor_modules/es-object-atoms/README.md +63 -0
  243. package/assets/api/vendor_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
  244. package/assets/api/vendor_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
  245. package/assets/api/vendor_modules/es-object-atoms/ToObject.d.ts +7 -0
  246. package/assets/api/vendor_modules/es-object-atoms/ToObject.js +10 -0
  247. package/assets/api/vendor_modules/es-object-atoms/index.d.ts +3 -0
  248. package/assets/api/vendor_modules/es-object-atoms/index.js +4 -0
  249. package/assets/api/vendor_modules/es-object-atoms/isObject.d.ts +3 -0
  250. package/assets/api/vendor_modules/es-object-atoms/isObject.js +6 -0
  251. package/assets/api/vendor_modules/es-object-atoms/package.json +79 -0
  252. package/assets/api/vendor_modules/es-object-atoms/test/index.js +38 -0
  253. package/assets/api/vendor_modules/es-object-atoms/tsconfig.json +7 -0
  254. package/assets/api/vendor_modules/escape-html/LICENSE +24 -0
  255. package/assets/api/vendor_modules/escape-html/Readme.md +43 -0
  256. package/assets/api/vendor_modules/escape-html/index.js +78 -0
  257. package/assets/api/vendor_modules/escape-html/package.json +24 -0
  258. package/assets/api/vendor_modules/etag/HISTORY.md +83 -0
  259. package/assets/api/vendor_modules/etag/LICENSE +22 -0
  260. package/assets/api/vendor_modules/etag/README.md +159 -0
  261. package/assets/api/vendor_modules/etag/index.js +131 -0
  262. package/assets/api/vendor_modules/etag/package.json +47 -0
  263. package/assets/api/vendor_modules/express/History.md +3676 -0
  264. package/assets/api/vendor_modules/express/LICENSE +24 -0
  265. package/assets/api/vendor_modules/express/Readme.md +260 -0
  266. package/assets/api/vendor_modules/express/index.js +11 -0
  267. package/assets/api/vendor_modules/express/lib/application.js +661 -0
  268. package/assets/api/vendor_modules/express/lib/express.js +116 -0
  269. package/assets/api/vendor_modules/express/lib/middleware/init.js +43 -0
  270. package/assets/api/vendor_modules/express/lib/middleware/query.js +47 -0
  271. package/assets/api/vendor_modules/express/lib/request.js +525 -0
  272. package/assets/api/vendor_modules/express/lib/response.js +1179 -0
  273. package/assets/api/vendor_modules/express/lib/router/index.js +673 -0
  274. package/assets/api/vendor_modules/express/lib/router/layer.js +181 -0
  275. package/assets/api/vendor_modules/express/lib/router/route.js +230 -0
  276. package/assets/api/vendor_modules/express/lib/utils.js +304 -0
  277. package/assets/api/vendor_modules/express/lib/view.js +182 -0
  278. package/assets/api/vendor_modules/express/package.json +102 -0
  279. package/assets/api/vendor_modules/finalhandler/HISTORY.md +216 -0
  280. package/assets/api/vendor_modules/finalhandler/LICENSE +22 -0
  281. package/assets/api/vendor_modules/finalhandler/README.md +147 -0
  282. package/assets/api/vendor_modules/finalhandler/SECURITY.md +25 -0
  283. package/assets/api/vendor_modules/finalhandler/index.js +341 -0
  284. package/assets/api/vendor_modules/finalhandler/package.json +47 -0
  285. package/assets/api/vendor_modules/forwarded/HISTORY.md +21 -0
  286. package/assets/api/vendor_modules/forwarded/LICENSE +22 -0
  287. package/assets/api/vendor_modules/forwarded/README.md +57 -0
  288. package/assets/api/vendor_modules/forwarded/index.js +90 -0
  289. package/assets/api/vendor_modules/forwarded/package.json +45 -0
  290. package/assets/api/vendor_modules/fresh/HISTORY.md +70 -0
  291. package/assets/api/vendor_modules/fresh/LICENSE +23 -0
  292. package/assets/api/vendor_modules/fresh/README.md +119 -0
  293. package/assets/api/vendor_modules/fresh/index.js +137 -0
  294. package/assets/api/vendor_modules/fresh/package.json +46 -0
  295. package/assets/api/vendor_modules/function-bind/.eslintrc +21 -0
  296. package/assets/api/vendor_modules/function-bind/.github/FUNDING.yml +12 -0
  297. package/assets/api/vendor_modules/function-bind/.github/SECURITY.md +3 -0
  298. package/assets/api/vendor_modules/function-bind/.nycrc +13 -0
  299. package/assets/api/vendor_modules/function-bind/CHANGELOG.md +136 -0
  300. package/assets/api/vendor_modules/function-bind/LICENSE +20 -0
  301. package/assets/api/vendor_modules/function-bind/README.md +46 -0
  302. package/assets/api/vendor_modules/function-bind/implementation.js +84 -0
  303. package/assets/api/vendor_modules/function-bind/index.js +5 -0
  304. package/assets/api/vendor_modules/function-bind/package.json +87 -0
  305. package/assets/api/vendor_modules/function-bind/test/.eslintrc +9 -0
  306. package/assets/api/vendor_modules/function-bind/test/index.js +252 -0
  307. package/assets/api/vendor_modules/get-intrinsic/.eslintrc +42 -0
  308. package/assets/api/vendor_modules/get-intrinsic/.github/FUNDING.yml +12 -0
  309. package/assets/api/vendor_modules/get-intrinsic/.nycrc +9 -0
  310. package/assets/api/vendor_modules/get-intrinsic/CHANGELOG.md +186 -0
  311. package/assets/api/vendor_modules/get-intrinsic/LICENSE +21 -0
  312. package/assets/api/vendor_modules/get-intrinsic/README.md +71 -0
  313. package/assets/api/vendor_modules/get-intrinsic/index.js +378 -0
  314. package/assets/api/vendor_modules/get-intrinsic/package.json +97 -0
  315. package/assets/api/vendor_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
  316. package/assets/api/vendor_modules/get-proto/.eslintrc +10 -0
  317. package/assets/api/vendor_modules/get-proto/.github/FUNDING.yml +12 -0
  318. package/assets/api/vendor_modules/get-proto/.nycrc +9 -0
  319. package/assets/api/vendor_modules/get-proto/CHANGELOG.md +21 -0
  320. package/assets/api/vendor_modules/get-proto/LICENSE +21 -0
  321. package/assets/api/vendor_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
  322. package/assets/api/vendor_modules/get-proto/Object.getPrototypeOf.js +6 -0
  323. package/assets/api/vendor_modules/get-proto/README.md +50 -0
  324. package/assets/api/vendor_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
  325. package/assets/api/vendor_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
  326. package/assets/api/vendor_modules/get-proto/index.d.ts +5 -0
  327. package/assets/api/vendor_modules/get-proto/index.js +27 -0
  328. package/assets/api/vendor_modules/get-proto/package.json +81 -0
  329. package/assets/api/vendor_modules/get-proto/test/index.js +68 -0
  330. package/assets/api/vendor_modules/get-proto/tsconfig.json +9 -0
  331. package/assets/api/vendor_modules/gopd/.eslintrc +16 -0
  332. package/assets/api/vendor_modules/gopd/.github/FUNDING.yml +12 -0
  333. package/assets/api/vendor_modules/gopd/CHANGELOG.md +45 -0
  334. package/assets/api/vendor_modules/gopd/LICENSE +21 -0
  335. package/assets/api/vendor_modules/gopd/README.md +40 -0
  336. package/assets/api/vendor_modules/gopd/gOPD.d.ts +1 -0
  337. package/assets/api/vendor_modules/gopd/gOPD.js +4 -0
  338. package/assets/api/vendor_modules/gopd/index.d.ts +5 -0
  339. package/assets/api/vendor_modules/gopd/index.js +15 -0
  340. package/assets/api/vendor_modules/gopd/package.json +77 -0
  341. package/assets/api/vendor_modules/gopd/test/index.js +36 -0
  342. package/assets/api/vendor_modules/gopd/tsconfig.json +9 -0
  343. package/assets/api/vendor_modules/has-symbols/.eslintrc +11 -0
  344. package/assets/api/vendor_modules/has-symbols/.github/FUNDING.yml +12 -0
  345. package/assets/api/vendor_modules/has-symbols/.nycrc +9 -0
  346. package/assets/api/vendor_modules/has-symbols/CHANGELOG.md +91 -0
  347. package/assets/api/vendor_modules/has-symbols/LICENSE +21 -0
  348. package/assets/api/vendor_modules/has-symbols/README.md +46 -0
  349. package/assets/api/vendor_modules/has-symbols/index.d.ts +3 -0
  350. package/assets/api/vendor_modules/has-symbols/index.js +14 -0
  351. package/assets/api/vendor_modules/has-symbols/package.json +111 -0
  352. package/assets/api/vendor_modules/has-symbols/shams.d.ts +3 -0
  353. package/assets/api/vendor_modules/has-symbols/shams.js +45 -0
  354. package/assets/api/vendor_modules/has-symbols/test/index.js +22 -0
  355. package/assets/api/vendor_modules/has-symbols/test/shams/core-js.js +29 -0
  356. package/assets/api/vendor_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
  357. package/assets/api/vendor_modules/has-symbols/test/tests.js +58 -0
  358. package/assets/api/vendor_modules/has-symbols/tsconfig.json +10 -0
  359. package/assets/api/vendor_modules/hasown/.github/FUNDING.yml +12 -0
  360. package/assets/api/vendor_modules/hasown/.nycrc +13 -0
  361. package/assets/api/vendor_modules/hasown/CHANGELOG.md +58 -0
  362. package/assets/api/vendor_modules/hasown/LICENSE +21 -0
  363. package/assets/api/vendor_modules/hasown/README.md +40 -0
  364. package/assets/api/vendor_modules/hasown/eslint.config.mjs +6 -0
  365. package/assets/api/vendor_modules/hasown/index.d.ts +3 -0
  366. package/assets/api/vendor_modules/hasown/index.js +8 -0
  367. package/assets/api/vendor_modules/hasown/package.json +91 -0
  368. package/assets/api/vendor_modules/hasown/tsconfig.json +6 -0
  369. package/assets/api/vendor_modules/http-errors/HISTORY.md +186 -0
  370. package/assets/api/vendor_modules/http-errors/LICENSE +23 -0
  371. package/assets/api/vendor_modules/http-errors/README.md +169 -0
  372. package/assets/api/vendor_modules/http-errors/index.js +290 -0
  373. package/assets/api/vendor_modules/http-errors/package.json +54 -0
  374. package/assets/api/vendor_modules/iconv-lite/Changelog.md +162 -0
  375. package/assets/api/vendor_modules/iconv-lite/LICENSE +21 -0
  376. package/assets/api/vendor_modules/iconv-lite/README.md +156 -0
  377. package/assets/api/vendor_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
  378. package/assets/api/vendor_modules/iconv-lite/encodings/dbcs-data.js +176 -0
  379. package/assets/api/vendor_modules/iconv-lite/encodings/index.js +22 -0
  380. package/assets/api/vendor_modules/iconv-lite/encodings/internal.js +188 -0
  381. package/assets/api/vendor_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
  382. package/assets/api/vendor_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  383. package/assets/api/vendor_modules/iconv-lite/encodings/sbcs-data.js +174 -0
  384. package/assets/api/vendor_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  385. package/assets/api/vendor_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  386. package/assets/api/vendor_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  387. package/assets/api/vendor_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  388. package/assets/api/vendor_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  389. package/assets/api/vendor_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  390. package/assets/api/vendor_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
  391. package/assets/api/vendor_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  392. package/assets/api/vendor_modules/iconv-lite/encodings/utf16.js +177 -0
  393. package/assets/api/vendor_modules/iconv-lite/encodings/utf7.js +290 -0
  394. package/assets/api/vendor_modules/iconv-lite/lib/bom-handling.js +52 -0
  395. package/assets/api/vendor_modules/iconv-lite/lib/extend-node.js +217 -0
  396. package/assets/api/vendor_modules/iconv-lite/lib/index.d.ts +24 -0
  397. package/assets/api/vendor_modules/iconv-lite/lib/index.js +153 -0
  398. package/assets/api/vendor_modules/iconv-lite/lib/streams.js +121 -0
  399. package/assets/api/vendor_modules/iconv-lite/package.json +46 -0
  400. package/assets/api/vendor_modules/inherits/LICENSE +16 -0
  401. package/assets/api/vendor_modules/inherits/README.md +42 -0
  402. package/assets/api/vendor_modules/inherits/inherits.js +9 -0
  403. package/assets/api/vendor_modules/inherits/inherits_browser.js +27 -0
  404. package/assets/api/vendor_modules/inherits/package.json +29 -0
  405. package/assets/api/vendor_modules/ipaddr.js/LICENSE +19 -0
  406. package/assets/api/vendor_modules/ipaddr.js/README.md +233 -0
  407. package/assets/api/vendor_modules/ipaddr.js/ipaddr.min.js +1 -0
  408. package/assets/api/vendor_modules/ipaddr.js/lib/ipaddr.js +673 -0
  409. package/assets/api/vendor_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
  410. package/assets/api/vendor_modules/ipaddr.js/package.json +35 -0
  411. package/assets/api/vendor_modules/math-intrinsics/.eslintrc +16 -0
  412. package/assets/api/vendor_modules/math-intrinsics/.github/FUNDING.yml +12 -0
  413. package/assets/api/vendor_modules/math-intrinsics/CHANGELOG.md +24 -0
  414. package/assets/api/vendor_modules/math-intrinsics/LICENSE +21 -0
  415. package/assets/api/vendor_modules/math-intrinsics/README.md +50 -0
  416. package/assets/api/vendor_modules/math-intrinsics/abs.d.ts +1 -0
  417. package/assets/api/vendor_modules/math-intrinsics/abs.js +4 -0
  418. package/assets/api/vendor_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
  419. package/assets/api/vendor_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
  420. package/assets/api/vendor_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
  421. package/assets/api/vendor_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
  422. package/assets/api/vendor_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
  423. package/assets/api/vendor_modules/math-intrinsics/constants/maxValue.js +5 -0
  424. package/assets/api/vendor_modules/math-intrinsics/floor.d.ts +1 -0
  425. package/assets/api/vendor_modules/math-intrinsics/floor.js +4 -0
  426. package/assets/api/vendor_modules/math-intrinsics/isFinite.d.ts +3 -0
  427. package/assets/api/vendor_modules/math-intrinsics/isFinite.js +12 -0
  428. package/assets/api/vendor_modules/math-intrinsics/isInteger.d.ts +3 -0
  429. package/assets/api/vendor_modules/math-intrinsics/isInteger.js +16 -0
  430. package/assets/api/vendor_modules/math-intrinsics/isNaN.d.ts +1 -0
  431. package/assets/api/vendor_modules/math-intrinsics/isNaN.js +6 -0
  432. package/assets/api/vendor_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
  433. package/assets/api/vendor_modules/math-intrinsics/isNegativeZero.js +6 -0
  434. package/assets/api/vendor_modules/math-intrinsics/max.d.ts +1 -0
  435. package/assets/api/vendor_modules/math-intrinsics/max.js +4 -0
  436. package/assets/api/vendor_modules/math-intrinsics/min.d.ts +1 -0
  437. package/assets/api/vendor_modules/math-intrinsics/min.js +4 -0
  438. package/assets/api/vendor_modules/math-intrinsics/mod.d.ts +3 -0
  439. package/assets/api/vendor_modules/math-intrinsics/mod.js +9 -0
  440. package/assets/api/vendor_modules/math-intrinsics/package.json +86 -0
  441. package/assets/api/vendor_modules/math-intrinsics/pow.d.ts +1 -0
  442. package/assets/api/vendor_modules/math-intrinsics/pow.js +4 -0
  443. package/assets/api/vendor_modules/math-intrinsics/round.d.ts +1 -0
  444. package/assets/api/vendor_modules/math-intrinsics/round.js +4 -0
  445. package/assets/api/vendor_modules/math-intrinsics/sign.d.ts +3 -0
  446. package/assets/api/vendor_modules/math-intrinsics/sign.js +11 -0
  447. package/assets/api/vendor_modules/math-intrinsics/test/index.js +192 -0
  448. package/assets/api/vendor_modules/math-intrinsics/tsconfig.json +3 -0
  449. package/assets/api/vendor_modules/media-typer/HISTORY.md +22 -0
  450. package/assets/api/vendor_modules/media-typer/LICENSE +22 -0
  451. package/assets/api/vendor_modules/media-typer/README.md +81 -0
  452. package/assets/api/vendor_modules/media-typer/index.js +270 -0
  453. package/assets/api/vendor_modules/media-typer/package.json +26 -0
  454. package/assets/api/vendor_modules/merge-descriptors/HISTORY.md +21 -0
  455. package/assets/api/vendor_modules/merge-descriptors/LICENSE +23 -0
  456. package/assets/api/vendor_modules/merge-descriptors/README.md +49 -0
  457. package/assets/api/vendor_modules/merge-descriptors/index.js +60 -0
  458. package/assets/api/vendor_modules/merge-descriptors/package.json +39 -0
  459. package/assets/api/vendor_modules/methods/HISTORY.md +29 -0
  460. package/assets/api/vendor_modules/methods/LICENSE +24 -0
  461. package/assets/api/vendor_modules/methods/README.md +51 -0
  462. package/assets/api/vendor_modules/methods/index.js +69 -0
  463. package/assets/api/vendor_modules/methods/package.json +36 -0
  464. package/assets/api/vendor_modules/mime/CHANGELOG.md +164 -0
  465. package/assets/api/vendor_modules/mime/LICENSE +21 -0
  466. package/assets/api/vendor_modules/mime/README.md +90 -0
  467. package/assets/api/vendor_modules/mime/cli.js +8 -0
  468. package/assets/api/vendor_modules/mime/mime.js +108 -0
  469. package/assets/api/vendor_modules/mime/package.json +44 -0
  470. package/assets/api/vendor_modules/mime/src/build.js +53 -0
  471. package/assets/api/vendor_modules/mime/src/test.js +60 -0
  472. package/assets/api/vendor_modules/mime/types.json +1 -0
  473. package/assets/api/vendor_modules/mime-db/HISTORY.md +507 -0
  474. package/assets/api/vendor_modules/mime-db/LICENSE +23 -0
  475. package/assets/api/vendor_modules/mime-db/README.md +100 -0
  476. package/assets/api/vendor_modules/mime-db/db.json +8519 -0
  477. package/assets/api/vendor_modules/mime-db/index.js +12 -0
  478. package/assets/api/vendor_modules/mime-db/package.json +60 -0
  479. package/assets/api/vendor_modules/mime-types/HISTORY.md +397 -0
  480. package/assets/api/vendor_modules/mime-types/LICENSE +23 -0
  481. package/assets/api/vendor_modules/mime-types/README.md +113 -0
  482. package/assets/api/vendor_modules/mime-types/index.js +188 -0
  483. package/assets/api/vendor_modules/mime-types/package.json +44 -0
  484. package/assets/api/vendor_modules/ms/index.js +152 -0
  485. package/assets/api/vendor_modules/ms/license.md +21 -0
  486. package/assets/api/vendor_modules/ms/package.json +37 -0
  487. package/assets/api/vendor_modules/ms/readme.md +51 -0
  488. package/assets/api/vendor_modules/negotiator/HISTORY.md +108 -0
  489. package/assets/api/vendor_modules/negotiator/LICENSE +24 -0
  490. package/assets/api/vendor_modules/negotiator/README.md +203 -0
  491. package/assets/api/vendor_modules/negotiator/index.js +82 -0
  492. package/assets/api/vendor_modules/negotiator/lib/charset.js +169 -0
  493. package/assets/api/vendor_modules/negotiator/lib/encoding.js +184 -0
  494. package/assets/api/vendor_modules/negotiator/lib/language.js +179 -0
  495. package/assets/api/vendor_modules/negotiator/lib/mediaType.js +294 -0
  496. package/assets/api/vendor_modules/negotiator/package.json +42 -0
  497. package/assets/api/vendor_modules/object-inspect/.eslintrc +53 -0
  498. package/assets/api/vendor_modules/object-inspect/.github/FUNDING.yml +12 -0
  499. package/assets/api/vendor_modules/object-inspect/.nycrc +13 -0
  500. package/assets/api/vendor_modules/object-inspect/CHANGELOG.md +424 -0
  501. package/assets/api/vendor_modules/object-inspect/LICENSE +21 -0
  502. package/assets/api/vendor_modules/object-inspect/example/all.js +23 -0
  503. package/assets/api/vendor_modules/object-inspect/example/circular.js +6 -0
  504. package/assets/api/vendor_modules/object-inspect/example/fn.js +5 -0
  505. package/assets/api/vendor_modules/object-inspect/example/inspect.js +10 -0
  506. package/assets/api/vendor_modules/object-inspect/index.js +544 -0
  507. package/assets/api/vendor_modules/object-inspect/package-support.json +20 -0
  508. package/assets/api/vendor_modules/object-inspect/package.json +105 -0
  509. package/assets/api/vendor_modules/object-inspect/readme.markdown +84 -0
  510. package/assets/api/vendor_modules/object-inspect/test/bigint.js +58 -0
  511. package/assets/api/vendor_modules/object-inspect/test/browser/dom.js +15 -0
  512. package/assets/api/vendor_modules/object-inspect/test/circular.js +16 -0
  513. package/assets/api/vendor_modules/object-inspect/test/deep.js +12 -0
  514. package/assets/api/vendor_modules/object-inspect/test/element.js +53 -0
  515. package/assets/api/vendor_modules/object-inspect/test/err.js +48 -0
  516. package/assets/api/vendor_modules/object-inspect/test/fakes.js +29 -0
  517. package/assets/api/vendor_modules/object-inspect/test/fn.js +76 -0
  518. package/assets/api/vendor_modules/object-inspect/test/global.js +17 -0
  519. package/assets/api/vendor_modules/object-inspect/test/has.js +15 -0
  520. package/assets/api/vendor_modules/object-inspect/test/holes.js +15 -0
  521. package/assets/api/vendor_modules/object-inspect/test/indent-option.js +271 -0
  522. package/assets/api/vendor_modules/object-inspect/test/inspect.js +139 -0
  523. package/assets/api/vendor_modules/object-inspect/test/lowbyte.js +12 -0
  524. package/assets/api/vendor_modules/object-inspect/test/number.js +58 -0
  525. package/assets/api/vendor_modules/object-inspect/test/quoteStyle.js +26 -0
  526. package/assets/api/vendor_modules/object-inspect/test/toStringTag.js +40 -0
  527. package/assets/api/vendor_modules/object-inspect/test/undef.js +12 -0
  528. package/assets/api/vendor_modules/object-inspect/test/values.js +261 -0
  529. package/assets/api/vendor_modules/object-inspect/test-core-js.js +26 -0
  530. package/assets/api/vendor_modules/object-inspect/util.inspect.js +1 -0
  531. package/assets/api/vendor_modules/on-finished/HISTORY.md +98 -0
  532. package/assets/api/vendor_modules/on-finished/LICENSE +23 -0
  533. package/assets/api/vendor_modules/on-finished/README.md +162 -0
  534. package/assets/api/vendor_modules/on-finished/index.js +234 -0
  535. package/assets/api/vendor_modules/on-finished/package.json +39 -0
  536. package/assets/api/vendor_modules/parseurl/HISTORY.md +58 -0
  537. package/assets/api/vendor_modules/parseurl/LICENSE +24 -0
  538. package/assets/api/vendor_modules/parseurl/README.md +133 -0
  539. package/assets/api/vendor_modules/parseurl/index.js +158 -0
  540. package/assets/api/vendor_modules/parseurl/package.json +40 -0
  541. package/assets/api/vendor_modules/path-to-regexp/LICENSE +21 -0
  542. package/assets/api/vendor_modules/path-to-regexp/Readme.md +35 -0
  543. package/assets/api/vendor_modules/path-to-regexp/index.js +158 -0
  544. package/assets/api/vendor_modules/path-to-regexp/package.json +30 -0
  545. package/assets/api/vendor_modules/proxy-addr/HISTORY.md +167 -0
  546. package/assets/api/vendor_modules/proxy-addr/LICENSE +22 -0
  547. package/assets/api/vendor_modules/proxy-addr/README.md +139 -0
  548. package/assets/api/vendor_modules/proxy-addr/index.js +359 -0
  549. package/assets/api/vendor_modules/proxy-addr/package.json +51 -0
  550. package/assets/api/vendor_modules/qs/.editorconfig +46 -0
  551. package/assets/api/vendor_modules/qs/.github/FUNDING.yml +12 -0
  552. package/assets/api/vendor_modules/qs/.github/SECURITY.md +11 -0
  553. package/assets/api/vendor_modules/qs/.github/THREAT_MODEL.md +78 -0
  554. package/assets/api/vendor_modules/qs/.nycrc +13 -0
  555. package/assets/api/vendor_modules/qs/CHANGELOG.md +833 -0
  556. package/assets/api/vendor_modules/qs/LICENSE.md +29 -0
  557. package/assets/api/vendor_modules/qs/README.md +758 -0
  558. package/assets/api/vendor_modules/qs/dist/qs.js +141 -0
  559. package/assets/api/vendor_modules/qs/eslint.config.mjs +57 -0
  560. package/assets/api/vendor_modules/qs/lib/formats.js +23 -0
  561. package/assets/api/vendor_modules/qs/lib/index.js +11 -0
  562. package/assets/api/vendor_modules/qs/lib/parse.js +414 -0
  563. package/assets/api/vendor_modules/qs/lib/stringify.js +363 -0
  564. package/assets/api/vendor_modules/qs/lib/utils.js +381 -0
  565. package/assets/api/vendor_modules/qs/package.json +95 -0
  566. package/assets/api/vendor_modules/qs/test/empty-keys-cases.js +267 -0
  567. package/assets/api/vendor_modules/qs/test/parse.js +1933 -0
  568. package/assets/api/vendor_modules/qs/test/stringify.js +1448 -0
  569. package/assets/api/vendor_modules/qs/test/utils.js +626 -0
  570. package/assets/api/vendor_modules/range-parser/HISTORY.md +56 -0
  571. package/assets/api/vendor_modules/range-parser/LICENSE +23 -0
  572. package/assets/api/vendor_modules/range-parser/README.md +84 -0
  573. package/assets/api/vendor_modules/range-parser/index.js +162 -0
  574. package/assets/api/vendor_modules/range-parser/package.json +44 -0
  575. package/assets/api/vendor_modules/raw-body/LICENSE +22 -0
  576. package/assets/api/vendor_modules/raw-body/README.md +223 -0
  577. package/assets/api/vendor_modules/raw-body/index.d.ts +87 -0
  578. package/assets/api/vendor_modules/raw-body/index.js +336 -0
  579. package/assets/api/vendor_modules/raw-body/package.json +47 -0
  580. package/assets/api/vendor_modules/safe-buffer/LICENSE +21 -0
  581. package/assets/api/vendor_modules/safe-buffer/README.md +584 -0
  582. package/assets/api/vendor_modules/safe-buffer/index.d.ts +187 -0
  583. package/assets/api/vendor_modules/safe-buffer/index.js +65 -0
  584. package/assets/api/vendor_modules/safe-buffer/package.json +51 -0
  585. package/assets/api/vendor_modules/safer-buffer/LICENSE +21 -0
  586. package/assets/api/vendor_modules/safer-buffer/Porting-Buffer.md +268 -0
  587. package/assets/api/vendor_modules/safer-buffer/Readme.md +156 -0
  588. package/assets/api/vendor_modules/safer-buffer/dangerous.js +58 -0
  589. package/assets/api/vendor_modules/safer-buffer/package.json +34 -0
  590. package/assets/api/vendor_modules/safer-buffer/safer.js +77 -0
  591. package/assets/api/vendor_modules/safer-buffer/tests.js +406 -0
  592. package/assets/api/vendor_modules/send/HISTORY.md +538 -0
  593. package/assets/api/vendor_modules/send/LICENSE +23 -0
  594. package/assets/api/vendor_modules/send/README.md +327 -0
  595. package/assets/api/vendor_modules/send/SECURITY.md +24 -0
  596. package/assets/api/vendor_modules/send/index.js +1142 -0
  597. package/assets/api/vendor_modules/send/node_modules/ms/index.js +162 -0
  598. package/assets/api/vendor_modules/send/node_modules/ms/license.md +21 -0
  599. package/assets/api/vendor_modules/send/node_modules/ms/package.json +38 -0
  600. package/assets/api/vendor_modules/send/node_modules/ms/readme.md +59 -0
  601. package/assets/api/vendor_modules/send/package.json +62 -0
  602. package/assets/api/vendor_modules/serve-static/HISTORY.md +493 -0
  603. package/assets/api/vendor_modules/serve-static/LICENSE +25 -0
  604. package/assets/api/vendor_modules/serve-static/README.md +257 -0
  605. package/assets/api/vendor_modules/serve-static/index.js +209 -0
  606. package/assets/api/vendor_modules/serve-static/package.json +42 -0
  607. package/assets/api/vendor_modules/serverless-http/LICENSE.txt +33 -0
  608. package/assets/api/vendor_modules/serverless-http/README.md +117 -0
  609. package/assets/api/vendor_modules/serverless-http/lib/finish.js +42 -0
  610. package/assets/api/vendor_modules/serverless-http/lib/framework/get-framework.js +79 -0
  611. package/assets/api/vendor_modules/serverless-http/lib/provider/aws/clean-up-event.js +98 -0
  612. package/assets/api/vendor_modules/serverless-http/lib/provider/aws/create-request.js +110 -0
  613. package/assets/api/vendor_modules/serverless-http/lib/provider/aws/format-response.js +45 -0
  614. package/assets/api/vendor_modules/serverless-http/lib/provider/aws/index.js +15 -0
  615. package/assets/api/vendor_modules/serverless-http/lib/provider/aws/is-binary.js +42 -0
  616. package/assets/api/vendor_modules/serverless-http/lib/provider/aws/sanitize-headers.js +21 -0
  617. package/assets/api/vendor_modules/serverless-http/lib/provider/azure/clean-up-request.js +41 -0
  618. package/assets/api/vendor_modules/serverless-http/lib/provider/azure/create-request.js +45 -0
  619. package/assets/api/vendor_modules/serverless-http/lib/provider/azure/format-response.js +18 -0
  620. package/assets/api/vendor_modules/serverless-http/lib/provider/azure/index.js +13 -0
  621. package/assets/api/vendor_modules/serverless-http/lib/provider/azure/is-binary.js +42 -0
  622. package/assets/api/vendor_modules/serverless-http/lib/provider/azure/sanitize-headers.js +23 -0
  623. package/assets/api/vendor_modules/serverless-http/lib/provider/azure/set-cookie.json +1 -0
  624. package/assets/api/vendor_modules/serverless-http/lib/provider/get-provider.js +17 -0
  625. package/assets/api/vendor_modules/serverless-http/lib/request.js +38 -0
  626. package/assets/api/vendor_modules/serverless-http/lib/response.js +135 -0
  627. package/assets/api/vendor_modules/serverless-http/package.json +93 -0
  628. package/assets/api/vendor_modules/serverless-http/serverless-http.d.ts +41 -0
  629. package/assets/api/vendor_modules/serverless-http/serverless-http.js +23 -0
  630. package/assets/api/vendor_modules/setprototypeof/LICENSE +13 -0
  631. package/assets/api/vendor_modules/setprototypeof/README.md +31 -0
  632. package/assets/api/vendor_modules/setprototypeof/index.d.ts +2 -0
  633. package/assets/api/vendor_modules/setprototypeof/index.js +17 -0
  634. package/assets/api/vendor_modules/setprototypeof/package.json +38 -0
  635. package/assets/api/vendor_modules/setprototypeof/test/index.js +24 -0
  636. package/assets/api/vendor_modules/side-channel/.editorconfig +9 -0
  637. package/assets/api/vendor_modules/side-channel/.eslintrc +12 -0
  638. package/assets/api/vendor_modules/side-channel/.github/FUNDING.yml +12 -0
  639. package/assets/api/vendor_modules/side-channel/.nycrc +13 -0
  640. package/assets/api/vendor_modules/side-channel/CHANGELOG.md +120 -0
  641. package/assets/api/vendor_modules/side-channel/LICENSE +21 -0
  642. package/assets/api/vendor_modules/side-channel/README.md +61 -0
  643. package/assets/api/vendor_modules/side-channel/index.d.ts +14 -0
  644. package/assets/api/vendor_modules/side-channel/index.js +46 -0
  645. package/assets/api/vendor_modules/side-channel/package.json +85 -0
  646. package/assets/api/vendor_modules/side-channel/test/index.js +120 -0
  647. package/assets/api/vendor_modules/side-channel/tsconfig.json +9 -0
  648. package/assets/api/vendor_modules/side-channel-list/.editorconfig +9 -0
  649. package/assets/api/vendor_modules/side-channel-list/.eslintrc +11 -0
  650. package/assets/api/vendor_modules/side-channel-list/.github/FUNDING.yml +12 -0
  651. package/assets/api/vendor_modules/side-channel-list/.nycrc +13 -0
  652. package/assets/api/vendor_modules/side-channel-list/CHANGELOG.md +36 -0
  653. package/assets/api/vendor_modules/side-channel-list/LICENSE +21 -0
  654. package/assets/api/vendor_modules/side-channel-list/README.md +62 -0
  655. package/assets/api/vendor_modules/side-channel-list/index.d.ts +13 -0
  656. package/assets/api/vendor_modules/side-channel-list/index.js +111 -0
  657. package/assets/api/vendor_modules/side-channel-list/list.d.ts +14 -0
  658. package/assets/api/vendor_modules/side-channel-list/package.json +77 -0
  659. package/assets/api/vendor_modules/side-channel-list/test/index.js +154 -0
  660. package/assets/api/vendor_modules/side-channel-list/tsconfig.json +9 -0
  661. package/assets/api/vendor_modules/side-channel-map/.editorconfig +9 -0
  662. package/assets/api/vendor_modules/side-channel-map/.eslintrc +11 -0
  663. package/assets/api/vendor_modules/side-channel-map/.github/FUNDING.yml +12 -0
  664. package/assets/api/vendor_modules/side-channel-map/.nycrc +13 -0
  665. package/assets/api/vendor_modules/side-channel-map/CHANGELOG.md +22 -0
  666. package/assets/api/vendor_modules/side-channel-map/LICENSE +21 -0
  667. package/assets/api/vendor_modules/side-channel-map/README.md +62 -0
  668. package/assets/api/vendor_modules/side-channel-map/index.d.ts +15 -0
  669. package/assets/api/vendor_modules/side-channel-map/index.js +68 -0
  670. package/assets/api/vendor_modules/side-channel-map/package.json +80 -0
  671. package/assets/api/vendor_modules/side-channel-map/test/index.js +114 -0
  672. package/assets/api/vendor_modules/side-channel-map/tsconfig.json +9 -0
  673. package/assets/api/vendor_modules/side-channel-weakmap/.editorconfig +9 -0
  674. package/assets/api/vendor_modules/side-channel-weakmap/.eslintrc +12 -0
  675. package/assets/api/vendor_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
  676. package/assets/api/vendor_modules/side-channel-weakmap/.nycrc +13 -0
  677. package/assets/api/vendor_modules/side-channel-weakmap/CHANGELOG.md +28 -0
  678. package/assets/api/vendor_modules/side-channel-weakmap/LICENSE +21 -0
  679. package/assets/api/vendor_modules/side-channel-weakmap/README.md +62 -0
  680. package/assets/api/vendor_modules/side-channel-weakmap/index.d.ts +15 -0
  681. package/assets/api/vendor_modules/side-channel-weakmap/index.js +84 -0
  682. package/assets/api/vendor_modules/side-channel-weakmap/package.json +87 -0
  683. package/assets/api/vendor_modules/side-channel-weakmap/test/index.js +114 -0
  684. package/assets/api/vendor_modules/side-channel-weakmap/tsconfig.json +9 -0
  685. package/assets/api/vendor_modules/statuses/HISTORY.md +87 -0
  686. package/assets/api/vendor_modules/statuses/LICENSE +23 -0
  687. package/assets/api/vendor_modules/statuses/README.md +139 -0
  688. package/assets/api/vendor_modules/statuses/codes.json +65 -0
  689. package/assets/api/vendor_modules/statuses/index.js +146 -0
  690. package/assets/api/vendor_modules/statuses/package.json +49 -0
  691. package/assets/api/vendor_modules/toidentifier/HISTORY.md +9 -0
  692. package/assets/api/vendor_modules/toidentifier/LICENSE +21 -0
  693. package/assets/api/vendor_modules/toidentifier/README.md +61 -0
  694. package/assets/api/vendor_modules/toidentifier/index.js +32 -0
  695. package/assets/api/vendor_modules/toidentifier/package.json +38 -0
  696. package/assets/api/vendor_modules/type-is/HISTORY.md +259 -0
  697. package/assets/api/vendor_modules/type-is/LICENSE +23 -0
  698. package/assets/api/vendor_modules/type-is/README.md +170 -0
  699. package/assets/api/vendor_modules/type-is/index.js +266 -0
  700. package/assets/api/vendor_modules/type-is/package.json +45 -0
  701. package/assets/api/vendor_modules/unpipe/HISTORY.md +4 -0
  702. package/assets/api/vendor_modules/unpipe/LICENSE +22 -0
  703. package/assets/api/vendor_modules/unpipe/README.md +43 -0
  704. package/assets/api/vendor_modules/unpipe/index.js +69 -0
  705. package/assets/api/vendor_modules/unpipe/package.json +27 -0
  706. package/assets/api/vendor_modules/utils-merge/LICENSE +20 -0
  707. package/assets/api/vendor_modules/utils-merge/README.md +34 -0
  708. package/assets/api/vendor_modules/utils-merge/index.js +23 -0
  709. package/assets/api/vendor_modules/utils-merge/package.json +40 -0
  710. package/assets/api/vendor_modules/vary/HISTORY.md +39 -0
  711. package/assets/api/vendor_modules/vary/LICENSE +22 -0
  712. package/assets/api/vendor_modules/vary/README.md +101 -0
  713. package/assets/api/vendor_modules/vary/index.js +149 -0
  714. package/assets/api/vendor_modules/vary/package.json +43 -0
  715. package/assets/federation-presignup/index.js +108 -0
  716. package/assets/firstadmin/index.js +361 -0
  717. package/assets/headscale-apikey/index.js +140 -0
  718. package/assets/invoke-relay/index.js +96 -0
  719. package/assets/issuer-canary/index.js +71 -0
  720. package/assets/issuer-publish/index.js +87 -0
  721. package/assets/keyminter/index.js +209 -0
  722. package/assets/plugin-authorizer/index.js +1740 -0
  723. package/assets/plugin-catalog/index.js +881 -0
  724. package/assets/reapproval/index.js +3761 -0
  725. package/assets/sg-manager/index.js +176 -0
  726. package/assets/tailnet-resolver/index.js +55 -0
  727. package/assets/web/chunk-2MOGDYK4.js +1 -0
  728. package/assets/web/chunk-2SO4BVIT.js +1 -0
  729. package/assets/web/chunk-2V6RSAAC.js +1 -0
  730. package/assets/web/chunk-32GNBTAL.js +1 -0
  731. package/assets/web/chunk-33SYY2JB.js +1 -0
  732. package/assets/web/chunk-3VWYT7AX.js +1 -0
  733. package/assets/web/chunk-4FG4DAWU.js +4 -0
  734. package/assets/web/chunk-4N2IUS6T.js +1 -0
  735. package/assets/web/chunk-4SK6XQ6C.js +1 -0
  736. package/assets/web/chunk-65WE5MXA.js +8 -0
  737. package/assets/web/chunk-6D7SSSJF.js +1 -0
  738. package/assets/web/chunk-6KFR7DYY.js +1 -0
  739. package/assets/web/chunk-A4WHI3ZG.js +8 -0
  740. package/assets/web/chunk-BNFKRZTP.js +1 -0
  741. package/assets/web/chunk-CG56PH3M.js +1 -0
  742. package/assets/web/chunk-CGO25AIM.js +1 -0
  743. package/assets/web/chunk-CP4XZPOA.js +1 -0
  744. package/assets/web/chunk-CV7EODPO.js +1 -0
  745. package/assets/web/chunk-D7TR2ORJ.js +1 -0
  746. package/assets/web/chunk-DCOFBAKJ.js +1 -0
  747. package/assets/web/chunk-DOLRLYW7.js +1 -0
  748. package/assets/web/chunk-EEJ3X466.js +1 -0
  749. package/assets/web/chunk-EQ4PF25J.js +1 -0
  750. package/assets/web/chunk-EVP5UVDQ.js +1 -0
  751. package/assets/web/chunk-EW2VMNHE.js +1 -0
  752. package/assets/web/chunk-FIUVIKAN.js +1 -0
  753. package/assets/web/chunk-GHEU25TG.js +1 -0
  754. package/assets/web/chunk-GK2T2SMO.js +1 -0
  755. package/assets/web/chunk-GKI3R2JB.js +1 -0
  756. package/assets/web/chunk-GPKKIOHD.js +2 -0
  757. package/assets/web/chunk-H4AVFUDM.js +1 -0
  758. package/assets/web/chunk-H5H727H6.js +1 -0
  759. package/assets/web/chunk-HGVFH6YM.js +1 -0
  760. package/assets/web/chunk-HHPIANBK.js +1 -0
  761. package/assets/web/chunk-HK56COCB.js +1 -0
  762. package/assets/web/chunk-HZUB7LFV.js +1 -0
  763. package/assets/web/chunk-I7NTNTBA.js +1 -0
  764. package/assets/web/chunk-IKK5DQ3Z.js +1 -0
  765. package/assets/web/chunk-IMH56UBX.js +1 -0
  766. package/assets/web/chunk-J3SSPCFV.js +1 -0
  767. package/assets/web/chunk-J4C7C5KO.js +1 -0
  768. package/assets/web/chunk-J57JB4MU.js +1 -0
  769. package/assets/web/chunk-JMBXRK3I.js +4 -0
  770. package/assets/web/chunk-KCCEQIXX.js +1 -0
  771. package/assets/web/chunk-KEBESIXR.js +1 -0
  772. package/assets/web/chunk-KPNHT4MK.js +1 -0
  773. package/assets/web/chunk-LMLXTVZG.js +1 -0
  774. package/assets/web/chunk-M6OAYNRE.js +1 -0
  775. package/assets/web/chunk-M7MGX5I4.js +1 -0
  776. package/assets/web/chunk-MU2VNTNY.js +1 -0
  777. package/assets/web/chunk-NABAVDRL.js +1 -0
  778. package/assets/web/chunk-NO5D6WDF.js +1 -0
  779. package/assets/web/chunk-O4QSFUXB.js +1 -0
  780. package/assets/web/chunk-OATVFQXO.js +1 -0
  781. package/assets/web/chunk-P5WRM37W.js +5 -0
  782. package/assets/web/chunk-PCP6D2SM.js +1 -0
  783. package/assets/web/chunk-PMMBJK7Q.js +1 -0
  784. package/assets/web/chunk-PSMER3HX.js +1 -0
  785. package/assets/web/chunk-QPBWZLCT.js +1 -0
  786. package/assets/web/chunk-QVABVDO5.js +1 -0
  787. package/assets/web/chunk-RI77LE5V.js +1 -0
  788. package/assets/web/chunk-RKGUEXZ2.js +1 -0
  789. package/assets/web/chunk-RMFH2YTZ.js +1 -0
  790. package/assets/web/chunk-RROPCBUH.js +1 -0
  791. package/assets/web/chunk-SJMLX5AT.js +1 -0
  792. package/assets/web/chunk-TKVALOE4.js +2 -0
  793. package/assets/web/chunk-TM43WUKM.js +1 -0
  794. package/assets/web/chunk-VKWV3ANT.js +1 -0
  795. package/assets/web/chunk-VTMYG6YW.js +1 -0
  796. package/assets/web/chunk-VWW4SA5R.js +1 -0
  797. package/assets/web/chunk-WEDAFMID.js +1 -0
  798. package/assets/web/chunk-WFIHWVQO.js +1 -0
  799. package/assets/web/chunk-XJM3HDJQ.js +1 -0
  800. package/assets/web/chunk-YVJV2RUY.js +1 -0
  801. package/assets/web/chunk-Z3KONI7L.js +1 -0
  802. package/assets/web/chunk-ZDCURXPS.js +1 -0
  803. package/assets/web/favicon.ico +0 -0
  804. package/assets/web/index.html +63 -0
  805. package/assets/web/main-S6E3BC5O.js +2 -0
  806. package/assets/web/polyfills-7RSNIJ6J.js +2 -0
  807. package/assets/web/styles-R6ZUWC6K.css +1 -0
  808. package/dist/index.d.ts +27 -0
  809. package/dist/index.js +66 -0
  810. package/dist/lambdacode/api/services/brandingShapes.d.ts +5 -0
  811. package/dist/lambdacode/api/services/brandingShapes.js +15 -0
  812. package/dist/lambdacode/issuer/objects.d.ts +8 -0
  813. package/dist/lambdacode/issuer/objects.js +11 -0
  814. package/dist/lambdacode/network/naming.d.ts +52 -0
  815. package/dist/lambdacode/network/naming.js +67 -0
  816. package/dist/lib/access-portal-hub.d.ts +53 -0
  817. package/dist/lib/access-portal-hub.js +87 -0
  818. package/dist/lib/access-portal.d.ts +32 -0
  819. package/dist/lib/access-portal.js +174 -0
  820. package/dist/lib/audit-log.d.ts +18 -0
  821. package/dist/lib/audit-log.js +25 -0
  822. package/dist/lib/connector-stack.d.ts +28 -0
  823. package/dist/lib/connector-stack.js +81 -0
  824. package/dist/lib/constructs/app-function.d.ts +14 -0
  825. package/dist/lib/constructs/app-function.js +84 -0
  826. package/dist/lib/constructs/app-table.d.ts +12 -0
  827. package/dist/lib/constructs/app-table.js +58 -0
  828. package/dist/lib/constructs/mirrored-image.d.ts +12 -0
  829. package/dist/lib/constructs/mirrored-image.js +80 -0
  830. package/dist/lib/constructs/monitoring.d.ts +21 -0
  831. package/dist/lib/constructs/monitoring.js +133 -0
  832. package/dist/lib/constructs/oidc-issuer.d.ts +44 -0
  833. package/dist/lib/constructs/oidc-issuer.js +234 -0
  834. package/dist/lib/constructs/scratch-tmpfs.d.ts +5 -0
  835. package/dist/lib/constructs/scratch-tmpfs.js +48 -0
  836. package/dist/lib/constructs/sg-manager.d.ts +27 -0
  837. package/dist/lib/constructs/sg-manager.js +88 -0
  838. package/dist/lib/constructs/tailnet-connector.d.ts +29 -0
  839. package/dist/lib/constructs/tailnet-connector.js +177 -0
  840. package/dist/lib/constructs/tailnet-resolver.d.ts +30 -0
  841. package/dist/lib/constructs/tailnet-resolver.js +71 -0
  842. package/dist/lib/constructs/target-account-trust.d.ts +32 -0
  843. package/dist/lib/constructs/target-account-trust.js +81 -0
  844. package/dist/lib/constructs/vending-api.d.ts +103 -0
  845. package/dist/lib/constructs/vending-api.js +203 -0
  846. package/dist/lib/constructs/web-acl.d.ts +61 -0
  847. package/dist/lib/constructs/web-acl.js +213 -0
  848. package/dist/lib/constructs/web-identity.d.ts +49 -0
  849. package/dist/lib/constructs/web-identity.js +116 -0
  850. package/dist/lib/creds-stack.d.ts +151 -0
  851. package/dist/lib/creds-stack.js +592 -0
  852. package/dist/lib/data-stack.d.ts +53 -0
  853. package/dist/lib/data-stack.js +282 -0
  854. package/dist/lib/dimensions-validation.d.ts +20 -0
  855. package/dist/lib/dimensions-validation.js +51 -0
  856. package/dist/lib/federation.d.ts +113 -0
  857. package/dist/lib/federation.js +254 -0
  858. package/dist/lib/managed-login-branding.json +450 -0
  859. package/dist/lib/network-stack.d.ts +58 -0
  860. package/dist/lib/network-stack.js +776 -0
  861. package/dist/lib/network-validation.d.ts +54 -0
  862. package/dist/lib/network-validation.js +220 -0
  863. package/dist/lib/pkg-paths.d.ts +3 -0
  864. package/dist/lib/pkg-paths.js +51 -0
  865. package/dist/lib/plugins/plugin-api.d.ts +40 -0
  866. package/dist/lib/plugins/plugin-api.js +125 -0
  867. package/dist/lib/plugins/plugin-catalog-activation.d.ts +31 -0
  868. package/dist/lib/plugins/plugin-catalog-activation.js +109 -0
  869. package/dist/lib/plugins/registration.d.ts +41 -0
  870. package/dist/lib/plugins/registration.js +121 -0
  871. package/dist/lib/plugins/runtime.d.ts +10 -0
  872. package/dist/lib/plugins/runtime.js +17 -0
  873. package/dist/lib/project-config.d.ts +164 -0
  874. package/dist/lib/project-config.js +2 -0
  875. package/dist/lib/target-account-stack.d.ts +15 -0
  876. package/dist/lib/target-account-stack.js +59 -0
  877. package/dist/lib/target-account-template.d.ts +13 -0
  878. package/dist/lib/target-account-template.js +64 -0
  879. package/dist/lib/web-cert-stack.d.ts +30 -0
  880. package/dist/lib/web-cert-stack.js +90 -0
  881. package/dist/lib/web-stack.d.ts +103 -0
  882. package/dist/lib/web-stack.js +540 -0
  883. package/node_modules/@fntio/infra-client-plugin-sdk/README.md +303 -0
  884. package/node_modules/@fntio/infra-client-plugin-sdk/dist/backend/context.d.ts +31 -0
  885. package/node_modules/@fntio/infra-client-plugin-sdk/dist/backend/context.js +58 -0
  886. package/node_modules/@fntio/infra-client-plugin-sdk/dist/backend/index.d.ts +9 -0
  887. package/node_modules/@fntio/infra-client-plugin-sdk/dist/backend/index.js +26 -0
  888. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/client.d.ts +59 -0
  889. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/client.js +290 -0
  890. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/errors.d.ts +14 -0
  891. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/errors.js +32 -0
  892. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/http.d.ts +72 -0
  893. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/http.js +170 -0
  894. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/index.d.ts +11 -0
  895. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/index.js +28 -0
  896. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/theme-apply.d.ts +22 -0
  897. package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/theme-apply.js +22 -0
  898. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/access.d.ts +14 -0
  899. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/access.js +41 -0
  900. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/authorizer.d.ts +17 -0
  901. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/authorizer.js +44 -0
  902. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/canonical.d.ts +2 -0
  903. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/canonical.js +21 -0
  904. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/catalog.d.ts +39 -0
  905. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/catalog.js +18 -0
  906. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/discovery.d.ts +78 -0
  907. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/discovery.js +48 -0
  908. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/fields.d.ts +7 -0
  909. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/fields.js +2 -0
  910. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/manifest.d.ts +59 -0
  911. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/manifest.js +19 -0
  912. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/messages.d.ts +111 -0
  913. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/messages.js +109 -0
  914. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/paths.d.ts +20 -0
  915. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/paths.js +49 -0
  916. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/theme.d.ts +21 -0
  917. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/theme.js +60 -0
  918. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/transport.d.ts +14 -0
  919. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/transport.js +10 -0
  920. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/validate.d.ts +27 -0
  921. package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/validate.js +321 -0
  922. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/devHost.d.ts +61 -0
  923. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/devHost.js +99 -0
  924. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/fakeDocument.d.ts +12 -0
  925. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/fakeDocument.js +22 -0
  926. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/fakeWindows.d.ts +22 -0
  927. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/fakeWindows.js +46 -0
  928. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/index.d.ts +4 -0
  929. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/index.js +20 -0
  930. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/samples.d.ts +37 -0
  931. package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/samples.js +228 -0
  932. package/node_modules/@fntio/infra-client-plugin-sdk/dist/host/host.d.ts +47 -0
  933. package/node_modules/@fntio/infra-client-plugin-sdk/dist/host/host.js +121 -0
  934. package/node_modules/@fntio/infra-client-plugin-sdk/dist/host/index.d.ts +5 -0
  935. package/node_modules/@fntio/infra-client-plugin-sdk/dist/host/index.js +22 -0
  936. package/node_modules/@fntio/infra-client-plugin-sdk/dist/index.d.ts +10 -0
  937. package/node_modules/@fntio/infra-client-plugin-sdk/dist/index.js +28 -0
  938. package/node_modules/@fntio/infra-client-plugin-sdk/package.json +99 -0
  939. package/openapi.yaml +4284 -0
  940. package/package.json +124 -4
@@ -0,0 +1,1033 @@
1
+ # AWS JWT Verify
2
+
3
+ **JavaScript** library for **verifying** JWTs signed by **Amazon Cognito**, and any **OIDC-compatible IDP** that signs JWTs with **RS256** / **RS384** / **RS512**.
4
+
5
+ ## Installation
6
+
7
+ `npm install aws-jwt-verify`
8
+
9
+ This library can be used with Node.js 14 or higher. If used with TypeScript, TypeScript 4 or higher is required.
10
+
11
+ This library can also be used in Web browsers.
12
+
13
+ ## Basic usage
14
+
15
+ ### Amazon Cognito
16
+
17
+ ```typescript
18
+ import { CognitoJwtVerifier } from "aws-jwt-verify";
19
+
20
+ // Verifier that expects valid access tokens:
21
+ const verifier = CognitoJwtVerifier.create({
22
+ userPoolId: "<user_pool_id>",
23
+ tokenUse: "access",
24
+ clientId: "<client_id>",
25
+ });
26
+
27
+ try {
28
+ const payload = await verifier.verify(
29
+ "eyJraWQeyJhdF9oYXNoIjoidk..." // the JWT as string
30
+ );
31
+ console.log("Token is valid. Payload:", payload);
32
+ } catch {
33
+ console.log("Token not valid!");
34
+ }
35
+ ```
36
+
37
+ See all verify parameters for Amazon Cognito JWTs [here](#cognitojwtverifier-verify-parameters).
38
+
39
+ ### Other IDPs
40
+
41
+ ```typescript
42
+ import { JwtRsaVerifier } from "aws-jwt-verify";
43
+
44
+ const verifier = JwtRsaVerifier.create({
45
+ issuer: "https://example.com/", // set this to the expected "iss" claim on your JWTs
46
+ audience: "<audience>", // set this to the expected "aud" claim on your JWTs
47
+ jwksUri: "https://example.com/.well-known/jwks.json", // set this to the JWKS uri from your OpenID configuration
48
+ });
49
+
50
+ try {
51
+ const payload = await verifier.verify("eyJraWQeyJhdF9oYXNoIjoidk...");
52
+ console.log("Token is valid. Payload:", payload);
53
+ } catch {
54
+ console.log("Token not valid!");
55
+ }
56
+ ```
57
+
58
+ See all verify parameters for JWTs from any IDP [here](#jwtrsaverifier-verify-parameters).
59
+
60
+ ## Philosophy of this library
61
+
62
+ - Do one thing and do it well. Focus solely on **verifying** JWTs.
63
+ - Pure **TypeScript** library that can be used in **Node.js** v14 and above (both CommonJS and ESM supported), as well in the modern evergreen Web browser.
64
+ - Support both **Amazon Cognito** as well as any other **OIDC-compatible IDP** as first class citizen.
65
+ - **0** runtime dependencies, batteries included. This library includes all necessary code to validate RS256/RS384/RS512-signed JWTs. E.g. it contains a simple (and pluggable) **HTTP** helper to fetch the **JWKS** from the JWKS URI, and it includes a simple **ASN.1** encoder to transform JWKs into **DER-encoded RSA public keys** (in order to verify JWTs with Node.js native crypto calls).
66
+ - Opinionated towards the **best practices** as described by the IETF in [JSON Web Token Best Current Practices](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-jwt-bcp-02#section-3).
67
+ - Make it **easy** for users to use this library in a **secure** way. For example, this library requires users to specify `issuer` and `audience`, as these should be checked for (see best practices linked to above).
68
+
69
+ Currently, only signature algorithms **RS256** , **RS384** and **RS512** are supported.
70
+
71
+ ## Intended Usage
72
+
73
+ This library was specifically designed to be easy to use in:
74
+
75
+ - [API Gateway Lambda authorizers](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html)
76
+ - [AppSync Lambda authorizers](https://docs.aws.amazon.com/appsync/latest/devguide/security-authz.html#aws-lambda-authorization)
77
+ - [CloudFront Lambda@Edge](https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html)
78
+ - Node.js APIs, e.g. running in AWS Fargate, that need to verify incoming JWTs
79
+
80
+ ## Usage in the Web browser
81
+
82
+ Many webdev toolchains (e.g. [CreateReactApp](https://github.com/facebook/create-react-app)) make including `npm` libraries in your web app easy, in which case using this library in your web app should just work.
83
+
84
+ If you need to bundle this library manually yourself, be aware that this library uses [subpath imports](https://nodejs.org/api/packages.html#subpath-imports), to automatically select the Web crypto implementation when bundling for the browser. This is supported out-of-the-box by [webpack](https://webpack.js.org/) and [esbuild](https://esbuild.github.io/). An example of using this library in a Vite web app, with Cypress tests, is included in this repository [here](tests/vite-app/).
85
+
86
+ ## Table of Contents
87
+
88
+ - [Verifying JWTs from Amazon Cognito](#Verifying-JWTs-from-Amazon-Cognito)
89
+ - [Verify parameters](#cognitojwtverifier-verify-parameters)
90
+ - [Checking scope](#checking-scope)
91
+ - [Custom JWT and JWK checks](#custom-jwt-and-jwk-checks)
92
+ - [Trusting multiple User Pools](#trusting-multiple-user-pools)
93
+ - [Using the generic JWT RSA verifier for Cognito JWTs](#using-the-generic-jwt-rsa-verifier-for-cognito-jwts)
94
+ - [Verifying JWTs from any OIDC-compatible IDP](#verifying-jwts-from-any-oidc-compatible-idp)
95
+ - [Verify parameters](#jwtrsaverifier-verify-parameters)
96
+ - [Peeking inside unverified JWTs](#peeking-inside-unverified-jwts)
97
+ - [Verification errors](#verification-errors)
98
+ - [Peek inside invalid JWTs](#peek-inside-invalid-jwts)
99
+ - [The JWKS cache](#the-jwks-cache)
100
+ - [Loading the JWKS from file](#loading-the-jwks-from-file)
101
+ - [Rate limiting](#rate-limiting)
102
+ - [Explicitly hydrating the JWKS cache](#explicitly-hydrating-the-jwks-cache)
103
+ - [Clearing the JWKS cache](#clearing-the-jwks-cache)
104
+ - [Customizing the JWKS cache](#customizing-the-jwks-cache)
105
+ - [Sharing the JWKS cache amongst different verifiers](#sharing-the-jwks-cache-amongst-different-verifiers)
106
+ - [Using a different `JsonFetcher` with `SimpleJwksCache`](#using-a-different-jsonfetcher-with-simplejwkscache)
107
+ - [Configuring the JWKS response timeout and other HTTP options with `JsonFetcher`](#configuring-the-jwks-response-timeout-and-other-http-options-with-jsonfetcher)
108
+ - [Using a different `penaltyBox` with `SimpleJwksCache`](#using-a-different-penaltybox-with-simplejwkscache)
109
+ - [Usage examples](#Usage-examples)
110
+ - [CloudFront Lambda@Edge](#cloudfront-lambdaedge)
111
+ - [API Gateway Lambda Authorizer - REST](#api-gateway-lambda-authorizer---rest)
112
+ - [HTTP API Authorizer](#http-api-lambda-authorizer)
113
+ - [AppSync Lambda Authorizer](#appsync-lambda-authorizer)
114
+ - [Fastify](#fastify)
115
+ - [Express](#express)
116
+ - [Security](#security)
117
+ - [License](#license)
118
+
119
+ ## Verifying JWTs from Amazon Cognito
120
+
121
+ Create a `CognitoJwtVerifier` instance and use it to verify JWTs:
122
+
123
+ ```typescript
124
+ import { CognitoJwtVerifier } from "aws-jwt-verify";
125
+
126
+ // Verifier that expects valid access tokens:
127
+ const verifier = CognitoJwtVerifier.create({
128
+ userPoolId: "<user_pool_id>",
129
+ tokenUse: "access",
130
+ clientId: "<client_id>",
131
+ });
132
+
133
+ try {
134
+ const payload = await verifier.verify(
135
+ "eyJraWQeyJhdF9oYXNoIjoidk..." // the JWT as string
136
+ );
137
+ console.log("Token is valid. Payload:", payload);
138
+ } catch {
139
+ console.log("Token not valid!");
140
+ }
141
+ ```
142
+
143
+ You can also use `verifySync`, if you've made sure the JWK has already been cached, see further below.
144
+
145
+ ### `CognitoJwtVerifier` `verify` parameters
146
+
147
+ Except the User Pool ID, parameters provided when creating the `CognitoJwtVerifier` act as defaults, that can be overridden upon calling `verify` or `verifySync`.
148
+
149
+ Supported parameters are:
150
+
151
+ - `tokenUse` (mandatory): verify that the JWT's `token_use` claim matches your expectation. Set to either `id` or `access`. Set to `null` to skip checking `token_use`.
152
+ - `clientId` (mandatory): verify that the JWT's `aud` (id token) or `client_id` (access token) claim matches your expectation. Provide a string, or an array of strings to allow multiple client ids (i.e. one of these client ids must match the JWT). Set to `null` to skip checking client id (not recommended unless you know what you are doing).
153
+ - `groups` (optional): verify that the JWT's `cognito:groups` claim matches your expectation. Provide a string, or an array of strings to allow multiple groups (i.e. one of these groups must match the JWT).
154
+ - `scope` (optional): verify that the JWT's `scope` claim matches your expectation (only of use for access tokens). Provide a string, or an array of strings to allow multiple scopes (i.e. one of these scopes must match the JWT). See also [Checking scope](#Checking-scope).
155
+ - `graceSeconds` (optional, default `0`): to account for clock differences between systems, provide the number of seconds beyond JWT expiry (`exp` claim) or before "not before" (`nbf` claim) you will allow.
156
+ - `customJwtCheck` (optional): your custom function with additional JWT (and JWK) checks to execute (see also below).
157
+ - `includeRawJwtInErrors` (optional, default `false`): set to `true` if you want to peek inside the invalid JWT when verification fails. Refer to: [Peek inside invalid JWTs](#peek-inside-invalid-jwts).
158
+
159
+ ```typescript
160
+ import { CognitoJwtVerifier } from "aws-jwt-verify";
161
+
162
+ const verifier = CognitoJwtVerifier.create({
163
+ userPoolId: "<user_pool_id>", // mandatory, can't be overridden upon calling verify
164
+ tokenUse: "id", // needs to be specified here or upon calling verify
165
+ clientId: "<client_id>", // needs to be specified here or upon calling verify
166
+ groups: "admins", // optional
167
+ graceSeconds: 0, // optional
168
+ scope: "my-api/read", // optional
169
+ customJwtCheck: (payload, header, jwk) => {}, // optional
170
+ });
171
+
172
+ try {
173
+ const payload = await verifier.verify("eyJraWQeyJhdF9oYXNoIjoidk...", {
174
+ groups: "users", // Cognito groups overridden: should be users (not admins)
175
+ });
176
+ console.log("Token is valid. Payload:", payload);
177
+ } catch {
178
+ console.log("Token not valid!");
179
+ }
180
+ ```
181
+
182
+ ### Checking scope
183
+
184
+ If you provide scopes to the `CognitoJwtVerifier`, the verifier will make sure the `scope` claim in the JWT includes at least one of those scopes:
185
+
186
+ ```typescript
187
+ import { CognitoJwtVerifier } from "aws-jwt-verify";
188
+
189
+ const verifier = CognitoJwtVerifier.create({
190
+ userPoolId: "<user_pool_id>",
191
+ tokenUse: "access", // scopes are only present on Cognito access tokens
192
+ clientId: "<client_id>",
193
+ scope: ["my-api:write", "my-api:admin"],
194
+ });
195
+
196
+ try {
197
+ const payload = await verifier.verify("eyJraWQeyJhdF9oYXNoIjoidk...");
198
+ console.log("Token is valid. Payload:", payload);
199
+ } catch {
200
+ console.log("Token not valid!");
201
+ }
202
+ ```
203
+
204
+ So a JWT payload like the following would have a valid scope:
205
+
206
+ ```javascript
207
+ {
208
+ "client_id": "<client_id>",
209
+ "scope": "my-api:write someotherscope yetanotherscope", // scope string is split on spaces to gather the array of scopes to compare with
210
+ "iat": 1234567890,
211
+ "...": "..."
212
+ }
213
+ ```
214
+
215
+ This scope would not be valid:
216
+
217
+ ```javascript
218
+ {
219
+ "client_id": "<client_id>",
220
+ "scope": "my-api:read someotherscope yetanotherscope", // Neither "my-api:write" nor "my-api:admin" present
221
+ "iat": 1234567890,
222
+ "...": "..."
223
+ }
224
+ ```
225
+
226
+ ### Custom JWT and JWK checks
227
+
228
+ It's possible to provide a function with your own custom JWT checks. This function will be called if the JWT is valid, at the end of the JWT verification.
229
+
230
+ The function will be called with:
231
+
232
+ - the decoded JWT header
233
+ - the decoded JWT payload
234
+ - the JWK that was used to verify the JWT
235
+
236
+ Throw an error in this function if you want to reject the JWT.
237
+
238
+ ```typescript
239
+ import { CognitoJwtVerifier } from "aws-jwt-verify";
240
+
241
+ const idTokenVerifier = CognitoJwtVerifier.create({
242
+ userPoolId: "<user_pool_id>",
243
+ tokenUse: "id",
244
+ clientId: "<client_id>",
245
+ customJwtCheck: async ({ header, payload, jwk }) => {
246
+ if (header.someHeaderField !== "expected") {
247
+ throw new Error("something wrong with the header");
248
+ }
249
+ if (payload.somePayloadField !== "expected") {
250
+ throw new Error("something wrong with the payload");
251
+ }
252
+ if (jwk.someJwkfField !== "expected") {
253
+ throw new Error("something wrong with the jwk");
254
+ }
255
+ await someAsyncCheck(...); // can call out to a DB or do whatever
256
+ },
257
+ });
258
+
259
+ // This will now throw, even if the JWT is otherwise valid, if your custom function throws:
260
+ await idTokenVerifier.verify("eyJraWQeyJhdF9oYXNoIjoidk...");
261
+ ```
262
+
263
+ Note that `customJwtCheck` may be an async function, but only if you use `verify` (not supported for `verifySync`).
264
+
265
+ ### Trusting multiple User Pools
266
+
267
+ If you want to allow JWTs from multiple User Pools, provide an array with these User Pools upon creating the verifier:
268
+
269
+ ```typescript
270
+ import { CognitoJwtVerifier } from "aws-jwt-verify";
271
+
272
+ // This verifier will trust both User Pools
273
+ const idTokenVerifier = CognitoJwtVerifier.create([
274
+ {
275
+ userPoolId: "<user_pool_id>",
276
+ tokenUse: "id",
277
+ clientId: "<client_id>", // clientId is mandatory at verifier level now, to disambiguate between User Pools
278
+ },
279
+ {
280
+ userPoolId: "<user_pool_id_2>",
281
+ tokenUse: "id",
282
+ clientId: "<client_id_2>",
283
+ },
284
+ ]);
285
+
286
+ try {
287
+ const idTokenPayload = await idTokenVerifier.verify(
288
+ "eyJraWQeyJhdF9oYXNoIjoidk..." // token must be signed by either of the User Pools
289
+ );
290
+ console.log("Token is valid. Payload:", idTokenPayload);
291
+ } catch {
292
+ console.log("Token not valid!");
293
+ }
294
+ ```
295
+
296
+ ### Using the generic JWT RSA verifier for Cognito JWTs
297
+
298
+ The generic `JwtRsaVerifier` (see [below](#verifying-jwts-from-any-oidc-compatible-idp)) can also be used for Cognito, which is useful if you want to define a verifier that trusts multiple IDPs, i.e. Cognito and another IDP.
299
+
300
+ In this case, leave `audience` to `null`, but rather manually add `validateCognitoJwtFields` in the `customJwtCheck`.
301
+ (Only Cognito ID tokens have an `audience` claim, Cognito Access token have a `client_id` claim instead. The `validateCognitoJwtFields` function handles this difference automatically for you)
302
+
303
+ ```typescript
304
+ import { JwtRsaVerifier } from "aws-jwt-verify";
305
+ import { validateCognitoJwtFields } from "aws-jwt-verify/cognito-verifier";
306
+
307
+ const verifier = JwtRsaVerifier.create([
308
+ {
309
+ issuer: "https://cognito-idp.eu-west-1.amazonaws.com/<user_pool_id>",
310
+ audience: null, // audience (~clientId) is checked instead, by the Cognito specific checks below
311
+ customJwtCheck: ({ payload }) =>
312
+ validateCognitoJwtFields(payload, {
313
+ tokenUse: "access", // set to "id" or "access" (or null if both are fine)
314
+ clientId: "<client_id>", // provide the client id, or an array of client ids (or null if you do not want to check client id)
315
+ groups: ["admin", "others"], // optional, provide a group name, or array of group names
316
+ }),
317
+ },
318
+ {
319
+ issuer: "https://example.com/my/other/idp",
320
+ audience: "myaudience", // do specify audience for other IDPs
321
+ },
322
+ ]);
323
+ ```
324
+
325
+ ## Verifying JWTs from any OIDC-compatible IDP
326
+
327
+ The generic `JwtRsaVerifier` works for any OIDC-compatible IDP that signs JWTs with RS256/RS384/RS512:
328
+
329
+ ```typescript
330
+ import { JwtRsaVerifier } from "aws-jwt-verify";
331
+
332
+ const verifier = JwtRsaVerifier.create({
333
+ issuer: "https://example.com/", // set this to the expected "iss" claim on your JWTs
334
+ audience: "<audience>", // set this to the expected "aud" claim on your JWTs
335
+ jwksUri: "https://example.com/.well-known/jwks.json", // set this to the JWKS uri from your OpenID configuration
336
+ });
337
+
338
+ try {
339
+ const payload = await verifier.verify("eyJraWQeyJhdF9oYXNoIjoidk...");
340
+ console.log("Token is valid. Payload:", payload);
341
+ } catch {
342
+ console.log("Token not valid!");
343
+ }
344
+ ```
345
+
346
+ Support Multiple IDP's:
347
+
348
+ ```typescript
349
+ const verifier = JwtRsaVerifier.create([
350
+ {
351
+ issuer: "https://example.com/idp1",
352
+ audience: "expectedAudienceIdp1",
353
+ },
354
+ {
355
+ issuer: "https://example.com/idp2",
356
+ audience: "expectedAudienceIdp2",
357
+ },
358
+ ]);
359
+
360
+ try {
361
+ const otherPayload = await verifier.verify("eyJraWQeyJhdF9oYXNoIjoidk..."); // Token must be from either idp1 or idp2
362
+ console.log("Token is valid. Payload:", otherPayload);
363
+ } catch {
364
+ console.log("Token not valid!");
365
+ }
366
+ ```
367
+
368
+ ### `JwtRsaVerifier` `verify` parameters
369
+
370
+ Except `issuer`, parameters provided when creating the `JwtRsaVerifier` act as defaults, that can be overridden upon calling `verify` or `verifySync`.
371
+
372
+ Supported parameters are:
373
+
374
+ - `jwksUri` (optional, can only be provided at verifier level): the URI where the JWKS can be downloaded from. To find this URI for your IDP, consult your IDP's OpenId configuration (e.g. by opening the OpenId configuration in your browser). Usually, it is `${issuer}/.well-known/jwks.json`, which is the default value that will be used if you don't explicitly provide `jwksUri`.
375
+ - `audience` (mandatory): verify that the JWT's `aud` claim matches your expectation. Provide a string, or an array of strings to allow multiple client ids (i.e. one of these audiences must match the JWT). Set to `null` to skip checking audience (not recommended unless you know what you are doing). Note that a JWT's `aud` claim might be an array of audiences. The `JwtRsaVerifier` will in that case make sure that at least one of these audiences matches with at least one of the audiences that were provided to the verifier.
376
+ - `scope` (optional): verify that the JWT's `scope` claim matches your expectation (only of use for access tokens). Provide a string, or an array of strings to allow multiple scopes (i.e. one of these scopes must match the JWT). See also [Checking scope](#checking-scope).
377
+ - `graceSeconds` (optional, default `0`): to account for clock differences between systems, provide the number of seconds beyond JWT expiry (`exp` claim) or before "not before" (`nbf` claim) you will allow.
378
+ - `customJwtCheck` (optional): your custom function with additional JWT checks to execute (see [Custom JWT and JWK checks](#custom-jwt-and-jwk-checks)).
379
+ - `includeRawJwtInErrors` (optional, default `false`): set to `true` if you want to peek inside the invalid JWT when verification fails. Refer to: [Peek inside invalid JWTs](#peek-inside-invalid-jwts).
380
+
381
+ ## Peeking inside unverified JWTs
382
+
383
+ You can peek into the payload of an unverified JWT as follows.
384
+
385
+ Note: this does NOT verify a JWT, do not trust the returned payload and header! For most use cases, you would not want to call this function directly yourself, rather you would call `verify()` with the JWT, which would call this function (and others) for you.
386
+
387
+ ```typescript
388
+ import { decomposeUnverifiedJwt } from "aws-jwt-verify/jwt";
389
+
390
+ // danger! payload is sanity checked and JSON-parsed, but otherwise unverified, trust nothing in it!
391
+ const { payload } = decomposeUnverifiedJwt(
392
+ "eyJraWQeyJhdF9oYXNoIjoidk..." // the JWT as string
393
+ );
394
+ ```
395
+
396
+ ## Verification errors
397
+
398
+ When verification of a JWT fails, this library will throw an error. All errors are defined in [src/error.ts](./src/error.ts) and can be imported and tested for like so:
399
+
400
+ ```typescript
401
+ import { CognitoJwtVerifier } from "aws-jwt-verify";
402
+ import { JwtExpiredError } from "aws-jwt-verify/error";
403
+
404
+ const verifier = CognitoJwtVerifier.create({
405
+ userPoolId: "<user_pool_id>",
406
+ tokenUse: "access",
407
+ clientId: "<client_id>",
408
+ });
409
+
410
+ try {
411
+ const payload = await verifier.verify(
412
+ "eyJraWQeyJhdF9oYXNoIjoidk..." // the JWT as string
413
+ );
414
+ } catch (err) {
415
+ // An error is thrown, so the JWT is not valid
416
+ // Use `instanceof` to test for specific error cases:
417
+ if (err instanceof JwtExpiredError) {
418
+ console.error("JWT expired!");
419
+ }
420
+ throw err;
421
+ }
422
+ ```
423
+
424
+ ### Peek inside invalid JWTs
425
+
426
+ If you want to peek inside invalid JWTs, set `includeRawJwtInErrors` to `true` when creating the verifier. The thrown error will then include the raw JWT:
427
+
428
+ ```typescript
429
+ import { CognitoJwtVerifier } from "aws-jwt-verify";
430
+ import { JwtInvalidClaimError } from "aws-jwt-verify/error";
431
+
432
+ const verifier = CognitoJwtVerifier.create({
433
+ userPoolId: "<user_pool_id>",
434
+ tokenUse: "access",
435
+ clientId: "<client_id>",
436
+ includeRawJwtInErrors: true, // can also be specified as parameter to the `verify` call
437
+ });
438
+
439
+ try {
440
+ const payload = await verifier.verify(
441
+ "eyJraWQeyJhdF9oYXNoIjoidk..." // the JWT as string
442
+ );
443
+ } catch (err) {
444
+ if (err instanceof JwtInvalidClaimError) {
445
+ // You can log the payload of the raw JWT, e.g. to aid in debugging and alerting on authentication errors
446
+ // Be careful not to disclose information on the error reason to the the client
447
+ console.error("JWT invalid because:", err.message);
448
+ console.error("Raw JWT:", err.rawJwt.payload);
449
+ }
450
+ throw new Error("Unauthorized");
451
+ }
452
+ ```
453
+
454
+ The `instanceof` check in the `catch` block above is crucial, because not all errors will include the rawJwt, only errors that subclass `JwtInvalidClaimError` will. In order to understand why this makes sense, you should know that this library verifies JWTs in 3 stages, that all must succeed for the JWT to be considered valid:
455
+
456
+ - Stage 1: Verify JWT structure and JSON parse the JWT
457
+ - Stage 2: Verify JWT cryptographic signature (i.e. RS256/RS384/RS512)
458
+ - Stage 3: Verify JWT claims (such as e.g. its expiration)
459
+
460
+ Only in case of stage 3 verification errors, will the raw JWT be included in the error (if you set `includeRawJwtInErrors` to `true`). This way, when you look at the invalid raw JWT in the error, you'll know that its structure and signature are at least valid (stages 1 and 2 succeeded).
461
+
462
+ Note that if you use [custom JWT checks](#custom-jwt-and-jwk-checks), you are in charge of throwing errors in your custom code. You can (optionally) subclass your errors from `JwtInvalidClaimError`, so that the raw JWT will be included on the errors you throw as well:
463
+
464
+ ```typescript
465
+ import { CognitoJwtVerifier } from "aws-jwt-verify";
466
+ import { JwtInvalidClaimError } from "aws-jwt-verify/error";
467
+
468
+ class CustomError extends JwtInvalidClaimError {}
469
+
470
+ const verifier = CognitoJwtVerifier.create({
471
+ userPoolId: "<user_pool_id>",
472
+ tokenUse: "access",
473
+ clientId: "<client_id>",
474
+ includeRawJwtInErrors: true,
475
+ customJwtCheck: ({ payload }) => {
476
+ if (payload.custom_claim !== "expected")
477
+ throw new CustomError("Invalid JWT", payload.custom_claim, "expected");
478
+ },
479
+ });
480
+
481
+ try {
482
+ const payload = await verifier.verify(
483
+ "eyJraWQeyJhdF9oYXNoIjoidk..." // the JWT as string
484
+ );
485
+ } catch (err) {
486
+ if (err instanceof JwtInvalidClaimError) {
487
+ console.error("JWT invalid:", err.rawJwt.payload);
488
+ }
489
+ throw new Error("Unauthorized");
490
+ }
491
+ ```
492
+
493
+ ## The JWKS cache
494
+
495
+ The JWKS cache is responsible for fetching the JWKS from the JWKS URI, caching it, and selecting the right JWK from it. Both the `CognitoJwtVerifier` and the (generic) `JwtRsaVerifier` utilize an in-memory JWKS cache. For each `issuer` a JWKS cache is maintained, and each JWK in a JWKS is selected and cached using its `kid` (key id). The JWKS for an `issuer` will be fetched once initially, and thereafter only upon key rotations (detected by the occurrence of a JWT with a `kid` that is not yet in the cache).
496
+
497
+ Note: examples below work the same for `CognitoJwtVerifier` and `JwtRsaVerifier`.
498
+
499
+ ### Loading the JWKS from file
500
+
501
+ If e.g. your runtime environment doesn't have internet access, or you want to prevent the fetch over the network, you can load the JWKS explicitly yourself:
502
+
503
+ ```typescript
504
+ import { CognitoJwtVerifier } from "aws-jwt-verify";
505
+ import { readFileSync } from "fs";
506
+
507
+ const idTokenVerifier = CognitoJwtVerifier.create({
508
+ userPoolId: "<user_pool_id>",
509
+ tokenUse: "id",
510
+ clientId: "<client_id>",
511
+ });
512
+
513
+ const jwks = JSON.parse(readFileSync("jwks.json", { encoding: "utf-8" }));
514
+ idTokenVerifier.cacheJwks(jwks);
515
+
516
+ // Because the JWKS doesn't need to be downloaded now, you can use verifySync:
517
+ try {
518
+ const idTokenPayload = idTokenVerifier.verifySync(
519
+ "eyJraWQeyJhdF9oYXNoIjoidk..."
520
+ );
521
+ console.log("Token is valid. Payload:", payload);
522
+ } catch {
523
+ console.log("Token not valid!");
524
+ }
525
+
526
+ // Async verify will of course work as well (and will use the cache also):
527
+ try {
528
+ const idTokenPayload = await idTokenVerifier.verify(
529
+ "eyJraWQeyJhdF9oYXNoIjoidk..."
530
+ );
531
+ console.log("Token is valid. Payload:", idTokenPayload);
532
+ } catch {
533
+ console.log("Token not valid!");
534
+ }
535
+ ```
536
+
537
+ Note that the verifier will still try to fetch the JWKS, if it encounters a JWT with a kid that is not in it's cached JWKS (i.e. to cater for key rotations).
538
+
539
+ ### Rate limiting
540
+
541
+ Both the `CognitoJwtVerifier` and the `JwtRsaVerifier` enforce a rate limit of 1 JWKS download per JWKS uri per 10 seconds. This protects users of this library from inadvertently flooding the JWKS uri with requests, and prevents wasting time doing network calls.
542
+
543
+ The rate limit works as follows (implemented by the `penaltyBox`, see below). When the verifier fetches the JWKS and fails to locate the JWT's kid in the JWKS, an error is thrown, and a timer of 10 seconds is started. Until that timer completes, the verifier will refuse to fetch the particular JWKS uri again. It will instead throw an error immediately on `verify` calls where that would require the JWKS to be downloaded.
544
+
545
+ The verifier will continue to verify JWTs for which the right JWK is already present in the cache, also it will still try other JWKS uris (for other issuers).
546
+
547
+ It is possible to implement a different rate limiting scheme yourself, by customizing the JWKS cache, or the `penaltyBox` implementation, see below.
548
+
549
+ ### Explicitly hydrating the JWKS cache
550
+
551
+ In a long running Node.js API (e.g. a Fargate container), it might make sense to hydrate the JWKS cache upon server start up. This will speed up the first JWT verification, as the JWKS doesn't have to be downloaded anymore.
552
+
553
+ This call will always fetch the current, latest, JWKS for each of the verifier's issuers (even though the JWKS might have been fetched and cached before):
554
+
555
+ ```typescript
556
+ const verifier = JwtRsaVerifier.create([
557
+ {
558
+ issuer: "https://example.com/idp1",
559
+ audience: "myappclient1",
560
+ },
561
+ {
562
+ issuer: "https://example.com/idp2",
563
+ audience: "myappclient2",
564
+ },
565
+ ]);
566
+
567
+ // Fetch and cache the JWKS for all configured issuers
568
+ await verifier.hydrate();
569
+ ```
570
+
571
+ Note: it is only useful to call this method if your calling process has an idle time window, in which it might just as well fetch the JWKS. For example, during container start up, when the load balancer does not yet route traffic to the container. Calling this method inside API Gateway custom authorizers or Lambda@Edge has no benefit (in fact, awaiting the call as part of the Lambda handler would even hurt performance as it bypasses the existing cached JWKS).
572
+
573
+ ### Clearing the JWKS cache
574
+
575
+ If you have a predefined rotation schedule for your JWKS, you could set the refresh interval of the verifier aligned to this schedule:
576
+
577
+ ```typescript
578
+ import { JwtRsaVerifier } from "aws-jwt-verify";
579
+
580
+ const verifier = JwtRsaVerifier.create({
581
+ issuer: "https://example.com/",
582
+ audience: "<audience>",
583
+ });
584
+
585
+ setInterval(() => {
586
+ verifier.cacheJwks({ keys: [] }); // empty cache, by loading an empty JWKS
587
+ }, 1000 * 60 * 60 * 4); // For a 4 hour refresh schedule
588
+ ```
589
+
590
+ If an automated rotation does not fit your use case, and you need to clear out the JWKS cache, you could use:
591
+
592
+ ```typescript
593
+ verifier.cacheJwks({ keys: [] });
594
+ ```
595
+
596
+ ### Customizing the JWKS cache
597
+
598
+ When you instantiate a `CognitoJwtVerifier` or `JwtRsaVerifier` without providing a `JwksCache`, the `SimpleJwksCache` is used:
599
+
600
+ ```typescript
601
+ import { JwtRsaVerifier } from "aws-jwt-verify";
602
+ import { SimpleJwksCache } from "aws-jwt-verify/jwk";
603
+
604
+ const verifier = JwtRsaVerifier.create({
605
+ issuer: "http://my-tenant.my-idp.com",
606
+ });
607
+
608
+ // Equivalent:
609
+ const verifier2 = JwtRsaVerifier.create(
610
+ {
611
+ issuer: "http://my-tenant.my-idp.com",
612
+ },
613
+ {
614
+ jwksCache: new SimpleJwksCache(),
615
+ }
616
+ );
617
+ ```
618
+
619
+ The `SimpleJwksCache` can be tailored by using a different `penaltyBox` and/or `fetcher` (see below).
620
+
621
+ Alternatively, you can implement an entirely custom `JwksCache` yourself, by creating a class that implements the interface `JwksCache` (from `"aws-jwt-verify/jwk"`). This allows for highly custom scenario's, e.g. you could implement a `JwksCache` with custom logic for selecting a JWK from the JWKS.
622
+
623
+ ### Sharing the JWKS cache amongst different verifiers
624
+
625
+ If you want to define multiple verifiers for the same JWKS uri, it makes sense to share the JWKS cache, so the JWKS will be downloaded and cached once:
626
+
627
+ ```typescript
628
+ import { JwtRsaVerifier } from "aws-jwt-verify";
629
+ import { SimpleJwksCache } from "aws-jwt-verify/jwk";
630
+
631
+ const sharedJwksCache = new SimpleJwksCache();
632
+
633
+ const verifierA = JwtRsaVerifier.create(
634
+ {
635
+ jwksUri: "https://example.com/keys/jwks.json",
636
+ issuer: "https://example.com/",
637
+ audience: "<audience>",
638
+ },
639
+ {
640
+ jwksCache: sharedJwksCache,
641
+ }
642
+ );
643
+
644
+ const verifierB = JwtRsaVerifier.create(
645
+ {
646
+ jwksUri: "https://example.com/keys/jwks.json", // same JWKS URI, so sharing cache makes sense
647
+ issuer: "https://example.com/",
648
+ audience: "<audience>",
649
+ },
650
+ {
651
+ jwksCache: sharedJwksCache,
652
+ }
653
+ );
654
+ ```
655
+
656
+ ### Using a different `JsonFetcher` with `SimpleJwksCache`
657
+
658
+ When instantiating `SimpleJwksCache`, the `fetcher` property can be populated with an instance of a class that implements the interface `JsonFetcher` (from `"aws-jwt-verify/https"`), such as the `SimpleJsonFetcher` (which is the default).
659
+
660
+ The purpose of the fetcher, is to execute fetches against the JWKS uri (HTTPS GET) and parse the resulting JSON file.
661
+ The default implementation, the `SimpleJsonFetcher`, has basic machinery to do fetches over HTTPS. It does 1 (immediate) retry in case of connection errors.
662
+
663
+ By supplying a custom fetcher when instantiating `SimpleJwksCache`, instead of `SimpleJsonFetcher`, you can implement any retry and backoff scheme you want, or use another HTTPS library:
664
+
665
+ ```typescript
666
+ import { JwtRsaVerifier } from "aws-jwt-verify";
667
+ import { SimpleJwksCache } from "aws-jwt-verify/jwk";
668
+ import { JsonFetcher } from "aws-jwt-verify/https";
669
+ import axios from "axios";
670
+
671
+ // Use axios to do the HTTPS fetches
672
+ class CustomFetcher implements JsonFetcher {
673
+ instance = axios.create();
674
+ public async fetch(uri: string) {
675
+ return this.instance.get(uri).then((response) => response.data);
676
+ }
677
+ }
678
+
679
+ const verifier = JwtRsaVerifier.create(
680
+ {
681
+ issuer: "http://my-tenant.my-idp.com",
682
+ },
683
+ {
684
+ jwksCache: new SimpleJwksCache({
685
+ fetcher: new CustomFetcher(),
686
+ }),
687
+ }
688
+ );
689
+ ```
690
+
691
+ ### Configuring the JWKS response timeout and other HTTP options with `JsonFetcher`
692
+
693
+ The following configurations are equivalent, use the latter one to set a custom fetch timeout and other HTTP options.
694
+
695
+ ```typescript
696
+ import { CognitoJwtVerifier } from "aws-jwt-verify";
697
+
698
+ // No jwksCache configured explicitly,
699
+ // so the default `SimpleJwksCache` with `SimpleJsonFetcher` will be used,
700
+ // with a default response timeout of 1500 ms.:
701
+ const verifier = CognitoJwtVerifier.create({
702
+ userPoolId: "<user_pool_id>",
703
+ tokenUse: "access", // or "id"
704
+ clientId: "<client_id>",
705
+ });
706
+ ```
707
+
708
+ Equivalent explicit configuration:
709
+
710
+ ```typescript
711
+ import { CognitoJwtVerifier } from "aws-jwt-verify";
712
+ import { SimpleJwksCache } from "aws-jwt-verify/jwk";
713
+ import { SimpleJsonFetcher } from "aws-jwt-verify/https";
714
+
715
+ const verifier = CognitoJwtVerifier.create(
716
+ {
717
+ userPoolId: "<your user pool id>",
718
+ tokenUse: "access", // or "id",
719
+ clientId: "<your client id>",
720
+ },
721
+ {
722
+ jwksCache: new SimpleJwksCache({
723
+ fetcher: new SimpleJsonFetcher({
724
+ defaultRequestOptions: {
725
+ responseTimeout: 1500,
726
+ // You can add additional request options:
727
+ // For NodeJS: https://nodejs.org/api/http.html#httprequestoptions-callback
728
+ // For Web (init object): https://developer.mozilla.org/en-US/docs/Web/API/fetch#syntax
729
+ },
730
+ }),
731
+ }),
732
+ }
733
+ );
734
+ ```
735
+
736
+ ### Using a different `penaltyBox` with `SimpleJwksCache`
737
+
738
+ When instantiating `SimpleJwksCache`, the `penaltyBox` property can be populated with an instance of a class that implements the interface `PenaltyBox` (from `"aws-jwt-verify/jwk"`), such as the `SimplePenaltyBox` (which is the default).
739
+
740
+ The `SimpleJwksCache` will always do `await penaltyBox.wait(jwksUri, kid)` before asking the `fetcher` to fetch the JWKS.
741
+
742
+ By supplying a custom penaltyBox when instantiating `SimpleJwksCache`, instead of `SimplePenaltyBox`, you can implement any waiting scheme you want, in your implementation of the `wait` function.
743
+
744
+ The `SimpleJwksCache` will call `penaltyBox.registerSuccessfulAttempt(jwksUri, kid)` when it succeeds in locating the right JWK in the JWKS, and call `penaltyBox.registerFailedAttempt(jwksUri, kid)` otherwise. You need to process these calls, so that you can determine the right amount of waiting in your `wait` implementation.
745
+
746
+ ```typescript
747
+ import { JwtRsaVerifier } from "aws-jwt-verify";
748
+ import {
749
+ SimpleJwksCache,
750
+ SimplePenaltyBox,
751
+ PenaltyBox,
752
+ } from "aws-jwt-verify/jwk";
753
+
754
+ // In this example we use the SimplePenaltyBox, but override the default wait period
755
+ const verifier = JwtRsaVerifier.create(
756
+ {
757
+ issuer: "http://my-tenant.my-idp.com",
758
+ },
759
+ {
760
+ jwksCache: new SimpleJwksCache({
761
+ penaltyBox: new SimplePenaltyBox({ waitSeconds: 1 }),
762
+ }),
763
+ }
764
+ );
765
+
766
+ // Or implement your own penaltyBox
767
+ // The example here just stupidly waits 5 second always,
768
+ // even on the first fetch of the JWKS uri
769
+ class CustomPenaltyBox implements PenaltyBox {
770
+ public async wait(jwksUri: string, kid: string) {
771
+ // implement something better
772
+ await new Promise((resolve) => setTimeout(resolve, 5000));
773
+ }
774
+ public registerFailedAttempt(jwksUri: string, kid: string) {
775
+ // implement
776
+ }
777
+ public registerSuccessfulAttempt(jwksUri: string, kid: string) {
778
+ // implement
779
+ }
780
+ }
781
+ const verifier2 = JwtRsaVerifier.create(
782
+ {
783
+ issuer: "http://my-tenant.my-idp.com",
784
+ },
785
+ {
786
+ jwksCache: new SimpleJwksCache({ penaltyBox: new CustomPenaltyBox() }),
787
+ }
788
+ );
789
+ ```
790
+
791
+ ## Usage Examples
792
+
793
+ ### CloudFront Lambda@Edge
794
+
795
+ The verifier should be instantiated _outside_ the Lambda handler, so the verifier's cache can be reused for subsequent requests for as long as the Lambda functions stays "hot".
796
+
797
+ This is an example of a [Viewer Request Lambda@Edge](https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html) function, that inspects each incoming request. It requires each incoming request to have a valid JWT (in this case an access token that includes scope "read") in the HTTP "Authorization" header.
798
+
799
+ ```javascript
800
+ const { CognitoJwtVerifier } = require("aws-jwt-verify");
801
+
802
+ // Create the verifier outside the Lambda handler (= during cold start),
803
+ // so the cache can be reused for subsequent invocations. Then, only during the
804
+ // first invocation, will the verifier actually need to fetch the JWKS.
805
+ const jwtVerifier = CognitoJwtVerifier.create({
806
+ userPoolId: "<user_pool_id>",
807
+ tokenUse: "access",
808
+ clientId: "<client_id>",
809
+ scope: "read",
810
+ });
811
+
812
+ exports.handler = async (event) => {
813
+ const { request } = event.Records[0].cf;
814
+ const accessToken = request.headers["authorization"][0].value;
815
+ try {
816
+ await jwtVerifier.verify(accessToken);
817
+ } catch {
818
+ return {
819
+ status: "403",
820
+ body: "Unauthorized",
821
+ };
822
+ }
823
+ return request; // allow request to proceed
824
+ };
825
+ ```
826
+
827
+ ### API Gateway Lambda Authorizer - REST
828
+
829
+ The verifier should be instantiated _outside_ the Lambda handler, so the verifier's cache can be reused for subsequent requests for as long as the Lambda functions stays "hot".
830
+
831
+ Two types of API Gateway Lambda authorizers could be created - token based and request-based. For both the types of authorizers, you could use the [AWS API Gateway Lambda Authorizer BluePrint](https://github.com/awslabs/aws-apigateway-lambda-authorizer-blueprints/blob/master/blueprints/nodejs/index.js) as a reference pattern where the [token validation](https://github.com/awslabs/aws-apigateway-lambda-authorizer-blueprints/blob/master/blueprints/nodejs/index.js#L17) could be achieved as follows
832
+
833
+ For token based authorizers, where lambda event payload is set to `Token` and token source is set to (http) `Header` with name `authorization`:
834
+
835
+ ```javascript
836
+ const { CognitoJwtVerifier } = require("aws-jwt-verify");
837
+
838
+ // Create the verifier outside the Lambda handler (= during cold start),
839
+ // so the cache can be reused for subsequent invocations. Then, only during the
840
+ // first invocation, will the verifier actually need to fetch the JWKS.
841
+ const jwtVerifier = CognitoJwtVerifier.create({
842
+ userPoolId: "<user_pool_id>",
843
+ tokenUse: "access",
844
+ clientId: "<client_id>",
845
+ scope: "read",
846
+ });
847
+
848
+ exports.handler = async (event) => {
849
+ const accessToken = event.authorizationToken;
850
+
851
+ let payload;
852
+ try {
853
+ // If the token is not valid, an error is thrown:
854
+ payload = await jwtVerifier.verify(accessToken);
855
+ } catch {
856
+ // API Gateway wants this *exact* error message, otherwise it returns 500 instead of 401:
857
+ throw new Error("Unauthorized");
858
+ }
859
+
860
+ // Proceed with additional authorization logic
861
+ // ...
862
+ };
863
+ ```
864
+
865
+ For request based authorizers, where lambda event payload is set to `Request` and identity source is set to (http) `Header` with name `authorization`:
866
+
867
+ ```javascript
868
+ const { CognitoJwtVerifier } = require("aws-jwt-verify");
869
+
870
+ // Create the verifier outside the Lambda handler (= during cold start),
871
+ // so the cache can be reused for subsequent invocations. Then, only during the
872
+ // first invocation, will the verifier actually need to fetch the JWKS.
873
+ const jwtVerifier = CognitoJwtVerifier.create({
874
+ userPoolId: "<user_pool_id>",
875
+ tokenUse: "access",
876
+ clientId: "<client_id>",
877
+ scope: "read",
878
+ });
879
+
880
+ exports.handler = async (event) => {
881
+ const accessToken = event.headers["authorization"];
882
+
883
+ let payload;
884
+ try {
885
+ // If the token is not valid, an error is thrown:
886
+ payload = await jwtVerifier.verify(accessToken);
887
+ } catch {
888
+ // API Gateway wants this *exact* error message, otherwise it returns 500 instead of 401:
889
+ throw new Error("Unauthorized");
890
+ }
891
+
892
+ // Proceed with additional authorization logic
893
+ // ...
894
+ };
895
+ ```
896
+
897
+ ### HTTP API Lambda Authorizer
898
+
899
+ An example of a sample HTTP Lambda authorizer is included [here](tests/cognito/lib/lambda-authorizer/index.js) as part of the test suite for the solution ([format 2.0](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html#http-api-lambda-authorizer.payload-format-response)).
900
+
901
+ ### AppSync Lambda Authorizer
902
+
903
+ The verifier should be instantiated _outside_ the Lambda handler, so the verifier's cache can be reused for subsequent requests for as long as the Lambda functions stays "hot".
904
+
905
+ This is an example of [AppSync Lambda Authorization](https://docs.aws.amazon.com/appsync/latest/devguide/security-authz.html#aws-lambda-authorization) function, that validates the JWT is valid (in this case an access token that includes scope "read") along with other authorization business logic
906
+
907
+ ```javascript
908
+ const { CognitoJwtVerifier } = require("aws-jwt-verify");
909
+
910
+ // Create the verifier outside the Lambda handler (= during cold start),
911
+ // so the cache can be reused for subsequent invocations. Then, only during the
912
+ // first invocation, will the verifier actually need to fetch the JWKS.
913
+ const jwtVerifier = CognitoJwtVerifier.create({
914
+ userPoolId: "<user_pool_id>",
915
+ tokenUse: "access",
916
+ clientId: "<client_id>",
917
+ scope: "read",
918
+ });
919
+
920
+ exports.handler = async (event) => {
921
+ const accessToken = event.authorizationToken;
922
+ try {
923
+ await jwtVerifier.verify(accessToken);
924
+ } catch {
925
+ return {
926
+ isAuthorized: false,
927
+ };
928
+ }
929
+ //Proceed with additional authorization logic
930
+ };
931
+ ```
932
+
933
+ ### Fastify
934
+
935
+ ```javascript
936
+ const { CognitoJwtVerifier } = require("aws-jwt-verify");
937
+ const fastify = require("fastify")({ logger: true });
938
+
939
+ // Create the verifier outside your route handlers,
940
+ // so the cache is persisted and can be shared amongst them.
941
+ const jwtVerifier = CognitoJwtVerifier.create({
942
+ userPoolId: "<user_pool_id>",
943
+ tokenUse: "access",
944
+ clientId: "<client_id>",
945
+ scope: "read",
946
+ });
947
+
948
+ fastify.get("/", async (request, reply) => {
949
+ try {
950
+ // A valid JWT is expected in the HTTP header "authorization"
951
+ await jwtVerifier.verify(request.headers.authorization);
952
+ } catch (authErr) {
953
+ fastify.log.error(authErr);
954
+ const err = new Error();
955
+ err.statusCode = 403;
956
+ throw err;
957
+ }
958
+ return { private: "only visible to users sending a valid JWT" };
959
+ });
960
+
961
+ const startFastify = async () => {
962
+ try {
963
+ await fastify.listen(3000);
964
+ } catch (err) {
965
+ fastify.log.error(err);
966
+ process.exit(1);
967
+ }
968
+ };
969
+
970
+ // Hydrate the JWT verifier, and start Fastify.
971
+ // Hydrating the verifier makes sure the JWKS is loaded into the JWT verifier,
972
+ // so it can verify JWTs immediately without any latency.
973
+ // (Alternatively, just start Fastify, the JWKS will be downloaded when the first JWT is being verified then)
974
+ Promise.all([jwtVerifier.hydrate(), () => fastify.listen(3000)]).catch(
975
+ (err) => {
976
+ fastify.log.error(err);
977
+ process.exit(1);
978
+ }
979
+ );
980
+ ```
981
+
982
+ ### Express
983
+
984
+ ```javascript
985
+ const { CognitoJwtVerifier } = require("aws-jwt-verify");
986
+ const express = require("express");
987
+ const app = express();
988
+ const port = 3000;
989
+
990
+ // Create the verifier outside your route handlers,
991
+ // so the cache is persisted and can be shared amongst them.
992
+ const jwtVerifier = CognitoJwtVerifier.create({
993
+ userPoolId: "<user_pool_id>",
994
+ tokenUse: "access",
995
+ clientId: "<client_id>",
996
+ scope: "read",
997
+ });
998
+
999
+ app.get("/", async (req, res, next) => {
1000
+ try {
1001
+ // A valid JWT is expected in the HTTP header "authorization"
1002
+ await jwtVerifier.verify(req.header("authorization"));
1003
+ } catch (err) {
1004
+ console.error(err);
1005
+ return res.status(403).json({ statusCode: 403, message: "Forbidden" });
1006
+ }
1007
+ res.json({ private: "only visible to users sending a valid JWT" });
1008
+ });
1009
+
1010
+ // Hydrate the JWT verifier, then start express.
1011
+ // Hydrating the verifier makes sure the JWKS is loaded into the JWT verifier,
1012
+ // so it can verify JWTs immediately without any latency.
1013
+ // (Alternatively, just start express, the JWKS will be downloaded when the first JWT is being verified then)
1014
+ jwtVerifier
1015
+ .hydrate()
1016
+ .catch((err) => {
1017
+ console.error(`Failed to hydrate JWT verifier: ${err}`);
1018
+ process.exit(1);
1019
+ })
1020
+ .then(() =>
1021
+ app.listen(port, () => {
1022
+ console.log(`Example app listening at http://localhost:${port}`);
1023
+ })
1024
+ );
1025
+ ```
1026
+
1027
+ # Security
1028
+
1029
+ See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
1030
+
1031
+ # License
1032
+
1033
+ This project is licensed under the Apache-2.0 License.