@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,1604 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __esm = (fn, res) => function __init() {
|
|
9
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
|
+
};
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
31
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
|
|
33
|
+
// ../infra-client-plugin-sdk/src/contracts/manifest.ts
|
|
34
|
+
var PLUGIN_PERMISSIONS, PLUGIN_ID_PATTERN, AWS_ACCOUNT_PATTERN;
|
|
35
|
+
var init_manifest = __esm({
|
|
36
|
+
"../infra-client-plugin-sdk/src/contracts/manifest.ts"() {
|
|
37
|
+
"use strict";
|
|
38
|
+
PLUGIN_PERMISSIONS = ["user", "admin"];
|
|
39
|
+
PLUGIN_ID_PATTERN = /^[a-z][a-z0-9-]{0,63}$/;
|
|
40
|
+
AWS_ACCOUNT_PATTERN = /^\d{12}$/;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// ../infra-client-plugin-sdk/src/contracts/validate.ts
|
|
45
|
+
var init_validate = __esm({
|
|
46
|
+
"../infra-client-plugin-sdk/src/contracts/validate.ts"() {
|
|
47
|
+
"use strict";
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// ../infra-client-plugin-sdk/src/contracts/canonical.ts
|
|
52
|
+
var init_canonical = __esm({
|
|
53
|
+
"../infra-client-plugin-sdk/src/contracts/canonical.ts"() {
|
|
54
|
+
"use strict";
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// ../infra-client-plugin-sdk/src/contracts/paths.ts
|
|
59
|
+
var init_paths = __esm({
|
|
60
|
+
"../infra-client-plugin-sdk/src/contracts/paths.ts"() {
|
|
61
|
+
"use strict";
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// ../infra-client-plugin-sdk/src/contracts/access.ts
|
|
66
|
+
function parsePluginTargetKey(key) {
|
|
67
|
+
if (!key.startsWith(PLUGIN_TARGET_PREFIX)) return null;
|
|
68
|
+
const parts = key.slice(PLUGIN_TARGET_PREFIX.length).split("#");
|
|
69
|
+
if (parts.length !== 3) return null;
|
|
70
|
+
const [pluginId, accountNumber, permission] = parts;
|
|
71
|
+
if (!PLUGIN_ID_PATTERN.test(pluginId) || !AWS_ACCOUNT_PATTERN.test(accountNumber)) return null;
|
|
72
|
+
if (!PLUGIN_PERMISSIONS.includes(permission)) return null;
|
|
73
|
+
return { pluginId, accountNumber, permission };
|
|
74
|
+
}
|
|
75
|
+
var PLUGIN_TARGET_PREFIX;
|
|
76
|
+
var init_access = __esm({
|
|
77
|
+
"../infra-client-plugin-sdk/src/contracts/access.ts"() {
|
|
78
|
+
"use strict";
|
|
79
|
+
init_manifest();
|
|
80
|
+
PLUGIN_TARGET_PREFIX = "plugin#";
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// ../infra-client-plugin-sdk/src/contracts/catalog.ts
|
|
85
|
+
var init_catalog = __esm({
|
|
86
|
+
"../infra-client-plugin-sdk/src/contracts/catalog.ts"() {
|
|
87
|
+
"use strict";
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// ../infra-client-plugin-sdk/src/contracts/discovery.ts
|
|
92
|
+
var init_discovery = __esm({
|
|
93
|
+
"../infra-client-plugin-sdk/src/contracts/discovery.ts"() {
|
|
94
|
+
"use strict";
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// ../infra-client-plugin-sdk/src/contracts/authorizer.ts
|
|
99
|
+
var init_authorizer = __esm({
|
|
100
|
+
"../infra-client-plugin-sdk/src/contracts/authorizer.ts"() {
|
|
101
|
+
"use strict";
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// ../infra-client-plugin-sdk/src/backend/context.ts
|
|
106
|
+
var init_context = __esm({
|
|
107
|
+
"../infra-client-plugin-sdk/src/backend/context.ts"() {
|
|
108
|
+
"use strict";
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
// ../infra-client-plugin-sdk/src/backend/index.ts
|
|
113
|
+
var init_backend = __esm({
|
|
114
|
+
"../infra-client-plugin-sdk/src/backend/index.ts"() {
|
|
115
|
+
"use strict";
|
|
116
|
+
init_manifest();
|
|
117
|
+
init_validate();
|
|
118
|
+
init_canonical();
|
|
119
|
+
init_paths();
|
|
120
|
+
init_access();
|
|
121
|
+
init_catalog();
|
|
122
|
+
init_discovery();
|
|
123
|
+
init_authorizer();
|
|
124
|
+
init_context();
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
// lambdacode/api/services/access.ts
|
|
129
|
+
function parsePrincipal(p) {
|
|
130
|
+
if (p.startsWith("user#")) return { kind: "user", userId: p.slice(5) };
|
|
131
|
+
if (p.startsWith("group#")) return { kind: "group", groupId: p.slice(6) };
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
function parseTarget(t) {
|
|
135
|
+
if (t.startsWith("role#")) {
|
|
136
|
+
const rest = t.slice(5);
|
|
137
|
+
const hash = rest.indexOf("#");
|
|
138
|
+
if (hash < 0) return null;
|
|
139
|
+
return { kind: "role", accountNumber: rest.slice(0, hash), roleName: rest.slice(hash + 1) };
|
|
140
|
+
}
|
|
141
|
+
if (t.startsWith("resource#")) return { kind: "resource", resourceId: t.slice(9) };
|
|
142
|
+
if (t.startsWith("share#")) return { kind: "share", shareId: t.slice(6) };
|
|
143
|
+
if (t.startsWith("plugin#")) {
|
|
144
|
+
const p = parsePluginTargetKey(t);
|
|
145
|
+
return p ? { kind: "plugin", ...p } : null;
|
|
146
|
+
}
|
|
147
|
+
if (t.startsWith("member#")) return { kind: "member", groupId: t.slice(7) };
|
|
148
|
+
if (t.startsWith("pref#role#")) {
|
|
149
|
+
const rest = t.slice(10);
|
|
150
|
+
const hash = rest.indexOf("#");
|
|
151
|
+
if (hash < 0) return null;
|
|
152
|
+
return { kind: "pref", accountNumber: rest.slice(0, hash), roleName: rest.slice(hash + 1) };
|
|
153
|
+
}
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
function isExpired(row, now = Date.now()) {
|
|
157
|
+
return Boolean(row.expiresAt) && !(Date.parse(row.expiresAt) > now);
|
|
158
|
+
}
|
|
159
|
+
async function scanAll(opts = {}) {
|
|
160
|
+
const rows = [];
|
|
161
|
+
const prefixes = opts.targetPrefixes ?? [];
|
|
162
|
+
const filter = prefixes.length ? {
|
|
163
|
+
FilterExpression: prefixes.map((_, i) => `begins_with(#t, :p${i})`).join(" OR "),
|
|
164
|
+
ExpressionAttributeNames: { "#t": "target" },
|
|
165
|
+
ExpressionAttributeValues: Object.fromEntries(prefixes.map((p, i) => [`:p${i}`, p]))
|
|
166
|
+
} : {};
|
|
167
|
+
let ExclusiveStartKey;
|
|
168
|
+
do {
|
|
169
|
+
const page = await ddb.send(
|
|
170
|
+
new import_lib_dynamodb.ScanCommand({ TableName: ACCESS_TABLE_NAME, ExclusiveStartKey, ...filter })
|
|
171
|
+
);
|
|
172
|
+
rows.push(...page?.Items ?? []);
|
|
173
|
+
ExclusiveStartKey = page?.LastEvaluatedKey;
|
|
174
|
+
} while (ExclusiveStartKey);
|
|
175
|
+
return rows;
|
|
176
|
+
}
|
|
177
|
+
function entryOf(target, direct, groups, now) {
|
|
178
|
+
const d = direct ? { grantedBy: direct.grantedBy, grantedAt: direct.grantedAt, expiresAt: direct.expiresAt } : void 0;
|
|
179
|
+
const directActive = Boolean(direct && !isExpired(direct, now));
|
|
180
|
+
const active = directActive || groups.length > 0;
|
|
181
|
+
return {
|
|
182
|
+
target,
|
|
183
|
+
direct: d,
|
|
184
|
+
groups,
|
|
185
|
+
active,
|
|
186
|
+
expiresAt: groups.length === 0 && directActive ? direct?.expiresAt : void 0
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function buildSnapshot(rows, now = Date.now()) {
|
|
190
|
+
const groupTargets = /* @__PURE__ */ new Map();
|
|
191
|
+
const groupMembers = /* @__PURE__ */ new Map();
|
|
192
|
+
const directRows = /* @__PURE__ */ new Map();
|
|
193
|
+
const userRows = [];
|
|
194
|
+
const presence = /* @__PURE__ */ new Map();
|
|
195
|
+
for (const r of rows) {
|
|
196
|
+
const p = parsePrincipal(r.principal);
|
|
197
|
+
if (!p) continue;
|
|
198
|
+
if (p.kind === "user" && r.target === PRESENCE_TARGET) {
|
|
199
|
+
if (typeof r.lastSeenAt === "string") presence.set(p.userId, r.lastSeenAt);
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
if (p.kind === "group") {
|
|
203
|
+
if (!isGrantTarget(r.target) || isExpired(r, now)) continue;
|
|
204
|
+
const list = groupTargets.get(p.groupId) ?? [];
|
|
205
|
+
list.push(r.target);
|
|
206
|
+
groupTargets.set(p.groupId, list);
|
|
207
|
+
} else if (r.target.startsWith("member#")) {
|
|
208
|
+
const g = r.target.slice("member#".length);
|
|
209
|
+
const list = groupMembers.get(g) ?? [];
|
|
210
|
+
list.push(p.userId);
|
|
211
|
+
groupMembers.set(g, list);
|
|
212
|
+
} else if (isGrantTarget(r.target)) {
|
|
213
|
+
const m = directRows.get(p.userId) ?? /* @__PURE__ */ new Map();
|
|
214
|
+
m.set(r.target, r);
|
|
215
|
+
directRows.set(p.userId, m);
|
|
216
|
+
userRows.push(r);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
const users = /* @__PURE__ */ new Map();
|
|
220
|
+
const groupsByUserTarget = /* @__PURE__ */ new Map();
|
|
221
|
+
for (const [g, members] of groupMembers) {
|
|
222
|
+
for (const u of members) {
|
|
223
|
+
const m = groupsByUserTarget.get(u) ?? /* @__PURE__ */ new Map();
|
|
224
|
+
for (const t of groupTargets.get(g) ?? []) {
|
|
225
|
+
const list = m.get(t) ?? [];
|
|
226
|
+
list.push(g);
|
|
227
|
+
m.set(t, list);
|
|
228
|
+
}
|
|
229
|
+
groupsByUserTarget.set(u, m);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const userIds = /* @__PURE__ */ new Set([...directRows.keys(), ...groupsByUserTarget.keys()]);
|
|
233
|
+
for (const u of userIds) {
|
|
234
|
+
const direct = directRows.get(u) ?? /* @__PURE__ */ new Map();
|
|
235
|
+
const viaGroups = groupsByUserTarget.get(u) ?? /* @__PURE__ */ new Map();
|
|
236
|
+
const targets = /* @__PURE__ */ new Set([...direct.keys(), ...viaGroups.keys()]);
|
|
237
|
+
const m = /* @__PURE__ */ new Map();
|
|
238
|
+
for (const t of targets) m.set(t, entryOf(t, direct.get(t), viaGroups.get(t) ?? [], now));
|
|
239
|
+
users.set(u, m);
|
|
240
|
+
}
|
|
241
|
+
return { users, groupTargets, groupMembers, userRows, presence };
|
|
242
|
+
}
|
|
243
|
+
var import_client_dynamodb, import_lib_dynamodb, ddb, ACCESS_TABLE_NAME, SHARE_DEF_PRINCIPAL, PRESENCE_TARGET, isGrantTarget, isShareDefRow;
|
|
244
|
+
var init_access2 = __esm({
|
|
245
|
+
"lambdacode/api/services/access.ts"() {
|
|
246
|
+
"use strict";
|
|
247
|
+
import_client_dynamodb = require("@aws-sdk/client-dynamodb");
|
|
248
|
+
init_backend();
|
|
249
|
+
import_lib_dynamodb = require("@aws-sdk/lib-dynamodb");
|
|
250
|
+
ddb = import_lib_dynamodb.DynamoDBDocumentClient.from(new import_client_dynamodb.DynamoDBClient({}));
|
|
251
|
+
ACCESS_TABLE_NAME = process.env.ACCESS_TABLE_NAME;
|
|
252
|
+
SHARE_DEF_PRINCIPAL = "sharedef";
|
|
253
|
+
PRESENCE_TARGET = "pref#presence";
|
|
254
|
+
isGrantTarget = (t) => t.startsWith("role#") || t.startsWith("resource#") || t.startsWith("share#") || t.startsWith("plugin#");
|
|
255
|
+
isShareDefRow = (r) => r.principal === SHARE_DEF_PRINCIPAL && typeof r.shareId === "string" && typeof r.ownerSub === "string" && typeof r.port === "number" && typeof r.siteId === "string" && typeof r.expiresAt === "string";
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
// lambdacode/api/services/actorContext.ts
|
|
260
|
+
function runAsActor(actor, fn) {
|
|
261
|
+
return store.run(actor, fn);
|
|
262
|
+
}
|
|
263
|
+
function currentActor() {
|
|
264
|
+
return store.getStore();
|
|
265
|
+
}
|
|
266
|
+
var import_async_hooks, store, systemActor;
|
|
267
|
+
var init_actorContext = __esm({
|
|
268
|
+
"lambdacode/api/services/actorContext.ts"() {
|
|
269
|
+
"use strict";
|
|
270
|
+
import_async_hooks = require("async_hooks");
|
|
271
|
+
store = new import_async_hooks.AsyncLocalStorage();
|
|
272
|
+
systemActor = (job, name) => ({
|
|
273
|
+
kind: "system",
|
|
274
|
+
id: `system:${job}`,
|
|
275
|
+
name: name ?? job
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
// lambdacode/api/services/httpErrors.ts
|
|
281
|
+
var init_httpErrors = __esm({
|
|
282
|
+
"lambdacode/api/services/httpErrors.ts"() {
|
|
283
|
+
"use strict";
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
// lambdacode/api/services/pluginCatalog.ts
|
|
288
|
+
var import_client_dynamodb2, import_lib_dynamodb2, ddb2;
|
|
289
|
+
var init_pluginCatalog = __esm({
|
|
290
|
+
"lambdacode/api/services/pluginCatalog.ts"() {
|
|
291
|
+
"use strict";
|
|
292
|
+
import_client_dynamodb2 = require("@aws-sdk/client-dynamodb");
|
|
293
|
+
import_lib_dynamodb2 = require("@aws-sdk/lib-dynamodb");
|
|
294
|
+
ddb2 = import_lib_dynamodb2.DynamoDBDocumentClient.from(new import_client_dynamodb2.DynamoDBClient({}));
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
// lambdacode/api/services/pluginAccess.ts
|
|
299
|
+
var init_pluginAccess = __esm({
|
|
300
|
+
"lambdacode/api/services/pluginAccess.ts"() {
|
|
301
|
+
"use strict";
|
|
302
|
+
init_access2();
|
|
303
|
+
init_pluginCatalog();
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
// lambdacode/api/services/revocationsService.ts
|
|
308
|
+
var import_client_dynamodb3, import_lib_dynamodb3, ddb3, REVOCATIONS_TABLE_NAME;
|
|
309
|
+
var init_revocationsService = __esm({
|
|
310
|
+
"lambdacode/api/services/revocationsService.ts"() {
|
|
311
|
+
"use strict";
|
|
312
|
+
import_client_dynamodb3 = require("@aws-sdk/client-dynamodb");
|
|
313
|
+
import_lib_dynamodb3 = require("@aws-sdk/lib-dynamodb");
|
|
314
|
+
ddb3 = import_lib_dynamodb3.DynamoDBDocumentClient.from(new import_client_dynamodb3.DynamoDBClient({}));
|
|
315
|
+
REVOCATIONS_TABLE_NAME = process.env.REVOCATIONS_TABLE_NAME;
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
// lambdacode/api/services/auditService.ts
|
|
320
|
+
function retentionDays() {
|
|
321
|
+
const n = Number(process.env.AUDIT_RETENTION_DAYS);
|
|
322
|
+
return Number.isInteger(n) && n > 0 ? n : DEFAULT_RETENTION_DAYS;
|
|
323
|
+
}
|
|
324
|
+
function tableOr() {
|
|
325
|
+
const table = tableName();
|
|
326
|
+
if (table) return table;
|
|
327
|
+
if (!warnedNoTable) {
|
|
328
|
+
warnedNoTable = true;
|
|
329
|
+
log("WARN: AUDIT_TABLE_NAME unset \u2014 activity is not recorded");
|
|
330
|
+
}
|
|
331
|
+
return void 0;
|
|
332
|
+
}
|
|
333
|
+
function compact(value) {
|
|
334
|
+
if (Array.isArray(value)) return value.map(compact);
|
|
335
|
+
if (value && typeof value === "object" && !(value instanceof Set)) {
|
|
336
|
+
const out = {};
|
|
337
|
+
for (const [k, v] of Object.entries(value)) {
|
|
338
|
+
if (v !== void 0) out[k] = compact(v);
|
|
339
|
+
}
|
|
340
|
+
return out;
|
|
341
|
+
}
|
|
342
|
+
return value;
|
|
343
|
+
}
|
|
344
|
+
function toRow(input, now) {
|
|
345
|
+
const bound = input.actor ?? currentActor();
|
|
346
|
+
if (!bound) log("ERROR: activity row without a bound actor (missing runAsActor?)", { action: input.action, target: input.target });
|
|
347
|
+
const actor = bound ?? UNKNOWN_ACTOR;
|
|
348
|
+
const details = input.details ? { ...input.details } : void 0;
|
|
349
|
+
if (details?.note !== void 0) details.note = String(details.note).slice(0, NOTE_MAX);
|
|
350
|
+
if (details?.affected && details.affected.length > AFFECTED_CAP) {
|
|
351
|
+
details.affectedCount = details.affected.length;
|
|
352
|
+
details.affected = details.affected.slice(0, AFFECTED_CAP);
|
|
353
|
+
}
|
|
354
|
+
if (details?.unchanged && details.unchanged.length > AFFECTED_CAP) {
|
|
355
|
+
details.unchangedCount = details.unchanged.length;
|
|
356
|
+
details.unchanged = details.unchanged.slice(0, AFFECTED_CAP);
|
|
357
|
+
}
|
|
358
|
+
const accountNumber = input.accountNumber ?? accountOf(input.target);
|
|
359
|
+
return compact({
|
|
360
|
+
...input,
|
|
361
|
+
eventId: (0, import_crypto.randomUUID)(),
|
|
362
|
+
outcome: input.outcome ?? "OK",
|
|
363
|
+
reason: input.reason === void 0 ? void 0 : String(input.reason).slice(0, REASON_MAX),
|
|
364
|
+
actor: { kind: actor.kind, id: actor.id, name: actor.name, claims: actor.claims && Object.keys(actor.claims).length ? actor.claims : void 0 },
|
|
365
|
+
accountNumber,
|
|
366
|
+
details,
|
|
367
|
+
at: now.toISOString(),
|
|
368
|
+
day: now.toISOString().slice(0, 10),
|
|
369
|
+
userId: input.subject?.id,
|
|
370
|
+
actorId: SESSION_ACTIONS.has(input.action) && input.subject?.kind === "user" ? input.subject.id : actor.id,
|
|
371
|
+
expiresAt: Math.floor(now.getTime() / 1e3) + retentionDays() * 24 * 60 * 60
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
function accountOf(target) {
|
|
375
|
+
if (!target) return void 0;
|
|
376
|
+
const p = parseTarget(target);
|
|
377
|
+
if (p?.kind === "role" || p?.kind === "plugin") return p.accountNumber;
|
|
378
|
+
if (target.startsWith("account#")) return target.slice("account#".length);
|
|
379
|
+
return void 0;
|
|
380
|
+
}
|
|
381
|
+
async function recordEvents(inputs) {
|
|
382
|
+
if (!inputs.length) return;
|
|
383
|
+
const table = tableOr();
|
|
384
|
+
if (!table) return;
|
|
385
|
+
const start = Date.now();
|
|
386
|
+
const rows = inputs.map((input, i) => toRow(input, new Date(start + i)));
|
|
387
|
+
for (let i = 0; i < rows.length; i += 25) {
|
|
388
|
+
let requests = rows.slice(i, i + 25).map((Item) => ({ PutRequest: { Item } }));
|
|
389
|
+
try {
|
|
390
|
+
for (let attempt = 0; attempt < 3 && requests.length; attempt++) {
|
|
391
|
+
const res = await ddb4.send(new import_lib_dynamodb4.BatchWriteCommand({ RequestItems: { [table]: requests } }));
|
|
392
|
+
requests = res.UnprocessedItems?.[table] ?? [];
|
|
393
|
+
}
|
|
394
|
+
if (requests.length) log("ERROR: activity batch left unprocessed rows", { count: requests.length });
|
|
395
|
+
} catch (err) {
|
|
396
|
+
log("ERROR: activity batch write failed (mutation unaffected)", { count: requests.length, error: err.message });
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
log("activity batch recorded", { count: rows.length, actions: [...new Set(rows.map((r) => r.action))] });
|
|
400
|
+
}
|
|
401
|
+
var import_crypto, import_client_dynamodb4, import_lib_dynamodb4, ddb4, tableName, log, DEFAULT_RETENTION_DAYS, REASON_MAX, NOTE_MAX, AFFECTED_CAP, DAY_MS, newBatchId, UNKNOWN_ACTOR, warnedNoTable, SESSION_ACTIONS;
|
|
402
|
+
var init_auditService = __esm({
|
|
403
|
+
"lambdacode/api/services/auditService.ts"() {
|
|
404
|
+
"use strict";
|
|
405
|
+
import_crypto = require("crypto");
|
|
406
|
+
import_client_dynamodb4 = require("@aws-sdk/client-dynamodb");
|
|
407
|
+
import_lib_dynamodb4 = require("@aws-sdk/lib-dynamodb");
|
|
408
|
+
init_actorContext();
|
|
409
|
+
init_access2();
|
|
410
|
+
ddb4 = import_lib_dynamodb4.DynamoDBDocumentClient.from(new import_client_dynamodb4.DynamoDBClient({}));
|
|
411
|
+
tableName = () => process.env.AUDIT_TABLE_NAME ?? "";
|
|
412
|
+
log = (msg, extra = {}) => console.log(JSON.stringify({ msg, ...extra }));
|
|
413
|
+
DEFAULT_RETENTION_DAYS = 400;
|
|
414
|
+
REASON_MAX = 300;
|
|
415
|
+
NOTE_MAX = 500;
|
|
416
|
+
AFFECTED_CAP = 50;
|
|
417
|
+
DAY_MS = 24 * 60 * 60 * 1e3;
|
|
418
|
+
newBatchId = () => (0, import_crypto.randomUUID)();
|
|
419
|
+
UNKNOWN_ACTOR = { kind: "system", id: "system:unknown" };
|
|
420
|
+
warnedNoTable = false;
|
|
421
|
+
SESSION_ACTIONS = /* @__PURE__ */ new Set(["vpn.connect", "vpn.disconnect"]);
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
// lambdacode/api/services/accessNotices.ts
|
|
426
|
+
var init_accessNotices = __esm({
|
|
427
|
+
"lambdacode/api/services/accessNotices.ts"() {
|
|
428
|
+
"use strict";
|
|
429
|
+
init_access2();
|
|
430
|
+
init_pluginAccess();
|
|
431
|
+
init_revocationsService();
|
|
432
|
+
init_auditService();
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
// lambdacode/api/services/grantsService.ts
|
|
437
|
+
var import_client_dynamodb5, import_lib_dynamodb5, ddb5, ROLES_TABLE_NAME, EXPIRING_WINDOW_MS;
|
|
438
|
+
var init_grantsService = __esm({
|
|
439
|
+
"lambdacode/api/services/grantsService.ts"() {
|
|
440
|
+
"use strict";
|
|
441
|
+
import_client_dynamodb5 = require("@aws-sdk/client-dynamodb");
|
|
442
|
+
import_lib_dynamodb5 = require("@aws-sdk/lib-dynamodb");
|
|
443
|
+
init_httpErrors();
|
|
444
|
+
init_access2();
|
|
445
|
+
init_accessNotices();
|
|
446
|
+
init_auditService();
|
|
447
|
+
ddb5 = import_lib_dynamodb5.DynamoDBDocumentClient.from(new import_client_dynamodb5.DynamoDBClient({}));
|
|
448
|
+
ROLES_TABLE_NAME = process.env.ROLES_TABLE_NAME;
|
|
449
|
+
EXPIRING_WINDOW_MS = 24 * 60 * 60 * 1e3;
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
// lambdacode/api/services/resourceGrantsService.ts
|
|
454
|
+
var import_client_dynamodb6, import_lib_dynamodb6, ddb6, RESOURCES_TABLE_NAME;
|
|
455
|
+
var init_resourceGrantsService = __esm({
|
|
456
|
+
"lambdacode/api/services/resourceGrantsService.ts"() {
|
|
457
|
+
"use strict";
|
|
458
|
+
import_client_dynamodb6 = require("@aws-sdk/client-dynamodb");
|
|
459
|
+
import_lib_dynamodb6 = require("@aws-sdk/lib-dynamodb");
|
|
460
|
+
init_httpErrors();
|
|
461
|
+
init_access2();
|
|
462
|
+
init_accessNotices();
|
|
463
|
+
init_auditService();
|
|
464
|
+
init_grantsService();
|
|
465
|
+
init_resourcesService();
|
|
466
|
+
ddb6 = import_lib_dynamodb6.DynamoDBDocumentClient.from(new import_client_dynamodb6.DynamoDBClient({}));
|
|
467
|
+
RESOURCES_TABLE_NAME = process.env.RESOURCES_TABLE_NAME;
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
// lambdacode/api/services/accountOrder.ts
|
|
472
|
+
var init_accountOrder = __esm({
|
|
473
|
+
"lambdacode/api/services/accountOrder.ts"() {
|
|
474
|
+
"use strict";
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
// lambdacode/api/services/dimensions.ts
|
|
479
|
+
var init_dimensions = __esm({
|
|
480
|
+
"lambdacode/api/services/dimensions.ts"() {
|
|
481
|
+
"use strict";
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
// lambdacode/api/services/catalogIndex.ts
|
|
486
|
+
var import_client_dynamodb7, import_lib_dynamodb7, ddb7, ACCOUNTS_TABLE_NAME, ROLES_TABLE_NAME2, GROUPS_TABLE_NAME, RESOURCES_TABLE_NAME2;
|
|
487
|
+
var init_catalogIndex = __esm({
|
|
488
|
+
"lambdacode/api/services/catalogIndex.ts"() {
|
|
489
|
+
"use strict";
|
|
490
|
+
import_client_dynamodb7 = require("@aws-sdk/client-dynamodb");
|
|
491
|
+
import_lib_dynamodb7 = require("@aws-sdk/lib-dynamodb");
|
|
492
|
+
init_accountOrder();
|
|
493
|
+
init_dimensions();
|
|
494
|
+
ddb7 = import_lib_dynamodb7.DynamoDBDocumentClient.from(new import_client_dynamodb7.DynamoDBClient({}));
|
|
495
|
+
ACCOUNTS_TABLE_NAME = process.env.ACCOUNTS_TABLE_NAME;
|
|
496
|
+
ROLES_TABLE_NAME2 = process.env.ROLES_TABLE_NAME;
|
|
497
|
+
GROUPS_TABLE_NAME = process.env.GROUPS_TABLE_NAME;
|
|
498
|
+
RESOURCES_TABLE_NAME2 = process.env.RESOURCES_TABLE_NAME;
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
// lambdacode/api/services/groupsService.ts
|
|
503
|
+
var import_client_dynamodb8, import_lib_dynamodb8, ddb8, GROUPS_TABLE_NAME2, ROLES_TABLE_NAME3, RESOURCES_TABLE_NAME3;
|
|
504
|
+
var init_groupsService = __esm({
|
|
505
|
+
"lambdacode/api/services/groupsService.ts"() {
|
|
506
|
+
"use strict";
|
|
507
|
+
import_client_dynamodb8 = require("@aws-sdk/client-dynamodb");
|
|
508
|
+
import_lib_dynamodb8 = require("@aws-sdk/lib-dynamodb");
|
|
509
|
+
init_httpErrors();
|
|
510
|
+
init_access2();
|
|
511
|
+
init_accessNotices();
|
|
512
|
+
init_auditService();
|
|
513
|
+
init_catalogIndex();
|
|
514
|
+
init_resourcesService();
|
|
515
|
+
ddb8 = import_lib_dynamodb8.DynamoDBDocumentClient.from(new import_client_dynamodb8.DynamoDBClient({}));
|
|
516
|
+
GROUPS_TABLE_NAME2 = process.env.GROUPS_TABLE_NAME;
|
|
517
|
+
ROLES_TABLE_NAME3 = process.env.ROLES_TABLE_NAME;
|
|
518
|
+
RESOURCES_TABLE_NAME3 = process.env.RESOURCES_TABLE_NAME;
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
|
|
522
|
+
// lambdacode/api/services/resourcesService.ts
|
|
523
|
+
var import_client_dynamodb9, import_lib_dynamodb9, ddb9, RESOURCES_TABLE_NAME4, ACCOUNTS_TABLE_NAME2, isSentinelRow;
|
|
524
|
+
var init_resourcesService = __esm({
|
|
525
|
+
"lambdacode/api/services/resourcesService.ts"() {
|
|
526
|
+
"use strict";
|
|
527
|
+
import_client_dynamodb9 = require("@aws-sdk/client-dynamodb");
|
|
528
|
+
import_lib_dynamodb9 = require("@aws-sdk/lib-dynamodb");
|
|
529
|
+
init_httpErrors();
|
|
530
|
+
init_resourceGrantsService();
|
|
531
|
+
init_groupsService();
|
|
532
|
+
init_access2();
|
|
533
|
+
init_auditService();
|
|
534
|
+
init_accessNotices();
|
|
535
|
+
ddb9 = import_lib_dynamodb9.DynamoDBDocumentClient.from(new import_client_dynamodb9.DynamoDBClient({}));
|
|
536
|
+
RESOURCES_TABLE_NAME4 = process.env.RESOURCES_TABLE_NAME;
|
|
537
|
+
ACCOUNTS_TABLE_NAME2 = process.env.ACCOUNTS_TABLE_NAME;
|
|
538
|
+
isSentinelRow = (resourceId) => String(resourceId).startsWith("__");
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
// lambdacode/network/acl-reconciler.ts
|
|
543
|
+
var acl_reconciler_exports = {};
|
|
544
|
+
__export(acl_reconciler_exports, {
|
|
545
|
+
RECONCILER_STATUS_KEY: () => RECONCILER_STATUS_KEY,
|
|
546
|
+
cidrContains: () => cidrContains,
|
|
547
|
+
handler: () => handler,
|
|
548
|
+
isPrivateCidr: () => isPrivateCidr
|
|
549
|
+
});
|
|
550
|
+
module.exports = __toCommonJS(acl_reconciler_exports);
|
|
551
|
+
var import_client_dynamodb10 = require("@aws-sdk/client-dynamodb");
|
|
552
|
+
|
|
553
|
+
// lambdacode/network/headscale-http.ts
|
|
554
|
+
var https = __toESM(require("node:https"));
|
|
555
|
+
var import_client_ssm = require("@aws-sdk/client-ssm");
|
|
556
|
+
var ssm = new import_client_ssm.SSMClient({});
|
|
557
|
+
var sources = /* @__PURE__ */ new Map();
|
|
558
|
+
var cached = /* @__PURE__ */ new Map();
|
|
559
|
+
var CERT_TTL_MS = 6e4;
|
|
560
|
+
function trustHeadscale(url, certParam) {
|
|
561
|
+
if (certParam) sources.set(new URL(url).origin, certParam);
|
|
562
|
+
}
|
|
563
|
+
async function certificateFor(origin, fresh) {
|
|
564
|
+
const param = sources.get(origin);
|
|
565
|
+
if (!param) throw new Error(`no certificate source registered for ${origin}`);
|
|
566
|
+
const hit = cached.get(param);
|
|
567
|
+
if (!fresh && hit && Date.now() - hit.at < CERT_TTL_MS) return hit.pem;
|
|
568
|
+
const out = await ssm.send(new import_client_ssm.GetParameterCommand({ Name: param }));
|
|
569
|
+
const pem = out.Parameter?.Value;
|
|
570
|
+
if (!pem) throw new Error(`certificate parameter ${param} is empty`);
|
|
571
|
+
cached.set(param, { pem, at: Date.now() });
|
|
572
|
+
return pem;
|
|
573
|
+
}
|
|
574
|
+
var TLS_FAILURES = /* @__PURE__ */ new Set([
|
|
575
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
576
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
577
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
578
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
579
|
+
"CERT_SIGNATURE_FAILURE",
|
|
580
|
+
"CERT_HAS_EXPIRED",
|
|
581
|
+
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
582
|
+
]);
|
|
583
|
+
var isTlsFailure = (err) => TLS_FAILURES.has(String(err?.code));
|
|
584
|
+
function request2(url, init, ca) {
|
|
585
|
+
return new Promise((resolve, reject) => {
|
|
586
|
+
const headers = {};
|
|
587
|
+
new Headers(init.headers ?? {}).forEach((v, k) => headers[k] = v);
|
|
588
|
+
const req = https.request(
|
|
589
|
+
url,
|
|
590
|
+
{ method: init.method ?? "GET", headers, ca: [ca] },
|
|
591
|
+
(res) => {
|
|
592
|
+
const chunks = [];
|
|
593
|
+
res.on("data", (c) => chunks.push(c));
|
|
594
|
+
res.on("error", reject);
|
|
595
|
+
res.on(
|
|
596
|
+
"end",
|
|
597
|
+
() => resolve(
|
|
598
|
+
new Response(Buffer.concat(chunks), {
|
|
599
|
+
status: res.statusCode ?? 0,
|
|
600
|
+
headers: Object.entries(res.headers).flatMap(
|
|
601
|
+
([k, v]) => v === void 0 ? [] : [v].flat().map((x) => [k, x])
|
|
602
|
+
)
|
|
603
|
+
})
|
|
604
|
+
)
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
);
|
|
608
|
+
req.on("error", reject);
|
|
609
|
+
const signal = init.signal;
|
|
610
|
+
if (signal) {
|
|
611
|
+
const abort = () => req.destroy(
|
|
612
|
+
signal.reason instanceof Error ? signal.reason : new Error("aborted")
|
|
613
|
+
);
|
|
614
|
+
if (signal.aborted) abort();
|
|
615
|
+
else signal.addEventListener("abort", abort, { once: true });
|
|
616
|
+
}
|
|
617
|
+
if (init.body !== void 0 && init.body !== null)
|
|
618
|
+
req.write(init.body);
|
|
619
|
+
req.end();
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
async function headscaleFetch(url, init = {}) {
|
|
623
|
+
if (!url.startsWith("https:")) return fetch(url, init);
|
|
624
|
+
const origin = new URL(url).origin;
|
|
625
|
+
try {
|
|
626
|
+
return await request2(url, init, await certificateFor(origin, false));
|
|
627
|
+
} catch (err) {
|
|
628
|
+
if (!isTlsFailure(err)) throw err;
|
|
629
|
+
return request2(url, init, await certificateFor(origin, true));
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// lambdacode/network/acl-reconciler.ts
|
|
634
|
+
var import_lib_dynamodb10 = require("@aws-sdk/lib-dynamodb");
|
|
635
|
+
var import_client_servicediscovery = require("@aws-sdk/client-servicediscovery");
|
|
636
|
+
var import_client_lambda2 = require("@aws-sdk/client-lambda");
|
|
637
|
+
var import_promises = require("node:dns/promises");
|
|
638
|
+
init_access2();
|
|
639
|
+
|
|
640
|
+
// lambdacode/network/naming.ts
|
|
641
|
+
var headscaleUserName = (cognitoSub) => `u-${cognitoSub}`;
|
|
642
|
+
var DEFAULT_RESOURCE_PREFIX = "infra-client";
|
|
643
|
+
var parseConnectorVpcs = (json) => new Map(
|
|
644
|
+
Object.entries(JSON.parse(json ?? "{}")).filter(
|
|
645
|
+
([, v]) => Array.isArray(v)
|
|
646
|
+
)
|
|
647
|
+
);
|
|
648
|
+
var connectorHostname = (account, name) => name ? `connector-${account}-${name}` : `connector-${account}`;
|
|
649
|
+
var sgManagerFnName = (prefix, name) => name ? `${prefix}-sg-manager-${name}` : `${prefix}-sg-manager`;
|
|
650
|
+
var tailnetResolverFnName = (prefix, siteId, name) => name ? `${prefix}-tailnet-resolver-${siteId}-${name}` : `${prefix}-tailnet-resolver-${siteId}`;
|
|
651
|
+
var aclReconcilerRelayFnName = (prefix) => `${prefix}-acl-reconciler-relay`;
|
|
652
|
+
|
|
653
|
+
// lambdacode/network/invoke.ts
|
|
654
|
+
var import_client_lambda = require("@aws-sdk/client-lambda");
|
|
655
|
+
var INVOKE_TIMEOUT_MS = 1e4;
|
|
656
|
+
async function invokeParsed(client, functionName, payload, timeoutMs) {
|
|
657
|
+
try {
|
|
658
|
+
const res = await client.send(
|
|
659
|
+
new import_client_lambda.InvokeCommand({ FunctionName: functionName, Payload: JSON.stringify(payload) }),
|
|
660
|
+
{ abortSignal: AbortSignal.timeout(timeoutMs) }
|
|
661
|
+
);
|
|
662
|
+
if (res.FunctionError) return { error: `function error: ${res.FunctionError}` };
|
|
663
|
+
return { body: JSON.parse(new TextDecoder().decode(res.Payload)) };
|
|
664
|
+
} catch (err) {
|
|
665
|
+
return { error: err.message };
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
// lambdacode/network/acl-reconciler.ts
|
|
670
|
+
init_actorContext();
|
|
671
|
+
init_resourcesService();
|
|
672
|
+
init_auditService();
|
|
673
|
+
var PREFIX = process.env.RESOURCE_PREFIX ?? DEFAULT_RESOURCE_PREFIX;
|
|
674
|
+
var HUB_ACCOUNT = process.env.HUB_ACCOUNT;
|
|
675
|
+
var RELAY_FN = aclReconcilerRelayFnName(PREFIX);
|
|
676
|
+
var connectorVpcs = /* @__PURE__ */ new Map();
|
|
677
|
+
var UNNAMED_HUB_VPC = [{}];
|
|
678
|
+
var inConfig = (account) => connectorVpcs.has(account);
|
|
679
|
+
var targetsOf = (account) => connectorVpcs.get(account) ?? UNNAMED_HUB_VPC;
|
|
680
|
+
var regionOfTarget = (t) => t.region ?? process.env.AWS_REGION;
|
|
681
|
+
var vpcNameOf = (account, nodeName) => targetsOf(account).find((t) => {
|
|
682
|
+
if (!t.name) return false;
|
|
683
|
+
const host = connectorHostname(account, t.name);
|
|
684
|
+
return nodeName === host || nodeName.startsWith(`${host}-`);
|
|
685
|
+
})?.name;
|
|
686
|
+
var approvedRoutesByVpc = /* @__PURE__ */ new Map();
|
|
687
|
+
var vpcKey = (account, name) => `${account}#${name ?? ""}`;
|
|
688
|
+
var ownerOf = (account, cidr) => {
|
|
689
|
+
const targets = targetsOf(account);
|
|
690
|
+
if (targets.length === 1) return targets[0];
|
|
691
|
+
return targets.find(
|
|
692
|
+
(t) => (approvedRoutesByVpc.get(vpcKey(account, t.name)) ?? []).some(
|
|
693
|
+
(route) => cidrContains(cidr, route)
|
|
694
|
+
)
|
|
695
|
+
);
|
|
696
|
+
};
|
|
697
|
+
var declaredRoutesByVpc = /* @__PURE__ */ new Map();
|
|
698
|
+
var declaredRoutesOf = (siteAccounts, account, nodeName) => {
|
|
699
|
+
const own = declaredRoutesByVpc.get(vpcKey(account, vpcNameOf(account, nodeName)));
|
|
700
|
+
if (own) return own;
|
|
701
|
+
const siteDeclares = [...declaredRoutesByVpc.keys()].some(
|
|
702
|
+
(k) => siteAccounts === null || siteAccounts.has(k.slice(0, k.indexOf("#")))
|
|
703
|
+
);
|
|
704
|
+
return siteDeclares ? [] : void 0;
|
|
705
|
+
};
|
|
706
|
+
var ddb10 = import_lib_dynamodb10.DynamoDBDocumentClient.from(new import_client_dynamodb10.DynamoDBClient({}));
|
|
707
|
+
var sd = new import_client_servicediscovery.ServiceDiscoveryClient({});
|
|
708
|
+
var lambda = new import_client_lambda2.LambdaClient({});
|
|
709
|
+
var RECONCILER_STATUS_KEY = "__reconciler-status__";
|
|
710
|
+
var RESOURCES_TABLE_NAME5 = process.env.RESOURCES_TABLE_NAME;
|
|
711
|
+
var STALE_CONNECTOR_MS = 15 * 60 * 1e3;
|
|
712
|
+
var CONNECTOR_PRUNE_MS = 24 * 60 * 60 * 1e3;
|
|
713
|
+
var DEVICE_IDLE_EXPIRE_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
714
|
+
var log2 = (msg, extra = {}) => console.log(JSON.stringify({ msg, ...extra }));
|
|
715
|
+
function newPassAudit() {
|
|
716
|
+
const enabled = Boolean(process.env.AUDIT_TABLE_NAME);
|
|
717
|
+
const batchId = enabled ? newBatchId() : "";
|
|
718
|
+
const rows = [];
|
|
719
|
+
return {
|
|
720
|
+
enabled,
|
|
721
|
+
observedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
722
|
+
rows,
|
|
723
|
+
push(input) {
|
|
724
|
+
if (!enabled) return;
|
|
725
|
+
rows.push({ ...input, category: "network", details: { ...input.details, batchId } });
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
function sitesFromEnv() {
|
|
730
|
+
const raw = process.env.HEADSCALE_SITES;
|
|
731
|
+
if (!raw) {
|
|
732
|
+
trustHeadscale(process.env.HEADSCALE_API_URL, process.env.HEADSCALE_TLS_PARAM);
|
|
733
|
+
return [
|
|
734
|
+
{
|
|
735
|
+
id: "",
|
|
736
|
+
apiUrl: process.env.HEADSCALE_API_URL,
|
|
737
|
+
auth: { Authorization: `Bearer ${process.env.HEADSCALE_API_KEY}` },
|
|
738
|
+
accounts: null,
|
|
739
|
+
resolvers: (process.env.SPLIT_DNS_RESOLVERS ?? "").split(",").map((ip) => ip.trim()).filter(Boolean),
|
|
740
|
+
sentinelKey: RECONCILER_STATUS_KEY
|
|
741
|
+
}
|
|
742
|
+
];
|
|
743
|
+
}
|
|
744
|
+
const planes = JSON.parse(raw);
|
|
745
|
+
for (const p of Object.values(planes)) trustHeadscale(p.url, p.certParam);
|
|
746
|
+
const siteOfAccount = JSON.parse(process.env.SITE_ACCOUNTS ?? "{}");
|
|
747
|
+
const splitBySite = JSON.parse(
|
|
748
|
+
process.env.SPLIT_DNS_BY_SITE ?? "{}"
|
|
749
|
+
);
|
|
750
|
+
const names = JSON.parse(process.env.SITE_NAMES ?? "{}");
|
|
751
|
+
return Object.keys(planes).sort().map((id) => ({
|
|
752
|
+
id,
|
|
753
|
+
displayName: typeof names[id] === "string" ? names[id] : void 0,
|
|
754
|
+
apiUrl: planes[id].url,
|
|
755
|
+
auth: { Authorization: `Bearer ${planes[id].key}` },
|
|
756
|
+
accounts: new Set(
|
|
757
|
+
Object.entries(siteOfAccount).filter(([, s]) => s === id).map(([a]) => a)
|
|
758
|
+
),
|
|
759
|
+
resolvers: splitBySite[id] ?? [],
|
|
760
|
+
sentinelKey: `${RECONCILER_STATUS_KEY}${id}`
|
|
761
|
+
}));
|
|
762
|
+
}
|
|
763
|
+
var HEADSCALE_TIMEOUT_MS = 1e4;
|
|
764
|
+
var HEADSCALE_POLICY_TIMEOUT_MS = 3e4;
|
|
765
|
+
var DNS_HOLD_MS = 24 * 60 * 60 * 1e3;
|
|
766
|
+
var headscaleFetch2 = (url, init = {}, timeoutMs = HEADSCALE_TIMEOUT_MS) => headscaleFetch(url, { ...init, signal: AbortSignal.timeout(timeoutMs) });
|
|
767
|
+
var POLICY_MAX_BYTES = 39e5;
|
|
768
|
+
var CIDR_RE = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d{1,2})$/;
|
|
769
|
+
function parseCidr(cidr) {
|
|
770
|
+
if (typeof cidr !== "string") return null;
|
|
771
|
+
const m = cidr.trim().match(CIDR_RE);
|
|
772
|
+
if (!m) return null;
|
|
773
|
+
const octets = m.slice(1, 5).map(Number);
|
|
774
|
+
const prefix = Number(m[5]);
|
|
775
|
+
if (octets.some((o) => o > 255) || prefix > 32) return null;
|
|
776
|
+
const base = (octets[0] << 24 | octets[1] << 16 | octets[2] << 8 | octets[3]) >>> 0;
|
|
777
|
+
return { base, prefix };
|
|
778
|
+
}
|
|
779
|
+
function cidrContains(inner, outer) {
|
|
780
|
+
const a = parseCidr(inner);
|
|
781
|
+
const b = parseCidr(outer);
|
|
782
|
+
if (!a || !b) return false;
|
|
783
|
+
if (a.prefix < b.prefix) return false;
|
|
784
|
+
const mask = b.prefix === 0 ? 0 : ~0 << 32 - b.prefix >>> 0;
|
|
785
|
+
return (a.base & mask) >>> 0 === (b.base & mask) >>> 0;
|
|
786
|
+
}
|
|
787
|
+
var PRIVATE_SPACE = ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"];
|
|
788
|
+
function isPrivateCidr(cidr) {
|
|
789
|
+
return PRIVATE_SPACE.some((space) => cidrContains(cidr, space));
|
|
790
|
+
}
|
|
791
|
+
function isIpv4(s) {
|
|
792
|
+
const m = s.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);
|
|
793
|
+
return m !== null && m.slice(1).every((o) => Number(o) <= 255);
|
|
794
|
+
}
|
|
795
|
+
async function resolveCloudMapIps(dnsName) {
|
|
796
|
+
const dot = dnsName.indexOf(".");
|
|
797
|
+
if (dot <= 0) return [];
|
|
798
|
+
try {
|
|
799
|
+
const res = await Promise.race([
|
|
800
|
+
sd.send(
|
|
801
|
+
new import_client_servicediscovery.DiscoverInstancesCommand({
|
|
802
|
+
ServiceName: dnsName.slice(0, dot),
|
|
803
|
+
NamespaceName: dnsName.slice(dot + 1),
|
|
804
|
+
MaxResults: 10
|
|
805
|
+
})
|
|
806
|
+
),
|
|
807
|
+
new Promise(
|
|
808
|
+
(_, reject) => setTimeout(() => reject(new Error("cloud map timeout")), 3e3)
|
|
809
|
+
)
|
|
810
|
+
]);
|
|
811
|
+
return (res.Instances ?? []).map((i) => i.Attributes?.AWS_INSTANCE_IPV4).filter((ip) => Boolean(ip));
|
|
812
|
+
} catch {
|
|
813
|
+
return [];
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
async function resolveDnsIps(dnsName) {
|
|
817
|
+
try {
|
|
818
|
+
const ips = await Promise.race([
|
|
819
|
+
(0, import_promises.resolve4)(dnsName),
|
|
820
|
+
new Promise(
|
|
821
|
+
(_, reject) => setTimeout(() => reject(new Error("dns timeout")), 3e3)
|
|
822
|
+
)
|
|
823
|
+
]);
|
|
824
|
+
return ips.slice(0, 8);
|
|
825
|
+
} catch {
|
|
826
|
+
return [];
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
async function invokeByName(account, fnName, payload, region) {
|
|
830
|
+
if (region === process.env.AWS_REGION) {
|
|
831
|
+
return invokeParsed(
|
|
832
|
+
lambda,
|
|
833
|
+
`arn:aws:lambda:${region}:${account}:function:${fnName}`,
|
|
834
|
+
payload,
|
|
835
|
+
INVOKE_TIMEOUT_MS
|
|
836
|
+
);
|
|
837
|
+
}
|
|
838
|
+
const { body, error } = await invokeParsed(
|
|
839
|
+
lambda,
|
|
840
|
+
RELAY_FN,
|
|
841
|
+
{ region, account, fnName, payload },
|
|
842
|
+
INVOKE_TIMEOUT_MS + 3e3
|
|
843
|
+
);
|
|
844
|
+
return error ? { error } : body;
|
|
845
|
+
}
|
|
846
|
+
var RESOLVER_BATCH = 64;
|
|
847
|
+
async function resolveRemoteIps(account, fnName, names, region) {
|
|
848
|
+
const out = {};
|
|
849
|
+
for (let i = 0; i < names.length; i += RESOLVER_BATCH) {
|
|
850
|
+
const { body, error } = await invokeByName(
|
|
851
|
+
account,
|
|
852
|
+
fnName,
|
|
853
|
+
{ names: names.slice(i, i + RESOLVER_BATCH) },
|
|
854
|
+
region
|
|
855
|
+
);
|
|
856
|
+
if (error) {
|
|
857
|
+
log2("WARN: tailnet-resolver invoke failed", { account, fnName, error });
|
|
858
|
+
return out;
|
|
859
|
+
}
|
|
860
|
+
const ips = body?.ips ?? {};
|
|
861
|
+
for (const [name, list] of Object.entries(ips)) {
|
|
862
|
+
const clean = (Array.isArray(list) ? list : []).filter(isIpv4).slice(0, 8);
|
|
863
|
+
if (clean.length) out[name] = clean;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
return out;
|
|
867
|
+
}
|
|
868
|
+
var SG_FAILURE_REASON = {
|
|
869
|
+
error: "the connector account's firewall manager could not update the group",
|
|
870
|
+
"sg-sync-failed": "the connector account's firewall manager could not be reached",
|
|
871
|
+
"not-found": "security group not found in the connector account",
|
|
872
|
+
invalid: "malformed security group id"
|
|
873
|
+
};
|
|
874
|
+
async function syncSecurityGroups(resources, statusByResource, prior, audit) {
|
|
875
|
+
const hub = process.env.AWS_REGION;
|
|
876
|
+
const byAccount = /* @__PURE__ */ new Map();
|
|
877
|
+
for (const r of resources) {
|
|
878
|
+
if (!r.securityGroupId) continue;
|
|
879
|
+
const list = byAccount.get(r.accountNumber) ?? [];
|
|
880
|
+
list.push(r);
|
|
881
|
+
byAccount.set(r.accountNumber, list);
|
|
882
|
+
}
|
|
883
|
+
const keep = new Set(byAccount.keys());
|
|
884
|
+
for (const account of prior.accounts) {
|
|
885
|
+
if (!byAccount.has(account)) byAccount.set(account, []);
|
|
886
|
+
}
|
|
887
|
+
const sameTarget = (a, b) => (a.name ?? null) === (b.name ?? null) && regionOfTarget(a) === regionOfTarget(b);
|
|
888
|
+
const targetsByAccount = /* @__PURE__ */ new Map();
|
|
889
|
+
for (const [account, rs] of byAccount) {
|
|
890
|
+
const configured = inConfig(account);
|
|
891
|
+
const wanted = rs.length || configured ? targetsOf(account) : prior.targets[account] ?? UNNAMED_HUB_VPC;
|
|
892
|
+
const reachable = wanted.filter((t) => configured || regionOfTarget(t) === hub);
|
|
893
|
+
for (const t of wanted) {
|
|
894
|
+
if (reachable.includes(t)) continue;
|
|
895
|
+
log2("ERROR: departed connector VPC in another region is unreachable \u2014 revoke its managed SG rules by hand", {
|
|
896
|
+
account,
|
|
897
|
+
...t
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
if (configured) {
|
|
901
|
+
for (const before of prior.targets[account] ?? []) {
|
|
902
|
+
if (wanted.some((t) => sameTarget(t, before))) continue;
|
|
903
|
+
log2("WARN: a connector VPC left config \u2014 managed SG rules left there must be revoked by hand", {
|
|
904
|
+
account,
|
|
905
|
+
...before
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
if (!reachable.length) {
|
|
910
|
+
byAccount.delete(account);
|
|
911
|
+
continue;
|
|
912
|
+
}
|
|
913
|
+
targetsByAccount.set(account, reachable);
|
|
914
|
+
}
|
|
915
|
+
const RANK = { ok: 3, "other-vpc": 0 };
|
|
916
|
+
const rank = (status) => RANK[status] ?? 1;
|
|
917
|
+
const toRule = (r) => ({
|
|
918
|
+
securityGroupId: r.securityGroupId,
|
|
919
|
+
// Same bounds as the ACL dst filter — the manager re-validates anyway.
|
|
920
|
+
ports: (Array.isArray(r.ports) ? r.ports : []).filter(
|
|
921
|
+
(p) => Number.isInteger(p) && p >= 1 && p <= 65535
|
|
922
|
+
)
|
|
923
|
+
});
|
|
924
|
+
await Promise.all(
|
|
925
|
+
[...byAccount].map(async ([account, rs]) => {
|
|
926
|
+
const targets2 = targetsByAccount.get(account);
|
|
927
|
+
const ownerOfResource = /* @__PURE__ */ new Map();
|
|
928
|
+
const rulesFor = new Map(targets2.map((t) => [t, []]));
|
|
929
|
+
for (const r of rs) {
|
|
930
|
+
const owner = ownerOf(account, r.cidr);
|
|
931
|
+
ownerOfResource.set(r.resourceId, owner);
|
|
932
|
+
for (const t of owner ? [owner] : targets2) rulesFor.get(t)?.push(toRule(r));
|
|
933
|
+
}
|
|
934
|
+
const verdicts = /* @__PURE__ */ new Map();
|
|
935
|
+
const failed = /* @__PURE__ */ new Map();
|
|
936
|
+
await Promise.all(
|
|
937
|
+
targets2.map(async (t) => {
|
|
938
|
+
const { body, error: failure } = await invokeByName(
|
|
939
|
+
account,
|
|
940
|
+
sgManagerFnName(PREFIX, t.name),
|
|
941
|
+
{ rules: rulesFor.get(t) ?? [] },
|
|
942
|
+
regionOfTarget(t)
|
|
943
|
+
);
|
|
944
|
+
if (failure) {
|
|
945
|
+
failed.set(t, failure);
|
|
946
|
+
log2("WARN: sg-manager sync failed", { account, ...t, error: failure });
|
|
947
|
+
return;
|
|
948
|
+
}
|
|
949
|
+
verdicts.set(
|
|
950
|
+
t,
|
|
951
|
+
body?.statuses ?? {}
|
|
952
|
+
);
|
|
953
|
+
})
|
|
954
|
+
);
|
|
955
|
+
if (failed.size) keep.add(account);
|
|
956
|
+
for (const t of targets2) {
|
|
957
|
+
for (const [sgId, v] of Object.entries(verdicts.get(t) ?? {})) {
|
|
958
|
+
if (v?.status !== "ok") continue;
|
|
959
|
+
const served = rs.filter((r) => r.securityGroupId === sgId);
|
|
960
|
+
const base = {
|
|
961
|
+
target: `sg#${sgId}`,
|
|
962
|
+
targetName: served.map((r) => r.name).join(", ") || void 0,
|
|
963
|
+
accountNumber: account,
|
|
964
|
+
details: {
|
|
965
|
+
...served.length === 1 ? { resourceId: served[0].resourceId } : {},
|
|
966
|
+
resourceIds: served.map((r) => r.resourceId),
|
|
967
|
+
vpcName: t.name,
|
|
968
|
+
protocol: "tcp"
|
|
969
|
+
}
|
|
970
|
+
};
|
|
971
|
+
if (typeof v.added === "number" && v.added > 0) {
|
|
972
|
+
const ports = [...new Set((rulesFor.get(t) ?? []).filter((x) => x.securityGroupId === sgId).flatMap((x) => x.ports))];
|
|
973
|
+
audit.push({ ...base, action: "sg.rule.add", details: { ...base.details, ports, added: v.added } });
|
|
974
|
+
}
|
|
975
|
+
if (typeof v.removed === "number" && v.removed > 0) {
|
|
976
|
+
audit.push({ ...base, action: "sg.rule.remove", details: { ...base.details, removed: v.removed } });
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
for (const r of rs) {
|
|
981
|
+
const entry = statusByResource[r.resourceId] ??= { status: "unknown" };
|
|
982
|
+
const owner = ownerOfResource.get(r.resourceId);
|
|
983
|
+
const asked = owner ? [owner] : targets2;
|
|
984
|
+
let best;
|
|
985
|
+
for (const t of asked) {
|
|
986
|
+
const status = verdicts.get(t)?.[r.securityGroupId]?.status;
|
|
987
|
+
if (status !== void 0 && (best === void 0 || rank(status) > rank(best))) best = status;
|
|
988
|
+
}
|
|
989
|
+
entry.sg = best !== void 0 && (best !== "other-vpc" || !asked.some((t) => failed.has(t))) ? best : "sg-sync-failed";
|
|
990
|
+
entry.sgId = r.securityGroupId;
|
|
991
|
+
const reason = SG_FAILURE_REASON[entry.sg];
|
|
992
|
+
const before = prior.sgVerdicts.get(r.resourceId);
|
|
993
|
+
if (!reason || before?.sg === entry.sg && before.sgId === r.securityGroupId) continue;
|
|
994
|
+
const error = entry.sg === "sg-sync-failed" ? asked.map((t) => failed.get(t)).find(Boolean) : asked.map((t) => verdicts.get(t)?.[r.securityGroupId]).find((v) => v?.status === entry.sg)?.error;
|
|
995
|
+
audit.push({
|
|
996
|
+
action: "sg.rule.add",
|
|
997
|
+
outcome: "FAILED",
|
|
998
|
+
reason,
|
|
999
|
+
target: `sg#${r.securityGroupId}`,
|
|
1000
|
+
targetName: r.name,
|
|
1001
|
+
accountNumber: account,
|
|
1002
|
+
details: { resourceId: r.resourceId, vpcName: owner?.name, protocol: "tcp", ports: toRule(r).ports, error }
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
})
|
|
1006
|
+
);
|
|
1007
|
+
const accounts = [...keep].sort();
|
|
1008
|
+
const targets = {};
|
|
1009
|
+
for (const account of accounts) targets[account] = targetsByAccount.get(account) ?? [];
|
|
1010
|
+
return { accounts, targets };
|
|
1011
|
+
}
|
|
1012
|
+
function recordSiteActivity(audit, o, prev) {
|
|
1013
|
+
if (!audit.enabled) return;
|
|
1014
|
+
const target = `site#${o.site.id}`;
|
|
1015
|
+
const targetName = o.site.displayName ?? o.site.id;
|
|
1016
|
+
const connectorDetails = (c) => ({
|
|
1017
|
+
nodeName: c.name,
|
|
1018
|
+
nodeId: c.nodeId,
|
|
1019
|
+
accountNumber: c.account,
|
|
1020
|
+
vpcName: c.vpcName,
|
|
1021
|
+
trusted: c.trusted
|
|
1022
|
+
});
|
|
1023
|
+
for (const c of o.pruned) {
|
|
1024
|
+
audit.push({ action: "connector.prune", target, targetName, accountNumber: c.account, details: connectorDetails(c) });
|
|
1025
|
+
}
|
|
1026
|
+
if (!prev || typeof prev !== "object") return;
|
|
1027
|
+
const now = o.topology.devices;
|
|
1028
|
+
const was = prev.devices && typeof prev.devices === "object" ? prev.devices : {};
|
|
1029
|
+
const session = (sub, action) => audit.push({
|
|
1030
|
+
action,
|
|
1031
|
+
subject: { kind: "user", id: sub },
|
|
1032
|
+
target,
|
|
1033
|
+
targetName,
|
|
1034
|
+
details: { siteId: o.site.id, devices: now[sub]?.count ?? 0, observedAt: audit.observedAt, granularity: "5m" }
|
|
1035
|
+
});
|
|
1036
|
+
for (const [sub, d] of Object.entries(now)) {
|
|
1037
|
+
if (d.online && was[sub]?.online !== true) session(sub, "vpn.connect");
|
|
1038
|
+
}
|
|
1039
|
+
for (const [sub, d] of Object.entries(was)) {
|
|
1040
|
+
if (d?.online === true && now[sub]?.online !== true) session(sub, "vpn.disconnect");
|
|
1041
|
+
}
|
|
1042
|
+
const key = (c) => c.nodeId ?? c.name;
|
|
1043
|
+
const onlineBefore = new Set((Array.isArray(prev.connectors) ? prev.connectors : []).filter((c) => c?.online === true).map(key));
|
|
1044
|
+
for (const c of o.topology.connectors) {
|
|
1045
|
+
if (c.online && !onlineBefore.has(key(c))) {
|
|
1046
|
+
audit.push({ action: "connector.online", target, targetName, accountNumber: c.account, details: connectorDetails(c) });
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
var handler = () => runAsActor(systemActor("reconciler"), reconcile);
|
|
1051
|
+
async function reconcile() {
|
|
1052
|
+
const audit = newPassAudit();
|
|
1053
|
+
const sites = sitesFromEnv();
|
|
1054
|
+
if (!sites.length) throw new Error("no sites configured (HEADSCALE_SITES empty)");
|
|
1055
|
+
connectorVpcs = parseConnectorVpcs(process.env.CONNECTOR_VPCS);
|
|
1056
|
+
declaredRoutesByVpc = new Map(
|
|
1057
|
+
Object.entries(JSON.parse(process.env.CONNECTOR_ROUTES ?? "{}")).filter(
|
|
1058
|
+
([, v]) => Array.isArray(v)
|
|
1059
|
+
)
|
|
1060
|
+
);
|
|
1061
|
+
approvedRoutesByVpc = /* @__PURE__ */ new Map();
|
|
1062
|
+
const usersByResource = /* @__PURE__ */ new Map();
|
|
1063
|
+
const usersByShare = /* @__PURE__ */ new Map();
|
|
1064
|
+
const accessRows = await scanAll({ targetPrefixes: ["resource#", "share#", "member#"] });
|
|
1065
|
+
const graph = buildSnapshot(accessRows);
|
|
1066
|
+
const liveShares = accessRows.filter(isShareDefRow).filter((d) => !isExpired(d));
|
|
1067
|
+
for (const [userId, entries] of graph.users) {
|
|
1068
|
+
for (const e of entries.values()) {
|
|
1069
|
+
const parsed = parseTarget(e.target);
|
|
1070
|
+
if (!e.active) continue;
|
|
1071
|
+
if (parsed?.kind === "resource") {
|
|
1072
|
+
if (!usersByResource.has(parsed.resourceId)) usersByResource.set(parsed.resourceId, /* @__PURE__ */ new Set());
|
|
1073
|
+
usersByResource.get(parsed.resourceId).add(userId);
|
|
1074
|
+
} else if (parsed?.kind === "share") {
|
|
1075
|
+
if (!usersByShare.has(parsed.shareId)) usersByShare.set(parsed.shareId, /* @__PURE__ */ new Set());
|
|
1076
|
+
usersByShare.get(parsed.shareId).add(userId);
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
let cursor;
|
|
1081
|
+
const resources = [];
|
|
1082
|
+
const priorSgAccounts = /* @__PURE__ */ new Set();
|
|
1083
|
+
const priorSgTargets = {};
|
|
1084
|
+
const seenSentinelIds = [];
|
|
1085
|
+
const priorTopology = /* @__PURE__ */ new Map();
|
|
1086
|
+
const priorSgVerdicts = /* @__PURE__ */ new Map();
|
|
1087
|
+
const priorAddrs = /* @__PURE__ */ new Map();
|
|
1088
|
+
const passStartedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
1089
|
+
cursor = void 0;
|
|
1090
|
+
do {
|
|
1091
|
+
const page = await ddb10.send(
|
|
1092
|
+
new import_lib_dynamodb10.ScanCommand({
|
|
1093
|
+
TableName: RESOURCES_TABLE_NAME5,
|
|
1094
|
+
ExclusiveStartKey: cursor,
|
|
1095
|
+
ProjectionExpression: "resourceId, accountNumber, #name, cidr, ports, dnsName, securityGroupId, sgAccounts, sgTargets, sgRegions, topology, #statuses",
|
|
1096
|
+
ExpressionAttributeNames: { "#name": "name", "#statuses": "statuses" }
|
|
1097
|
+
})
|
|
1098
|
+
);
|
|
1099
|
+
for (const row of page.Items ?? []) {
|
|
1100
|
+
const rid = String(row.resourceId ?? "");
|
|
1101
|
+
if (rid.startsWith("__") && !rid.startsWith(RECONCILER_STATUS_KEY)) continue;
|
|
1102
|
+
if (rid.startsWith(RECONCILER_STATUS_KEY)) {
|
|
1103
|
+
if (row.topology && typeof row.topology === "object") {
|
|
1104
|
+
priorTopology.set(rid, row.topology);
|
|
1105
|
+
}
|
|
1106
|
+
if (row.statuses && typeof row.statuses === "object") {
|
|
1107
|
+
for (const [id, s] of Object.entries(row.statuses)) {
|
|
1108
|
+
if (s?.sg) priorSgVerdicts.set(id, { sg: s.sg, sgId: s.sgId });
|
|
1109
|
+
const recorded = Array.isArray(s?.addrIps) ? s.addrIps : s?.addr === "dns" ? [s.addrIp] : [];
|
|
1110
|
+
const ips = recorded.filter((ip) => typeof ip === "string" && isIpv4(ip));
|
|
1111
|
+
if (s?.addrName && ips.length) {
|
|
1112
|
+
priorAddrs.set(id, { name: s.addrName, ips, at: typeof s.addrAt === "string" ? s.addrAt : passStartedAt });
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
if (Array.isArray(row.sgAccounts)) {
|
|
1117
|
+
for (const a of row.sgAccounts) priorSgAccounts.add(a);
|
|
1118
|
+
}
|
|
1119
|
+
if (row.sgTargets && typeof row.sgTargets === "object") {
|
|
1120
|
+
for (const [a, list] of Object.entries(row.sgTargets)) {
|
|
1121
|
+
if (Array.isArray(list)) priorSgTargets[a] = list;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
if (row.sgRegions && typeof row.sgRegions === "object") {
|
|
1125
|
+
for (const [a, region] of Object.entries(row.sgRegions)) {
|
|
1126
|
+
priorSgTargets[a] ??= [{ region }];
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
seenSentinelIds.push(rid);
|
|
1130
|
+
continue;
|
|
1131
|
+
}
|
|
1132
|
+
if (isSentinelRow(rid)) continue;
|
|
1133
|
+
resources.push(row);
|
|
1134
|
+
}
|
|
1135
|
+
cursor = page.LastEvaluatedKey;
|
|
1136
|
+
} while (cursor);
|
|
1137
|
+
const statusByResource = {};
|
|
1138
|
+
const skipped = [];
|
|
1139
|
+
const notEnrolled = /* @__PURE__ */ new Set();
|
|
1140
|
+
const autoApproved = [];
|
|
1141
|
+
const expiredDevices = [];
|
|
1142
|
+
const prunedConnectors = [];
|
|
1143
|
+
const outcomes = [];
|
|
1144
|
+
const mappedAccounts = sites[0].accounts === null ? null : new Set(sites.flatMap((s) => [...s.accounts]));
|
|
1145
|
+
for (const r of resources) {
|
|
1146
|
+
if (mappedAccounts && !mappedAccounts.has(r.accountNumber)) {
|
|
1147
|
+
statusByResource[r.resourceId] = { status: "no-site" };
|
|
1148
|
+
skipped.push({ resourceId: r.resourceId, reason: "no-site" });
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
for (const site of sites) {
|
|
1152
|
+
const outcome = {
|
|
1153
|
+
site,
|
|
1154
|
+
acls: [],
|
|
1155
|
+
resourcesLive: 0,
|
|
1156
|
+
sharesLive: 0,
|
|
1157
|
+
shareStatuses: {},
|
|
1158
|
+
staleConnectors: [],
|
|
1159
|
+
pruned: [],
|
|
1160
|
+
resourceIds: /* @__PURE__ */ new Set(),
|
|
1161
|
+
topology: { connectors: [], devices: {} }
|
|
1162
|
+
};
|
|
1163
|
+
outcomes.push(outcome);
|
|
1164
|
+
const siteResources = site.accounts === null ? resources : resources.filter((r) => site.accounts.has(r.accountNumber));
|
|
1165
|
+
for (const r of siteResources) outcome.resourceIds.add(r.resourceId);
|
|
1166
|
+
try {
|
|
1167
|
+
const nodesRes = await headscaleFetch2(`${site.apiUrl}/api/v1/node`, {
|
|
1168
|
+
headers: site.auth
|
|
1169
|
+
});
|
|
1170
|
+
if (!nodesRes.ok) throw new Error(`node list: ${nodesRes.status}`);
|
|
1171
|
+
const { nodes = [] } = await nodesRes.json();
|
|
1172
|
+
const usersRes = await headscaleFetch2(`${site.apiUrl}/api/v1/user`, {
|
|
1173
|
+
headers: site.auth
|
|
1174
|
+
});
|
|
1175
|
+
if (!usersRes.ok) throw new Error(`user list: ${usersRes.status}`);
|
|
1176
|
+
const { users = [] } = await usersRes.json();
|
|
1177
|
+
const enrolledUsers = new Set(
|
|
1178
|
+
users.map((u) => u.name).filter((n) => Boolean(n))
|
|
1179
|
+
);
|
|
1180
|
+
const approvedByAccount = /* @__PURE__ */ new Map();
|
|
1181
|
+
const ipsByOwner = /* @__PURE__ */ new Map();
|
|
1182
|
+
for (const node of nodes) {
|
|
1183
|
+
const name = node.givenName || node.name || "";
|
|
1184
|
+
const owner = node.user?.name;
|
|
1185
|
+
const expired = Boolean(
|
|
1186
|
+
node.expiry && Date.parse(node.expiry) <= Date.now()
|
|
1187
|
+
);
|
|
1188
|
+
if (owner?.startsWith("u-") && !expired) {
|
|
1189
|
+
const set = ipsByOwner.get(owner) ?? /* @__PURE__ */ new Set();
|
|
1190
|
+
for (const ip of (node.ipAddresses ?? []).filter(isIpv4)) set.add(ip);
|
|
1191
|
+
if (set.size) ipsByOwner.set(owner, set);
|
|
1192
|
+
}
|
|
1193
|
+
if (owner?.startsWith("u-") && !expired) {
|
|
1194
|
+
const sub = owner.slice(2);
|
|
1195
|
+
const d = outcome.topology.devices[sub] ?? { count: 0, online: false };
|
|
1196
|
+
d.count++;
|
|
1197
|
+
d.online = d.online || node.online === true;
|
|
1198
|
+
if (node.lastSeen && (!d.lastSeen || node.lastSeen > d.lastSeen)) {
|
|
1199
|
+
d.lastSeen = node.lastSeen;
|
|
1200
|
+
}
|
|
1201
|
+
outcome.topology.devices[sub] = d;
|
|
1202
|
+
}
|
|
1203
|
+
if (owner && owner !== "infra" && node.id) {
|
|
1204
|
+
const idleSince = node.lastSeen ? Date.parse(node.lastSeen) : NaN;
|
|
1205
|
+
if (node.online === false && !expired && !Number.isNaN(idleSince) && Date.now() - idleSince > DEVICE_IDLE_EXPIRE_MS) {
|
|
1206
|
+
const res2 = await headscaleFetch2(
|
|
1207
|
+
`${site.apiUrl}/api/v1/node/${node.id}/expire`,
|
|
1208
|
+
{ method: "POST", headers: site.auth }
|
|
1209
|
+
);
|
|
1210
|
+
if (res2.ok) expiredDevices.push(name);
|
|
1211
|
+
else log2("WARN: device expiry failed", { name, status: res2.status });
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
const m = name.match(/^connector-(\d+)(?:-|$)/);
|
|
1215
|
+
if (!m) continue;
|
|
1216
|
+
const account = m[1];
|
|
1217
|
+
if (site.accounts !== null && !site.accounts.has(account)) {
|
|
1218
|
+
log2("WARN: connector account not in this site", {
|
|
1219
|
+
site: site.id,
|
|
1220
|
+
name,
|
|
1221
|
+
account
|
|
1222
|
+
});
|
|
1223
|
+
continue;
|
|
1224
|
+
}
|
|
1225
|
+
let approved = node.approvedRoutes ?? [];
|
|
1226
|
+
const advertised = node.availableRoutes ?? node.subnetRoutes ?? [];
|
|
1227
|
+
const unapproved = advertised.filter((r) => !approved.includes(r));
|
|
1228
|
+
const declared = declaredRoutesOf(site.accounts, account, name);
|
|
1229
|
+
const allowed = (r) => isPrivateCidr(r) && (declared === void 0 || declared.some((d) => cidrContains(r, d)));
|
|
1230
|
+
const wanted = unapproved.filter(allowed);
|
|
1231
|
+
const refused = unapproved.filter((r) => !allowed(r));
|
|
1232
|
+
if (node.user?.name === "infra" && refused.length) {
|
|
1233
|
+
log2("WARN: connector advertises routes that are not private or not declared for its VPC; not approved", { name, refused });
|
|
1234
|
+
}
|
|
1235
|
+
const undeclared = node.user?.name === "infra" ? approved.filter((r) => !allowed(r)) : [];
|
|
1236
|
+
if (undeclared.length) {
|
|
1237
|
+
log2("WARN: connector holds approved routes outside its VPC's declared ones", { name, undeclared });
|
|
1238
|
+
}
|
|
1239
|
+
if (node.user?.name === "infra" && node.id && wanted.length) {
|
|
1240
|
+
const res2 = await headscaleFetch2(
|
|
1241
|
+
`${site.apiUrl}/api/v1/node/${node.id}/approve_routes`,
|
|
1242
|
+
{
|
|
1243
|
+
method: "POST",
|
|
1244
|
+
headers: { ...site.auth, "Content-Type": "application/json" },
|
|
1245
|
+
body: JSON.stringify({ routes: [...approved, ...wanted] })
|
|
1246
|
+
}
|
|
1247
|
+
);
|
|
1248
|
+
if (res2.ok) {
|
|
1249
|
+
approved = [...approved, ...wanted];
|
|
1250
|
+
autoApproved.push(`${name}:${wanted.join("|")}`);
|
|
1251
|
+
} else {
|
|
1252
|
+
log2("WARN: route auto-approval failed", { name, status: res2.status });
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
const vpcName = vpcNameOf(account, name);
|
|
1256
|
+
outcome.topology.connectors.push({
|
|
1257
|
+
account,
|
|
1258
|
+
name,
|
|
1259
|
+
...vpcName ? { vpcName } : {},
|
|
1260
|
+
nodeId: node.id,
|
|
1261
|
+
trusted: node.user?.name === "infra",
|
|
1262
|
+
online: node.online === true,
|
|
1263
|
+
lastSeen: node.lastSeen,
|
|
1264
|
+
advertisedRoutes: advertised,
|
|
1265
|
+
approvedRoutes: approved
|
|
1266
|
+
});
|
|
1267
|
+
if (!approved.length) continue;
|
|
1268
|
+
const lastSeen = node.lastSeen ? Date.parse(node.lastSeen) : NaN;
|
|
1269
|
+
if (node.online === false && !Number.isNaN(lastSeen) && Date.now() - lastSeen > STALE_CONNECTOR_MS) {
|
|
1270
|
+
outcome.staleConnectors.push(name);
|
|
1271
|
+
}
|
|
1272
|
+
const prior = approvedByAccount.get(account) ?? [];
|
|
1273
|
+
approvedByAccount.set(account, [.../* @__PURE__ */ new Set([...prior, ...approved])]);
|
|
1274
|
+
const key = vpcKey(account, vpcName);
|
|
1275
|
+
approvedRoutesByVpc.set(key, [.../* @__PURE__ */ new Set([...approvedRoutesByVpc.get(key) ?? [], ...approved])]);
|
|
1276
|
+
}
|
|
1277
|
+
const prunedHere = [];
|
|
1278
|
+
for (const c of outcome.topology.connectors) {
|
|
1279
|
+
if (!c.trusted || c.online || !c.nodeId) continue;
|
|
1280
|
+
const replacement = outcome.topology.connectors.some(
|
|
1281
|
+
(o) => o.account === c.account && o.vpcName === c.vpcName && o.trusted && o.online
|
|
1282
|
+
);
|
|
1283
|
+
const seen = c.lastSeen ? Date.parse(c.lastSeen) : NaN;
|
|
1284
|
+
if (!replacement || Number.isNaN(seen) || Date.now() - seen < CONNECTOR_PRUNE_MS) {
|
|
1285
|
+
continue;
|
|
1286
|
+
}
|
|
1287
|
+
const res2 = await headscaleFetch2(`${site.apiUrl}/api/v1/node/${c.nodeId}`, {
|
|
1288
|
+
method: "DELETE",
|
|
1289
|
+
headers: site.auth
|
|
1290
|
+
});
|
|
1291
|
+
if (res2.ok) prunedHere.push(c);
|
|
1292
|
+
else log2("WARN: connector prune failed", { name: c.name, status: res2.status });
|
|
1293
|
+
}
|
|
1294
|
+
if (prunedHere.length) {
|
|
1295
|
+
outcome.pruned = prunedHere;
|
|
1296
|
+
prunedConnectors.push(...prunedHere.map((c) => c.name));
|
|
1297
|
+
outcome.staleConnectors = outcome.staleConnectors.filter((n) => !prunedHere.some((c) => c.name === n));
|
|
1298
|
+
outcome.topology.connectors = outcome.topology.connectors.filter((c) => !prunedHere.includes(c));
|
|
1299
|
+
}
|
|
1300
|
+
const namesByTarget = /* @__PURE__ */ new Map();
|
|
1301
|
+
if (site.id) {
|
|
1302
|
+
for (const r of siteResources) {
|
|
1303
|
+
if (!r.dnsName || !usersByResource.has(r.resourceId)) continue;
|
|
1304
|
+
if (!approvedByAccount.has(r.accountNumber)) continue;
|
|
1305
|
+
const owner = ownerOf(r.accountNumber, r.cidr);
|
|
1306
|
+
const perTarget = namesByTarget.get(r.accountNumber) ?? /* @__PURE__ */ new Map();
|
|
1307
|
+
for (const t of owner ? [owner] : targetsOf(r.accountNumber)) {
|
|
1308
|
+
const set = perTarget.get(t) ?? /* @__PURE__ */ new Set();
|
|
1309
|
+
set.add(r.dnsName);
|
|
1310
|
+
perTarget.set(t, set);
|
|
1311
|
+
}
|
|
1312
|
+
namesByTarget.set(r.accountNumber, perTarget);
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
const remoteIps = /* @__PURE__ */ new Map();
|
|
1316
|
+
await Promise.all(
|
|
1317
|
+
[...namesByTarget].flatMap(
|
|
1318
|
+
([account, perTarget]) => [...perTarget].map(async ([t, names]) => {
|
|
1319
|
+
const m = await resolveRemoteIps(
|
|
1320
|
+
account,
|
|
1321
|
+
tailnetResolverFnName(PREFIX, site.id, t.name),
|
|
1322
|
+
[...names],
|
|
1323
|
+
regionOfTarget(t)
|
|
1324
|
+
);
|
|
1325
|
+
for (const [n, ips] of Object.entries(m)) {
|
|
1326
|
+
const key = `${account}#${n}`;
|
|
1327
|
+
if (!remoteIps.has(key)) remoteIps.set(key, ips);
|
|
1328
|
+
}
|
|
1329
|
+
})
|
|
1330
|
+
)
|
|
1331
|
+
);
|
|
1332
|
+
for (const r of siteResources) {
|
|
1333
|
+
const prior = priorAddrs.get(r.resourceId);
|
|
1334
|
+
const remembered = prior && prior.name === r.dnsName ? { addrName: prior.name, addrIps: prior.ips, addrAt: prior.at } : {};
|
|
1335
|
+
const users2 = usersByResource.get(r.resourceId);
|
|
1336
|
+
if (!users2) {
|
|
1337
|
+
statusByResource[r.resourceId] = { status: "no-grants", ...remembered };
|
|
1338
|
+
continue;
|
|
1339
|
+
}
|
|
1340
|
+
const approved = approvedByAccount.get(r.accountNumber);
|
|
1341
|
+
if (!approved) {
|
|
1342
|
+
skipped.push({ resourceId: r.resourceId, reason: "no-connector" });
|
|
1343
|
+
statusByResource[r.resourceId] = { status: "no-connector", ...remembered };
|
|
1344
|
+
continue;
|
|
1345
|
+
}
|
|
1346
|
+
let dstCidrs = [r.cidr];
|
|
1347
|
+
const addrInfo = {};
|
|
1348
|
+
if (r.dnsName) {
|
|
1349
|
+
addrInfo.addrName = r.dnsName;
|
|
1350
|
+
const hubOwned = r.accountNumber === HUB_ACCOUNT;
|
|
1351
|
+
let live = hubOwned ? await resolveCloudMapIps(r.dnsName) : [];
|
|
1352
|
+
if (!live.length) {
|
|
1353
|
+
live = remoteIps.get(`${r.accountNumber}#${r.dnsName}`) ?? [];
|
|
1354
|
+
}
|
|
1355
|
+
if (!live.length && (hubOwned || !(await resolveCloudMapIps(r.dnsName)).length)) {
|
|
1356
|
+
live = await resolveDnsIps(r.dnsName);
|
|
1357
|
+
}
|
|
1358
|
+
if (live.length) {
|
|
1359
|
+
dstCidrs = live.map((ip) => `${ip}/32`);
|
|
1360
|
+
addrInfo.addr = "dns";
|
|
1361
|
+
} else {
|
|
1362
|
+
addrInfo.addr = "dns-stale";
|
|
1363
|
+
const expired = !(Date.now() - Date.parse(remembered.addrAt ?? "") <= DNS_HOLD_MS);
|
|
1364
|
+
if (!remembered.addrIps || expired) {
|
|
1365
|
+
skipped.push({ resourceId: r.resourceId, reason: "dns-unresolved" });
|
|
1366
|
+
statusByResource[r.resourceId] = { status: "dns-unresolved", ...addrInfo };
|
|
1367
|
+
continue;
|
|
1368
|
+
}
|
|
1369
|
+
dstCidrs = remembered.addrIps.map((ip) => `${ip}/32`);
|
|
1370
|
+
addrInfo.addrIps = remembered.addrIps;
|
|
1371
|
+
addrInfo.addrAt = remembered.addrAt;
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
const contained = dstCidrs.filter(
|
|
1375
|
+
(c) => approved.some((route) => cidrContains(c, route))
|
|
1376
|
+
);
|
|
1377
|
+
if (addrInfo.addr) {
|
|
1378
|
+
addrInfo.addrIp = (contained[0] ?? dstCidrs[0]).replace(/\/\d+$/, "");
|
|
1379
|
+
if (addrInfo.addr === "dns" && contained.length) {
|
|
1380
|
+
addrInfo.addrIps = contained.map((c) => c.replace(/\/\d+$/, ""));
|
|
1381
|
+
addrInfo.addrAt = passStartedAt;
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
if (!contained.length) {
|
|
1385
|
+
skipped.push({
|
|
1386
|
+
resourceId: r.resourceId,
|
|
1387
|
+
reason: "outside-approved-routes"
|
|
1388
|
+
});
|
|
1389
|
+
statusByResource[r.resourceId] = { status: "outside-approved-routes", ...addrInfo };
|
|
1390
|
+
continue;
|
|
1391
|
+
}
|
|
1392
|
+
const ports = (Array.isArray(r.ports) ? r.ports : []).filter(
|
|
1393
|
+
(p) => Number.isInteger(p) && p >= 1 && p <= 65535
|
|
1394
|
+
);
|
|
1395
|
+
if (!ports.length) {
|
|
1396
|
+
skipped.push({ resourceId: r.resourceId, reason: "no-valid-ports" });
|
|
1397
|
+
statusByResource[r.resourceId] = { status: "no-valid-ports", ...addrInfo };
|
|
1398
|
+
continue;
|
|
1399
|
+
}
|
|
1400
|
+
outcome.resourcesLive++;
|
|
1401
|
+
statusByResource[r.resourceId] = {
|
|
1402
|
+
status: "live",
|
|
1403
|
+
users: [...users2].filter(
|
|
1404
|
+
(u) => enrolledUsers.has(headscaleUserName(u))
|
|
1405
|
+
).length,
|
|
1406
|
+
...addrInfo
|
|
1407
|
+
};
|
|
1408
|
+
for (const user of users2) {
|
|
1409
|
+
if (!enrolledUsers.has(headscaleUserName(user))) {
|
|
1410
|
+
notEnrolled.add(user);
|
|
1411
|
+
continue;
|
|
1412
|
+
}
|
|
1413
|
+
outcome.acls.push({
|
|
1414
|
+
action: "accept",
|
|
1415
|
+
src: [`${headscaleUserName(user)}@`],
|
|
1416
|
+
dst: contained.flatMap((c) => ports.map((p) => `${c}:${p}`))
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
const siteShares = site.accounts === null ? liveShares : liveShares.filter((sh) => sh.siteId === site.id);
|
|
1421
|
+
for (const sh of siteShares) {
|
|
1422
|
+
const entry = { status: "live" };
|
|
1423
|
+
outcome.shareStatuses[sh.shareId] = entry;
|
|
1424
|
+
const port = sh.port;
|
|
1425
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) {
|
|
1426
|
+
entry.status = "invalid-port";
|
|
1427
|
+
continue;
|
|
1428
|
+
}
|
|
1429
|
+
const ownerIps = [...ipsByOwner.get(headscaleUserName(sh.ownerSub)) ?? []];
|
|
1430
|
+
if (!ownerIps.length) {
|
|
1431
|
+
entry.status = "owner-not-enrolled";
|
|
1432
|
+
continue;
|
|
1433
|
+
}
|
|
1434
|
+
const grantees = [...usersByShare.get(sh.shareId) ?? []].filter((u) => u !== sh.ownerSub);
|
|
1435
|
+
const enrolled = grantees.filter((u) => enrolledUsers.has(headscaleUserName(u)));
|
|
1436
|
+
for (const u of grantees) if (!enrolledUsers.has(headscaleUserName(u))) notEnrolled.add(u);
|
|
1437
|
+
if (!enrolled.length) {
|
|
1438
|
+
entry.status = grantees.length ? "no-enrolled-grantees" : "no-grantees";
|
|
1439
|
+
continue;
|
|
1440
|
+
}
|
|
1441
|
+
entry.users = enrolled.length;
|
|
1442
|
+
outcome.sharesLive++;
|
|
1443
|
+
for (const u of enrolled) {
|
|
1444
|
+
outcome.acls.push({
|
|
1445
|
+
action: "accept",
|
|
1446
|
+
src: [`${headscaleUserName(u)}@`],
|
|
1447
|
+
dst: ownerIps.map((ip) => `${ip}/32:${port}`)
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
for (const ip of site.resolvers) {
|
|
1452
|
+
if (!isIpv4(ip)) {
|
|
1453
|
+
log2("WARN: skipping non-IPv4 split-DNS resolver", {
|
|
1454
|
+
site: site.id,
|
|
1455
|
+
value: ip
|
|
1456
|
+
});
|
|
1457
|
+
continue;
|
|
1458
|
+
}
|
|
1459
|
+
outcome.acls.push({ action: "accept", src: ["*"], dst: [`${ip}/32:53`] });
|
|
1460
|
+
}
|
|
1461
|
+
const policy = JSON.stringify({ acls: outcome.acls });
|
|
1462
|
+
const policyBytes = Buffer.byteLength(policy);
|
|
1463
|
+
if (policyBytes > POLICY_MAX_BYTES) {
|
|
1464
|
+
throw new Error(
|
|
1465
|
+
`policy is ${policyBytes} bytes, over the control server's ${POLICY_MAX_BYTES}-byte limit; grant through fewer, wider resources or split the site`
|
|
1466
|
+
);
|
|
1467
|
+
}
|
|
1468
|
+
if (policyBytes > POLICY_MAX_BYTES * 0.75) {
|
|
1469
|
+
log2("WARN: policy is near the control server's size limit", { site: site.id, policyBytes, limit: POLICY_MAX_BYTES });
|
|
1470
|
+
}
|
|
1471
|
+
const res = await headscaleFetch2(`${site.apiUrl}/api/v1/policy`, {
|
|
1472
|
+
method: "PUT",
|
|
1473
|
+
headers: { ...site.auth, "Content-Type": "application/json" },
|
|
1474
|
+
body: JSON.stringify({ policy })
|
|
1475
|
+
}, HEADSCALE_POLICY_TIMEOUT_MS);
|
|
1476
|
+
if (!res.ok) {
|
|
1477
|
+
const detail = await res.text().catch(() => "");
|
|
1478
|
+
throw new Error(`policy put: ${res.status} ${detail}`);
|
|
1479
|
+
}
|
|
1480
|
+
} catch (err) {
|
|
1481
|
+
outcome.putError = err.message;
|
|
1482
|
+
log2("ERROR: site pass failed", { site: site.id, error: outcome.putError });
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
const sg = await syncSecurityGroups(
|
|
1486
|
+
resources,
|
|
1487
|
+
statusByResource,
|
|
1488
|
+
{ accounts: [...priorSgAccounts].sort(), targets: priorSgTargets, sgVerdicts: priorSgVerdicts },
|
|
1489
|
+
audit
|
|
1490
|
+
);
|
|
1491
|
+
const carrierSiteId = outcomes.find((o) => !o.putError)?.site.id;
|
|
1492
|
+
for (const o of outcomes) {
|
|
1493
|
+
if (o.putError) continue;
|
|
1494
|
+
recordSiteActivity(audit, o, priorTopology.get(o.site.sentinelKey));
|
|
1495
|
+
const isCarrier = o.site.id === carrierSiteId;
|
|
1496
|
+
const siteStatuses = {};
|
|
1497
|
+
for (const [rid, entry] of Object.entries(statusByResource)) {
|
|
1498
|
+
const noSite = entry.status === "no-site";
|
|
1499
|
+
if (o.resourceIds.has(rid) || noSite && isCarrier) {
|
|
1500
|
+
siteStatuses[rid] = entry;
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
try {
|
|
1504
|
+
await ddb10.send(
|
|
1505
|
+
new import_lib_dynamodb10.PutCommand({
|
|
1506
|
+
TableName: RESOURCES_TABLE_NAME5,
|
|
1507
|
+
Item: {
|
|
1508
|
+
resourceId: o.site.sentinelKey,
|
|
1509
|
+
...o.site.id ? { siteId: o.site.id } : {},
|
|
1510
|
+
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1511
|
+
statuses: siteStatuses,
|
|
1512
|
+
staleConnectors: o.staleConnectors,
|
|
1513
|
+
resourcesLive: o.resourcesLive,
|
|
1514
|
+
rules: o.acls.length,
|
|
1515
|
+
sharesLive: o.sharesLive,
|
|
1516
|
+
shares: o.shareStatuses,
|
|
1517
|
+
topology: o.topology,
|
|
1518
|
+
// Accounts (possibly still) holding our managed SG rules (+ which named / foreign-region VPCs) —
|
|
1519
|
+
// read back next pass to sweep departed ones. One carrier row (SG sync is global; reads union all rows).
|
|
1520
|
+
...isCarrier ? { sgAccounts: sg.accounts, sgTargets: sg.targets } : {}
|
|
1521
|
+
}
|
|
1522
|
+
})
|
|
1523
|
+
);
|
|
1524
|
+
} catch (err) {
|
|
1525
|
+
log2("WARN: status write failed", {
|
|
1526
|
+
site: o.site.id,
|
|
1527
|
+
error: err.message
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
const currentKeys = new Set(sites.map((s) => s.sentinelKey));
|
|
1532
|
+
for (const rid of seenSentinelIds) {
|
|
1533
|
+
if (currentKeys.has(rid)) continue;
|
|
1534
|
+
try {
|
|
1535
|
+
await ddb10.send(
|
|
1536
|
+
new import_lib_dynamodb10.DeleteCommand({
|
|
1537
|
+
TableName: RESOURCES_TABLE_NAME5,
|
|
1538
|
+
Key: { resourceId: rid }
|
|
1539
|
+
})
|
|
1540
|
+
);
|
|
1541
|
+
log2("removed stale reconciler sentinel", { resourceId: rid });
|
|
1542
|
+
} catch (err) {
|
|
1543
|
+
log2("WARN: stale sentinel delete failed", {
|
|
1544
|
+
resourceId: rid,
|
|
1545
|
+
error: err.message
|
|
1546
|
+
});
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
if (audit.rows.length) await recordEvents(audit.rows);
|
|
1550
|
+
const staleConnectors = outcomes.flatMap((o) => o.staleConnectors);
|
|
1551
|
+
console.log(
|
|
1552
|
+
JSON.stringify({
|
|
1553
|
+
_aws: {
|
|
1554
|
+
Timestamp: Date.now(),
|
|
1555
|
+
CloudWatchMetrics: [
|
|
1556
|
+
{
|
|
1557
|
+
Namespace: "InfraClient/Network",
|
|
1558
|
+
Dimensions: [[]],
|
|
1559
|
+
Metrics: [{ Name: "StaleConnectors", Unit: "Count" }]
|
|
1560
|
+
}
|
|
1561
|
+
]
|
|
1562
|
+
},
|
|
1563
|
+
StaleConnectors: staleConnectors.length,
|
|
1564
|
+
staleConnectors
|
|
1565
|
+
})
|
|
1566
|
+
);
|
|
1567
|
+
const rules = outcomes.reduce((n, o) => n + o.acls.length, 0);
|
|
1568
|
+
log2("reconciled", {
|
|
1569
|
+
sites: outcomes.map((o) => ({
|
|
1570
|
+
site: o.site.id,
|
|
1571
|
+
rules: o.acls.length,
|
|
1572
|
+
resourcesLive: o.resourcesLive,
|
|
1573
|
+
sharesLive: o.sharesLive,
|
|
1574
|
+
shares: o.shareStatuses,
|
|
1575
|
+
error: o.putError
|
|
1576
|
+
})),
|
|
1577
|
+
resources: resources.length,
|
|
1578
|
+
resourcesSkipped: skipped,
|
|
1579
|
+
usersNotEnrolled: [...notEnrolled],
|
|
1580
|
+
autoApprovedRoutes: autoApproved,
|
|
1581
|
+
expiredIdleDevices: expiredDevices,
|
|
1582
|
+
prunedConnectors,
|
|
1583
|
+
staleConnectors,
|
|
1584
|
+
usersWithGrants: new Set(
|
|
1585
|
+
[...usersByResource.values()].flatMap((s) => [...s])
|
|
1586
|
+
).size,
|
|
1587
|
+
rules,
|
|
1588
|
+
activityRows: audit.rows.length
|
|
1589
|
+
});
|
|
1590
|
+
const failed = outcomes.filter((o) => o.putError);
|
|
1591
|
+
if (failed.length) {
|
|
1592
|
+
throw new Error(
|
|
1593
|
+
failed.map((o) => `${o.site.id ? `site ${o.site.id}: ` : ""}${o.putError}`).join("; ")
|
|
1594
|
+
);
|
|
1595
|
+
}
|
|
1596
|
+
return { rules };
|
|
1597
|
+
}
|
|
1598
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1599
|
+
0 && (module.exports = {
|
|
1600
|
+
RECONCILER_STATUS_KEY,
|
|
1601
|
+
cidrContains,
|
|
1602
|
+
handler,
|
|
1603
|
+
isPrivateCidr
|
|
1604
|
+
});
|