@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.
- package/CHANGELOG.md +193 -0
- package/LICENSE +93 -0
- package/README.md +875 -2
- package/assets/acl-reconciler/index.js +1604 -0
- package/assets/api/index.js +9857 -0
- package/assets/api/package.json +9 -0
- package/assets/api/vendor_modules/.package-lock.json +857 -0
- package/assets/api/vendor_modules/accepts/HISTORY.md +243 -0
- package/assets/api/vendor_modules/accepts/LICENSE +23 -0
- package/assets/api/vendor_modules/accepts/README.md +140 -0
- package/assets/api/vendor_modules/accepts/index.js +238 -0
- package/assets/api/vendor_modules/accepts/package.json +47 -0
- package/assets/api/vendor_modules/array-flatten/LICENSE +21 -0
- package/assets/api/vendor_modules/array-flatten/README.md +43 -0
- package/assets/api/vendor_modules/array-flatten/array-flatten.js +64 -0
- package/assets/api/vendor_modules/array-flatten/package.json +39 -0
- package/assets/api/vendor_modules/aws-jwt-verify/LICENSE +175 -0
- package/assets/api/vendor_modules/aws-jwt-verify/README.md +1033 -0
- package/assets/api/vendor_modules/aws-jwt-verify/asn1.d.ts +20 -0
- package/assets/api/vendor_modules/aws-jwt-verify/assert.d.ts +41 -0
- package/assets/api/vendor_modules/aws-jwt-verify/cognito-verifier.d.ts +183 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/asn1.js +301 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/assert.js +108 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/cognito-verifier.js +158 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/error.js +131 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/https-common.js +29 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/https-node.js +89 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/https.js +52 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/index.js +9 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/jwk.js +221 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/jwt-model.js +10 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/jwt-rsa.js +397 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/jwt.js +161 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/node-web-compat-node.js +48 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/node-web-compat-web.js +78 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/node-web-compat.js +11 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/package.json +1 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/safe-json-parse.js +34 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/cjs/typing-util.js +6 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/asn1.js +296 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/assert.js +101 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/cognito-verifier.js +153 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/error.js +101 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/https-common.js +25 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/https-node.js +85 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/https.js +48 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/index.js +4 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/jwk.js +208 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/jwt-model.js +7 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/jwt-rsa.js +389 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/jwt.js +156 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/node-web-compat-node.js +45 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/node-web-compat-web.js +75 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/node-web-compat.js +10 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/package.json +1 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/safe-json-parse.js +29 -0
- package/assets/api/vendor_modules/aws-jwt-verify/dist/esm/typing-util.js +5 -0
- package/assets/api/vendor_modules/aws-jwt-verify/error.d.ts +108 -0
- package/assets/api/vendor_modules/aws-jwt-verify/https-common.d.ts +9 -0
- package/assets/api/vendor_modules/aws-jwt-verify/https-node.d.ts +20 -0
- package/assets/api/vendor_modules/aws-jwt-verify/https.d.ts +35 -0
- package/assets/api/vendor_modules/aws-jwt-verify/index.d.ts +2 -0
- package/assets/api/vendor_modules/aws-jwt-verify/jwk.d.ts +76 -0
- package/assets/api/vendor_modules/aws-jwt-verify/jwt-model.d.ts +78 -0
- package/assets/api/vendor_modules/aws-jwt-verify/jwt-rsa.d.ts +348 -0
- package/assets/api/vendor_modules/aws-jwt-verify/jwt.d.ts +51 -0
- package/assets/api/vendor_modules/aws-jwt-verify/package.json +136 -0
- package/assets/api/vendor_modules/aws-jwt-verify/safe-json-parse.d.ts +18 -0
- package/assets/api/vendor_modules/aws-jwt-verify/typing-util.d.ts +38 -0
- package/assets/api/vendor_modules/body-parser/HISTORY.md +703 -0
- package/assets/api/vendor_modules/body-parser/LICENSE +23 -0
- package/assets/api/vendor_modules/body-parser/README.md +476 -0
- package/assets/api/vendor_modules/body-parser/index.js +156 -0
- package/assets/api/vendor_modules/body-parser/lib/read.js +205 -0
- package/assets/api/vendor_modules/body-parser/lib/types/json.js +247 -0
- package/assets/api/vendor_modules/body-parser/lib/types/raw.js +105 -0
- package/assets/api/vendor_modules/body-parser/lib/types/text.js +125 -0
- package/assets/api/vendor_modules/body-parser/lib/types/urlencoded.js +303 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/.editorconfig +46 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/.github/SECURITY.md +11 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/.github/THREAT_MODEL.md +80 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/.nycrc +13 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/CHANGELOG.md +872 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/LICENSE.md +29 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/README.md +804 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/dist/qs.js +141 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/eslint.config.mjs +57 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/formats.js +23 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/index.js +11 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/parse.js +503 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/stringify.js +378 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/lib/utils.js +512 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/package.json +95 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/test/empty-keys-cases.js +267 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/test/parse.js +2296 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/test/stringify.js +1995 -0
- package/assets/api/vendor_modules/body-parser/node_modules/qs/test/utils.js +822 -0
- package/assets/api/vendor_modules/body-parser/package.json +55 -0
- package/assets/api/vendor_modules/bytes/History.md +97 -0
- package/assets/api/vendor_modules/bytes/LICENSE +23 -0
- package/assets/api/vendor_modules/bytes/Readme.md +152 -0
- package/assets/api/vendor_modules/bytes/index.js +170 -0
- package/assets/api/vendor_modules/bytes/package.json +42 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/.eslintrc +17 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/LICENSE +21 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/README.md +62 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/index.d.ts +64 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/index.js +15 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/package.json +85 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/test/index.js +63 -0
- package/assets/api/vendor_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/assets/api/vendor_modules/call-bound/.eslintrc +13 -0
- package/assets/api/vendor_modules/call-bound/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/call-bound/.nycrc +9 -0
- package/assets/api/vendor_modules/call-bound/CHANGELOG.md +42 -0
- package/assets/api/vendor_modules/call-bound/LICENSE +21 -0
- package/assets/api/vendor_modules/call-bound/README.md +53 -0
- package/assets/api/vendor_modules/call-bound/index.d.ts +94 -0
- package/assets/api/vendor_modules/call-bound/index.js +19 -0
- package/assets/api/vendor_modules/call-bound/package.json +99 -0
- package/assets/api/vendor_modules/call-bound/test/index.js +61 -0
- package/assets/api/vendor_modules/call-bound/tsconfig.json +10 -0
- package/assets/api/vendor_modules/content-disposition/HISTORY.md +60 -0
- package/assets/api/vendor_modules/content-disposition/LICENSE +22 -0
- package/assets/api/vendor_modules/content-disposition/README.md +142 -0
- package/assets/api/vendor_modules/content-disposition/index.js +458 -0
- package/assets/api/vendor_modules/content-disposition/package.json +44 -0
- package/assets/api/vendor_modules/content-type/HISTORY.md +29 -0
- package/assets/api/vendor_modules/content-type/LICENSE +22 -0
- package/assets/api/vendor_modules/content-type/README.md +94 -0
- package/assets/api/vendor_modules/content-type/index.js +225 -0
- package/assets/api/vendor_modules/content-type/package.json +42 -0
- package/assets/api/vendor_modules/cookie/LICENSE +24 -0
- package/assets/api/vendor_modules/cookie/README.md +317 -0
- package/assets/api/vendor_modules/cookie/SECURITY.md +25 -0
- package/assets/api/vendor_modules/cookie/index.js +335 -0
- package/assets/api/vendor_modules/cookie/package.json +44 -0
- package/assets/api/vendor_modules/cookie-signature/History.md +42 -0
- package/assets/api/vendor_modules/cookie-signature/Readme.md +42 -0
- package/assets/api/vendor_modules/cookie-signature/index.js +51 -0
- package/assets/api/vendor_modules/cookie-signature/package.json +18 -0
- package/assets/api/vendor_modules/debug/.coveralls.yml +1 -0
- package/assets/api/vendor_modules/debug/.eslintrc +11 -0
- package/assets/api/vendor_modules/debug/.travis.yml +14 -0
- package/assets/api/vendor_modules/debug/CHANGELOG.md +362 -0
- package/assets/api/vendor_modules/debug/LICENSE +19 -0
- package/assets/api/vendor_modules/debug/Makefile +50 -0
- package/assets/api/vendor_modules/debug/README.md +312 -0
- package/assets/api/vendor_modules/debug/component.json +19 -0
- package/assets/api/vendor_modules/debug/karma.conf.js +70 -0
- package/assets/api/vendor_modules/debug/node.js +1 -0
- package/assets/api/vendor_modules/debug/package.json +49 -0
- package/assets/api/vendor_modules/debug/src/browser.js +185 -0
- package/assets/api/vendor_modules/debug/src/debug.js +202 -0
- package/assets/api/vendor_modules/debug/src/index.js +10 -0
- package/assets/api/vendor_modules/debug/src/inspector-log.js +15 -0
- package/assets/api/vendor_modules/debug/src/node.js +248 -0
- package/assets/api/vendor_modules/depd/History.md +103 -0
- package/assets/api/vendor_modules/depd/LICENSE +22 -0
- package/assets/api/vendor_modules/depd/Readme.md +280 -0
- package/assets/api/vendor_modules/depd/index.js +538 -0
- package/assets/api/vendor_modules/depd/lib/browser/index.js +77 -0
- package/assets/api/vendor_modules/depd/package.json +45 -0
- package/assets/api/vendor_modules/destroy/LICENSE +23 -0
- package/assets/api/vendor_modules/destroy/README.md +63 -0
- package/assets/api/vendor_modules/destroy/index.js +209 -0
- package/assets/api/vendor_modules/destroy/package.json +48 -0
- package/assets/api/vendor_modules/dunder-proto/.eslintrc +5 -0
- package/assets/api/vendor_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/dunder-proto/.nycrc +13 -0
- package/assets/api/vendor_modules/dunder-proto/CHANGELOG.md +24 -0
- package/assets/api/vendor_modules/dunder-proto/LICENSE +21 -0
- package/assets/api/vendor_modules/dunder-proto/README.md +54 -0
- package/assets/api/vendor_modules/dunder-proto/get.d.ts +5 -0
- package/assets/api/vendor_modules/dunder-proto/get.js +30 -0
- package/assets/api/vendor_modules/dunder-proto/package.json +76 -0
- package/assets/api/vendor_modules/dunder-proto/set.d.ts +5 -0
- package/assets/api/vendor_modules/dunder-proto/set.js +35 -0
- package/assets/api/vendor_modules/dunder-proto/test/get.js +34 -0
- package/assets/api/vendor_modules/dunder-proto/test/index.js +4 -0
- package/assets/api/vendor_modules/dunder-proto/test/set.js +50 -0
- package/assets/api/vendor_modules/dunder-proto/tsconfig.json +9 -0
- package/assets/api/vendor_modules/ee-first/LICENSE +22 -0
- package/assets/api/vendor_modules/ee-first/README.md +80 -0
- package/assets/api/vendor_modules/ee-first/index.js +95 -0
- package/assets/api/vendor_modules/ee-first/package.json +29 -0
- package/assets/api/vendor_modules/encodeurl/LICENSE +22 -0
- package/assets/api/vendor_modules/encodeurl/README.md +109 -0
- package/assets/api/vendor_modules/encodeurl/index.js +60 -0
- package/assets/api/vendor_modules/encodeurl/package.json +40 -0
- package/assets/api/vendor_modules/es-define-property/.eslintrc +13 -0
- package/assets/api/vendor_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/es-define-property/.nycrc +9 -0
- package/assets/api/vendor_modules/es-define-property/CHANGELOG.md +29 -0
- package/assets/api/vendor_modules/es-define-property/LICENSE +21 -0
- package/assets/api/vendor_modules/es-define-property/README.md +49 -0
- package/assets/api/vendor_modules/es-define-property/index.d.ts +3 -0
- package/assets/api/vendor_modules/es-define-property/index.js +14 -0
- package/assets/api/vendor_modules/es-define-property/package.json +81 -0
- package/assets/api/vendor_modules/es-define-property/test/index.js +56 -0
- package/assets/api/vendor_modules/es-define-property/tsconfig.json +10 -0
- package/assets/api/vendor_modules/es-errors/.eslintrc +5 -0
- package/assets/api/vendor_modules/es-errors/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/es-errors/CHANGELOG.md +40 -0
- package/assets/api/vendor_modules/es-errors/LICENSE +21 -0
- package/assets/api/vendor_modules/es-errors/README.md +55 -0
- package/assets/api/vendor_modules/es-errors/eval.d.ts +3 -0
- package/assets/api/vendor_modules/es-errors/eval.js +4 -0
- package/assets/api/vendor_modules/es-errors/index.d.ts +3 -0
- package/assets/api/vendor_modules/es-errors/index.js +4 -0
- package/assets/api/vendor_modules/es-errors/package.json +80 -0
- package/assets/api/vendor_modules/es-errors/range.d.ts +3 -0
- package/assets/api/vendor_modules/es-errors/range.js +4 -0
- package/assets/api/vendor_modules/es-errors/ref.d.ts +3 -0
- package/assets/api/vendor_modules/es-errors/ref.js +4 -0
- package/assets/api/vendor_modules/es-errors/syntax.d.ts +3 -0
- package/assets/api/vendor_modules/es-errors/syntax.js +4 -0
- package/assets/api/vendor_modules/es-errors/test/index.js +19 -0
- package/assets/api/vendor_modules/es-errors/tsconfig.json +49 -0
- package/assets/api/vendor_modules/es-errors/type.d.ts +3 -0
- package/assets/api/vendor_modules/es-errors/type.js +4 -0
- package/assets/api/vendor_modules/es-errors/uri.d.ts +3 -0
- package/assets/api/vendor_modules/es-errors/uri.js +4 -0
- package/assets/api/vendor_modules/es-object-atoms/.eslintrc +16 -0
- package/assets/api/vendor_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/es-object-atoms/CHANGELOG.md +44 -0
- package/assets/api/vendor_modules/es-object-atoms/LICENSE +21 -0
- package/assets/api/vendor_modules/es-object-atoms/README.md +63 -0
- package/assets/api/vendor_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/assets/api/vendor_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/assets/api/vendor_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/assets/api/vendor_modules/es-object-atoms/ToObject.js +10 -0
- package/assets/api/vendor_modules/es-object-atoms/index.d.ts +3 -0
- package/assets/api/vendor_modules/es-object-atoms/index.js +4 -0
- package/assets/api/vendor_modules/es-object-atoms/isObject.d.ts +3 -0
- package/assets/api/vendor_modules/es-object-atoms/isObject.js +6 -0
- package/assets/api/vendor_modules/es-object-atoms/package.json +79 -0
- package/assets/api/vendor_modules/es-object-atoms/test/index.js +38 -0
- package/assets/api/vendor_modules/es-object-atoms/tsconfig.json +7 -0
- package/assets/api/vendor_modules/escape-html/LICENSE +24 -0
- package/assets/api/vendor_modules/escape-html/Readme.md +43 -0
- package/assets/api/vendor_modules/escape-html/index.js +78 -0
- package/assets/api/vendor_modules/escape-html/package.json +24 -0
- package/assets/api/vendor_modules/etag/HISTORY.md +83 -0
- package/assets/api/vendor_modules/etag/LICENSE +22 -0
- package/assets/api/vendor_modules/etag/README.md +159 -0
- package/assets/api/vendor_modules/etag/index.js +131 -0
- package/assets/api/vendor_modules/etag/package.json +47 -0
- package/assets/api/vendor_modules/express/History.md +3676 -0
- package/assets/api/vendor_modules/express/LICENSE +24 -0
- package/assets/api/vendor_modules/express/Readme.md +260 -0
- package/assets/api/vendor_modules/express/index.js +11 -0
- package/assets/api/vendor_modules/express/lib/application.js +661 -0
- package/assets/api/vendor_modules/express/lib/express.js +116 -0
- package/assets/api/vendor_modules/express/lib/middleware/init.js +43 -0
- package/assets/api/vendor_modules/express/lib/middleware/query.js +47 -0
- package/assets/api/vendor_modules/express/lib/request.js +525 -0
- package/assets/api/vendor_modules/express/lib/response.js +1179 -0
- package/assets/api/vendor_modules/express/lib/router/index.js +673 -0
- package/assets/api/vendor_modules/express/lib/router/layer.js +181 -0
- package/assets/api/vendor_modules/express/lib/router/route.js +230 -0
- package/assets/api/vendor_modules/express/lib/utils.js +304 -0
- package/assets/api/vendor_modules/express/lib/view.js +182 -0
- package/assets/api/vendor_modules/express/package.json +102 -0
- package/assets/api/vendor_modules/finalhandler/HISTORY.md +216 -0
- package/assets/api/vendor_modules/finalhandler/LICENSE +22 -0
- package/assets/api/vendor_modules/finalhandler/README.md +147 -0
- package/assets/api/vendor_modules/finalhandler/SECURITY.md +25 -0
- package/assets/api/vendor_modules/finalhandler/index.js +341 -0
- package/assets/api/vendor_modules/finalhandler/package.json +47 -0
- package/assets/api/vendor_modules/forwarded/HISTORY.md +21 -0
- package/assets/api/vendor_modules/forwarded/LICENSE +22 -0
- package/assets/api/vendor_modules/forwarded/README.md +57 -0
- package/assets/api/vendor_modules/forwarded/index.js +90 -0
- package/assets/api/vendor_modules/forwarded/package.json +45 -0
- package/assets/api/vendor_modules/fresh/HISTORY.md +70 -0
- package/assets/api/vendor_modules/fresh/LICENSE +23 -0
- package/assets/api/vendor_modules/fresh/README.md +119 -0
- package/assets/api/vendor_modules/fresh/index.js +137 -0
- package/assets/api/vendor_modules/fresh/package.json +46 -0
- package/assets/api/vendor_modules/function-bind/.eslintrc +21 -0
- package/assets/api/vendor_modules/function-bind/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/function-bind/.github/SECURITY.md +3 -0
- package/assets/api/vendor_modules/function-bind/.nycrc +13 -0
- package/assets/api/vendor_modules/function-bind/CHANGELOG.md +136 -0
- package/assets/api/vendor_modules/function-bind/LICENSE +20 -0
- package/assets/api/vendor_modules/function-bind/README.md +46 -0
- package/assets/api/vendor_modules/function-bind/implementation.js +84 -0
- package/assets/api/vendor_modules/function-bind/index.js +5 -0
- package/assets/api/vendor_modules/function-bind/package.json +87 -0
- package/assets/api/vendor_modules/function-bind/test/.eslintrc +9 -0
- package/assets/api/vendor_modules/function-bind/test/index.js +252 -0
- package/assets/api/vendor_modules/get-intrinsic/.eslintrc +42 -0
- package/assets/api/vendor_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/get-intrinsic/.nycrc +9 -0
- package/assets/api/vendor_modules/get-intrinsic/CHANGELOG.md +186 -0
- package/assets/api/vendor_modules/get-intrinsic/LICENSE +21 -0
- package/assets/api/vendor_modules/get-intrinsic/README.md +71 -0
- package/assets/api/vendor_modules/get-intrinsic/index.js +378 -0
- package/assets/api/vendor_modules/get-intrinsic/package.json +97 -0
- package/assets/api/vendor_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/assets/api/vendor_modules/get-proto/.eslintrc +10 -0
- package/assets/api/vendor_modules/get-proto/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/get-proto/.nycrc +9 -0
- package/assets/api/vendor_modules/get-proto/CHANGELOG.md +21 -0
- package/assets/api/vendor_modules/get-proto/LICENSE +21 -0
- package/assets/api/vendor_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/assets/api/vendor_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/assets/api/vendor_modules/get-proto/README.md +50 -0
- package/assets/api/vendor_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/assets/api/vendor_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/assets/api/vendor_modules/get-proto/index.d.ts +5 -0
- package/assets/api/vendor_modules/get-proto/index.js +27 -0
- package/assets/api/vendor_modules/get-proto/package.json +81 -0
- package/assets/api/vendor_modules/get-proto/test/index.js +68 -0
- package/assets/api/vendor_modules/get-proto/tsconfig.json +9 -0
- package/assets/api/vendor_modules/gopd/.eslintrc +16 -0
- package/assets/api/vendor_modules/gopd/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/gopd/CHANGELOG.md +45 -0
- package/assets/api/vendor_modules/gopd/LICENSE +21 -0
- package/assets/api/vendor_modules/gopd/README.md +40 -0
- package/assets/api/vendor_modules/gopd/gOPD.d.ts +1 -0
- package/assets/api/vendor_modules/gopd/gOPD.js +4 -0
- package/assets/api/vendor_modules/gopd/index.d.ts +5 -0
- package/assets/api/vendor_modules/gopd/index.js +15 -0
- package/assets/api/vendor_modules/gopd/package.json +77 -0
- package/assets/api/vendor_modules/gopd/test/index.js +36 -0
- package/assets/api/vendor_modules/gopd/tsconfig.json +9 -0
- package/assets/api/vendor_modules/has-symbols/.eslintrc +11 -0
- package/assets/api/vendor_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/has-symbols/.nycrc +9 -0
- package/assets/api/vendor_modules/has-symbols/CHANGELOG.md +91 -0
- package/assets/api/vendor_modules/has-symbols/LICENSE +21 -0
- package/assets/api/vendor_modules/has-symbols/README.md +46 -0
- package/assets/api/vendor_modules/has-symbols/index.d.ts +3 -0
- package/assets/api/vendor_modules/has-symbols/index.js +14 -0
- package/assets/api/vendor_modules/has-symbols/package.json +111 -0
- package/assets/api/vendor_modules/has-symbols/shams.d.ts +3 -0
- package/assets/api/vendor_modules/has-symbols/shams.js +45 -0
- package/assets/api/vendor_modules/has-symbols/test/index.js +22 -0
- package/assets/api/vendor_modules/has-symbols/test/shams/core-js.js +29 -0
- package/assets/api/vendor_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- package/assets/api/vendor_modules/has-symbols/test/tests.js +58 -0
- package/assets/api/vendor_modules/has-symbols/tsconfig.json +10 -0
- package/assets/api/vendor_modules/hasown/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/hasown/.nycrc +13 -0
- package/assets/api/vendor_modules/hasown/CHANGELOG.md +58 -0
- package/assets/api/vendor_modules/hasown/LICENSE +21 -0
- package/assets/api/vendor_modules/hasown/README.md +40 -0
- package/assets/api/vendor_modules/hasown/eslint.config.mjs +6 -0
- package/assets/api/vendor_modules/hasown/index.d.ts +3 -0
- package/assets/api/vendor_modules/hasown/index.js +8 -0
- package/assets/api/vendor_modules/hasown/package.json +91 -0
- package/assets/api/vendor_modules/hasown/tsconfig.json +6 -0
- package/assets/api/vendor_modules/http-errors/HISTORY.md +186 -0
- package/assets/api/vendor_modules/http-errors/LICENSE +23 -0
- package/assets/api/vendor_modules/http-errors/README.md +169 -0
- package/assets/api/vendor_modules/http-errors/index.js +290 -0
- package/assets/api/vendor_modules/http-errors/package.json +54 -0
- package/assets/api/vendor_modules/iconv-lite/Changelog.md +162 -0
- package/assets/api/vendor_modules/iconv-lite/LICENSE +21 -0
- package/assets/api/vendor_modules/iconv-lite/README.md +156 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/dbcs-data.js +176 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/index.js +22 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/internal.js +188 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/sbcs-data.js +174 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/utf16.js +177 -0
- package/assets/api/vendor_modules/iconv-lite/encodings/utf7.js +290 -0
- package/assets/api/vendor_modules/iconv-lite/lib/bom-handling.js +52 -0
- package/assets/api/vendor_modules/iconv-lite/lib/extend-node.js +217 -0
- package/assets/api/vendor_modules/iconv-lite/lib/index.d.ts +24 -0
- package/assets/api/vendor_modules/iconv-lite/lib/index.js +153 -0
- package/assets/api/vendor_modules/iconv-lite/lib/streams.js +121 -0
- package/assets/api/vendor_modules/iconv-lite/package.json +46 -0
- package/assets/api/vendor_modules/inherits/LICENSE +16 -0
- package/assets/api/vendor_modules/inherits/README.md +42 -0
- package/assets/api/vendor_modules/inherits/inherits.js +9 -0
- package/assets/api/vendor_modules/inherits/inherits_browser.js +27 -0
- package/assets/api/vendor_modules/inherits/package.json +29 -0
- package/assets/api/vendor_modules/ipaddr.js/LICENSE +19 -0
- package/assets/api/vendor_modules/ipaddr.js/README.md +233 -0
- package/assets/api/vendor_modules/ipaddr.js/ipaddr.min.js +1 -0
- package/assets/api/vendor_modules/ipaddr.js/lib/ipaddr.js +673 -0
- package/assets/api/vendor_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
- package/assets/api/vendor_modules/ipaddr.js/package.json +35 -0
- package/assets/api/vendor_modules/math-intrinsics/.eslintrc +16 -0
- package/assets/api/vendor_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/assets/api/vendor_modules/math-intrinsics/LICENSE +21 -0
- package/assets/api/vendor_modules/math-intrinsics/README.md +50 -0
- package/assets/api/vendor_modules/math-intrinsics/abs.d.ts +1 -0
- package/assets/api/vendor_modules/math-intrinsics/abs.js +4 -0
- package/assets/api/vendor_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/assets/api/vendor_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/assets/api/vendor_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/assets/api/vendor_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/assets/api/vendor_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/assets/api/vendor_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/assets/api/vendor_modules/math-intrinsics/floor.d.ts +1 -0
- package/assets/api/vendor_modules/math-intrinsics/floor.js +4 -0
- package/assets/api/vendor_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/assets/api/vendor_modules/math-intrinsics/isFinite.js +12 -0
- package/assets/api/vendor_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/assets/api/vendor_modules/math-intrinsics/isInteger.js +16 -0
- package/assets/api/vendor_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/assets/api/vendor_modules/math-intrinsics/isNaN.js +6 -0
- package/assets/api/vendor_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/assets/api/vendor_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/assets/api/vendor_modules/math-intrinsics/max.d.ts +1 -0
- package/assets/api/vendor_modules/math-intrinsics/max.js +4 -0
- package/assets/api/vendor_modules/math-intrinsics/min.d.ts +1 -0
- package/assets/api/vendor_modules/math-intrinsics/min.js +4 -0
- package/assets/api/vendor_modules/math-intrinsics/mod.d.ts +3 -0
- package/assets/api/vendor_modules/math-intrinsics/mod.js +9 -0
- package/assets/api/vendor_modules/math-intrinsics/package.json +86 -0
- package/assets/api/vendor_modules/math-intrinsics/pow.d.ts +1 -0
- package/assets/api/vendor_modules/math-intrinsics/pow.js +4 -0
- package/assets/api/vendor_modules/math-intrinsics/round.d.ts +1 -0
- package/assets/api/vendor_modules/math-intrinsics/round.js +4 -0
- package/assets/api/vendor_modules/math-intrinsics/sign.d.ts +3 -0
- package/assets/api/vendor_modules/math-intrinsics/sign.js +11 -0
- package/assets/api/vendor_modules/math-intrinsics/test/index.js +192 -0
- package/assets/api/vendor_modules/math-intrinsics/tsconfig.json +3 -0
- package/assets/api/vendor_modules/media-typer/HISTORY.md +22 -0
- package/assets/api/vendor_modules/media-typer/LICENSE +22 -0
- package/assets/api/vendor_modules/media-typer/README.md +81 -0
- package/assets/api/vendor_modules/media-typer/index.js +270 -0
- package/assets/api/vendor_modules/media-typer/package.json +26 -0
- package/assets/api/vendor_modules/merge-descriptors/HISTORY.md +21 -0
- package/assets/api/vendor_modules/merge-descriptors/LICENSE +23 -0
- package/assets/api/vendor_modules/merge-descriptors/README.md +49 -0
- package/assets/api/vendor_modules/merge-descriptors/index.js +60 -0
- package/assets/api/vendor_modules/merge-descriptors/package.json +39 -0
- package/assets/api/vendor_modules/methods/HISTORY.md +29 -0
- package/assets/api/vendor_modules/methods/LICENSE +24 -0
- package/assets/api/vendor_modules/methods/README.md +51 -0
- package/assets/api/vendor_modules/methods/index.js +69 -0
- package/assets/api/vendor_modules/methods/package.json +36 -0
- package/assets/api/vendor_modules/mime/CHANGELOG.md +164 -0
- package/assets/api/vendor_modules/mime/LICENSE +21 -0
- package/assets/api/vendor_modules/mime/README.md +90 -0
- package/assets/api/vendor_modules/mime/cli.js +8 -0
- package/assets/api/vendor_modules/mime/mime.js +108 -0
- package/assets/api/vendor_modules/mime/package.json +44 -0
- package/assets/api/vendor_modules/mime/src/build.js +53 -0
- package/assets/api/vendor_modules/mime/src/test.js +60 -0
- package/assets/api/vendor_modules/mime/types.json +1 -0
- package/assets/api/vendor_modules/mime-db/HISTORY.md +507 -0
- package/assets/api/vendor_modules/mime-db/LICENSE +23 -0
- package/assets/api/vendor_modules/mime-db/README.md +100 -0
- package/assets/api/vendor_modules/mime-db/db.json +8519 -0
- package/assets/api/vendor_modules/mime-db/index.js +12 -0
- package/assets/api/vendor_modules/mime-db/package.json +60 -0
- package/assets/api/vendor_modules/mime-types/HISTORY.md +397 -0
- package/assets/api/vendor_modules/mime-types/LICENSE +23 -0
- package/assets/api/vendor_modules/mime-types/README.md +113 -0
- package/assets/api/vendor_modules/mime-types/index.js +188 -0
- package/assets/api/vendor_modules/mime-types/package.json +44 -0
- package/assets/api/vendor_modules/ms/index.js +152 -0
- package/assets/api/vendor_modules/ms/license.md +21 -0
- package/assets/api/vendor_modules/ms/package.json +37 -0
- package/assets/api/vendor_modules/ms/readme.md +51 -0
- package/assets/api/vendor_modules/negotiator/HISTORY.md +108 -0
- package/assets/api/vendor_modules/negotiator/LICENSE +24 -0
- package/assets/api/vendor_modules/negotiator/README.md +203 -0
- package/assets/api/vendor_modules/negotiator/index.js +82 -0
- package/assets/api/vendor_modules/negotiator/lib/charset.js +169 -0
- package/assets/api/vendor_modules/negotiator/lib/encoding.js +184 -0
- package/assets/api/vendor_modules/negotiator/lib/language.js +179 -0
- package/assets/api/vendor_modules/negotiator/lib/mediaType.js +294 -0
- package/assets/api/vendor_modules/negotiator/package.json +42 -0
- package/assets/api/vendor_modules/object-inspect/.eslintrc +53 -0
- package/assets/api/vendor_modules/object-inspect/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/object-inspect/.nycrc +13 -0
- package/assets/api/vendor_modules/object-inspect/CHANGELOG.md +424 -0
- package/assets/api/vendor_modules/object-inspect/LICENSE +21 -0
- package/assets/api/vendor_modules/object-inspect/example/all.js +23 -0
- package/assets/api/vendor_modules/object-inspect/example/circular.js +6 -0
- package/assets/api/vendor_modules/object-inspect/example/fn.js +5 -0
- package/assets/api/vendor_modules/object-inspect/example/inspect.js +10 -0
- package/assets/api/vendor_modules/object-inspect/index.js +544 -0
- package/assets/api/vendor_modules/object-inspect/package-support.json +20 -0
- package/assets/api/vendor_modules/object-inspect/package.json +105 -0
- package/assets/api/vendor_modules/object-inspect/readme.markdown +84 -0
- package/assets/api/vendor_modules/object-inspect/test/bigint.js +58 -0
- package/assets/api/vendor_modules/object-inspect/test/browser/dom.js +15 -0
- package/assets/api/vendor_modules/object-inspect/test/circular.js +16 -0
- package/assets/api/vendor_modules/object-inspect/test/deep.js +12 -0
- package/assets/api/vendor_modules/object-inspect/test/element.js +53 -0
- package/assets/api/vendor_modules/object-inspect/test/err.js +48 -0
- package/assets/api/vendor_modules/object-inspect/test/fakes.js +29 -0
- package/assets/api/vendor_modules/object-inspect/test/fn.js +76 -0
- package/assets/api/vendor_modules/object-inspect/test/global.js +17 -0
- package/assets/api/vendor_modules/object-inspect/test/has.js +15 -0
- package/assets/api/vendor_modules/object-inspect/test/holes.js +15 -0
- package/assets/api/vendor_modules/object-inspect/test/indent-option.js +271 -0
- package/assets/api/vendor_modules/object-inspect/test/inspect.js +139 -0
- package/assets/api/vendor_modules/object-inspect/test/lowbyte.js +12 -0
- package/assets/api/vendor_modules/object-inspect/test/number.js +58 -0
- package/assets/api/vendor_modules/object-inspect/test/quoteStyle.js +26 -0
- package/assets/api/vendor_modules/object-inspect/test/toStringTag.js +40 -0
- package/assets/api/vendor_modules/object-inspect/test/undef.js +12 -0
- package/assets/api/vendor_modules/object-inspect/test/values.js +261 -0
- package/assets/api/vendor_modules/object-inspect/test-core-js.js +26 -0
- package/assets/api/vendor_modules/object-inspect/util.inspect.js +1 -0
- package/assets/api/vendor_modules/on-finished/HISTORY.md +98 -0
- package/assets/api/vendor_modules/on-finished/LICENSE +23 -0
- package/assets/api/vendor_modules/on-finished/README.md +162 -0
- package/assets/api/vendor_modules/on-finished/index.js +234 -0
- package/assets/api/vendor_modules/on-finished/package.json +39 -0
- package/assets/api/vendor_modules/parseurl/HISTORY.md +58 -0
- package/assets/api/vendor_modules/parseurl/LICENSE +24 -0
- package/assets/api/vendor_modules/parseurl/README.md +133 -0
- package/assets/api/vendor_modules/parseurl/index.js +158 -0
- package/assets/api/vendor_modules/parseurl/package.json +40 -0
- package/assets/api/vendor_modules/path-to-regexp/LICENSE +21 -0
- package/assets/api/vendor_modules/path-to-regexp/Readme.md +35 -0
- package/assets/api/vendor_modules/path-to-regexp/index.js +158 -0
- package/assets/api/vendor_modules/path-to-regexp/package.json +30 -0
- package/assets/api/vendor_modules/proxy-addr/HISTORY.md +167 -0
- package/assets/api/vendor_modules/proxy-addr/LICENSE +22 -0
- package/assets/api/vendor_modules/proxy-addr/README.md +139 -0
- package/assets/api/vendor_modules/proxy-addr/index.js +359 -0
- package/assets/api/vendor_modules/proxy-addr/package.json +51 -0
- package/assets/api/vendor_modules/qs/.editorconfig +46 -0
- package/assets/api/vendor_modules/qs/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/qs/.github/SECURITY.md +11 -0
- package/assets/api/vendor_modules/qs/.github/THREAT_MODEL.md +78 -0
- package/assets/api/vendor_modules/qs/.nycrc +13 -0
- package/assets/api/vendor_modules/qs/CHANGELOG.md +833 -0
- package/assets/api/vendor_modules/qs/LICENSE.md +29 -0
- package/assets/api/vendor_modules/qs/README.md +758 -0
- package/assets/api/vendor_modules/qs/dist/qs.js +141 -0
- package/assets/api/vendor_modules/qs/eslint.config.mjs +57 -0
- package/assets/api/vendor_modules/qs/lib/formats.js +23 -0
- package/assets/api/vendor_modules/qs/lib/index.js +11 -0
- package/assets/api/vendor_modules/qs/lib/parse.js +414 -0
- package/assets/api/vendor_modules/qs/lib/stringify.js +363 -0
- package/assets/api/vendor_modules/qs/lib/utils.js +381 -0
- package/assets/api/vendor_modules/qs/package.json +95 -0
- package/assets/api/vendor_modules/qs/test/empty-keys-cases.js +267 -0
- package/assets/api/vendor_modules/qs/test/parse.js +1933 -0
- package/assets/api/vendor_modules/qs/test/stringify.js +1448 -0
- package/assets/api/vendor_modules/qs/test/utils.js +626 -0
- package/assets/api/vendor_modules/range-parser/HISTORY.md +56 -0
- package/assets/api/vendor_modules/range-parser/LICENSE +23 -0
- package/assets/api/vendor_modules/range-parser/README.md +84 -0
- package/assets/api/vendor_modules/range-parser/index.js +162 -0
- package/assets/api/vendor_modules/range-parser/package.json +44 -0
- package/assets/api/vendor_modules/raw-body/LICENSE +22 -0
- package/assets/api/vendor_modules/raw-body/README.md +223 -0
- package/assets/api/vendor_modules/raw-body/index.d.ts +87 -0
- package/assets/api/vendor_modules/raw-body/index.js +336 -0
- package/assets/api/vendor_modules/raw-body/package.json +47 -0
- package/assets/api/vendor_modules/safe-buffer/LICENSE +21 -0
- package/assets/api/vendor_modules/safe-buffer/README.md +584 -0
- package/assets/api/vendor_modules/safe-buffer/index.d.ts +187 -0
- package/assets/api/vendor_modules/safe-buffer/index.js +65 -0
- package/assets/api/vendor_modules/safe-buffer/package.json +51 -0
- package/assets/api/vendor_modules/safer-buffer/LICENSE +21 -0
- package/assets/api/vendor_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/assets/api/vendor_modules/safer-buffer/Readme.md +156 -0
- package/assets/api/vendor_modules/safer-buffer/dangerous.js +58 -0
- package/assets/api/vendor_modules/safer-buffer/package.json +34 -0
- package/assets/api/vendor_modules/safer-buffer/safer.js +77 -0
- package/assets/api/vendor_modules/safer-buffer/tests.js +406 -0
- package/assets/api/vendor_modules/send/HISTORY.md +538 -0
- package/assets/api/vendor_modules/send/LICENSE +23 -0
- package/assets/api/vendor_modules/send/README.md +327 -0
- package/assets/api/vendor_modules/send/SECURITY.md +24 -0
- package/assets/api/vendor_modules/send/index.js +1142 -0
- package/assets/api/vendor_modules/send/node_modules/ms/index.js +162 -0
- package/assets/api/vendor_modules/send/node_modules/ms/license.md +21 -0
- package/assets/api/vendor_modules/send/node_modules/ms/package.json +38 -0
- package/assets/api/vendor_modules/send/node_modules/ms/readme.md +59 -0
- package/assets/api/vendor_modules/send/package.json +62 -0
- package/assets/api/vendor_modules/serve-static/HISTORY.md +493 -0
- package/assets/api/vendor_modules/serve-static/LICENSE +25 -0
- package/assets/api/vendor_modules/serve-static/README.md +257 -0
- package/assets/api/vendor_modules/serve-static/index.js +209 -0
- package/assets/api/vendor_modules/serve-static/package.json +42 -0
- package/assets/api/vendor_modules/serverless-http/LICENSE.txt +33 -0
- package/assets/api/vendor_modules/serverless-http/README.md +117 -0
- package/assets/api/vendor_modules/serverless-http/lib/finish.js +42 -0
- package/assets/api/vendor_modules/serverless-http/lib/framework/get-framework.js +79 -0
- package/assets/api/vendor_modules/serverless-http/lib/provider/aws/clean-up-event.js +98 -0
- package/assets/api/vendor_modules/serverless-http/lib/provider/aws/create-request.js +110 -0
- package/assets/api/vendor_modules/serverless-http/lib/provider/aws/format-response.js +45 -0
- package/assets/api/vendor_modules/serverless-http/lib/provider/aws/index.js +15 -0
- package/assets/api/vendor_modules/serverless-http/lib/provider/aws/is-binary.js +42 -0
- package/assets/api/vendor_modules/serverless-http/lib/provider/aws/sanitize-headers.js +21 -0
- package/assets/api/vendor_modules/serverless-http/lib/provider/azure/clean-up-request.js +41 -0
- package/assets/api/vendor_modules/serverless-http/lib/provider/azure/create-request.js +45 -0
- package/assets/api/vendor_modules/serverless-http/lib/provider/azure/format-response.js +18 -0
- package/assets/api/vendor_modules/serverless-http/lib/provider/azure/index.js +13 -0
- package/assets/api/vendor_modules/serverless-http/lib/provider/azure/is-binary.js +42 -0
- package/assets/api/vendor_modules/serverless-http/lib/provider/azure/sanitize-headers.js +23 -0
- package/assets/api/vendor_modules/serverless-http/lib/provider/azure/set-cookie.json +1 -0
- package/assets/api/vendor_modules/serverless-http/lib/provider/get-provider.js +17 -0
- package/assets/api/vendor_modules/serverless-http/lib/request.js +38 -0
- package/assets/api/vendor_modules/serverless-http/lib/response.js +135 -0
- package/assets/api/vendor_modules/serverless-http/package.json +93 -0
- package/assets/api/vendor_modules/serverless-http/serverless-http.d.ts +41 -0
- package/assets/api/vendor_modules/serverless-http/serverless-http.js +23 -0
- package/assets/api/vendor_modules/setprototypeof/LICENSE +13 -0
- package/assets/api/vendor_modules/setprototypeof/README.md +31 -0
- package/assets/api/vendor_modules/setprototypeof/index.d.ts +2 -0
- package/assets/api/vendor_modules/setprototypeof/index.js +17 -0
- package/assets/api/vendor_modules/setprototypeof/package.json +38 -0
- package/assets/api/vendor_modules/setprototypeof/test/index.js +24 -0
- package/assets/api/vendor_modules/side-channel/.editorconfig +9 -0
- package/assets/api/vendor_modules/side-channel/.eslintrc +12 -0
- package/assets/api/vendor_modules/side-channel/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/side-channel/.nycrc +13 -0
- package/assets/api/vendor_modules/side-channel/CHANGELOG.md +120 -0
- package/assets/api/vendor_modules/side-channel/LICENSE +21 -0
- package/assets/api/vendor_modules/side-channel/README.md +61 -0
- package/assets/api/vendor_modules/side-channel/index.d.ts +14 -0
- package/assets/api/vendor_modules/side-channel/index.js +46 -0
- package/assets/api/vendor_modules/side-channel/package.json +85 -0
- package/assets/api/vendor_modules/side-channel/test/index.js +120 -0
- package/assets/api/vendor_modules/side-channel/tsconfig.json +9 -0
- package/assets/api/vendor_modules/side-channel-list/.editorconfig +9 -0
- package/assets/api/vendor_modules/side-channel-list/.eslintrc +11 -0
- package/assets/api/vendor_modules/side-channel-list/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/side-channel-list/.nycrc +13 -0
- package/assets/api/vendor_modules/side-channel-list/CHANGELOG.md +36 -0
- package/assets/api/vendor_modules/side-channel-list/LICENSE +21 -0
- package/assets/api/vendor_modules/side-channel-list/README.md +62 -0
- package/assets/api/vendor_modules/side-channel-list/index.d.ts +13 -0
- package/assets/api/vendor_modules/side-channel-list/index.js +111 -0
- package/assets/api/vendor_modules/side-channel-list/list.d.ts +14 -0
- package/assets/api/vendor_modules/side-channel-list/package.json +77 -0
- package/assets/api/vendor_modules/side-channel-list/test/index.js +154 -0
- package/assets/api/vendor_modules/side-channel-list/tsconfig.json +9 -0
- package/assets/api/vendor_modules/side-channel-map/.editorconfig +9 -0
- package/assets/api/vendor_modules/side-channel-map/.eslintrc +11 -0
- package/assets/api/vendor_modules/side-channel-map/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/side-channel-map/.nycrc +13 -0
- package/assets/api/vendor_modules/side-channel-map/CHANGELOG.md +22 -0
- package/assets/api/vendor_modules/side-channel-map/LICENSE +21 -0
- package/assets/api/vendor_modules/side-channel-map/README.md +62 -0
- package/assets/api/vendor_modules/side-channel-map/index.d.ts +15 -0
- package/assets/api/vendor_modules/side-channel-map/index.js +68 -0
- package/assets/api/vendor_modules/side-channel-map/package.json +80 -0
- package/assets/api/vendor_modules/side-channel-map/test/index.js +114 -0
- package/assets/api/vendor_modules/side-channel-map/tsconfig.json +9 -0
- package/assets/api/vendor_modules/side-channel-weakmap/.editorconfig +9 -0
- package/assets/api/vendor_modules/side-channel-weakmap/.eslintrc +12 -0
- package/assets/api/vendor_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
- package/assets/api/vendor_modules/side-channel-weakmap/.nycrc +13 -0
- package/assets/api/vendor_modules/side-channel-weakmap/CHANGELOG.md +28 -0
- package/assets/api/vendor_modules/side-channel-weakmap/LICENSE +21 -0
- package/assets/api/vendor_modules/side-channel-weakmap/README.md +62 -0
- package/assets/api/vendor_modules/side-channel-weakmap/index.d.ts +15 -0
- package/assets/api/vendor_modules/side-channel-weakmap/index.js +84 -0
- package/assets/api/vendor_modules/side-channel-weakmap/package.json +87 -0
- package/assets/api/vendor_modules/side-channel-weakmap/test/index.js +114 -0
- package/assets/api/vendor_modules/side-channel-weakmap/tsconfig.json +9 -0
- package/assets/api/vendor_modules/statuses/HISTORY.md +87 -0
- package/assets/api/vendor_modules/statuses/LICENSE +23 -0
- package/assets/api/vendor_modules/statuses/README.md +139 -0
- package/assets/api/vendor_modules/statuses/codes.json +65 -0
- package/assets/api/vendor_modules/statuses/index.js +146 -0
- package/assets/api/vendor_modules/statuses/package.json +49 -0
- package/assets/api/vendor_modules/toidentifier/HISTORY.md +9 -0
- package/assets/api/vendor_modules/toidentifier/LICENSE +21 -0
- package/assets/api/vendor_modules/toidentifier/README.md +61 -0
- package/assets/api/vendor_modules/toidentifier/index.js +32 -0
- package/assets/api/vendor_modules/toidentifier/package.json +38 -0
- package/assets/api/vendor_modules/type-is/HISTORY.md +259 -0
- package/assets/api/vendor_modules/type-is/LICENSE +23 -0
- package/assets/api/vendor_modules/type-is/README.md +170 -0
- package/assets/api/vendor_modules/type-is/index.js +266 -0
- package/assets/api/vendor_modules/type-is/package.json +45 -0
- package/assets/api/vendor_modules/unpipe/HISTORY.md +4 -0
- package/assets/api/vendor_modules/unpipe/LICENSE +22 -0
- package/assets/api/vendor_modules/unpipe/README.md +43 -0
- package/assets/api/vendor_modules/unpipe/index.js +69 -0
- package/assets/api/vendor_modules/unpipe/package.json +27 -0
- package/assets/api/vendor_modules/utils-merge/LICENSE +20 -0
- package/assets/api/vendor_modules/utils-merge/README.md +34 -0
- package/assets/api/vendor_modules/utils-merge/index.js +23 -0
- package/assets/api/vendor_modules/utils-merge/package.json +40 -0
- package/assets/api/vendor_modules/vary/HISTORY.md +39 -0
- package/assets/api/vendor_modules/vary/LICENSE +22 -0
- package/assets/api/vendor_modules/vary/README.md +101 -0
- package/assets/api/vendor_modules/vary/index.js +149 -0
- package/assets/api/vendor_modules/vary/package.json +43 -0
- package/assets/federation-presignup/index.js +108 -0
- package/assets/firstadmin/index.js +361 -0
- package/assets/headscale-apikey/index.js +140 -0
- package/assets/invoke-relay/index.js +96 -0
- package/assets/issuer-canary/index.js +71 -0
- package/assets/issuer-publish/index.js +87 -0
- package/assets/keyminter/index.js +209 -0
- package/assets/plugin-authorizer/index.js +1740 -0
- package/assets/plugin-catalog/index.js +881 -0
- package/assets/reapproval/index.js +3761 -0
- package/assets/sg-manager/index.js +176 -0
- package/assets/tailnet-resolver/index.js +55 -0
- package/assets/web/chunk-2MOGDYK4.js +1 -0
- package/assets/web/chunk-2SO4BVIT.js +1 -0
- package/assets/web/chunk-2V6RSAAC.js +1 -0
- package/assets/web/chunk-32GNBTAL.js +1 -0
- package/assets/web/chunk-33SYY2JB.js +1 -0
- package/assets/web/chunk-3VWYT7AX.js +1 -0
- package/assets/web/chunk-4FG4DAWU.js +4 -0
- package/assets/web/chunk-4N2IUS6T.js +1 -0
- package/assets/web/chunk-4SK6XQ6C.js +1 -0
- package/assets/web/chunk-65WE5MXA.js +8 -0
- package/assets/web/chunk-6D7SSSJF.js +1 -0
- package/assets/web/chunk-6KFR7DYY.js +1 -0
- package/assets/web/chunk-A4WHI3ZG.js +8 -0
- package/assets/web/chunk-BNFKRZTP.js +1 -0
- package/assets/web/chunk-CG56PH3M.js +1 -0
- package/assets/web/chunk-CGO25AIM.js +1 -0
- package/assets/web/chunk-CP4XZPOA.js +1 -0
- package/assets/web/chunk-CV7EODPO.js +1 -0
- package/assets/web/chunk-D7TR2ORJ.js +1 -0
- package/assets/web/chunk-DCOFBAKJ.js +1 -0
- package/assets/web/chunk-DOLRLYW7.js +1 -0
- package/assets/web/chunk-EEJ3X466.js +1 -0
- package/assets/web/chunk-EQ4PF25J.js +1 -0
- package/assets/web/chunk-EVP5UVDQ.js +1 -0
- package/assets/web/chunk-EW2VMNHE.js +1 -0
- package/assets/web/chunk-FIUVIKAN.js +1 -0
- package/assets/web/chunk-GHEU25TG.js +1 -0
- package/assets/web/chunk-GK2T2SMO.js +1 -0
- package/assets/web/chunk-GKI3R2JB.js +1 -0
- package/assets/web/chunk-GPKKIOHD.js +2 -0
- package/assets/web/chunk-H4AVFUDM.js +1 -0
- package/assets/web/chunk-H5H727H6.js +1 -0
- package/assets/web/chunk-HGVFH6YM.js +1 -0
- package/assets/web/chunk-HHPIANBK.js +1 -0
- package/assets/web/chunk-HK56COCB.js +1 -0
- package/assets/web/chunk-HZUB7LFV.js +1 -0
- package/assets/web/chunk-I7NTNTBA.js +1 -0
- package/assets/web/chunk-IKK5DQ3Z.js +1 -0
- package/assets/web/chunk-IMH56UBX.js +1 -0
- package/assets/web/chunk-J3SSPCFV.js +1 -0
- package/assets/web/chunk-J4C7C5KO.js +1 -0
- package/assets/web/chunk-J57JB4MU.js +1 -0
- package/assets/web/chunk-JMBXRK3I.js +4 -0
- package/assets/web/chunk-KCCEQIXX.js +1 -0
- package/assets/web/chunk-KEBESIXR.js +1 -0
- package/assets/web/chunk-KPNHT4MK.js +1 -0
- package/assets/web/chunk-LMLXTVZG.js +1 -0
- package/assets/web/chunk-M6OAYNRE.js +1 -0
- package/assets/web/chunk-M7MGX5I4.js +1 -0
- package/assets/web/chunk-MU2VNTNY.js +1 -0
- package/assets/web/chunk-NABAVDRL.js +1 -0
- package/assets/web/chunk-NO5D6WDF.js +1 -0
- package/assets/web/chunk-O4QSFUXB.js +1 -0
- package/assets/web/chunk-OATVFQXO.js +1 -0
- package/assets/web/chunk-P5WRM37W.js +5 -0
- package/assets/web/chunk-PCP6D2SM.js +1 -0
- package/assets/web/chunk-PMMBJK7Q.js +1 -0
- package/assets/web/chunk-PSMER3HX.js +1 -0
- package/assets/web/chunk-QPBWZLCT.js +1 -0
- package/assets/web/chunk-QVABVDO5.js +1 -0
- package/assets/web/chunk-RI77LE5V.js +1 -0
- package/assets/web/chunk-RKGUEXZ2.js +1 -0
- package/assets/web/chunk-RMFH2YTZ.js +1 -0
- package/assets/web/chunk-RROPCBUH.js +1 -0
- package/assets/web/chunk-SJMLX5AT.js +1 -0
- package/assets/web/chunk-TKVALOE4.js +2 -0
- package/assets/web/chunk-TM43WUKM.js +1 -0
- package/assets/web/chunk-VKWV3ANT.js +1 -0
- package/assets/web/chunk-VTMYG6YW.js +1 -0
- package/assets/web/chunk-VWW4SA5R.js +1 -0
- package/assets/web/chunk-WEDAFMID.js +1 -0
- package/assets/web/chunk-WFIHWVQO.js +1 -0
- package/assets/web/chunk-XJM3HDJQ.js +1 -0
- package/assets/web/chunk-YVJV2RUY.js +1 -0
- package/assets/web/chunk-Z3KONI7L.js +1 -0
- package/assets/web/chunk-ZDCURXPS.js +1 -0
- package/assets/web/favicon.ico +0 -0
- package/assets/web/index.html +63 -0
- package/assets/web/main-S6E3BC5O.js +2 -0
- package/assets/web/polyfills-7RSNIJ6J.js +2 -0
- package/assets/web/styles-R6ZUWC6K.css +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +66 -0
- package/dist/lambdacode/api/services/brandingShapes.d.ts +5 -0
- package/dist/lambdacode/api/services/brandingShapes.js +15 -0
- package/dist/lambdacode/issuer/objects.d.ts +8 -0
- package/dist/lambdacode/issuer/objects.js +11 -0
- package/dist/lambdacode/network/naming.d.ts +52 -0
- package/dist/lambdacode/network/naming.js +67 -0
- package/dist/lib/access-portal-hub.d.ts +53 -0
- package/dist/lib/access-portal-hub.js +87 -0
- package/dist/lib/access-portal.d.ts +32 -0
- package/dist/lib/access-portal.js +174 -0
- package/dist/lib/audit-log.d.ts +18 -0
- package/dist/lib/audit-log.js +25 -0
- package/dist/lib/connector-stack.d.ts +28 -0
- package/dist/lib/connector-stack.js +81 -0
- package/dist/lib/constructs/app-function.d.ts +14 -0
- package/dist/lib/constructs/app-function.js +84 -0
- package/dist/lib/constructs/app-table.d.ts +12 -0
- package/dist/lib/constructs/app-table.js +58 -0
- package/dist/lib/constructs/mirrored-image.d.ts +12 -0
- package/dist/lib/constructs/mirrored-image.js +80 -0
- package/dist/lib/constructs/monitoring.d.ts +21 -0
- package/dist/lib/constructs/monitoring.js +133 -0
- package/dist/lib/constructs/oidc-issuer.d.ts +44 -0
- package/dist/lib/constructs/oidc-issuer.js +234 -0
- package/dist/lib/constructs/scratch-tmpfs.d.ts +5 -0
- package/dist/lib/constructs/scratch-tmpfs.js +48 -0
- package/dist/lib/constructs/sg-manager.d.ts +27 -0
- package/dist/lib/constructs/sg-manager.js +88 -0
- package/dist/lib/constructs/tailnet-connector.d.ts +29 -0
- package/dist/lib/constructs/tailnet-connector.js +177 -0
- package/dist/lib/constructs/tailnet-resolver.d.ts +30 -0
- package/dist/lib/constructs/tailnet-resolver.js +71 -0
- package/dist/lib/constructs/target-account-trust.d.ts +32 -0
- package/dist/lib/constructs/target-account-trust.js +81 -0
- package/dist/lib/constructs/vending-api.d.ts +103 -0
- package/dist/lib/constructs/vending-api.js +203 -0
- package/dist/lib/constructs/web-acl.d.ts +61 -0
- package/dist/lib/constructs/web-acl.js +213 -0
- package/dist/lib/constructs/web-identity.d.ts +49 -0
- package/dist/lib/constructs/web-identity.js +116 -0
- package/dist/lib/creds-stack.d.ts +151 -0
- package/dist/lib/creds-stack.js +592 -0
- package/dist/lib/data-stack.d.ts +53 -0
- package/dist/lib/data-stack.js +282 -0
- package/dist/lib/dimensions-validation.d.ts +20 -0
- package/dist/lib/dimensions-validation.js +51 -0
- package/dist/lib/federation.d.ts +113 -0
- package/dist/lib/federation.js +254 -0
- package/dist/lib/managed-login-branding.json +450 -0
- package/dist/lib/network-stack.d.ts +58 -0
- package/dist/lib/network-stack.js +776 -0
- package/dist/lib/network-validation.d.ts +54 -0
- package/dist/lib/network-validation.js +220 -0
- package/dist/lib/pkg-paths.d.ts +3 -0
- package/dist/lib/pkg-paths.js +51 -0
- package/dist/lib/plugins/plugin-api.d.ts +40 -0
- package/dist/lib/plugins/plugin-api.js +125 -0
- package/dist/lib/plugins/plugin-catalog-activation.d.ts +31 -0
- package/dist/lib/plugins/plugin-catalog-activation.js +109 -0
- package/dist/lib/plugins/registration.d.ts +41 -0
- package/dist/lib/plugins/registration.js +121 -0
- package/dist/lib/plugins/runtime.d.ts +10 -0
- package/dist/lib/plugins/runtime.js +17 -0
- package/dist/lib/project-config.d.ts +164 -0
- package/dist/lib/project-config.js +2 -0
- package/dist/lib/target-account-stack.d.ts +15 -0
- package/dist/lib/target-account-stack.js +59 -0
- package/dist/lib/target-account-template.d.ts +13 -0
- package/dist/lib/target-account-template.js +64 -0
- package/dist/lib/web-cert-stack.d.ts +30 -0
- package/dist/lib/web-cert-stack.js +90 -0
- package/dist/lib/web-stack.d.ts +103 -0
- package/dist/lib/web-stack.js +540 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/README.md +303 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/backend/context.d.ts +31 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/backend/context.js +58 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/backend/index.d.ts +9 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/backend/index.js +26 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/client.d.ts +59 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/client.js +290 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/errors.d.ts +14 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/errors.js +32 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/http.d.ts +72 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/http.js +170 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/index.d.ts +11 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/index.js +28 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/theme-apply.d.ts +22 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/browser/theme-apply.js +22 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/access.d.ts +14 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/access.js +41 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/authorizer.d.ts +17 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/authorizer.js +44 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/canonical.d.ts +2 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/canonical.js +21 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/catalog.d.ts +39 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/catalog.js +18 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/discovery.d.ts +78 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/discovery.js +48 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/fields.d.ts +7 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/fields.js +2 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/manifest.d.ts +59 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/manifest.js +19 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/messages.d.ts +111 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/messages.js +109 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/paths.d.ts +20 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/paths.js +49 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/theme.d.ts +21 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/theme.js +60 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/transport.d.ts +14 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/transport.js +10 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/validate.d.ts +27 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/contracts/validate.js +321 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/devHost.d.ts +61 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/devHost.js +99 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/fakeDocument.d.ts +12 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/fakeDocument.js +22 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/fakeWindows.d.ts +22 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/fakeWindows.js +46 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/index.d.ts +4 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/index.js +20 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/samples.d.ts +37 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/fixtures/samples.js +228 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/host/host.d.ts +47 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/host/host.js +121 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/host/index.d.ts +5 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/host/index.js +22 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/index.d.ts +10 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/dist/index.js +28 -0
- package/node_modules/@fntio/infra-client-plugin-sdk/package.json +99 -0
- package/openapi.yaml +4284 -0
- package/package.json +124 -4
|
@@ -0,0 +1,1740 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// lambdacode/plugins/authorizer.ts
|
|
21
|
+
var authorizer_exports = {};
|
|
22
|
+
__export(authorizer_exports, {
|
|
23
|
+
handler: () => handler
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(authorizer_exports);
|
|
26
|
+
|
|
27
|
+
// ../infra-client-plugin-sdk/src/contracts/manifest.ts
|
|
28
|
+
var PLUGIN_PERMISSIONS = ["user", "admin"];
|
|
29
|
+
var PLUGIN_MANIFEST_SCHEMA_VERSION = 1;
|
|
30
|
+
var PLUGIN_HOST_API_VERSION = 1;
|
|
31
|
+
var PLUGIN_ACCOUNT_PARAM = "accountNumber";
|
|
32
|
+
var PLUGIN_ID_PATTERN = /^[a-z][a-z0-9-]{0,63}$/;
|
|
33
|
+
var AWS_ACCOUNT_PATTERN = /^\d{12}$/;
|
|
34
|
+
|
|
35
|
+
// ../infra-client-plugin-sdk/src/contracts/paths.ts
|
|
36
|
+
var PLUGIN_API_ROOT = "/api/plugins";
|
|
37
|
+
function pluginApiBaseUrl(pluginId) {
|
|
38
|
+
return `${PLUGIN_API_ROOT}/${pluginId}`;
|
|
39
|
+
}
|
|
40
|
+
function pluginAccountRoot(pluginId) {
|
|
41
|
+
return `${pluginApiBaseUrl(pluginId)}/accounts/{${PLUGIN_ACCOUNT_PARAM}}`;
|
|
42
|
+
}
|
|
43
|
+
function parsePluginResourcePath(resource) {
|
|
44
|
+
const prefix = `${PLUGIN_API_ROOT}/`;
|
|
45
|
+
if (!resource.startsWith(prefix)) return null;
|
|
46
|
+
const pluginId = resource.slice(prefix.length).split("/")[0];
|
|
47
|
+
if (!PLUGIN_ID_PATTERN.test(pluginId)) return null;
|
|
48
|
+
const root = pluginAccountRoot(pluginId);
|
|
49
|
+
if (resource === root) return { pluginId, routePath: "/" };
|
|
50
|
+
return resource.startsWith(`${root}/`) ? { pluginId, routePath: resource.slice(root.length) } : null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ../infra-client-plugin-sdk/src/contracts/access.ts
|
|
54
|
+
var PLUGIN_TARGET_PREFIX = "plugin#";
|
|
55
|
+
function pluginTargetKey(target) {
|
|
56
|
+
return `${PLUGIN_TARGET_PREFIX}${target.pluginId}#${target.accountNumber}#${target.permission}`;
|
|
57
|
+
}
|
|
58
|
+
function parsePluginTargetKey(key) {
|
|
59
|
+
if (!key.startsWith(PLUGIN_TARGET_PREFIX)) return null;
|
|
60
|
+
const parts = key.slice(PLUGIN_TARGET_PREFIX.length).split("#");
|
|
61
|
+
if (parts.length !== 3) return null;
|
|
62
|
+
const [pluginId, accountNumber, permission] = parts;
|
|
63
|
+
if (!PLUGIN_ID_PATTERN.test(pluginId) || !AWS_ACCOUNT_PATTERN.test(accountNumber)) return null;
|
|
64
|
+
if (!PLUGIN_PERMISSIONS.includes(permission)) return null;
|
|
65
|
+
return { pluginId, accountNumber, permission };
|
|
66
|
+
}
|
|
67
|
+
function pluginPermissionsImpliedBy(granted, declared) {
|
|
68
|
+
if (!declared.includes(granted)) return [];
|
|
69
|
+
if (granted === "admin" && declared.includes("user")) return ["admin", "user"];
|
|
70
|
+
return [granted];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// ../infra-client-plugin-sdk/src/contracts/catalog.ts
|
|
74
|
+
function pluginCatalogStatus(record) {
|
|
75
|
+
if (!record.installed) return "removed";
|
|
76
|
+
if (record.schemaVersion !== PLUGIN_MANIFEST_SCHEMA_VERSION || record.manifest.hostApiVersion !== PLUGIN_HOST_API_VERSION) {
|
|
77
|
+
return "unsupported";
|
|
78
|
+
}
|
|
79
|
+
return record.manifest.enabled ? "active" : "disabled";
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// lambdacode/api/services/access.ts
|
|
83
|
+
var import_client_dynamodb = require("@aws-sdk/client-dynamodb");
|
|
84
|
+
var import_lib_dynamodb = require("@aws-sdk/lib-dynamodb");
|
|
85
|
+
var ddb = import_lib_dynamodb.DynamoDBDocumentClient.from(new import_client_dynamodb.DynamoDBClient({}));
|
|
86
|
+
var ACCESS_TABLE_NAME = process.env.ACCESS_TABLE_NAME;
|
|
87
|
+
var userPrincipal = (sub) => `user#${sub}`;
|
|
88
|
+
var groupPrincipal = (groupId) => `group#${groupId}`;
|
|
89
|
+
var pluginTarget = (pluginId, accountNumber, permission) => pluginTargetKey({ pluginId, accountNumber, permission });
|
|
90
|
+
function parsePrincipal(p) {
|
|
91
|
+
if (p.startsWith("user#")) return { kind: "user", userId: p.slice(5) };
|
|
92
|
+
if (p.startsWith("group#")) return { kind: "group", groupId: p.slice(6) };
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
function parseTarget(t) {
|
|
96
|
+
if (t.startsWith("role#")) {
|
|
97
|
+
const rest = t.slice(5);
|
|
98
|
+
const hash = rest.indexOf("#");
|
|
99
|
+
if (hash < 0) return null;
|
|
100
|
+
return { kind: "role", accountNumber: rest.slice(0, hash), roleName: rest.slice(hash + 1) };
|
|
101
|
+
}
|
|
102
|
+
if (t.startsWith("resource#")) return { kind: "resource", resourceId: t.slice(9) };
|
|
103
|
+
if (t.startsWith("share#")) return { kind: "share", shareId: t.slice(6) };
|
|
104
|
+
if (t.startsWith("plugin#")) {
|
|
105
|
+
const p = parsePluginTargetKey(t);
|
|
106
|
+
return p ? { kind: "plugin", ...p } : null;
|
|
107
|
+
}
|
|
108
|
+
if (t.startsWith("member#")) return { kind: "member", groupId: t.slice(7) };
|
|
109
|
+
if (t.startsWith("pref#role#")) {
|
|
110
|
+
const rest = t.slice(10);
|
|
111
|
+
const hash = rest.indexOf("#");
|
|
112
|
+
if (hash < 0) return null;
|
|
113
|
+
return { kind: "pref", accountNumber: rest.slice(0, hash), roleName: rest.slice(hash + 1) };
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
var consistentRead = (opts) => opts.consistent ? { ConsistentRead: true } : {};
|
|
118
|
+
function isExpired(row, now = Date.now()) {
|
|
119
|
+
return Boolean(row.expiresAt) && !(Date.parse(row.expiresAt) > now);
|
|
120
|
+
}
|
|
121
|
+
async function queryPrincipal(principal, targetPrefix, opts = {}) {
|
|
122
|
+
const rows = [];
|
|
123
|
+
let ExclusiveStartKey;
|
|
124
|
+
do {
|
|
125
|
+
const page = await ddb.send(
|
|
126
|
+
new import_lib_dynamodb.QueryCommand({
|
|
127
|
+
TableName: ACCESS_TABLE_NAME,
|
|
128
|
+
KeyConditionExpression: targetPrefix ? "principal = :p AND begins_with(#t, :pre)" : "principal = :p",
|
|
129
|
+
ExpressionAttributeValues: {
|
|
130
|
+
":p": principal,
|
|
131
|
+
...targetPrefix ? { ":pre": targetPrefix } : {}
|
|
132
|
+
},
|
|
133
|
+
...targetPrefix ? { ExpressionAttributeNames: { "#t": "target" } } : {},
|
|
134
|
+
...consistentRead(opts),
|
|
135
|
+
ExclusiveStartKey
|
|
136
|
+
})
|
|
137
|
+
);
|
|
138
|
+
rows.push(...page?.Items ?? []);
|
|
139
|
+
ExclusiveStartKey = page?.LastEvaluatedKey;
|
|
140
|
+
} while (ExclusiveStartKey);
|
|
141
|
+
return rows;
|
|
142
|
+
}
|
|
143
|
+
function entryOf(target, direct, groups, now) {
|
|
144
|
+
const d = direct ? { grantedBy: direct.grantedBy, grantedAt: direct.grantedAt, expiresAt: direct.expiresAt } : void 0;
|
|
145
|
+
const directActive = Boolean(direct && !isExpired(direct, now));
|
|
146
|
+
const active = directActive || groups.length > 0;
|
|
147
|
+
return {
|
|
148
|
+
target,
|
|
149
|
+
direct: d,
|
|
150
|
+
groups,
|
|
151
|
+
active,
|
|
152
|
+
expiresAt: groups.length === 0 && directActive ? direct?.expiresAt : void 0
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
var BATCH_GET_ATTEMPTS = 5;
|
|
156
|
+
var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
157
|
+
async function batchGetAll(table, keys, opts = {}) {
|
|
158
|
+
const out = [];
|
|
159
|
+
for (let i = 0; i < keys.length; i += 100) {
|
|
160
|
+
let chunk = keys.slice(i, i + 100);
|
|
161
|
+
for (let attempt = 0; chunk.length; attempt++) {
|
|
162
|
+
if (attempt >= BATCH_GET_ATTEMPTS) {
|
|
163
|
+
throw new Error(`${table} BatchGet left ${chunk.length} keys unprocessed after ${attempt} attempts`);
|
|
164
|
+
}
|
|
165
|
+
if (attempt) await sleep(20 * attempt);
|
|
166
|
+
const res = await ddb.send(
|
|
167
|
+
new import_lib_dynamodb.BatchGetCommand({ RequestItems: { [table]: { Keys: chunk, ...consistentRead(opts) } } })
|
|
168
|
+
);
|
|
169
|
+
out.push(...res?.Responses?.[table] ?? []);
|
|
170
|
+
chunk = res?.UnprocessedKeys?.[table]?.Keys ?? [];
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return out;
|
|
174
|
+
}
|
|
175
|
+
async function effectiveForMany(userId, targets, opts = {}) {
|
|
176
|
+
const out = /* @__PURE__ */ new Map();
|
|
177
|
+
const wanted = [...new Set(targets)];
|
|
178
|
+
if (!wanted.length) return out;
|
|
179
|
+
const [ownWanted, memberships] = await Promise.all([
|
|
180
|
+
batchGetAll(ACCESS_TABLE_NAME, wanted.map((target) => ({ principal: userPrincipal(userId), target })), opts),
|
|
181
|
+
queryPrincipal(userPrincipal(userId), "member#", opts)
|
|
182
|
+
]);
|
|
183
|
+
const direct = new Map(ownWanted.map((r) => [r.target, r]));
|
|
184
|
+
const groupIds = memberships.map((r) => r.target.slice("member#".length));
|
|
185
|
+
const holding = /* @__PURE__ */ new Map();
|
|
186
|
+
const keys = groupIds.flatMap((g) => wanted.map((target) => ({ principal: groupPrincipal(g), target })));
|
|
187
|
+
for (const it of await batchGetAll(ACCESS_TABLE_NAME, keys, opts)) {
|
|
188
|
+
const row = it;
|
|
189
|
+
const p = parsePrincipal(row.principal);
|
|
190
|
+
if (p?.kind !== "group" || isExpired(row)) continue;
|
|
191
|
+
const list = holding.get(row.target) ?? [];
|
|
192
|
+
list.push(p.groupId);
|
|
193
|
+
holding.set(row.target, list);
|
|
194
|
+
}
|
|
195
|
+
const now = Date.now();
|
|
196
|
+
for (const t of wanted) {
|
|
197
|
+
const d = direct.get(t);
|
|
198
|
+
const g = holding.get(t) ?? [];
|
|
199
|
+
if (!d && !g.length) continue;
|
|
200
|
+
out.set(t, entryOf(t, d, g, now));
|
|
201
|
+
}
|
|
202
|
+
return out;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// lambdacode/api/services/auditService.ts
|
|
206
|
+
var import_crypto = require("crypto");
|
|
207
|
+
var import_client_dynamodb2 = require("@aws-sdk/client-dynamodb");
|
|
208
|
+
var import_lib_dynamodb2 = require("@aws-sdk/lib-dynamodb");
|
|
209
|
+
|
|
210
|
+
// lambdacode/api/services/actorContext.ts
|
|
211
|
+
var import_async_hooks = require("async_hooks");
|
|
212
|
+
var store = new import_async_hooks.AsyncLocalStorage();
|
|
213
|
+
function currentActor() {
|
|
214
|
+
return store.getStore();
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// lambdacode/api/services/auditService.ts
|
|
218
|
+
var ddb2 = import_lib_dynamodb2.DynamoDBDocumentClient.from(new import_client_dynamodb2.DynamoDBClient({}));
|
|
219
|
+
var tableName = () => process.env.AUDIT_TABLE_NAME ?? "";
|
|
220
|
+
var log = (msg, extra = {}) => console.log(JSON.stringify({ msg, ...extra }));
|
|
221
|
+
var DEFAULT_RETENTION_DAYS = 400;
|
|
222
|
+
var REASON_MAX = 300;
|
|
223
|
+
var NOTE_MAX = 500;
|
|
224
|
+
var AFFECTED_CAP = 50;
|
|
225
|
+
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
226
|
+
function retentionDays() {
|
|
227
|
+
const n = Number(process.env.AUDIT_RETENTION_DAYS);
|
|
228
|
+
return Number.isInteger(n) && n > 0 ? n : DEFAULT_RETENTION_DAYS;
|
|
229
|
+
}
|
|
230
|
+
var UNKNOWN_ACTOR = { kind: "system", id: "system:unknown" };
|
|
231
|
+
var warnedNoTable = false;
|
|
232
|
+
function tableOr() {
|
|
233
|
+
const table = tableName();
|
|
234
|
+
if (table) return table;
|
|
235
|
+
if (!warnedNoTable) {
|
|
236
|
+
warnedNoTable = true;
|
|
237
|
+
log("WARN: AUDIT_TABLE_NAME unset \u2014 activity is not recorded");
|
|
238
|
+
}
|
|
239
|
+
return void 0;
|
|
240
|
+
}
|
|
241
|
+
function compact(value) {
|
|
242
|
+
if (Array.isArray(value)) return value.map(compact);
|
|
243
|
+
if (value && typeof value === "object" && !(value instanceof Set)) {
|
|
244
|
+
const out = {};
|
|
245
|
+
for (const [k, v] of Object.entries(value)) {
|
|
246
|
+
if (v !== void 0) out[k] = compact(v);
|
|
247
|
+
}
|
|
248
|
+
return out;
|
|
249
|
+
}
|
|
250
|
+
return value;
|
|
251
|
+
}
|
|
252
|
+
var SESSION_ACTIONS = /* @__PURE__ */ new Set(["vpn.connect", "vpn.disconnect"]);
|
|
253
|
+
function toRow(input, now) {
|
|
254
|
+
const bound = input.actor ?? currentActor();
|
|
255
|
+
if (!bound) log("ERROR: activity row without a bound actor (missing runAsActor?)", { action: input.action, target: input.target });
|
|
256
|
+
const actor = bound ?? UNKNOWN_ACTOR;
|
|
257
|
+
const details = input.details ? { ...input.details } : void 0;
|
|
258
|
+
if (details?.note !== void 0) details.note = String(details.note).slice(0, NOTE_MAX);
|
|
259
|
+
if (details?.affected && details.affected.length > AFFECTED_CAP) {
|
|
260
|
+
details.affectedCount = details.affected.length;
|
|
261
|
+
details.affected = details.affected.slice(0, AFFECTED_CAP);
|
|
262
|
+
}
|
|
263
|
+
if (details?.unchanged && details.unchanged.length > AFFECTED_CAP) {
|
|
264
|
+
details.unchangedCount = details.unchanged.length;
|
|
265
|
+
details.unchanged = details.unchanged.slice(0, AFFECTED_CAP);
|
|
266
|
+
}
|
|
267
|
+
const accountNumber = input.accountNumber ?? accountOf(input.target);
|
|
268
|
+
return compact({
|
|
269
|
+
...input,
|
|
270
|
+
eventId: (0, import_crypto.randomUUID)(),
|
|
271
|
+
outcome: input.outcome ?? "OK",
|
|
272
|
+
reason: input.reason === void 0 ? void 0 : String(input.reason).slice(0, REASON_MAX),
|
|
273
|
+
actor: { kind: actor.kind, id: actor.id, name: actor.name, claims: actor.claims && Object.keys(actor.claims).length ? actor.claims : void 0 },
|
|
274
|
+
accountNumber,
|
|
275
|
+
details,
|
|
276
|
+
at: now.toISOString(),
|
|
277
|
+
day: now.toISOString().slice(0, 10),
|
|
278
|
+
userId: input.subject?.id,
|
|
279
|
+
actorId: SESSION_ACTIONS.has(input.action) && input.subject?.kind === "user" ? input.subject.id : actor.id,
|
|
280
|
+
expiresAt: Math.floor(now.getTime() / 1e3) + retentionDays() * 24 * 60 * 60
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
function accountOf(target) {
|
|
284
|
+
if (!target) return void 0;
|
|
285
|
+
const p = parseTarget(target);
|
|
286
|
+
if (p?.kind === "role" || p?.kind === "plugin") return p.accountNumber;
|
|
287
|
+
if (target.startsWith("account#")) return target.slice("account#".length);
|
|
288
|
+
return void 0;
|
|
289
|
+
}
|
|
290
|
+
async function recordEvent(input) {
|
|
291
|
+
const table = tableOr();
|
|
292
|
+
if (!table) return;
|
|
293
|
+
const row = toRow(input, /* @__PURE__ */ new Date());
|
|
294
|
+
try {
|
|
295
|
+
await ddb2.send(new import_lib_dynamodb2.PutCommand({ TableName: table, Item: row }));
|
|
296
|
+
log("activity recorded", { action: row.action, outcome: row.outcome, actor: row.actorId, subject: row.userId, target: row.target, eventId: row.eventId });
|
|
297
|
+
} catch (err) {
|
|
298
|
+
log("ERROR: activity write failed (mutation unaffected)", { action: row.action, target: row.target, error: err.message });
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// lambdacode/api/services/pluginCatalog.ts
|
|
303
|
+
var import_client_dynamodb3 = require("@aws-sdk/client-dynamodb");
|
|
304
|
+
var import_lib_dynamodb3 = require("@aws-sdk/lib-dynamodb");
|
|
305
|
+
var ddb3 = import_lib_dynamodb3.DynamoDBDocumentClient.from(new import_client_dynamodb3.DynamoDBClient({}));
|
|
306
|
+
var emptyPluginCatalog = {
|
|
307
|
+
async list() {
|
|
308
|
+
return [];
|
|
309
|
+
},
|
|
310
|
+
async get() {
|
|
311
|
+
return void 0;
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
var log2 = (msg, extra = {}) => console.log(JSON.stringify({ msg, ...extra }));
|
|
315
|
+
function isPluginCatalogRecord(item) {
|
|
316
|
+
if (!item || typeof item !== "object") return false;
|
|
317
|
+
const r = item;
|
|
318
|
+
const m = r.manifest;
|
|
319
|
+
return typeof r.pluginId === "string" && typeof r.schemaVersion === "number" && typeof r.installed === "boolean" && typeof r.revision === "string" && !!m && typeof m === "object" && m.id === r.pluginId && typeof m.enabled === "boolean" && typeof m.hostApiVersion === "number" && Array.isArray(m.accounts) && Array.isArray(m.permissions) && Array.isArray(r.routes);
|
|
320
|
+
}
|
|
321
|
+
function dynamoPluginCatalog(tableName2) {
|
|
322
|
+
const accept = (item) => {
|
|
323
|
+
if (isPluginCatalogRecord(item)) return item;
|
|
324
|
+
log2("WARN: malformed plugin catalog record skipped", {
|
|
325
|
+
pluginId: item?.pluginId
|
|
326
|
+
});
|
|
327
|
+
return void 0;
|
|
328
|
+
};
|
|
329
|
+
return {
|
|
330
|
+
async list(opts = {}) {
|
|
331
|
+
const out = [];
|
|
332
|
+
let ExclusiveStartKey;
|
|
333
|
+
do {
|
|
334
|
+
const page = await ddb3.send(
|
|
335
|
+
new import_lib_dynamodb3.ScanCommand({ TableName: tableName2, ExclusiveStartKey, ...opts.consistent ? { ConsistentRead: true } : {} })
|
|
336
|
+
);
|
|
337
|
+
for (const item of page?.Items ?? []) {
|
|
338
|
+
const r = accept(item);
|
|
339
|
+
if (r) out.push(r);
|
|
340
|
+
}
|
|
341
|
+
ExclusiveStartKey = page?.LastEvaluatedKey;
|
|
342
|
+
} while (ExclusiveStartKey);
|
|
343
|
+
return out;
|
|
344
|
+
},
|
|
345
|
+
async get(pluginId, opts = {}) {
|
|
346
|
+
const res = await ddb3.send(
|
|
347
|
+
new import_lib_dynamodb3.GetCommand({
|
|
348
|
+
TableName: tableName2,
|
|
349
|
+
Key: { pluginId },
|
|
350
|
+
...opts.consistent ? { ConsistentRead: true } : {}
|
|
351
|
+
})
|
|
352
|
+
);
|
|
353
|
+
return res.Item ? accept(res.Item) : void 0;
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
function pluginCatalog() {
|
|
358
|
+
const table = process.env.PLUGIN_CATALOG_TABLE_NAME;
|
|
359
|
+
return table ? dynamoPluginCatalog(table) : emptyPluginCatalog;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// lambdacode/api/services/pluginAccess.ts
|
|
363
|
+
function pluginAvailability(record, accountNumber, permission, registeredAccounts2) {
|
|
364
|
+
if (!record) return { available: false, reason: "plugin-unknown" };
|
|
365
|
+
const status = pluginCatalogStatus(record);
|
|
366
|
+
if (status !== "active") return { available: false, reason: `plugin-${status}` };
|
|
367
|
+
if (!record.manifest.permissions.some((p) => p.id === permission)) {
|
|
368
|
+
return { available: false, reason: "permission-undeclared" };
|
|
369
|
+
}
|
|
370
|
+
if (!record.manifest.accounts.some((a) => a.accountNumber === accountNumber)) {
|
|
371
|
+
return { available: false, reason: "account-unbound" };
|
|
372
|
+
}
|
|
373
|
+
if (!registeredAccounts2.has(accountNumber)) return { available: false, reason: "account-unregistered" };
|
|
374
|
+
return { available: true };
|
|
375
|
+
}
|
|
376
|
+
function withAccounts(catalog, accounts) {
|
|
377
|
+
const accountNames = /* @__PURE__ */ new Map();
|
|
378
|
+
for (const [n, meta] of accounts) if (meta.name) accountNames.set(n, meta.name);
|
|
379
|
+
return { catalog, registeredAccounts: new Set(accounts.keys()), accountNames };
|
|
380
|
+
}
|
|
381
|
+
function deriveCapabilities(pluginId, accountNumber, held, ctx) {
|
|
382
|
+
const record = ctx.catalog.get(pluginId);
|
|
383
|
+
const declared = record?.manifest.permissions.map((p) => p.id) ?? [];
|
|
384
|
+
const out = [];
|
|
385
|
+
for (const permission of PLUGIN_PERMISSIONS) {
|
|
386
|
+
const sources = [...held.values()].filter(
|
|
387
|
+
(s) => s.permission === permission || pluginPermissionsImpliedBy(s.permission, declared).includes(permission)
|
|
388
|
+
);
|
|
389
|
+
if (!sources.length) continue;
|
|
390
|
+
const a = pluginAvailability(record, accountNumber, permission, ctx.registeredAccounts);
|
|
391
|
+
out.push({ pluginId, accountNumber, permission, sources, ...a.available ? { available: true } : a });
|
|
392
|
+
}
|
|
393
|
+
return out;
|
|
394
|
+
}
|
|
395
|
+
var sourceOf = (permission, direct, groups) => ({
|
|
396
|
+
permission,
|
|
397
|
+
...direct && !isExpired(direct) ? { direct } : {},
|
|
398
|
+
groups
|
|
399
|
+
});
|
|
400
|
+
var byBindingThenPermission = (a, b) => a.pluginId.localeCompare(b.pluginId) || a.accountNumber.localeCompare(b.accountNumber) || PLUGIN_PERMISSIONS.indexOf(a.permission) - PLUGIN_PERMISSIONS.indexOf(b.permission);
|
|
401
|
+
function resolvePluginCapabilities(entries, ctx) {
|
|
402
|
+
const byBinding = /* @__PURE__ */ new Map();
|
|
403
|
+
for (const e of entries) {
|
|
404
|
+
if (!e.active) continue;
|
|
405
|
+
const p = parseTarget(e.target);
|
|
406
|
+
if (p?.kind !== "plugin") continue;
|
|
407
|
+
const key = `${p.pluginId}#${p.accountNumber}`;
|
|
408
|
+
const b = byBinding.get(key) ?? { pluginId: p.pluginId, accountNumber: p.accountNumber, held: /* @__PURE__ */ new Map() };
|
|
409
|
+
b.held.set(p.permission, sourceOf(p.permission, e.direct, e.groups));
|
|
410
|
+
byBinding.set(key, b);
|
|
411
|
+
}
|
|
412
|
+
const out = [];
|
|
413
|
+
for (const b of byBinding.values()) out.push(...deriveCapabilities(b.pluginId, b.accountNumber, b.held, ctx));
|
|
414
|
+
return out.sort(byBindingThenPermission);
|
|
415
|
+
}
|
|
416
|
+
async function checkPluginPermission(userId, pluginId, accountNumber, required, opts = {}) {
|
|
417
|
+
const read = { consistent: opts.consistent ?? true };
|
|
418
|
+
const [record, accounts] = await Promise.all([
|
|
419
|
+
opts.record ?? (opts.catalog ?? pluginCatalog()).get(pluginId, read),
|
|
420
|
+
registeredAccounts([accountNumber], read)
|
|
421
|
+
]);
|
|
422
|
+
const ctx = withAccounts(new Map(record ? [[pluginId, record]] : []), accounts);
|
|
423
|
+
const availability = pluginAvailability(record, accountNumber, required, ctx.registeredAccounts);
|
|
424
|
+
if (!availability.available) return { allowed: false, reason: availability.reason, record };
|
|
425
|
+
const targets = PLUGIN_PERMISSIONS.map((p) => pluginTarget(pluginId, accountNumber, p));
|
|
426
|
+
const held = await effectiveForMany(userId, targets, read);
|
|
427
|
+
const allowed = resolvePluginCapabilities(held.values(), ctx).some((c) => c.permission === required && c.available);
|
|
428
|
+
return { allowed, reason: allowed ? "allowed" : "no-grant", record };
|
|
429
|
+
}
|
|
430
|
+
async function registeredAccounts(numbers, opts = {}) {
|
|
431
|
+
const out = /* @__PURE__ */ new Map();
|
|
432
|
+
const ids = [...new Set(numbers)];
|
|
433
|
+
if (!ids.length) return out;
|
|
434
|
+
const table = process.env.ACCOUNTS_TABLE_NAME;
|
|
435
|
+
if (!table) throw new Error("ACCOUNTS_TABLE_NAME is not set (plugin catalog readers need the Accounts table)");
|
|
436
|
+
for (const item of await batchGetAll(table, ids.map((accountNumber) => ({ accountNumber })), opts)) {
|
|
437
|
+
out.set(item.accountNumber, { name: item.name || void 0 });
|
|
438
|
+
}
|
|
439
|
+
return out;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/error.js
|
|
443
|
+
var JwtBaseError = class extends Error {
|
|
444
|
+
};
|
|
445
|
+
var FailedAssertionError = class extends JwtBaseError {
|
|
446
|
+
constructor(msg, actual, expected) {
|
|
447
|
+
super(msg);
|
|
448
|
+
this.failedAssertion = {
|
|
449
|
+
actual,
|
|
450
|
+
expected
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
var JwtParseError = class extends JwtBaseError {
|
|
455
|
+
constructor(msg, error) {
|
|
456
|
+
const message2 = error != null ? `${msg}: ${error}` : msg;
|
|
457
|
+
super(message2);
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
var ParameterValidationError = class extends JwtBaseError {
|
|
461
|
+
};
|
|
462
|
+
var JwtInvalidSignatureError = class extends JwtBaseError {
|
|
463
|
+
};
|
|
464
|
+
var JwtInvalidSignatureAlgorithmError = class extends FailedAssertionError {
|
|
465
|
+
};
|
|
466
|
+
var JwtInvalidClaimError = class extends FailedAssertionError {
|
|
467
|
+
withRawJwt({ header, payload }) {
|
|
468
|
+
this.rawJwt = {
|
|
469
|
+
header,
|
|
470
|
+
payload
|
|
471
|
+
};
|
|
472
|
+
return this;
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
var JwtInvalidIssuerError = class extends JwtInvalidClaimError {
|
|
476
|
+
};
|
|
477
|
+
var JwtInvalidAudienceError = class extends JwtInvalidClaimError {
|
|
478
|
+
};
|
|
479
|
+
var JwtInvalidScopeError = class extends JwtInvalidClaimError {
|
|
480
|
+
};
|
|
481
|
+
var JwtExpiredError = class extends JwtInvalidClaimError {
|
|
482
|
+
};
|
|
483
|
+
var JwtNotBeforeError = class extends JwtInvalidClaimError {
|
|
484
|
+
};
|
|
485
|
+
var CognitoJwtInvalidGroupError = class extends JwtInvalidClaimError {
|
|
486
|
+
};
|
|
487
|
+
var CognitoJwtInvalidTokenUseError = class extends JwtInvalidClaimError {
|
|
488
|
+
};
|
|
489
|
+
var CognitoJwtInvalidClientIdError = class extends JwtInvalidClaimError {
|
|
490
|
+
};
|
|
491
|
+
var JwksValidationError = class extends JwtBaseError {
|
|
492
|
+
};
|
|
493
|
+
var JwkValidationError = class extends JwtBaseError {
|
|
494
|
+
};
|
|
495
|
+
var JwtWithoutValidKidError = class extends JwtBaseError {
|
|
496
|
+
};
|
|
497
|
+
var KidNotFoundInJwksError = class extends JwtBaseError {
|
|
498
|
+
};
|
|
499
|
+
var WaitPeriodNotYetEndedJwkError = class extends JwtBaseError {
|
|
500
|
+
};
|
|
501
|
+
var JwksNotAvailableInCacheError = class extends JwtBaseError {
|
|
502
|
+
};
|
|
503
|
+
var JwkInvalidUseError = class extends FailedAssertionError {
|
|
504
|
+
};
|
|
505
|
+
var JwkInvalidKtyError = class extends FailedAssertionError {
|
|
506
|
+
};
|
|
507
|
+
var FetchError = class extends JwtBaseError {
|
|
508
|
+
constructor(uri, msg) {
|
|
509
|
+
super(`Failed to fetch ${uri}: ${msg}`);
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
var NonRetryableFetchError = class extends FetchError {
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/node-web-compat-node.js
|
|
516
|
+
var import_crypto2 = require("crypto");
|
|
517
|
+
|
|
518
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/asn1.js
|
|
519
|
+
var Asn1Class;
|
|
520
|
+
(function(Asn1Class2) {
|
|
521
|
+
Asn1Class2[Asn1Class2["Universal"] = 0] = "Universal";
|
|
522
|
+
})(Asn1Class || (Asn1Class = {}));
|
|
523
|
+
var Asn1Encoding;
|
|
524
|
+
(function(Asn1Encoding2) {
|
|
525
|
+
Asn1Encoding2[Asn1Encoding2["Primitive"] = 0] = "Primitive";
|
|
526
|
+
Asn1Encoding2[Asn1Encoding2["Constructed"] = 1] = "Constructed";
|
|
527
|
+
})(Asn1Encoding || (Asn1Encoding = {}));
|
|
528
|
+
var Asn1Tag;
|
|
529
|
+
(function(Asn1Tag2) {
|
|
530
|
+
Asn1Tag2[Asn1Tag2["BitString"] = 3] = "BitString";
|
|
531
|
+
Asn1Tag2[Asn1Tag2["ObjectIdentifier"] = 6] = "ObjectIdentifier";
|
|
532
|
+
Asn1Tag2[Asn1Tag2["Sequence"] = 16] = "Sequence";
|
|
533
|
+
Asn1Tag2[Asn1Tag2["Null"] = 5] = "Null";
|
|
534
|
+
Asn1Tag2[Asn1Tag2["Integer"] = 2] = "Integer";
|
|
535
|
+
})(Asn1Tag || (Asn1Tag = {}));
|
|
536
|
+
function encodeIdentifier(identifier) {
|
|
537
|
+
const identifierAsNumber = identifier.class << 7 | identifier.primitiveOrConstructed << 5 | identifier.tag;
|
|
538
|
+
return Buffer.from([identifierAsNumber]);
|
|
539
|
+
}
|
|
540
|
+
function encodeLength(length) {
|
|
541
|
+
if (length < 128) {
|
|
542
|
+
return Buffer.from([length]);
|
|
543
|
+
}
|
|
544
|
+
const integers = [];
|
|
545
|
+
while (length > 0) {
|
|
546
|
+
integers.push(length % 256);
|
|
547
|
+
length = length >> 8;
|
|
548
|
+
}
|
|
549
|
+
integers.reverse();
|
|
550
|
+
return Buffer.from([128 | integers.length, ...integers]);
|
|
551
|
+
}
|
|
552
|
+
function encodeBufferAsPositiveInteger(buffer) {
|
|
553
|
+
if (buffer[0] >> 7) {
|
|
554
|
+
buffer = Buffer.concat([Buffer.from([0]), buffer]);
|
|
555
|
+
}
|
|
556
|
+
return Buffer.concat([
|
|
557
|
+
encodeIdentifier({
|
|
558
|
+
class: Asn1Class.Universal,
|
|
559
|
+
primitiveOrConstructed: Asn1Encoding.Primitive,
|
|
560
|
+
tag: Asn1Tag.Integer
|
|
561
|
+
}),
|
|
562
|
+
encodeLength(buffer.length),
|
|
563
|
+
buffer
|
|
564
|
+
]);
|
|
565
|
+
}
|
|
566
|
+
function encodeObjectIdentifier(oid) {
|
|
567
|
+
const oidComponents = oid.split(".").map((i) => parseInt(i));
|
|
568
|
+
const firstSubidentifier = oidComponents[0] * 40 + oidComponents[1];
|
|
569
|
+
const subsequentSubidentifiers = oidComponents.slice(2).reduce((expanded, component) => {
|
|
570
|
+
const bytes = [];
|
|
571
|
+
do {
|
|
572
|
+
bytes.push(component % 128);
|
|
573
|
+
component = component >> 7;
|
|
574
|
+
} while (component);
|
|
575
|
+
return expanded.concat(bytes.map((b, index) => index ? b + 128 : b).reverse());
|
|
576
|
+
}, []);
|
|
577
|
+
const oidBuffer = Buffer.from([
|
|
578
|
+
firstSubidentifier,
|
|
579
|
+
...subsequentSubidentifiers
|
|
580
|
+
]);
|
|
581
|
+
return Buffer.concat([
|
|
582
|
+
encodeIdentifier({
|
|
583
|
+
class: Asn1Class.Universal,
|
|
584
|
+
primitiveOrConstructed: Asn1Encoding.Primitive,
|
|
585
|
+
tag: Asn1Tag.ObjectIdentifier
|
|
586
|
+
}),
|
|
587
|
+
encodeLength(oidBuffer.length),
|
|
588
|
+
oidBuffer
|
|
589
|
+
]);
|
|
590
|
+
}
|
|
591
|
+
function encodeBufferAsBitString(buffer) {
|
|
592
|
+
const bitString = Buffer.concat([Buffer.from([0]), buffer]);
|
|
593
|
+
return Buffer.concat([
|
|
594
|
+
encodeIdentifier({
|
|
595
|
+
class: Asn1Class.Universal,
|
|
596
|
+
primitiveOrConstructed: Asn1Encoding.Primitive,
|
|
597
|
+
tag: Asn1Tag.BitString
|
|
598
|
+
}),
|
|
599
|
+
encodeLength(bitString.length),
|
|
600
|
+
bitString
|
|
601
|
+
]);
|
|
602
|
+
}
|
|
603
|
+
function encodeSequence(sequenceItems) {
|
|
604
|
+
const concatenated = Buffer.concat(sequenceItems);
|
|
605
|
+
return Buffer.concat([
|
|
606
|
+
encodeIdentifier({
|
|
607
|
+
class: Asn1Class.Universal,
|
|
608
|
+
primitiveOrConstructed: Asn1Encoding.Constructed,
|
|
609
|
+
tag: Asn1Tag.Sequence
|
|
610
|
+
}),
|
|
611
|
+
encodeLength(concatenated.length),
|
|
612
|
+
concatenated
|
|
613
|
+
]);
|
|
614
|
+
}
|
|
615
|
+
function encodeNull() {
|
|
616
|
+
return Buffer.concat([
|
|
617
|
+
encodeIdentifier({
|
|
618
|
+
class: Asn1Class.Universal,
|
|
619
|
+
primitiveOrConstructed: Asn1Encoding.Primitive,
|
|
620
|
+
tag: Asn1Tag.Null
|
|
621
|
+
}),
|
|
622
|
+
encodeLength(0)
|
|
623
|
+
]);
|
|
624
|
+
}
|
|
625
|
+
var ALGORITHM_RSA_ENCRYPTION = encodeSequence([
|
|
626
|
+
encodeObjectIdentifier("1.2.840.113549.1.1.1"),
|
|
627
|
+
encodeNull()
|
|
628
|
+
// parameters
|
|
629
|
+
]);
|
|
630
|
+
function constructPublicKeyInDerFormat(n, e) {
|
|
631
|
+
return encodeSequence([
|
|
632
|
+
ALGORITHM_RSA_ENCRYPTION,
|
|
633
|
+
encodeBufferAsBitString(encodeSequence([
|
|
634
|
+
encodeBufferAsPositiveInteger(n),
|
|
635
|
+
encodeBufferAsPositiveInteger(e)
|
|
636
|
+
]))
|
|
637
|
+
]);
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/https-node.js
|
|
641
|
+
var import_https = require("https");
|
|
642
|
+
|
|
643
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/https-common.js
|
|
644
|
+
function validateHttpsJsonResponse(uri, statusCode, contentType) {
|
|
645
|
+
if (statusCode === 429) {
|
|
646
|
+
throw new FetchError(uri, "Too many requests");
|
|
647
|
+
} else if (statusCode !== 200) {
|
|
648
|
+
throw new NonRetryableFetchError(uri, `Status code is ${statusCode}, expected 200`);
|
|
649
|
+
}
|
|
650
|
+
if (!contentType || !contentType.toLowerCase().startsWith("application/json")) {
|
|
651
|
+
throw new NonRetryableFetchError(uri, `Content-type is "${contentType}", expected "application/json"`);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/https-node.js
|
|
656
|
+
var import_stream = require("stream");
|
|
657
|
+
var import_util = require("util");
|
|
658
|
+
|
|
659
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/safe-json-parse.js
|
|
660
|
+
function isJsonObject(j) {
|
|
661
|
+
return typeof j === "object" && !Array.isArray(j) && j !== null;
|
|
662
|
+
}
|
|
663
|
+
function safeJsonParse(s) {
|
|
664
|
+
return JSON.parse(s, (_, value) => {
|
|
665
|
+
if (typeof value === "object" && !Array.isArray(value) && value !== null) {
|
|
666
|
+
delete value.__proto__;
|
|
667
|
+
delete value.constructor;
|
|
668
|
+
}
|
|
669
|
+
return value;
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/https-node.js
|
|
674
|
+
async function fetchJson(uri, requestOptions, data) {
|
|
675
|
+
let responseTimeout;
|
|
676
|
+
return new Promise((resolve, reject) => {
|
|
677
|
+
const req = (0, import_https.request)(uri, {
|
|
678
|
+
method: "GET",
|
|
679
|
+
...requestOptions
|
|
680
|
+
}, (response) => {
|
|
681
|
+
(0, import_stream.pipeline)([
|
|
682
|
+
response,
|
|
683
|
+
getJsonDestination(uri, response.statusCode, response.headers)
|
|
684
|
+
], done);
|
|
685
|
+
});
|
|
686
|
+
if (requestOptions?.responseTimeout) {
|
|
687
|
+
responseTimeout = setTimeout(() => done(new FetchError(uri, `Response time-out (after ${requestOptions.responseTimeout} ms.)`)), requestOptions.responseTimeout);
|
|
688
|
+
responseTimeout.unref();
|
|
689
|
+
}
|
|
690
|
+
function done(...args) {
|
|
691
|
+
if (responseTimeout)
|
|
692
|
+
clearTimeout(responseTimeout);
|
|
693
|
+
if (args[0] == null) {
|
|
694
|
+
resolve(args[1]);
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
req.socket?.emit("agentRemove");
|
|
698
|
+
let error = args[0];
|
|
699
|
+
if (!(error instanceof FetchError)) {
|
|
700
|
+
error = new FetchError(uri, error.message);
|
|
701
|
+
}
|
|
702
|
+
req.destroy();
|
|
703
|
+
reject(error);
|
|
704
|
+
}
|
|
705
|
+
req.on("error", done);
|
|
706
|
+
req.end(data);
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
function getJsonDestination(uri, statusCode, headers) {
|
|
710
|
+
return async (responseIterable) => {
|
|
711
|
+
validateHttpsJsonResponse(uri, statusCode, headers["content-type"]);
|
|
712
|
+
const collected = [];
|
|
713
|
+
for await (const chunk of responseIterable) {
|
|
714
|
+
collected.push(chunk);
|
|
715
|
+
}
|
|
716
|
+
try {
|
|
717
|
+
return safeJsonParse(new import_util.TextDecoder("utf8", { fatal: true, ignoreBOM: true }).decode(Buffer.concat(collected)));
|
|
718
|
+
} catch (err) {
|
|
719
|
+
throw new NonRetryableFetchError(uri, err);
|
|
720
|
+
}
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/node-web-compat-node.js
|
|
725
|
+
var JwtSignatureAlgorithms;
|
|
726
|
+
(function(JwtSignatureAlgorithms2) {
|
|
727
|
+
JwtSignatureAlgorithms2["RS256"] = "RSA-SHA256";
|
|
728
|
+
JwtSignatureAlgorithms2["RS384"] = "RSA-SHA384";
|
|
729
|
+
JwtSignatureAlgorithms2["RS512"] = "RSA-SHA512";
|
|
730
|
+
})(JwtSignatureAlgorithms || (JwtSignatureAlgorithms = {}));
|
|
731
|
+
var nodeWebCompat = {
|
|
732
|
+
fetchJson,
|
|
733
|
+
transformJwkToKeyObjectSync: (jwk) => (0, import_crypto2.createPublicKey)({
|
|
734
|
+
key: constructPublicKeyInDerFormat(Buffer.from(jwk.n, "base64"), Buffer.from(jwk.e, "base64")),
|
|
735
|
+
format: "der",
|
|
736
|
+
type: "spki"
|
|
737
|
+
}),
|
|
738
|
+
transformJwkToKeyObjectAsync: async (jwk) => (0, import_crypto2.createPublicKey)({
|
|
739
|
+
key: constructPublicKeyInDerFormat(Buffer.from(jwk.n, "base64"), Buffer.from(jwk.e, "base64")),
|
|
740
|
+
format: "der",
|
|
741
|
+
type: "spki"
|
|
742
|
+
}),
|
|
743
|
+
parseB64UrlString: (b64) => Buffer.from(b64, "base64").toString("utf8"),
|
|
744
|
+
verifySignatureSync: ({ alg, keyObject, jwsSigningInput, signature }) => (
|
|
745
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
746
|
+
(0, import_crypto2.createVerify)(JwtSignatureAlgorithms[alg]).update(jwsSigningInput).verify(keyObject, signature, "base64")
|
|
747
|
+
),
|
|
748
|
+
verifySignatureAsync: async ({ alg, keyObject, jwsSigningInput, signature }) => (
|
|
749
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
750
|
+
(0, import_crypto2.createVerify)(JwtSignatureAlgorithms[alg]).update(jwsSigningInput).verify(keyObject, signature, "base64")
|
|
751
|
+
),
|
|
752
|
+
defaultFetchTimeouts: {
|
|
753
|
+
socketIdle: 500,
|
|
754
|
+
response: 1500
|
|
755
|
+
},
|
|
756
|
+
setTimeoutUnref: (...args) => setTimeout(...args).unref()
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/https.js
|
|
760
|
+
var fetchJson2 = nodeWebCompat.fetchJson;
|
|
761
|
+
var SimpleJsonFetcher = class {
|
|
762
|
+
constructor(props) {
|
|
763
|
+
this.defaultRequestOptions = {
|
|
764
|
+
timeout: nodeWebCompat.defaultFetchTimeouts.socketIdle,
|
|
765
|
+
responseTimeout: nodeWebCompat.defaultFetchTimeouts.response,
|
|
766
|
+
...props?.defaultRequestOptions
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* Execute a HTTPS request (with 1 immediate retry in case of errors)
|
|
771
|
+
* @param uri - The URI
|
|
772
|
+
* @param requestOptions - The RequestOptions to use
|
|
773
|
+
* @param data - Data to send to the URI (e.g. POST data)
|
|
774
|
+
* @returns - The response as parsed JSON
|
|
775
|
+
*/
|
|
776
|
+
async fetch(uri, requestOptions, data) {
|
|
777
|
+
requestOptions = { ...this.defaultRequestOptions, ...requestOptions };
|
|
778
|
+
try {
|
|
779
|
+
return await fetchJson2(uri, requestOptions, data);
|
|
780
|
+
} catch (err) {
|
|
781
|
+
if (err instanceof NonRetryableFetchError) {
|
|
782
|
+
throw err;
|
|
783
|
+
}
|
|
784
|
+
return fetchJson2(uri, requestOptions, data);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/assert.js
|
|
790
|
+
function assertStringEquals(name, actual, expected, errorConstructor = FailedAssertionError) {
|
|
791
|
+
if (!actual) {
|
|
792
|
+
throw new errorConstructor(`Missing ${name}. Expected: ${expected}`, actual, expected);
|
|
793
|
+
}
|
|
794
|
+
if (typeof actual !== "string") {
|
|
795
|
+
throw new errorConstructor(`${name} is not of type string`, actual, expected);
|
|
796
|
+
}
|
|
797
|
+
if (expected !== actual) {
|
|
798
|
+
throw new errorConstructor(`${name} not allowed: ${actual}. Expected: ${expected}`, actual, expected);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
function assertStringArrayContainsString(name, actual, expected, errorConstructor = FailedAssertionError) {
|
|
802
|
+
if (!actual) {
|
|
803
|
+
throw new errorConstructor(`Missing ${name}. ${expectationMessage(expected)}`, actual, expected);
|
|
804
|
+
}
|
|
805
|
+
if (typeof actual !== "string") {
|
|
806
|
+
throw new errorConstructor(`${name} is not of type string`, actual, expected);
|
|
807
|
+
}
|
|
808
|
+
return assertStringArraysOverlap(name, actual, expected, errorConstructor);
|
|
809
|
+
}
|
|
810
|
+
function assertStringArraysOverlap(name, actual, expected, errorConstructor = FailedAssertionError) {
|
|
811
|
+
if (!actual) {
|
|
812
|
+
throw new errorConstructor(`Missing ${name}. ${expectationMessage(expected)}`, actual, expected);
|
|
813
|
+
}
|
|
814
|
+
const expectedAsSet = new Set(Array.isArray(expected) ? expected : [expected]);
|
|
815
|
+
if (typeof actual === "string") {
|
|
816
|
+
actual = [actual];
|
|
817
|
+
}
|
|
818
|
+
if (!Array.isArray(actual)) {
|
|
819
|
+
throw new errorConstructor(`${name} is not an array`, actual, expected);
|
|
820
|
+
}
|
|
821
|
+
const overlaps = actual.some((actualItem) => {
|
|
822
|
+
if (typeof actualItem !== "string") {
|
|
823
|
+
throw new errorConstructor(`${name} includes elements that are not of type string`, actual, expected);
|
|
824
|
+
}
|
|
825
|
+
return expectedAsSet.has(actualItem);
|
|
826
|
+
});
|
|
827
|
+
if (!overlaps) {
|
|
828
|
+
throw new errorConstructor(`${name} not allowed: ${actual.join(", ")}. ${expectationMessage(expected)}`, actual, expected);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
function expectationMessage(expected) {
|
|
832
|
+
if (Array.isArray(expected)) {
|
|
833
|
+
if (expected.length > 1) {
|
|
834
|
+
return `Expected one of: ${expected.join(", ")}`;
|
|
835
|
+
}
|
|
836
|
+
return `Expected: ${expected[0]}`;
|
|
837
|
+
}
|
|
838
|
+
return `Expected: ${expected}`;
|
|
839
|
+
}
|
|
840
|
+
function assertIsNotPromise(actual, errorFactory) {
|
|
841
|
+
if (actual && typeof actual.then === "function") {
|
|
842
|
+
throw errorFactory();
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/jwk.js
|
|
847
|
+
var optionalJwkFieldNames = [
|
|
848
|
+
"use",
|
|
849
|
+
"alg",
|
|
850
|
+
"kid",
|
|
851
|
+
"n",
|
|
852
|
+
"e"
|
|
853
|
+
// https://datatracker.ietf.org/doc/html/rfc7518#section-6.3.1.2
|
|
854
|
+
];
|
|
855
|
+
var mandatoryJwkFieldNames = [
|
|
856
|
+
"kty"
|
|
857
|
+
// https://datatracker.ietf.org/doc/html/rfc7517#section-4.1
|
|
858
|
+
];
|
|
859
|
+
function findJwkInJwks(jwks, kid) {
|
|
860
|
+
return jwks.keys.find((jwk) => jwk.kid != null && jwk.kid === kid);
|
|
861
|
+
}
|
|
862
|
+
async function fetchJwks(jwksUri) {
|
|
863
|
+
const jwks = await fetchJson2(jwksUri);
|
|
864
|
+
assertIsJwks(jwks);
|
|
865
|
+
return jwks;
|
|
866
|
+
}
|
|
867
|
+
async function fetchJwk(jwksUri, decomposedJwt) {
|
|
868
|
+
if (!decomposedJwt.header.kid) {
|
|
869
|
+
throw new JwtWithoutValidKidError("JWT header does not have valid kid claim");
|
|
870
|
+
}
|
|
871
|
+
const jwks = await fetchJwks(jwksUri);
|
|
872
|
+
const jwk = findJwkInJwks(jwks, decomposedJwt.header.kid);
|
|
873
|
+
if (!jwk) {
|
|
874
|
+
throw new KidNotFoundInJwksError(`JWK for kid "${decomposedJwt.header.kid}" not found in the JWKS`);
|
|
875
|
+
}
|
|
876
|
+
return jwk;
|
|
877
|
+
}
|
|
878
|
+
function assertIsJwks(jwks) {
|
|
879
|
+
if (!jwks) {
|
|
880
|
+
throw new JwksValidationError("JWKS empty");
|
|
881
|
+
}
|
|
882
|
+
if (!isJsonObject(jwks)) {
|
|
883
|
+
throw new JwksValidationError("JWKS should be an object");
|
|
884
|
+
}
|
|
885
|
+
if (!Object.keys(jwks).includes("keys")) {
|
|
886
|
+
throw new JwksValidationError("JWKS does not include keys");
|
|
887
|
+
}
|
|
888
|
+
if (!Array.isArray(jwks.keys)) {
|
|
889
|
+
throw new JwksValidationError("JWKS keys should be an array");
|
|
890
|
+
}
|
|
891
|
+
for (const jwk of jwks.keys) {
|
|
892
|
+
assertIsJwk(jwk);
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
function assertIsRsaSignatureJwk(jwk) {
|
|
896
|
+
assertStringEquals("JWK use", jwk.use, "sig", JwkInvalidUseError);
|
|
897
|
+
assertStringEquals("JWK kty", jwk.kty, "RSA", JwkInvalidKtyError);
|
|
898
|
+
if (!jwk.n)
|
|
899
|
+
throw new JwkValidationError("Missing modulus (n)");
|
|
900
|
+
if (!jwk.e)
|
|
901
|
+
throw new JwkValidationError("Missing exponent (e)");
|
|
902
|
+
}
|
|
903
|
+
function assertIsJwk(jwk) {
|
|
904
|
+
if (!jwk) {
|
|
905
|
+
throw new JwkValidationError("JWK empty");
|
|
906
|
+
}
|
|
907
|
+
if (!isJsonObject(jwk)) {
|
|
908
|
+
throw new JwkValidationError("JWK should be an object");
|
|
909
|
+
}
|
|
910
|
+
for (const field of mandatoryJwkFieldNames) {
|
|
911
|
+
if (typeof jwk[field] !== "string") {
|
|
912
|
+
throw new JwkValidationError(`JWK ${field} should be a string`);
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
for (const field of optionalJwkFieldNames) {
|
|
916
|
+
if (field in jwk && typeof jwk[field] !== "string") {
|
|
917
|
+
throw new JwkValidationError(`JWK ${field} should be a string`);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
function isJwks(jwks) {
|
|
922
|
+
try {
|
|
923
|
+
assertIsJwks(jwks);
|
|
924
|
+
return true;
|
|
925
|
+
} catch {
|
|
926
|
+
return false;
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
function isJwk(jwk) {
|
|
930
|
+
try {
|
|
931
|
+
assertIsJwk(jwk);
|
|
932
|
+
return true;
|
|
933
|
+
} catch {
|
|
934
|
+
return false;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
var SimplePenaltyBox = class {
|
|
938
|
+
constructor(props) {
|
|
939
|
+
this.waitingUris = /* @__PURE__ */ new Map();
|
|
940
|
+
this.waitSeconds = props?.waitSeconds ?? 10;
|
|
941
|
+
}
|
|
942
|
+
async wait(jwksUri) {
|
|
943
|
+
if (this.waitingUris.has(jwksUri)) {
|
|
944
|
+
throw new WaitPeriodNotYetEndedJwkError("Not allowed to fetch JWKS yet, still waiting for back off period to end");
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
release(jwksUri) {
|
|
948
|
+
const i = this.waitingUris.get(jwksUri);
|
|
949
|
+
if (i) {
|
|
950
|
+
clearTimeout(i);
|
|
951
|
+
this.waitingUris.delete(jwksUri);
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
registerFailedAttempt(jwksUri) {
|
|
955
|
+
const i = nodeWebCompat.setTimeoutUnref(() => {
|
|
956
|
+
this.waitingUris.delete(jwksUri);
|
|
957
|
+
}, this.waitSeconds * 1e3);
|
|
958
|
+
this.waitingUris.set(jwksUri, i);
|
|
959
|
+
}
|
|
960
|
+
registerSuccessfulAttempt(jwksUri) {
|
|
961
|
+
this.release(jwksUri);
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
var SimpleJwksCache = class {
|
|
965
|
+
constructor(props) {
|
|
966
|
+
this.jwksCache = /* @__PURE__ */ new Map();
|
|
967
|
+
this.fetchingJwks = /* @__PURE__ */ new Map();
|
|
968
|
+
this.penaltyBox = props?.penaltyBox ?? new SimplePenaltyBox();
|
|
969
|
+
this.fetcher = props?.fetcher ?? new SimpleJsonFetcher();
|
|
970
|
+
}
|
|
971
|
+
addJwks(jwksUri, jwks) {
|
|
972
|
+
this.jwksCache.set(jwksUri, jwks);
|
|
973
|
+
}
|
|
974
|
+
async getJwks(jwksUri) {
|
|
975
|
+
const existingFetch = this.fetchingJwks.get(jwksUri);
|
|
976
|
+
if (existingFetch) {
|
|
977
|
+
return existingFetch;
|
|
978
|
+
}
|
|
979
|
+
const jwksPromise = this.fetcher.fetch(jwksUri).then((res) => {
|
|
980
|
+
assertIsJwks(res);
|
|
981
|
+
return res;
|
|
982
|
+
});
|
|
983
|
+
this.fetchingJwks.set(jwksUri, jwksPromise);
|
|
984
|
+
let jwks;
|
|
985
|
+
try {
|
|
986
|
+
jwks = await jwksPromise;
|
|
987
|
+
} finally {
|
|
988
|
+
this.fetchingJwks.delete(jwksUri);
|
|
989
|
+
}
|
|
990
|
+
this.jwksCache.set(jwksUri, jwks);
|
|
991
|
+
return jwks;
|
|
992
|
+
}
|
|
993
|
+
getCachedJwk(jwksUri, decomposedJwt) {
|
|
994
|
+
if (typeof decomposedJwt.header.kid !== "string") {
|
|
995
|
+
throw new JwtWithoutValidKidError("JWT header does not have valid kid claim");
|
|
996
|
+
}
|
|
997
|
+
if (!this.jwksCache.has(jwksUri)) {
|
|
998
|
+
throw new JwksNotAvailableInCacheError(`JWKS for uri ${jwksUri} not yet available in cache`);
|
|
999
|
+
}
|
|
1000
|
+
const jwk = findJwkInJwks(this.jwksCache.get(jwksUri), decomposedJwt.header.kid);
|
|
1001
|
+
if (!jwk) {
|
|
1002
|
+
throw new KidNotFoundInJwksError(`JWK for kid ${decomposedJwt.header.kid} not found in the JWKS`);
|
|
1003
|
+
}
|
|
1004
|
+
return jwk;
|
|
1005
|
+
}
|
|
1006
|
+
async getJwk(jwksUri, decomposedJwt) {
|
|
1007
|
+
if (typeof decomposedJwt.header.kid !== "string") {
|
|
1008
|
+
throw new JwtWithoutValidKidError("JWT header does not have valid kid claim");
|
|
1009
|
+
}
|
|
1010
|
+
const cachedJwks = this.jwksCache.get(jwksUri);
|
|
1011
|
+
if (cachedJwks) {
|
|
1012
|
+
const cachedJwk = findJwkInJwks(cachedJwks, decomposedJwt.header.kid);
|
|
1013
|
+
if (cachedJwk) {
|
|
1014
|
+
return cachedJwk;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
await this.penaltyBox.wait(jwksUri, decomposedJwt.header.kid);
|
|
1018
|
+
const jwks = await this.getJwks(jwksUri);
|
|
1019
|
+
const jwk = findJwkInJwks(jwks, decomposedJwt.header.kid);
|
|
1020
|
+
if (!jwk) {
|
|
1021
|
+
this.penaltyBox.registerFailedAttempt(jwksUri, decomposedJwt.header.kid);
|
|
1022
|
+
throw new KidNotFoundInJwksError(`JWK for kid "${decomposedJwt.header.kid}" not found in the JWKS`);
|
|
1023
|
+
} else {
|
|
1024
|
+
this.penaltyBox.registerSuccessfulAttempt(jwksUri, decomposedJwt.header.kid);
|
|
1025
|
+
}
|
|
1026
|
+
return jwk;
|
|
1027
|
+
}
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/jwt-model.js
|
|
1031
|
+
var supportedSignatureAlgorithms = [
|
|
1032
|
+
"RS256",
|
|
1033
|
+
"RS384",
|
|
1034
|
+
"RS512"
|
|
1035
|
+
];
|
|
1036
|
+
|
|
1037
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/jwt.js
|
|
1038
|
+
function assertJwtHeader(header) {
|
|
1039
|
+
if (!isJsonObject(header)) {
|
|
1040
|
+
throw new JwtParseError("JWT header is not an object");
|
|
1041
|
+
}
|
|
1042
|
+
if (header.alg !== void 0 && typeof header.alg !== "string") {
|
|
1043
|
+
throw new JwtParseError("JWT header alg claim is not a string");
|
|
1044
|
+
}
|
|
1045
|
+
if (header.kid !== void 0 && typeof header.kid !== "string") {
|
|
1046
|
+
throw new JwtParseError("JWT header kid claim is not a string");
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
function assertJwtPayload(payload) {
|
|
1050
|
+
if (!isJsonObject(payload)) {
|
|
1051
|
+
throw new JwtParseError("JWT payload is not an object");
|
|
1052
|
+
}
|
|
1053
|
+
if (payload.exp !== void 0 && !Number.isFinite(payload.exp)) {
|
|
1054
|
+
throw new JwtParseError("JWT payload exp claim is not a number");
|
|
1055
|
+
}
|
|
1056
|
+
if (payload.iss !== void 0 && typeof payload.iss !== "string") {
|
|
1057
|
+
throw new JwtParseError("JWT payload iss claim is not a string");
|
|
1058
|
+
}
|
|
1059
|
+
if (payload.sub !== void 0 && typeof payload.sub !== "string") {
|
|
1060
|
+
throw new JwtParseError("JWT payload sub claim is not a string");
|
|
1061
|
+
}
|
|
1062
|
+
if (payload.aud !== void 0 && typeof payload.aud !== "string" && (!Array.isArray(payload.aud) || payload.aud.some((aud) => typeof aud !== "string"))) {
|
|
1063
|
+
throw new JwtParseError("JWT payload aud claim is not a string or array of strings");
|
|
1064
|
+
}
|
|
1065
|
+
if (payload.nbf !== void 0 && !Number.isFinite(payload.nbf)) {
|
|
1066
|
+
throw new JwtParseError("JWT payload nbf claim is not a number");
|
|
1067
|
+
}
|
|
1068
|
+
if (payload.iat !== void 0 && !Number.isFinite(payload.iat)) {
|
|
1069
|
+
throw new JwtParseError("JWT payload iat claim is not a number");
|
|
1070
|
+
}
|
|
1071
|
+
if (payload.scope !== void 0 && typeof payload.scope !== "string") {
|
|
1072
|
+
throw new JwtParseError("JWT payload scope claim is not a string");
|
|
1073
|
+
}
|
|
1074
|
+
if (payload.jti !== void 0 && typeof payload.jti !== "string") {
|
|
1075
|
+
throw new JwtParseError("JWT payload jti claim is not a string");
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
function decomposeUnverifiedJwt(jwt) {
|
|
1079
|
+
if (!jwt) {
|
|
1080
|
+
throw new JwtParseError("Empty JWT");
|
|
1081
|
+
}
|
|
1082
|
+
if (typeof jwt !== "string") {
|
|
1083
|
+
throw new JwtParseError("JWT is not a string");
|
|
1084
|
+
}
|
|
1085
|
+
if (!jwt.match(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/)) {
|
|
1086
|
+
throw new JwtParseError("JWT string does not consist of exactly 3 parts (header, payload, signature)");
|
|
1087
|
+
}
|
|
1088
|
+
const [headerB64, payloadB64, signatureB64] = jwt.split(".");
|
|
1089
|
+
const [headerString, payloadString] = [headerB64, payloadB64].map(nodeWebCompat.parseB64UrlString);
|
|
1090
|
+
let header;
|
|
1091
|
+
try {
|
|
1092
|
+
header = safeJsonParse(headerString);
|
|
1093
|
+
} catch (err) {
|
|
1094
|
+
throw new JwtParseError("Invalid JWT. Header is not a valid JSON object", err);
|
|
1095
|
+
}
|
|
1096
|
+
assertJwtHeader(header);
|
|
1097
|
+
let payload;
|
|
1098
|
+
try {
|
|
1099
|
+
payload = safeJsonParse(payloadString);
|
|
1100
|
+
} catch (err) {
|
|
1101
|
+
throw new JwtParseError("Invalid JWT. Payload is not a valid JSON object", err);
|
|
1102
|
+
}
|
|
1103
|
+
assertJwtPayload(payload);
|
|
1104
|
+
return {
|
|
1105
|
+
header,
|
|
1106
|
+
headerB64,
|
|
1107
|
+
payload,
|
|
1108
|
+
payloadB64,
|
|
1109
|
+
signatureB64
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
function validateJwtFields(payload, options) {
|
|
1113
|
+
if (payload.exp !== void 0) {
|
|
1114
|
+
if (payload.exp + (options.graceSeconds ?? 0) < Date.now() / 1e3) {
|
|
1115
|
+
throw new JwtExpiredError(`Token expired at ${new Date(payload.exp * 1e3).toISOString()}`, payload.exp);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
if (payload.nbf !== void 0) {
|
|
1119
|
+
if (payload.nbf - (options.graceSeconds ?? 0) > Date.now() / 1e3) {
|
|
1120
|
+
throw new JwtNotBeforeError(`Token can't be used before ${new Date(payload.nbf * 1e3).toISOString()}`, payload.nbf);
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
if (options.issuer !== null) {
|
|
1124
|
+
if (options.issuer === void 0) {
|
|
1125
|
+
throw new ParameterValidationError("issuer must be provided or set to null explicitly");
|
|
1126
|
+
}
|
|
1127
|
+
assertStringArrayContainsString("Issuer", payload.iss, options.issuer, JwtInvalidIssuerError);
|
|
1128
|
+
}
|
|
1129
|
+
if (options.audience !== null) {
|
|
1130
|
+
if (options.audience === void 0) {
|
|
1131
|
+
throw new ParameterValidationError("audience must be provided or set to null explicitly");
|
|
1132
|
+
}
|
|
1133
|
+
assertStringArraysOverlap("Audience", payload.aud, options.audience, JwtInvalidAudienceError);
|
|
1134
|
+
}
|
|
1135
|
+
if (options.scope != null) {
|
|
1136
|
+
assertStringArraysOverlap("Scope", payload.scope?.split(" "), options.scope, JwtInvalidScopeError);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/jwt-rsa.js
|
|
1141
|
+
function validateJwtHeaderAndJwk(header, jwk) {
|
|
1142
|
+
assertIsRsaSignatureJwk(jwk);
|
|
1143
|
+
if (jwk.alg) {
|
|
1144
|
+
assertStringEquals("JWT signature algorithm", header.alg, jwk.alg, JwtInvalidSignatureAlgorithmError);
|
|
1145
|
+
}
|
|
1146
|
+
assertStringArrayContainsString("JWT signature algorithm", header.alg, supportedSignatureAlgorithms, JwtInvalidSignatureAlgorithmError);
|
|
1147
|
+
}
|
|
1148
|
+
async function verifyDecomposedJwt(decomposedJwt, jwksUri, options, jwkFetcher = fetchJwk, transformJwkToKeyObjectFn = nodeWebCompat.transformJwkToKeyObjectAsync) {
|
|
1149
|
+
const { header, headerB64, payload, payloadB64, signatureB64 } = decomposedJwt;
|
|
1150
|
+
const jwk = await jwkFetcher(jwksUri, decomposedJwt);
|
|
1151
|
+
validateJwtHeaderAndJwk(decomposedJwt.header, jwk);
|
|
1152
|
+
const keyObject = await transformJwkToKeyObjectFn(jwk, header.alg, payload.iss);
|
|
1153
|
+
const valid = await nodeWebCompat.verifySignatureAsync({
|
|
1154
|
+
jwsSigningInput: `${headerB64}.${payloadB64}`,
|
|
1155
|
+
signature: signatureB64,
|
|
1156
|
+
alg: header.alg,
|
|
1157
|
+
keyObject
|
|
1158
|
+
});
|
|
1159
|
+
if (!valid) {
|
|
1160
|
+
throw new JwtInvalidSignatureError("Invalid signature");
|
|
1161
|
+
}
|
|
1162
|
+
try {
|
|
1163
|
+
validateJwtFields(payload, options);
|
|
1164
|
+
if (options.customJwtCheck) {
|
|
1165
|
+
await options.customJwtCheck({ header, payload, jwk });
|
|
1166
|
+
}
|
|
1167
|
+
} catch (err) {
|
|
1168
|
+
if (options.includeRawJwtInErrors && err instanceof JwtInvalidClaimError) {
|
|
1169
|
+
throw err.withRawJwt(decomposedJwt);
|
|
1170
|
+
}
|
|
1171
|
+
throw err;
|
|
1172
|
+
}
|
|
1173
|
+
return payload;
|
|
1174
|
+
}
|
|
1175
|
+
function verifyDecomposedJwtSync(decomposedJwt, jwkOrJwks, options, transformJwkToKeyObjectFn) {
|
|
1176
|
+
const { header, headerB64, payload, payloadB64, signatureB64 } = decomposedJwt;
|
|
1177
|
+
let jwk;
|
|
1178
|
+
if (isJwk(jwkOrJwks)) {
|
|
1179
|
+
jwk = jwkOrJwks;
|
|
1180
|
+
} else if (isJwks(jwkOrJwks)) {
|
|
1181
|
+
const locatedJwk = header.kid ? findJwkInJwks(jwkOrJwks, header.kid) : void 0;
|
|
1182
|
+
if (!locatedJwk) {
|
|
1183
|
+
throw new KidNotFoundInJwksError(`JWK for kid ${header.kid} not found in the JWKS`);
|
|
1184
|
+
}
|
|
1185
|
+
jwk = locatedJwk;
|
|
1186
|
+
} else {
|
|
1187
|
+
throw new ParameterValidationError([
|
|
1188
|
+
`Expected a valid JWK or JWKS (parsed as JavaScript object), but received: ${jwkOrJwks}.`,
|
|
1189
|
+
"If you're passing a JWKS URI, use the async verify() method instead, it will download and parse the JWKS for you"
|
|
1190
|
+
].join());
|
|
1191
|
+
}
|
|
1192
|
+
validateJwtHeaderAndJwk(decomposedJwt.header, jwk);
|
|
1193
|
+
const keyObject = transformJwkToKeyObjectFn(jwk, header.alg, payload.iss);
|
|
1194
|
+
const valid = nodeWebCompat.verifySignatureSync({
|
|
1195
|
+
jwsSigningInput: `${headerB64}.${payloadB64}`,
|
|
1196
|
+
signature: signatureB64,
|
|
1197
|
+
alg: header.alg,
|
|
1198
|
+
keyObject
|
|
1199
|
+
});
|
|
1200
|
+
if (!valid) {
|
|
1201
|
+
throw new JwtInvalidSignatureError("Invalid signature");
|
|
1202
|
+
}
|
|
1203
|
+
try {
|
|
1204
|
+
validateJwtFields(payload, options);
|
|
1205
|
+
if (options.customJwtCheck) {
|
|
1206
|
+
const res = options.customJwtCheck({ header, payload, jwk });
|
|
1207
|
+
assertIsNotPromise(res, () => new ParameterValidationError("Custom JWT checks must be synchronous but a promise was returned"));
|
|
1208
|
+
}
|
|
1209
|
+
} catch (err) {
|
|
1210
|
+
if (options.includeRawJwtInErrors && err instanceof JwtInvalidClaimError) {
|
|
1211
|
+
throw err.withRawJwt(decomposedJwt);
|
|
1212
|
+
}
|
|
1213
|
+
throw err;
|
|
1214
|
+
}
|
|
1215
|
+
return payload;
|
|
1216
|
+
}
|
|
1217
|
+
var JwtRsaVerifierBase = class {
|
|
1218
|
+
constructor(verifyProperties, jwksCache = new SimpleJwksCache()) {
|
|
1219
|
+
this.jwksCache = jwksCache;
|
|
1220
|
+
this.issuersConfig = /* @__PURE__ */ new Map();
|
|
1221
|
+
this.publicKeyCache = new KeyObjectCache();
|
|
1222
|
+
if (Array.isArray(verifyProperties)) {
|
|
1223
|
+
if (!verifyProperties.length) {
|
|
1224
|
+
throw new ParameterValidationError("Provide at least one issuer configuration");
|
|
1225
|
+
}
|
|
1226
|
+
for (const prop of verifyProperties) {
|
|
1227
|
+
if (this.issuersConfig.has(prop.issuer)) {
|
|
1228
|
+
throw new ParameterValidationError(`issuer ${prop.issuer} supplied multiple times`);
|
|
1229
|
+
}
|
|
1230
|
+
this.issuersConfig.set(prop.issuer, this.withJwksUri(prop));
|
|
1231
|
+
}
|
|
1232
|
+
} else {
|
|
1233
|
+
this.issuersConfig.set(verifyProperties.issuer, this.withJwksUri(verifyProperties));
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
get expectedIssuers() {
|
|
1237
|
+
return Array.from(this.issuersConfig.keys());
|
|
1238
|
+
}
|
|
1239
|
+
getIssuerConfig(issuer) {
|
|
1240
|
+
if (!issuer) {
|
|
1241
|
+
if (this.issuersConfig.size !== 1) {
|
|
1242
|
+
throw new ParameterValidationError("issuer must be provided");
|
|
1243
|
+
}
|
|
1244
|
+
issuer = this.issuersConfig.keys().next().value;
|
|
1245
|
+
}
|
|
1246
|
+
const config = this.issuersConfig.get(issuer);
|
|
1247
|
+
if (!config) {
|
|
1248
|
+
throw new ParameterValidationError(`issuer not configured: ${issuer}`);
|
|
1249
|
+
}
|
|
1250
|
+
return config;
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* This method loads a JWKS that you provide, into the JWKS cache, so that it is
|
|
1254
|
+
* available for JWT verification. Use this method to speed up the first JWT verification
|
|
1255
|
+
* (when the JWKS would otherwise have to be downloaded from the JWKS uri), or to provide the JWKS
|
|
1256
|
+
* in case the JwtVerifier does not have internet access to download the JWKS
|
|
1257
|
+
*
|
|
1258
|
+
* @param jwksThe JWKS
|
|
1259
|
+
* @param issuer The issuer for which you want to cache the JWKS
|
|
1260
|
+
* Supply this field, if you instantiated the JwtVerifier with multiple issuers
|
|
1261
|
+
* @returns void
|
|
1262
|
+
*/
|
|
1263
|
+
cacheJwks(...[jwks, issuer]) {
|
|
1264
|
+
const issuerConfig = this.getIssuerConfig(issuer);
|
|
1265
|
+
this.jwksCache.addJwks(issuerConfig.jwksUri, jwks);
|
|
1266
|
+
this.publicKeyCache.clearCache(issuerConfig.issuer);
|
|
1267
|
+
}
|
|
1268
|
+
/**
|
|
1269
|
+
* Hydrate the JWKS cache for (all of) the configured issuer(s).
|
|
1270
|
+
* This will fetch and cache the latest and greatest JWKS for concerned issuer(s).
|
|
1271
|
+
*
|
|
1272
|
+
* @param issuer The issuer to fetch the JWKS for
|
|
1273
|
+
* @returns void
|
|
1274
|
+
*/
|
|
1275
|
+
async hydrate() {
|
|
1276
|
+
const jwksFetches = this.expectedIssuers.map((issuer) => this.getIssuerConfig(issuer).jwksUri).map((jwksUri) => this.jwksCache.getJwks(jwksUri));
|
|
1277
|
+
await Promise.all(jwksFetches);
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
* Verify (synchronously) a JWT that is signed using RS256 / RS384 / RS512.
|
|
1281
|
+
*
|
|
1282
|
+
* @param jwt The JWT, as string
|
|
1283
|
+
* @param props Verification properties
|
|
1284
|
+
* @returns The payload of the JWT––if the JWT is valid, otherwise an error is thrown
|
|
1285
|
+
*/
|
|
1286
|
+
verifySync(...[jwt, properties]) {
|
|
1287
|
+
const { decomposedJwt, jwksUri, verifyProperties } = this.getVerifyParameters(jwt, properties);
|
|
1288
|
+
return this.verifyDecomposedJwtSync(decomposedJwt, jwksUri, verifyProperties);
|
|
1289
|
+
}
|
|
1290
|
+
/**
|
|
1291
|
+
* Verify (synchronously) an already decomposed JWT, that is signed using RS256 / RS384 / RS512.
|
|
1292
|
+
*
|
|
1293
|
+
* @param decomposedJwt The decomposed Jwt
|
|
1294
|
+
* @param jwk The JWK to verify the JWTs signature with
|
|
1295
|
+
* @param verifyProperties The properties to use for verification
|
|
1296
|
+
* @returns The payload of the JWT––if the JWT is valid, otherwise an error is thrown
|
|
1297
|
+
*/
|
|
1298
|
+
verifyDecomposedJwtSync(decomposedJwt, jwksUri, verifyProperties) {
|
|
1299
|
+
const jwk = this.jwksCache.getCachedJwk(jwksUri, decomposedJwt);
|
|
1300
|
+
return verifyDecomposedJwtSync(decomposedJwt, jwk, verifyProperties, this.publicKeyCache.transformJwkToKeyObjectSync.bind(this.publicKeyCache));
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* Verify (asynchronously) a JWT that is signed using RS256 / RS384 / RS512.
|
|
1304
|
+
* This call is asynchronous, and the JWKS will be fetched from the JWKS uri,
|
|
1305
|
+
* in case it is not yet available in the cache.
|
|
1306
|
+
*
|
|
1307
|
+
* @param jwt The JWT, as string
|
|
1308
|
+
* @param props Verification properties
|
|
1309
|
+
* @returns Promise that resolves to the payload of the JWT––if the JWT is valid, otherwise the promise rejects
|
|
1310
|
+
*/
|
|
1311
|
+
async verify(...[jwt, properties]) {
|
|
1312
|
+
const { decomposedJwt, jwksUri, verifyProperties } = this.getVerifyParameters(jwt, properties);
|
|
1313
|
+
return this.verifyDecomposedJwt(decomposedJwt, jwksUri, verifyProperties);
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* Verify (asynchronously) an already decomposed JWT, that is signed using RS256 / RS384 / RS512.
|
|
1317
|
+
*
|
|
1318
|
+
* @param decomposedJwt The decomposed Jwt
|
|
1319
|
+
* @param jwk The JWK to verify the JWTs signature with
|
|
1320
|
+
* @param verifyProperties The properties to use for verification
|
|
1321
|
+
* @returns The payload of the JWT––if the JWT is valid, otherwise an error is thrown
|
|
1322
|
+
*/
|
|
1323
|
+
verifyDecomposedJwt(decomposedJwt, jwksUri, verifyProperties) {
|
|
1324
|
+
return verifyDecomposedJwt(decomposedJwt, jwksUri, verifyProperties, this.jwksCache.getJwk.bind(this.jwksCache), this.publicKeyCache.transformJwkToKeyObjectAsync.bind(this.publicKeyCache));
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* Get the verification parameters to use, by merging the issuer configuration,
|
|
1328
|
+
* with the overriding properties that are now provided
|
|
1329
|
+
*
|
|
1330
|
+
* @param jwt: the JWT that is going to be verified
|
|
1331
|
+
* @param verifyProperties: the overriding properties, that override the issuer configuration
|
|
1332
|
+
* @returns The merged verification parameters
|
|
1333
|
+
*/
|
|
1334
|
+
getVerifyParameters(jwt, verifyProperties) {
|
|
1335
|
+
const decomposedJwt = decomposeUnverifiedJwt(jwt);
|
|
1336
|
+
assertStringArrayContainsString("Issuer", decomposedJwt.payload.iss, this.expectedIssuers, JwtInvalidIssuerError);
|
|
1337
|
+
const issuerConfig = this.getIssuerConfig(decomposedJwt.payload.iss);
|
|
1338
|
+
return {
|
|
1339
|
+
decomposedJwt,
|
|
1340
|
+
jwksUri: issuerConfig.jwksUri,
|
|
1341
|
+
verifyProperties: {
|
|
1342
|
+
...issuerConfig,
|
|
1343
|
+
...verifyProperties
|
|
1344
|
+
}
|
|
1345
|
+
};
|
|
1346
|
+
}
|
|
1347
|
+
/**
|
|
1348
|
+
* Get issuer config with JWKS URI, by adding a default JWKS URI if needed
|
|
1349
|
+
*
|
|
1350
|
+
* @param config: the issuer config.
|
|
1351
|
+
* @returns The config with JWKS URI
|
|
1352
|
+
*/
|
|
1353
|
+
withJwksUri(config) {
|
|
1354
|
+
if (config.jwksUri) {
|
|
1355
|
+
return config;
|
|
1356
|
+
}
|
|
1357
|
+
const issuerUri = new URL(config.issuer).pathname.replace(/\/$/, "");
|
|
1358
|
+
return {
|
|
1359
|
+
jwksUri: new URL(`${issuerUri}/.well-known/jwks.json`, config.issuer).href,
|
|
1360
|
+
...config
|
|
1361
|
+
};
|
|
1362
|
+
}
|
|
1363
|
+
};
|
|
1364
|
+
var KeyObjectCache = class {
|
|
1365
|
+
constructor(transformJwkToKeyObjectSyncFn = nodeWebCompat.transformJwkToKeyObjectSync, transformJwkToKeyObjectAsyncFn = nodeWebCompat.transformJwkToKeyObjectAsync) {
|
|
1366
|
+
this.transformJwkToKeyObjectSyncFn = transformJwkToKeyObjectSyncFn;
|
|
1367
|
+
this.transformJwkToKeyObjectAsyncFn = transformJwkToKeyObjectAsyncFn;
|
|
1368
|
+
this.publicKeys = /* @__PURE__ */ new Map();
|
|
1369
|
+
}
|
|
1370
|
+
/**
|
|
1371
|
+
* Transform the JWK into an RSA public key in native key object format.
|
|
1372
|
+
* If the transformed JWK is already in the cache, it is returned from the cache instead.
|
|
1373
|
+
*
|
|
1374
|
+
* @param jwk: the JWK
|
|
1375
|
+
* @param jwtHeaderAlg: the alg from the JWT header (used if absent on JWK)
|
|
1376
|
+
* @param issuer: the issuer that uses the JWK for signing JWTs (used for caching the transformation)
|
|
1377
|
+
* @returns the RSA public key in native key object format
|
|
1378
|
+
*/
|
|
1379
|
+
transformJwkToKeyObjectSync(jwk, jwtHeaderAlg, issuer) {
|
|
1380
|
+
const alg = jwk.alg ?? jwtHeaderAlg;
|
|
1381
|
+
if (!issuer || !jwk.kid || !alg) {
|
|
1382
|
+
return this.transformJwkToKeyObjectSyncFn(jwk, alg, issuer);
|
|
1383
|
+
}
|
|
1384
|
+
const fromCache = this.publicKeys.get(issuer)?.get(jwk.kid)?.get(alg);
|
|
1385
|
+
if (fromCache)
|
|
1386
|
+
return fromCache;
|
|
1387
|
+
const publicKey = this.transformJwkToKeyObjectSyncFn(jwk, alg, issuer);
|
|
1388
|
+
this.putKeyObjectInCache(issuer, jwk.kid, alg, publicKey);
|
|
1389
|
+
return publicKey;
|
|
1390
|
+
}
|
|
1391
|
+
/**
|
|
1392
|
+
* Transform the JWK into an RSA public key in native key object format (async).
|
|
1393
|
+
* If the transformed JWK is already in the cache, it is returned from the cache instead.
|
|
1394
|
+
*
|
|
1395
|
+
* @param jwk: the JWK
|
|
1396
|
+
* @param jwtHeaderAlg: the alg from the JWT header (used if absent on JWK)
|
|
1397
|
+
* @param issuer: the issuer that uses the JWK for signing JWTs (used for caching the transformation)
|
|
1398
|
+
* @returns the RSA public key in native key object format
|
|
1399
|
+
*/
|
|
1400
|
+
async transformJwkToKeyObjectAsync(jwk, jwtHeaderAlg, issuer) {
|
|
1401
|
+
const alg = jwk.alg ?? jwtHeaderAlg;
|
|
1402
|
+
if (!issuer || !jwk.kid || !alg) {
|
|
1403
|
+
return this.transformJwkToKeyObjectAsyncFn(jwk, alg, issuer);
|
|
1404
|
+
}
|
|
1405
|
+
const fromCache = this.publicKeys.get(issuer)?.get(jwk.kid)?.get(alg);
|
|
1406
|
+
if (fromCache)
|
|
1407
|
+
return fromCache;
|
|
1408
|
+
const publicKey = await this.transformJwkToKeyObjectAsyncFn(jwk, alg, issuer);
|
|
1409
|
+
this.putKeyObjectInCache(issuer, jwk.kid, alg, publicKey);
|
|
1410
|
+
return publicKey;
|
|
1411
|
+
}
|
|
1412
|
+
putKeyObjectInCache(issuer, kid, alg, publicKey) {
|
|
1413
|
+
const cachedIssuer = this.publicKeys.get(issuer);
|
|
1414
|
+
const cachedIssuerKid = cachedIssuer?.get(kid);
|
|
1415
|
+
if (cachedIssuerKid) {
|
|
1416
|
+
cachedIssuerKid.set(alg, publicKey);
|
|
1417
|
+
} else if (cachedIssuer) {
|
|
1418
|
+
cachedIssuer.set(kid, /* @__PURE__ */ new Map([[alg, publicKey]]));
|
|
1419
|
+
} else {
|
|
1420
|
+
this.publicKeys.set(issuer, /* @__PURE__ */ new Map([[kid, /* @__PURE__ */ new Map([[alg, publicKey]])]]));
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
clearCache(issuer) {
|
|
1424
|
+
this.publicKeys.delete(issuer);
|
|
1425
|
+
}
|
|
1426
|
+
};
|
|
1427
|
+
|
|
1428
|
+
// ../../node_modules/aws-jwt-verify/dist/esm/cognito-verifier.js
|
|
1429
|
+
function validateCognitoJwtFields(payload, options) {
|
|
1430
|
+
if (options.groups != null) {
|
|
1431
|
+
assertStringArraysOverlap("Cognito group", payload["cognito:groups"], options.groups, CognitoJwtInvalidGroupError);
|
|
1432
|
+
}
|
|
1433
|
+
assertStringArrayContainsString("Token use", payload.token_use, ["id", "access"], CognitoJwtInvalidTokenUseError);
|
|
1434
|
+
if (options.tokenUse !== null) {
|
|
1435
|
+
if (options.tokenUse === void 0) {
|
|
1436
|
+
throw new ParameterValidationError("tokenUse must be provided or set to null explicitly");
|
|
1437
|
+
}
|
|
1438
|
+
assertStringEquals("Token use", payload.token_use, options.tokenUse, CognitoJwtInvalidTokenUseError);
|
|
1439
|
+
}
|
|
1440
|
+
if (options.clientId !== null) {
|
|
1441
|
+
if (options.clientId === void 0) {
|
|
1442
|
+
throw new ParameterValidationError("clientId must be provided or set to null explicitly");
|
|
1443
|
+
}
|
|
1444
|
+
if (payload.token_use === "id") {
|
|
1445
|
+
assertStringArrayContainsString('Client ID ("audience")', payload.aud, options.clientId, CognitoJwtInvalidClientIdError);
|
|
1446
|
+
} else {
|
|
1447
|
+
assertStringArrayContainsString("Client ID", payload.client_id, options.clientId, CognitoJwtInvalidClientIdError);
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
var CognitoJwtVerifier = class _CognitoJwtVerifier extends JwtRsaVerifierBase {
|
|
1452
|
+
constructor(props, jwksCache) {
|
|
1453
|
+
const issuerConfig = Array.isArray(props) ? props.map((p) => ({
|
|
1454
|
+
...p,
|
|
1455
|
+
..._CognitoJwtVerifier.parseUserPoolId(p.userPoolId),
|
|
1456
|
+
audience: null
|
|
1457
|
+
// checked instead by validateCognitoJwtFields
|
|
1458
|
+
})) : {
|
|
1459
|
+
...props,
|
|
1460
|
+
..._CognitoJwtVerifier.parseUserPoolId(props.userPoolId),
|
|
1461
|
+
audience: null
|
|
1462
|
+
// checked instead by validateCognitoJwtFields
|
|
1463
|
+
};
|
|
1464
|
+
super(issuerConfig, jwksCache);
|
|
1465
|
+
}
|
|
1466
|
+
/**
|
|
1467
|
+
* Parse a User Pool ID, to extract the issuer and JWKS URI
|
|
1468
|
+
*
|
|
1469
|
+
* @param userPoolId The User Pool ID
|
|
1470
|
+
* @returns The issuer and JWKS URI for the User Pool
|
|
1471
|
+
*/
|
|
1472
|
+
static parseUserPoolId(userPoolId) {
|
|
1473
|
+
const match = userPoolId.match(/^(?<region>(\w+-)?\w+-\w+-\d)+_\w+$/);
|
|
1474
|
+
if (!match) {
|
|
1475
|
+
throw new ParameterValidationError(`Invalid Cognito User Pool ID: ${userPoolId}`);
|
|
1476
|
+
}
|
|
1477
|
+
const region = match.groups.region;
|
|
1478
|
+
const issuer = `https://cognito-idp.${region}.amazonaws.com/${userPoolId}`;
|
|
1479
|
+
return {
|
|
1480
|
+
issuer,
|
|
1481
|
+
jwksUri: `${issuer}/.well-known/jwks.json`
|
|
1482
|
+
};
|
|
1483
|
+
}
|
|
1484
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
1485
|
+
static create(verifyProperties, additionalProperties) {
|
|
1486
|
+
return new this(verifyProperties, additionalProperties?.jwksCache);
|
|
1487
|
+
}
|
|
1488
|
+
/**
|
|
1489
|
+
* Verify (synchronously) a JWT that is signed by Amazon Cognito.
|
|
1490
|
+
*
|
|
1491
|
+
* @param jwt The JWT, as string
|
|
1492
|
+
* @param props Verification properties
|
|
1493
|
+
* @returns The payload of the JWT––if the JWT is valid, otherwise an error is thrown
|
|
1494
|
+
*/
|
|
1495
|
+
verifySync(...[jwt, properties]) {
|
|
1496
|
+
const { decomposedJwt, jwksUri, verifyProperties } = this.getVerifyParameters(jwt, properties);
|
|
1497
|
+
this.verifyDecomposedJwtSync(decomposedJwt, jwksUri, verifyProperties);
|
|
1498
|
+
try {
|
|
1499
|
+
validateCognitoJwtFields(decomposedJwt.payload, verifyProperties);
|
|
1500
|
+
} catch (err) {
|
|
1501
|
+
if (verifyProperties.includeRawJwtInErrors && err instanceof JwtInvalidClaimError) {
|
|
1502
|
+
throw err.withRawJwt(decomposedJwt);
|
|
1503
|
+
}
|
|
1504
|
+
throw err;
|
|
1505
|
+
}
|
|
1506
|
+
return decomposedJwt.payload;
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* Verify (asynchronously) a JWT that is signed by Amazon Cognito.
|
|
1510
|
+
* This call is asynchronous, and the JWKS will be fetched from the JWKS uri,
|
|
1511
|
+
* in case it is not yet available in the cache.
|
|
1512
|
+
*
|
|
1513
|
+
* @param jwt The JWT, as string
|
|
1514
|
+
* @param props Verification properties
|
|
1515
|
+
* @returns Promise that resolves to the payload of the JWT––if the JWT is valid, otherwise the promise rejects
|
|
1516
|
+
*/
|
|
1517
|
+
async verify(...[jwt, properties]) {
|
|
1518
|
+
const { decomposedJwt, jwksUri, verifyProperties } = this.getVerifyParameters(jwt, properties);
|
|
1519
|
+
await this.verifyDecomposedJwt(decomposedJwt, jwksUri, verifyProperties);
|
|
1520
|
+
try {
|
|
1521
|
+
validateCognitoJwtFields(decomposedJwt.payload, verifyProperties);
|
|
1522
|
+
} catch (err) {
|
|
1523
|
+
if (verifyProperties.includeRawJwtInErrors && err instanceof JwtInvalidClaimError) {
|
|
1524
|
+
throw err.withRawJwt(decomposedJwt);
|
|
1525
|
+
}
|
|
1526
|
+
throw err;
|
|
1527
|
+
}
|
|
1528
|
+
return decomposedJwt.payload;
|
|
1529
|
+
}
|
|
1530
|
+
/**
|
|
1531
|
+
* This method loads a JWKS that you provide, into the JWKS cache, so that it is
|
|
1532
|
+
* available for JWT verification. Use this method to speed up the first JWT verification
|
|
1533
|
+
* (when the JWKS would otherwise have to be downloaded from the JWKS uri), or to provide the JWKS
|
|
1534
|
+
* in case the JwtVerifier does not have internet access to download the JWKS
|
|
1535
|
+
*
|
|
1536
|
+
* @param jwks The JWKS
|
|
1537
|
+
* @param userPoolId The userPoolId for which you want to cache the JWKS
|
|
1538
|
+
* Supply this field, if you instantiated the CognitoJwtVerifier with multiple userPoolIds
|
|
1539
|
+
* @returns void
|
|
1540
|
+
*/
|
|
1541
|
+
cacheJwks(...[jwks, userPoolId]) {
|
|
1542
|
+
let issuer;
|
|
1543
|
+
if (userPoolId !== void 0) {
|
|
1544
|
+
issuer = _CognitoJwtVerifier.parseUserPoolId(userPoolId).issuer;
|
|
1545
|
+
} else if (this.expectedIssuers.length > 1) {
|
|
1546
|
+
throw new ParameterValidationError("userPoolId must be provided");
|
|
1547
|
+
}
|
|
1548
|
+
const issuerConfig = this.getIssuerConfig(issuer);
|
|
1549
|
+
super.cacheJwks(jwks, issuerConfig.issuer);
|
|
1550
|
+
}
|
|
1551
|
+
};
|
|
1552
|
+
|
|
1553
|
+
// lambdacode/api/services/claims.ts
|
|
1554
|
+
var CUSTOM_PREFIX = "custom:";
|
|
1555
|
+
function customClaims(source) {
|
|
1556
|
+
const out = {};
|
|
1557
|
+
for (const [k, v] of Object.entries(source)) {
|
|
1558
|
+
if (k.startsWith(CUSTOM_PREFIX) && typeof v === "string" && v !== "") {
|
|
1559
|
+
out[k.slice(CUSTOM_PREFIX.length)] = v;
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
return out;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
// lambdacode/api/services/serviceUserRegistry.ts
|
|
1566
|
+
var import_client_dynamodb4 = require("@aws-sdk/client-dynamodb");
|
|
1567
|
+
var import_lib_dynamodb4 = require("@aws-sdk/lib-dynamodb");
|
|
1568
|
+
var ddb4 = import_lib_dynamodb4.DynamoDBDocumentClient.from(new import_client_dynamodb4.DynamoDBClient({}));
|
|
1569
|
+
var SERVICE_USERS_TABLE_NAME = process.env.SERVICE_USERS_TABLE_NAME;
|
|
1570
|
+
var SERVICE_SCOPE = "api/invoke";
|
|
1571
|
+
async function getServiceUserName(clientId) {
|
|
1572
|
+
const out = await ddb4.send(
|
|
1573
|
+
new import_lib_dynamodb4.GetCommand({ TableName: SERVICE_USERS_TABLE_NAME, Key: { clientId }, ConsistentRead: true })
|
|
1574
|
+
);
|
|
1575
|
+
return out.Item?.name || void 0;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
// lambdacode/api/services/tokenVerifier.ts
|
|
1579
|
+
var TokenVerificationError = class extends Error {
|
|
1580
|
+
constructor(reason, message2) {
|
|
1581
|
+
super(message2);
|
|
1582
|
+
this.reason = reason;
|
|
1583
|
+
this.name = "TokenVerificationError";
|
|
1584
|
+
}
|
|
1585
|
+
};
|
|
1586
|
+
var idVerifier = CognitoJwtVerifier.create({
|
|
1587
|
+
userPoolId: process.env.USER_POOL_ID,
|
|
1588
|
+
tokenUse: "id",
|
|
1589
|
+
clientId: null
|
|
1590
|
+
});
|
|
1591
|
+
var accessVerifier = CognitoJwtVerifier.create({
|
|
1592
|
+
userPoolId: process.env.USER_POOL_ID,
|
|
1593
|
+
tokenUse: "access",
|
|
1594
|
+
clientId: null
|
|
1595
|
+
});
|
|
1596
|
+
function bearerToken(header) {
|
|
1597
|
+
const value = header ?? "";
|
|
1598
|
+
return value.startsWith("Bearer ") ? value.slice(7) : value;
|
|
1599
|
+
}
|
|
1600
|
+
var message = (err) => err instanceof Error ? err.message : String(err);
|
|
1601
|
+
async function verifyBearerToken(token) {
|
|
1602
|
+
if (!token) throw new TokenVerificationError("invalid", "missing bearer token");
|
|
1603
|
+
let idFailure;
|
|
1604
|
+
let keysUnavailable = false;
|
|
1605
|
+
try {
|
|
1606
|
+
const payload2 = await idVerifier.verify(token);
|
|
1607
|
+
return {
|
|
1608
|
+
kind: "user",
|
|
1609
|
+
subject: payload2.sub,
|
|
1610
|
+
email: typeof payload2.email === "string" ? payload2.email : void 0,
|
|
1611
|
+
claims: customClaims(payload2),
|
|
1612
|
+
groups: payload2["cognito:groups"] ?? []
|
|
1613
|
+
};
|
|
1614
|
+
} catch (err) {
|
|
1615
|
+
idFailure = err;
|
|
1616
|
+
keysUnavailable = err instanceof FetchError;
|
|
1617
|
+
}
|
|
1618
|
+
let payload;
|
|
1619
|
+
try {
|
|
1620
|
+
payload = await accessVerifier.verify(token);
|
|
1621
|
+
} catch (err) {
|
|
1622
|
+
if (err instanceof FetchError || keysUnavailable) {
|
|
1623
|
+
throw new TokenVerificationError("dependency", `signing keys unavailable: ${message(keysUnavailable ? idFailure : err)}`);
|
|
1624
|
+
}
|
|
1625
|
+
throw new TokenVerificationError("invalid", `not an ID token (${message(idFailure)}) nor an access token (${message(err)})`);
|
|
1626
|
+
}
|
|
1627
|
+
const scopes = typeof payload.scope === "string" ? payload.scope.split(" ") : [];
|
|
1628
|
+
if (!scopes.includes(SERVICE_SCOPE)) throw new TokenVerificationError("invalid", `access token without the ${SERVICE_SCOPE} scope`);
|
|
1629
|
+
let name;
|
|
1630
|
+
try {
|
|
1631
|
+
name = await getServiceUserName(payload.sub);
|
|
1632
|
+
} catch (err) {
|
|
1633
|
+
throw new TokenVerificationError("dependency", `service-user registry unavailable: ${message(err)}`);
|
|
1634
|
+
}
|
|
1635
|
+
if (!name) throw new TokenVerificationError("invalid", `no registry row for service client ${payload.sub}`);
|
|
1636
|
+
return { kind: "service", subject: payload.sub, name };
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
// lambdacode/plugins/authorizer.ts
|
|
1640
|
+
var log3 = (msg, extra = {}) => console.log(JSON.stringify({ msg, ...extra }));
|
|
1641
|
+
var UNAUTHORIZED = "Unauthorized";
|
|
1642
|
+
function headerValue(event, name) {
|
|
1643
|
+
const headers = event.headers ?? {};
|
|
1644
|
+
const key = Object.keys(headers).find((k) => k.toLowerCase() === name);
|
|
1645
|
+
return key === void 0 ? void 0 : headers[key] ?? void 0;
|
|
1646
|
+
}
|
|
1647
|
+
async function resolveRoute(event, catalog) {
|
|
1648
|
+
const resource = parsePluginResourcePath(event.resource ?? "");
|
|
1649
|
+
if (!resource) return { denial: "resource-malformed" };
|
|
1650
|
+
const { pluginId } = resource;
|
|
1651
|
+
const accountNumber = event.pathParameters?.[PLUGIN_ACCOUNT_PARAM] ?? "";
|
|
1652
|
+
if (!AWS_ACCOUNT_PATTERN.test(accountNumber)) return { denial: "account-malformed", pluginId };
|
|
1653
|
+
const record = await catalog.get(pluginId, { consistent: true });
|
|
1654
|
+
const route = record?.routes.find((r) => r.method === event.httpMethod && r.resourcePath === event.resource);
|
|
1655
|
+
if (!record || !route) return { denial: "route-unknown", pluginId, accountNumber };
|
|
1656
|
+
return { pluginId, accountNumber, record, route };
|
|
1657
|
+
}
|
|
1658
|
+
function policy(effect, principalId, methodArn, context) {
|
|
1659
|
+
return {
|
|
1660
|
+
principalId,
|
|
1661
|
+
policyDocument: { Version: "2012-10-17", Statement: [{ Action: "execute-api:Invoke", Effect: effect, Resource: methodArn }] },
|
|
1662
|
+
context
|
|
1663
|
+
};
|
|
1664
|
+
}
|
|
1665
|
+
async function deny(refusal, fields, methodArn) {
|
|
1666
|
+
const { reason, principal, correlationId, route } = refusal;
|
|
1667
|
+
log3("plugin authorizer: deny", { ...fields, reason });
|
|
1668
|
+
const name = principal.kind === "user" ? principal.email : principal.name;
|
|
1669
|
+
await recordEvent({
|
|
1670
|
+
category: "auth",
|
|
1671
|
+
action: "plugin.access",
|
|
1672
|
+
outcome: "DENIED",
|
|
1673
|
+
reason,
|
|
1674
|
+
actor: { kind: principal.kind === "user" ? "user" : "service", id: principal.subject, name },
|
|
1675
|
+
subject: { kind: principal.kind === "user" ? "user" : "serviceUser", id: principal.subject, name },
|
|
1676
|
+
target: route && pluginTarget(route.pluginId, route.accountNumber, route.route.permission),
|
|
1677
|
+
targetName: route?.record.manifest.displayName,
|
|
1678
|
+
details: { correlationId, routeId: route?.route.id, requiredPermission: route?.route.permission }
|
|
1679
|
+
});
|
|
1680
|
+
return policy("Deny", principal.subject, methodArn, { reason });
|
|
1681
|
+
}
|
|
1682
|
+
async function handler(event) {
|
|
1683
|
+
const correlationId = event.requestContext?.requestId || "unknown";
|
|
1684
|
+
const where = { correlationId, method: event.httpMethod, resource: event.resource };
|
|
1685
|
+
const token = bearerToken(headerValue(event, "authorization"));
|
|
1686
|
+
if (!token) {
|
|
1687
|
+
log3("plugin authorizer: no bearer token", where);
|
|
1688
|
+
throw new Error(UNAUTHORIZED);
|
|
1689
|
+
}
|
|
1690
|
+
const [verified, resolved] = await Promise.allSettled([verifyBearerToken(token), resolveRoute(event, pluginCatalog())]);
|
|
1691
|
+
if (verified.status === "rejected") {
|
|
1692
|
+
const err = verified.reason;
|
|
1693
|
+
if (err instanceof TokenVerificationError && err.reason === "invalid") {
|
|
1694
|
+
log3("plugin authorizer: token rejected", { ...where, error: err.message });
|
|
1695
|
+
throw new Error(UNAUTHORIZED);
|
|
1696
|
+
}
|
|
1697
|
+
log3("plugin authorizer: verification failed on a dependency", { ...where, error: err.message });
|
|
1698
|
+
throw err;
|
|
1699
|
+
}
|
|
1700
|
+
if (resolved.status === "rejected") {
|
|
1701
|
+
log3("plugin authorizer: catalog unreadable", { ...where, error: resolved.reason.message });
|
|
1702
|
+
throw resolved.reason;
|
|
1703
|
+
}
|
|
1704
|
+
const principal = verified.value;
|
|
1705
|
+
const who = { subject: principal.subject, principalType: principal.kind };
|
|
1706
|
+
const route = resolved.value;
|
|
1707
|
+
if ("denial" in route) {
|
|
1708
|
+
return deny({ reason: route.denial, principal, correlationId }, { ...where, ...who, pluginId: route.pluginId, accountNumber: route.accountNumber }, event.methodArn);
|
|
1709
|
+
}
|
|
1710
|
+
const what = {
|
|
1711
|
+
...where,
|
|
1712
|
+
...who,
|
|
1713
|
+
pluginId: route.pluginId,
|
|
1714
|
+
accountNumber: route.accountNumber,
|
|
1715
|
+
routeId: route.route.id,
|
|
1716
|
+
requiredPermission: route.route.permission,
|
|
1717
|
+
revision: route.record.revision
|
|
1718
|
+
};
|
|
1719
|
+
const decision = await checkPluginPermission(principal.subject, route.pluginId, route.accountNumber, route.route.permission, {
|
|
1720
|
+
record: route.record,
|
|
1721
|
+
consistent: true
|
|
1722
|
+
});
|
|
1723
|
+
if (!decision.allowed) return deny({ reason: decision.reason, principal, correlationId, route }, what, event.methodArn);
|
|
1724
|
+
const context = {
|
|
1725
|
+
pluginId: route.pluginId,
|
|
1726
|
+
pluginRevision: route.record.revision,
|
|
1727
|
+
routeId: route.route.id,
|
|
1728
|
+
accountNumber: route.accountNumber,
|
|
1729
|
+
requiredPermission: route.route.permission,
|
|
1730
|
+
subject: principal.subject,
|
|
1731
|
+
principalType: principal.kind,
|
|
1732
|
+
correlationId
|
|
1733
|
+
};
|
|
1734
|
+
log3("plugin authorizer: allow", what);
|
|
1735
|
+
return policy("Allow", principal.subject, event.methodArn, { ...context });
|
|
1736
|
+
}
|
|
1737
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1738
|
+
0 && (module.exports = {
|
|
1739
|
+
handler
|
|
1740
|
+
});
|