diff --git a/Dockerfile b/Dockerfile index 626180f..47a0e3b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,6 @@ LABEL org.opencontainers.image.vendor="Authkeys" \ org.opencontainers.image.source="https://github.com/theoapp/theo-node" \ org.opencontainers.image.title="Theo Server" \ org.opencontainers.image.description="The authorized keys manager" \ - org.opencontainers.image.version="1.3.0" \ + org.opencontainers.image.version="1.4.0-beta.0" \ org.opencontainers.image.documentation="https://theoapp.readthedocs.io" \ org.opencontainers.image.licenses='Apache-2.0' diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml new file mode 100644 index 0000000..549027e --- /dev/null +++ b/docker-compose-dev.yml @@ -0,0 +1,28 @@ +version: "3.1" + +services: + postgres: + image: postgres:14 + environment: + POSTGRES_DB: ${DB_NAME} + POSTGRES_USER: ${DB_USER} + POSTGRES_PASSWORD: ${DB_PASSWORD} + volumes: + - ./data/postgres:/var/lib/postgresql/data + ports: + - "127.0.0.1:5432:5432" + profiles: + - postgres + mariadb: + image: mariadb:10.6 + environment: + MYSQL_ROOT_PASSWORD: secretRootPassword + MYSQL_DATABASE: ${DB_NAME} + MYSQL_USER: ${DB_USER} + MYSQL_PASSWORD: ${DB_PASSWORD} + volumes: + - ./data/mariadb:/var/lib/mysql + ports: + - "127.0.0.1:3306:3306" + profiles: + - mariadb diff --git a/docker-compose/docker-compose-test-postgres-redis-core-cluster.yml b/docker-compose/docker-compose-test-postgres-redis-core-cluster.yml new file mode 100644 index 0000000..acc8281 --- /dev/null +++ b/docker-compose/docker-compose-test-postgres-redis-core-cluster.yml @@ -0,0 +1,68 @@ +version: '3.1' + +services: + db: + image: ${POSTGRES_IMAGE} + environment: + POSTGRES_DB: ${POSTGRES_DB} + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + cache: + image: ${REDIS_IMAGE} + theo1: + image: theo:test + container_name: theo1 + environment: + MODE: test + DB_ENGINE: postgres + DB_HOST: db + DB_USER: ${POSTGRES_USER} + DB_PASSWORD: ${POSTGRES_PASSWORD} + DB_NAME: ${POSTGRES_DB} + CORE_TOKEN: ${CORE_TOKEN} + CACHE_ENABLED: redis + CACHE_URI: redis://cache:6379 + CLUSTER_MODE: 1 + DB_CONN_MAX_RETRY: 30 + SKIP_UPDATECHECK: 1 + depends_on: + - cache + - db + theo2: + image: theo:test + container_name: theo2 + environment: + MODE: test + DB_ENGINE: postgres + DB_HOST: db + DB_USER: ${POSTGRES_USER} + DB_PASSWORD: ${POSTGRES_PASSWORD} + DB_NAME: ${POSTGRES_DB} + CORE_TOKEN: ${CORE_TOKEN} + CACHE_ENABLED: redis + CACHE_URI: redis://cache:6379 + CLUSTER_MODE: 1 + DB_CONN_MAX_RETRY: 30 + SKIP_UPDATECHECK: 1 + depends_on: + - cache + - db + theo3: + image: theo:test + container_name: theo3 + environment: + MODE: test + DB_ENGINE: postgres + DB_HOST: db + DB_USER: ${POSTGRES_USER} + DB_PASSWORD: ${POSTGRES_PASSWORD} + DB_NAME: ${POSTGRES_DB} + CORE_TOKEN: ${CORE_TOKEN} + CACHE_ENABLED: redis + CACHE_URI: redis://cache:6379 + CLUSTER_MODE: 1 + DB_CONN_MAX_RETRY: 30 + SKIP_UPDATECHECK: 1 + depends_on: + - cache + - db diff --git a/docker-compose/docker-compose-test-postgres-redis-core.yml b/docker-compose/docker-compose-test-postgres-redis-core.yml new file mode 100644 index 0000000..684a199 --- /dev/null +++ b/docker-compose/docker-compose-test-postgres-redis-core.yml @@ -0,0 +1,30 @@ +version: '3.1' + +services: + db: + image: ${POSTGRES_IMAGE} + environment: + POSTGRES_DB: ${POSTGRES_DB} + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + cache: + image: ${REDIS_IMAGE} + theo: + image: theo:test + container_name: theo1 + environment: + MODE: test + DB_ENGINE: postgres + DB_HOST: db + DB_USER: ${POSTGRES_USER} + DB_PASSWORD: ${POSTGRES_PASSWORD} + DB_NAME: ${POSTGRES_DB} + CORE_TOKEN: ${CORE_TOKEN} + CACHE_ENABLED: redis + CACHE_URI: redis://cache:6379 + CLUSTER_MODE: 1 + DB_CONN_MAX_RETRY: 30 + SKIP_UPDATECHECK: 1 + depends_on: + - cache + - db diff --git a/docker-compose/docker-compose-test-postgres-redis.yml b/docker-compose/docker-compose-test-postgres-redis.yml new file mode 100644 index 0000000..cc31c45 --- /dev/null +++ b/docker-compose/docker-compose-test-postgres-redis.yml @@ -0,0 +1,30 @@ +version: '3.1' + +services: + db: + image: ${POSTGRES_IMAGE} + environment: + POSTGRES_DB: ${POSTGRES_DB} + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + cache: + image: ${REDIS_IMAGE} + theo: + image: theo:test + container_name: theo + environment: + MODE: test + DB_ENGINE: postgres + DB_HOST: db + DB_USER: ${POSTGRES_USER} + DB_PASSWORD: ${POSTGRES_PASSWORD} + DB_NAME: ${POSTGRES_DB} + ADMIN_TOKEN: ${ADMIN_TOKEN} + CLIENT_TOKENS: ${CLIENT_TOKENS} + CACHE_ENABLED: redis + CACHE_URI: redis://cache:6379 + DB_CONN_MAX_RETRY: 30 + SKIP_UPDATECHECK: 1 + depends_on: + - cache + - db diff --git a/docker-compose/docker-compose-test-postgres.yml b/docker-compose/docker-compose-test-postgres.yml new file mode 100644 index 0000000..c15296c --- /dev/null +++ b/docker-compose/docker-compose-test-postgres.yml @@ -0,0 +1,25 @@ +version: '3.1' + +services: + db: + image: ${POSTGRES_IMAGE} + environment: + POSTGRES_DB: ${POSTGRES_DB} + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + theo: + image: theo:test + container_name: theo + environment: + MODE: test + DB_ENGINE: postgres + DB_HOST: db + DB_USER: ${POSTGRES_USER} + DB_PASSWORD: ${POSTGRES_PASSWORD} + DB_NAME: ${POSTGRES_DB} + ADMIN_TOKEN: ${ADMIN_TOKEN} + CLIENT_TOKENS: ${CLIENT_TOKENS} + DB_CONN_MAX_RETRY: 30 + SKIP_UPDATECHECK: 1 + depends_on: + - db diff --git a/docker-compose/test_env b/docker-compose/test_env index 194a330..ed48b14 100644 --- a/docker-compose/test_env +++ b/docker-compose/test_env @@ -1,7 +1,8 @@ # docker images -export MARIADB_IMAGE=mariadb:10.5 +export MARIADB_IMAGE=mariadb:10.6 export MYSQLSERVER_IMAGE=mysql/mysql-server:8.0 -export REDIS_IMAGE=redis:6.0 +export POSTGRES_IMAGE=postgres:14 +export REDIS_IMAGE=redis:6 export MEMCACHED_IMAGE=memcached:1-alpine # mariadb/mysql @@ -18,3 +19,10 @@ export CLIENT_TOKENS=njknsjd2412fnjkasnj,knkjnknfjfnjenkln export ADMIN_TOKEN_AUDIT=jjkfsdbb23 export ADMIN_TOKENS_AUDIT=4getm3N0t:admin1,n0t4ever:admin2,jjkfsdbb23:admin3 + + +# Postgres + +export POSTGRES_DB=theo +export POSTGRES_USER=theouser +export POSTGRES_PASSWORD=theopwd \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index eb2acea..deda6a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,19 +1,20 @@ { "name": "theo", - "version": "1.3.0", + "version": "1.4.0-beta.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "theo", - "version": "1.3.0", + "version": "1.4.0-beta.0", "license": "Apache-2.0", "dependencies": { - "@authkeys/microservice": "^2.4.3", - "@authkeys/mysql-connman": "^0.6.0", + "@authkeys/microservice": "^2.5.0", + "@authkeys/mysql-connman": "^0.8.2", "dotenv": "^8.2.0", "memcached": "^2.2.2", "node-fetch": "^2.6.1", + "pg": "^8.7.1", "redis": "^3.0.0", "semver": "^7.3.4", "sqlite3": "^5.0.0", @@ -45,13 +46,13 @@ } }, "node_modules/@authkeys/microservice": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/@authkeys/microservice/-/microservice-2.4.3.tgz", - "integrity": "sha512-WtGDqD79SavzOD//SLRmYscNWR/5d41AAjW2+9bejkmg6mp0bBp0RRBHDrgdiOTIqUCJVLF/E0uS13b9tB7KVw==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@authkeys/microservice/-/microservice-2.5.0.tgz", + "integrity": "sha512-32xUDwnWTwEOWSnS6b6CZ3FyUWPJYFn5/AfzdxemRQ8s0WCcDe1WNsFLbBPy23YThGYlimlmlTqw0YxtGLsJaQ==", "dependencies": { "body-parser": "^1.19.0", - "bunyan": "^1.8.12", - "debug": "^3.2.6", + "bunyan": "^1.8.15", + "debug": "^3.2.7", "express": "^4.17.1", "express-prometheus-middleware": "^0.8.4", "node-fetch": "^2.6.1", @@ -59,14 +60,15 @@ } }, "node_modules/@authkeys/mysql-connman": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@authkeys/mysql-connman/-/mysql-connman-0.6.2.tgz", - "integrity": "sha512-yNETMV8xpWcSqs2v13ZaWO9v9HOAJjrfbDhwT87eK5+scihIYy3PRyAMJkCLf6V2/6fYJgANY22BkMAMKzY39w==", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/@authkeys/mysql-connman/-/mysql-connman-0.8.2.tgz", + "integrity": "sha512-VJ8GsbjYlxguf/4YbeeYFvkpBeSA4lhoF7JikAtykuI/djOmhxQsGzy1w1IaOZk21r+7I0Wd2NBTtjRplvzIxg==", "dependencies": { - "babel-eslint": "^10.0.2", "mysql2": "^2.1.0" }, "optionalDependencies": { + "@fluidware-it/opentracing-injector": "^0.2.0", + "babel-eslint": "^10.0.2", "eslint": "^6.0.1", "eslint-config-prettier": "^6.0.0", "eslint-config-standard": "^13.0.1", @@ -523,6 +525,9 @@ }, "engines": { "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@babel/cli/node_modules/make-dir": { @@ -560,6 +565,7 @@ "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "devOptional": true, "dependencies": { "@babel/highlight": "^7.10.4" } @@ -620,6 +626,11 @@ }, "engines": { "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/@babel/core/node_modules/json5": { @@ -696,6 +707,7 @@ "version": "7.13.0", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.13.0.tgz", "integrity": "sha512-zBZfgvBB/ywjx0Rgc2+BwoH/3H+lDtlgD4hBOpEv5LxRnYsm/753iRuLepqnYlynpjC3AdQxtxsoeHJoEEwOAw==", + "devOptional": true, "dependencies": { "@babel/types": "^7.13.0", "jsesc": "^2.5.1", @@ -838,6 +850,7 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "devOptional": true, "dependencies": { "@babel/helper-get-function-arity": "^7.12.13", "@babel/template": "^7.12.13", @@ -848,6 +861,7 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "devOptional": true, "dependencies": { "@babel/types": "^7.12.13" } @@ -957,6 +971,7 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "devOptional": true, "dependencies": { "@babel/types": "^7.12.13" } @@ -964,7 +979,8 @@ "node_modules/@babel/helper-validator-identifier": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==" + "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "devOptional": true }, "node_modules/@babel/helper-validator-option": { "version": "7.12.17", @@ -999,6 +1015,7 @@ "version": "7.13.8", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.8.tgz", "integrity": "sha512-4vrIhfJyfNf+lCtXC2ck1rKSzDwciqF7IWFhXXrSOUC2O5DrVp+w4c6ed4AllTxhTkUP5x2tYj41VaxdVMMRDw==", + "devOptional": true, "dependencies": { "@babel/helper-validator-identifier": "^7.12.11", "chalk": "^2.0.0", @@ -1030,6 +1047,7 @@ "version": "7.13.4", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.4.tgz", "integrity": "sha512-uvoOulWHhI+0+1f9L4BoozY7U5cIkZ9PgJqvb041d6vypgUmtVPG4vmGm4pSggjl8BELzvHyUeJSUyEMY6b+qA==", + "devOptional": true, "bin": { "parser": "bin/babel-parser.js" }, @@ -1865,6 +1883,9 @@ "@babel/plugin-transform-dotall-regex": "^7.4.4", "@babel/types": "^7.4.4", "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, "node_modules/@babel/register": { @@ -1927,6 +1948,7 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "devOptional": true, "dependencies": { "@babel/code-frame": "^7.12.13", "@babel/parser": "^7.12.13", @@ -1937,6 +1959,7 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "devOptional": true, "dependencies": { "@babel/highlight": "^7.12.13" } @@ -1945,6 +1968,7 @@ "version": "7.13.0", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.0.tgz", "integrity": "sha512-xys5xi5JEhzC3RzEmSGrs/b3pJW/o87SypZ+G/PhaE7uqVQNv/jlmVIBXuoh5atqQ434LfXV+sf23Oxj0bchJQ==", + "devOptional": true, "dependencies": { "@babel/code-frame": "^7.12.13", "@babel/generator": "^7.13.0", @@ -1961,6 +1985,7 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "devOptional": true, "dependencies": { "@babel/highlight": "^7.12.13" } @@ -1969,22 +1994,30 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "devOptional": true, "dependencies": { "ms": "2.1.2" }, "engines": { "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/@babel/traverse/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "devOptional": true }, "node_modules/@babel/types": { "version": "7.13.0", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.0.tgz", "integrity": "sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA==", + "devOptional": true, "dependencies": { "@babel/helper-validator-identifier": "^7.12.11", "lodash": "^4.17.19", @@ -2049,6 +2082,16 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "devOptional": true }, + "node_modules/@fluidware-it/opentracing-injector": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@fluidware-it/opentracing-injector/-/opentracing-injector-0.2.1.tgz", + "integrity": "sha512-WEuuVc+P20eXFPfvJJb24S8Nt3HZJsO0wsyvUs0M5j6dibbKxWxi//S3vXziHwiulO88Ekh0gI6tQdy7dqBAtQ==", + "optional": true, + "dependencies": { + "jaeger-client": "^3.18.1", + "opentracing": "^0.14.5" + } + }, "node_modules/@istanbuljs/nyc-config-babel": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@istanbuljs/nyc-config-babel/-/nyc-config-babel-2.1.1.tgz", @@ -2056,6 +2099,10 @@ "dev": true, "engines": { "node": ">=6" + }, + "peerDependencies": { + "@babel/register": "*", + "babel-plugin-istanbul": ">=5" } }, "node_modules/@nicolo-ribaudo/chokidar-2": { @@ -2213,6 +2260,10 @@ "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, "node_modules/ansi-align": { @@ -2253,6 +2304,15 @@ "node": ">=6" } }, + "node_modules/ansi-color": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ansi-color/-/ansi-color-0.2.1.tgz", + "integrity": "sha1-PnXAN0dSF1RO12Oo21cJ+prlv5o=", + "optional": true, + "engines": { + "node": "*" + } + }, "node_modules/ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", @@ -2302,6 +2362,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "devOptional": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -2429,6 +2490,9 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array-unique": { @@ -2453,6 +2517,9 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/asn1": { @@ -2535,6 +2602,8 @@ "version": "10.1.0", "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", + "deprecated": "babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.", + "optional": true, "dependencies": { "@babel/code-frame": "^7.0.0", "@babel/parser": "^7.7.0", @@ -2545,6 +2614,9 @@ }, "engines": { "node": ">=6" + }, + "peerDependencies": { + "eslint": ">= 4.12.1" } }, "node_modules/babel-plugin-dynamic-import-node": { @@ -2606,6 +2678,9 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/babel-plugin-istanbul/node_modules/p-locate": { @@ -2986,10 +3061,33 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, + "node_modules/buffer-writer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", + "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/bufrw": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/bufrw/-/bufrw-1.3.0.tgz", + "integrity": "sha512-jzQnSbdJqhIltU9O5KUiTtljP9ccw2u5ix59McQy4pV2xGhVLhRZIndY8GIrgh5HjXa6+QJ9AQhOd2QWQizJFQ==", + "optional": true, + "dependencies": { + "ansi-color": "^0.2.1", + "error": "^7.0.0", + "hexer": "^1.5.0", + "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 0.10.x" + } + }, "node_modules/bunyan": { - "version": "1.8.14", - "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.14.tgz", - "integrity": "sha512-LlahJUxXzZLuw/hetUQJmRgZ1LF6+cr5TPpRj6jf327AsiIq2jhYEH4oqUUkVKTor+9w2BT3oxVwhzE5lw9tcg==", + "version": "1.8.15", + "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.15.tgz", + "integrity": "sha512-0tECWShh6wUysgucJcBAoYegf3JJoZWibxdqhTm7OHPeT42qdjkZ29QCMcKwbgU1kiH+auSIasNRXMLWXafXig==", "engines": [ "node >=0.10.0" ], @@ -3128,6 +3226,9 @@ "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/callsites": { @@ -3164,6 +3265,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "devOptional": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -3439,6 +3541,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "devOptional": true, "dependencies": { "color-name": "1.1.3" } @@ -3446,7 +3549,8 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "devOptional": true }, "node_modules/colorette": { "version": "1.2.2", @@ -3621,7 +3725,11 @@ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.1.tgz", "integrity": "sha512-9Id2xHY1W7m8hCl8NkhQn5CufmF/WuR30BTRewvCXc1aZd3kMECwNZ69ndLbekKfakw9Rf2Xyc+QR6E7Gg+obg==", "dev": true, - "hasInstallScript": true + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } }, "node_modules/core-js-compat": { "version": "3.9.0", @@ -4072,6 +4180,16 @@ "node": ">=6" } }, + "node_modules/error": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/error/-/error-7.0.2.tgz", + "integrity": "sha1-pfdf/02ZJhJt2sDqXcOOaJFTywI=", + "optional": true, + "dependencies": { + "string-template": "~0.2.1", + "xtend": "~4.0.0" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -4102,6 +4220,9 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/es-to-primitive": { @@ -4116,6 +4237,9 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/es6-error": { @@ -4151,6 +4275,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "devOptional": true, "engines": { "node": ">=0.8.0" } @@ -4330,6 +4455,9 @@ }, "engines": { "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0" } }, "node_modules/eslint-plugin-import/node_modules/debug": { @@ -4429,7 +4557,24 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.1.0.tgz", "integrity": "sha512-ZL7+QRixjTR6/528YNGyDotyffm5OQst/sGxKDwGb9Uqs4In5Egi4+jbobhqJoyoCM6/7v/1A5fhQ7ScMtDjaQ==", - "optional": true + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true, + "peerDependencies": { + "eslint": ">=5.0.0" + } }, "node_modules/eslint-scope": { "version": "5.1.1", @@ -4463,6 +4608,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "devOptional": true, "engines": { "node": ">=4" } @@ -4540,6 +4686,11 @@ }, "engines": { "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/eslint/node_modules/eslint-visitor-keys": { @@ -4561,6 +4712,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint/node_modules/has-flag": { @@ -5166,6 +5320,9 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/find-cache-dir/node_modules/p-locate": { @@ -5296,6 +5453,20 @@ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "engines": { "node": ">=4" } @@ -5454,7 +5625,8 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "devOptional": true }, "node_modules/functional-red-black-tree": { "version": "1.0.1", @@ -5555,6 +5727,9 @@ "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-stdin": { @@ -5649,6 +5824,7 @@ "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "devOptional": true, "engines": { "node": ">=4" } @@ -5703,6 +5879,7 @@ "version": "5.1.5", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", "optional": true, "dependencies": { "ajv": "^6.12.3", @@ -5716,6 +5893,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "devOptional": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -5727,6 +5905,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "devOptional": true, "engines": { "node": ">=4" } @@ -5738,6 +5917,9 @@ "devOptional": true, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-unicode": { @@ -5826,6 +6008,24 @@ "he": "bin/he" } }, + "node_modules/hexer": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/hexer/-/hexer-1.5.0.tgz", + "integrity": "sha1-uGzoCFmOip0YksVx887dhvyfBlM=", + "optional": true, + "dependencies": { + "ansi-color": "^0.2.1", + "minimist": "^1.1.0", + "process": "^0.10.0", + "xtend": "^4.0.0" + }, + "bin": { + "hexer": "cli.js" + }, + "engines": { + "node": ">= 0.10.x" + } + }, "node_modules/homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", @@ -5931,6 +6131,9 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/import-lazy": { @@ -6143,6 +6346,9 @@ "devOptional": true, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-ci": { @@ -6161,8 +6367,12 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "devOptional": true, "dependencies": { "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-data-descriptor": { @@ -6198,6 +6408,9 @@ "devOptional": true, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-descriptor": { @@ -6288,6 +6501,9 @@ "devOptional": true, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-npm": { @@ -6371,6 +6587,9 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-stream": { @@ -6389,6 +6608,9 @@ "optional": true, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-symbol": { @@ -6401,6 +6623,9 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-typedarray": { @@ -6583,6 +6808,11 @@ }, "engines": { "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/istanbul-lib-source-maps/node_modules/glob": { @@ -6600,6 +6830,9 @@ }, "engines": { "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/istanbul-lib-source-maps/node_modules/make-dir": { @@ -6680,10 +6913,27 @@ "retry": "0.6.0" } }, + "node_modules/jaeger-client": { + "version": "3.18.1", + "resolved": "https://registry.npmjs.org/jaeger-client/-/jaeger-client-3.18.1.tgz", + "integrity": "sha512-eZLM2U6rJvYo0XbzQYFeMYfp29gQix7SKlmDReorp9hJkUwXZtTyxW81AcKdmFCjLHO5tFysTX+394BnjEnUZg==", + "optional": true, + "dependencies": { + "node-int64": "^0.4.0", + "opentracing": "^0.14.4", + "thriftrw": "^3.5.0", + "uuid": "^3.2.1", + "xorshift": "^0.2.0" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "devOptional": true }, "node_modules/js-yaml": { "version": "3.14.1", @@ -6707,6 +6957,7 @@ "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "devOptional": true, "bin": { "jsesc": "bin/jsesc" }, @@ -6858,7 +7109,8 @@ "node_modules/lodash": { "version": "4.17.20", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "devOptional": true }, "node_modules/lodash.debounce": { "version": "4.0.8", @@ -7201,6 +7453,7 @@ "version": "3.2.6", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", "dev": true, "dependencies": { "ms": "^2.1.1" @@ -7265,6 +7518,7 @@ "version": "0.5.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz", "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==", + "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", "dev": true, "dependencies": { "minimist": "^1.2.5" @@ -7314,6 +7568,9 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mocha/node_modules/p-locate": { @@ -7433,7 +7690,21 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/multiparty/node_modules/setprototypeof": { "version": "1.2.0", @@ -7516,9 +7787,9 @@ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" }, "node_modules/nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", + "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==", "optional": true }, "node_modules/nanomatch": { @@ -7705,6 +7976,9 @@ }, "engines": { "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/node-gyp/node_modules/nopt": { @@ -7728,6 +8002,12 @@ "semver": "bin/semver" } }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "optional": true + }, "node_modules/node-modules-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", @@ -7741,6 +8021,7 @@ "version": "0.11.0", "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz", "integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==", + "deprecated": "Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future", "dependencies": { "detect-libc": "^1.0.2", "mkdirp": "^0.5.1", @@ -7771,6 +8052,9 @@ }, "engines": { "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/node-pre-gyp/node_modules/nopt": { @@ -7880,6 +8164,9 @@ }, "bin": { "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" } }, "node_modules/normalize-package-data": { @@ -8029,6 +8316,9 @@ }, "engines": { "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/nyc/node_modules/locate-path": { @@ -8067,6 +8357,9 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/nyc/node_modules/p-locate": { @@ -8182,7 +8475,10 @@ "version": "1.9.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==", - "devOptional": true + "devOptional": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/object-keys": { "version": "1.1.1", @@ -8219,6 +8515,9 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object.getownpropertydescriptors": { @@ -8233,6 +8532,9 @@ }, "engines": { "node": ">= 0.8" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object.pick": { @@ -8261,6 +8563,9 @@ }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/on-finished": { @@ -8305,6 +8610,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/opentracing": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/opentracing/-/opentracing-0.14.5.tgz", + "integrity": "sha512-XLKtEfHxqrWyF1fzxznsv78w3csW41ucHnjiKnfzZLD5FN8UBDZZL1i4q0FR29zjxXhm+2Hop+5Vr/b8tKIvEg==", + "optional": true, + "engines": { + "node": ">=0.10" + } + }, "node_modules/optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -8428,6 +8742,11 @@ "semver": "bin/semver.js" } }, + "node_modules/packet-reader": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", + "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -8515,7 +8834,8 @@ "node_modules/path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "devOptional": true }, "node_modules/path-to-regexp": { "version": "0.1.7", @@ -8528,17 +8848,91 @@ "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", "optional": true, "dependencies": { - "pify": "^2.0.0" + "pify": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "optional": true + }, + "node_modules/pg": { + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.7.1.tgz", + "integrity": "sha512-7bdYcv7V6U3KAtWjpQJJBww0UEsWuh4yQ/EjNf2HeO/NnvKjpvhEIe/A/TleP6wtmSKnUnghs5A9jUoK6iDdkA==", + "dependencies": { + "buffer-writer": "2.0.0", + "packet-reader": "1.0.0", + "pg-connection-string": "^2.5.0", + "pg-pool": "^3.4.1", + "pg-protocol": "^1.5.0", + "pg-types": "^2.1.0", + "pgpass": "1.x" + }, + "engines": { + "node": ">= 8.0.0" + }, + "peerDependencies": { + "pg-native": ">=2.0.0" + }, + "peerDependenciesMeta": { + "pg-native": { + "optional": true + } + } + }, + "node_modules/pg-connection-string": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", + "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" + }, + "node_modules/pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/pg-pool": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.4.1.tgz", + "integrity": "sha512-TVHxR/gf3MeJRvchgNHxsYsTCHQ+4wm3VIHSS19z8NC0+gioEhq1okDY1sm/TYbfoP6JLFx01s0ShvZ3puP/iQ==", + "peerDependencies": { + "pg": ">=8.0" + } + }, + "node_modules/pg-protocol": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz", + "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==" + }, + "node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "dependencies": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" }, "engines": { "node": ">=4" } }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "optional": true + "node_modules/pgpass": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.4.tgz", + "integrity": "sha512-YmuA56alyBq7M59vxVBfPJrGSozru8QAdoNlWuW3cz8l+UX3cWge0vTvjKhsSHSJpo3Bom8/Mm6hf0TR5GY0+w==", + "dependencies": { + "split2": "^3.1.1" + } }, "node_modules/picomatch": { "version": "2.2.2", @@ -8547,6 +8941,9 @@ "optional": true, "engines": { "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/pify": { @@ -8592,6 +8989,41 @@ "node": ">=0.10.0" } }, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "dependencies": { + "xtend": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -8634,6 +9066,15 @@ "node": ">=6.0.0" } }, + "node_modules/process": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/process/-/process-0.10.1.tgz", + "integrity": "sha1-hCRXzFHP7XLcd1r+6vuMYDQ3JyU=", + "optional": true, + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -8848,6 +9289,10 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-redis" } }, "node_modules/redis-commands": { @@ -9044,6 +9489,7 @@ "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", "optional": true, "dependencies": { "aws-sign2": "~0.7.0", @@ -9108,9 +9554,13 @@ "version": "1.19.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "devOptional": true, "dependencies": { "is-core-module": "^2.1.0", "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve-from": { @@ -9126,6 +9576,7 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "deprecated": "https://github.com/lydell/resolve-url#deprecated", "dev": true, "optional": true }, @@ -9639,6 +10090,7 @@ "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -9712,6 +10164,9 @@ }, "engines": { "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/spawn-wrap/node_modules/rimraf": { @@ -9771,6 +10226,27 @@ "node": ">=0.10.0" } }, + "node_modules/split2": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", + "dependencies": { + "readable-stream": "^3.0.0" + } + }, + "node_modules/split2/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -9788,6 +10264,14 @@ }, "optionalDependencies": { "node-gyp": "3.x" + }, + "peerDependencies": { + "node-gyp": "3.x" + }, + "peerDependenciesMeta": { + "node-gyp": { + "optional": true + } } }, "node_modules/sqlstring": { @@ -9813,6 +10297,11 @@ "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, "engines": { "node": ">=0.10.0" } @@ -9860,6 +10349,12 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/string-template": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", + "integrity": "sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=", + "optional": true + }, "node_modules/string-width": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.1.tgz", @@ -9894,6 +10389,9 @@ "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { @@ -9904,6 +10402,9 @@ "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/strip-ansi": { @@ -9943,12 +10444,16 @@ "devOptional": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "devOptional": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -9997,6 +10502,7 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", + "deprecated": "This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.", "optional": true, "dependencies": { "block-stream": "*", @@ -10066,6 +10572,9 @@ }, "engines": { "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/test-exclude/node_modules/load-json-file": { @@ -10106,6 +10615,9 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/test-exclude/node_modules/p-locate": { @@ -10196,6 +10708,32 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "devOptional": true }, + "node_modules/thriftrw": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/thriftrw/-/thriftrw-3.12.0.tgz", + "integrity": "sha512-4YZvR4DPEI41n4Opwr4jmrLGG4hndxr7387kzRFIIzxHQjarPusH4lGXrugvgb7TtPrfZVTpZCVe44/xUxowEw==", + "optional": true, + "dependencies": { + "bufrw": "^1.3.0", + "error": "7.0.2", + "long": "^2.4.0" + }, + "bin": { + "thrift2json": "thrift2json.js" + }, + "engines": { + "node": ">= 0.10.x" + } + }, + "node_modules/thriftrw/node_modules/long": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/long/-/long-2.4.0.tgz", + "integrity": "sha1-n6GAux2VAM3CnEFWdmoZleH0Uk8=", + "optional": true, + "engines": { + "node": ">=0.6" + } + }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -10218,6 +10756,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "devOptional": true, "engines": { "node": ">=4" } @@ -10688,6 +11227,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "deprecated": "Please see https://github.com/lydell/urix#deprecated", "dev": true, "optional": true }, @@ -10738,6 +11278,7 @@ "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", "bin": { "uuid": "bin/uuid" } @@ -10958,6 +11499,20 @@ "node": ">=8" } }, + "node_modules/xorshift": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/xorshift/-/xorshift-0.2.1.tgz", + "integrity": "sha1-/NgiZ+k1HBPw+5xzMH8lMx0pxjo=", + "optional": true + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } + }, "node_modules/y18n": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", @@ -11061,6 +11616,9 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/yargs/node_modules/p-locate": { @@ -11101,13 +11659,13 @@ }, "dependencies": { "@authkeys/microservice": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/@authkeys/microservice/-/microservice-2.4.3.tgz", - "integrity": "sha512-WtGDqD79SavzOD//SLRmYscNWR/5d41AAjW2+9bejkmg6mp0bBp0RRBHDrgdiOTIqUCJVLF/E0uS13b9tB7KVw==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@authkeys/microservice/-/microservice-2.5.0.tgz", + "integrity": "sha512-32xUDwnWTwEOWSnS6b6CZ3FyUWPJYFn5/AfzdxemRQ8s0WCcDe1WNsFLbBPy23YThGYlimlmlTqw0YxtGLsJaQ==", "requires": { "body-parser": "^1.19.0", - "bunyan": "^1.8.12", - "debug": "^3.2.6", + "bunyan": "^1.8.15", + "debug": "^3.2.7", "express": "^4.17.1", "express-prometheus-middleware": "^0.8.4", "node-fetch": "^2.6.1", @@ -11115,10 +11673,11 @@ } }, "@authkeys/mysql-connman": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@authkeys/mysql-connman/-/mysql-connman-0.6.2.tgz", - "integrity": "sha512-yNETMV8xpWcSqs2v13ZaWO9v9HOAJjrfbDhwT87eK5+scihIYy3PRyAMJkCLf6V2/6fYJgANY22BkMAMKzY39w==", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/@authkeys/mysql-connman/-/mysql-connman-0.8.2.tgz", + "integrity": "sha512-VJ8GsbjYlxguf/4YbeeYFvkpBeSA4lhoF7JikAtykuI/djOmhxQsGzy1w1IaOZk21r+7I0Wd2NBTtjRplvzIxg==", "requires": { + "@fluidware-it/opentracing-injector": "^0.2.0", "babel-eslint": "^10.0.2", "eslint": "^6.0.1", "eslint-config-prettier": "^6.0.0", @@ -11489,6 +12048,7 @@ "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "devOptional": true, "requires": { "@babel/highlight": "^7.10.4" } @@ -11597,6 +12157,7 @@ "version": "7.13.0", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.13.0.tgz", "integrity": "sha512-zBZfgvBB/ywjx0Rgc2+BwoH/3H+lDtlgD4hBOpEv5LxRnYsm/753iRuLepqnYlynpjC3AdQxtxsoeHJoEEwOAw==", + "devOptional": true, "requires": { "@babel/types": "^7.13.0", "jsesc": "^2.5.1", @@ -11717,6 +12278,7 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "devOptional": true, "requires": { "@babel/helper-get-function-arity": "^7.12.13", "@babel/template": "^7.12.13", @@ -11727,6 +12289,7 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "devOptional": true, "requires": { "@babel/types": "^7.12.13" } @@ -11836,6 +12399,7 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "devOptional": true, "requires": { "@babel/types": "^7.12.13" } @@ -11843,7 +12407,8 @@ "@babel/helper-validator-identifier": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==" + "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "devOptional": true }, "@babel/helper-validator-option": { "version": "7.12.17", @@ -11878,6 +12443,7 @@ "version": "7.13.8", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.8.tgz", "integrity": "sha512-4vrIhfJyfNf+lCtXC2ck1rKSzDwciqF7IWFhXXrSOUC2O5DrVp+w4c6ed4AllTxhTkUP5x2tYj41VaxdVMMRDw==", + "devOptional": true, "requires": { "@babel/helper-validator-identifier": "^7.12.11", "chalk": "^2.0.0", @@ -11902,7 +12468,8 @@ "@babel/parser": { "version": "7.13.4", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.4.tgz", - "integrity": "sha512-uvoOulWHhI+0+1f9L4BoozY7U5cIkZ9PgJqvb041d6vypgUmtVPG4vmGm4pSggjl8BELzvHyUeJSUyEMY6b+qA==" + "integrity": "sha512-uvoOulWHhI+0+1f9L4BoozY7U5cIkZ9PgJqvb041d6vypgUmtVPG4vmGm4pSggjl8BELzvHyUeJSUyEMY6b+qA==", + "devOptional": true }, "@babel/plugin-proposal-async-generator-functions": { "version": "7.13.8", @@ -12606,6 +13173,7 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "devOptional": true, "requires": { "@babel/code-frame": "^7.12.13", "@babel/parser": "^7.12.13", @@ -12616,6 +13184,7 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "devOptional": true, "requires": { "@babel/highlight": "^7.12.13" } @@ -12626,6 +13195,7 @@ "version": "7.13.0", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.0.tgz", "integrity": "sha512-xys5xi5JEhzC3RzEmSGrs/b3pJW/o87SypZ+G/PhaE7uqVQNv/jlmVIBXuoh5atqQ434LfXV+sf23Oxj0bchJQ==", + "devOptional": true, "requires": { "@babel/code-frame": "^7.12.13", "@babel/generator": "^7.13.0", @@ -12642,6 +13212,7 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "devOptional": true, "requires": { "@babel/highlight": "^7.12.13" } @@ -12650,6 +13221,7 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "devOptional": true, "requires": { "ms": "2.1.2" } @@ -12657,7 +13229,8 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "devOptional": true } } }, @@ -12665,6 +13238,7 @@ "version": "7.13.0", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.0.tgz", "integrity": "sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA==", + "devOptional": true, "requires": { "@babel/helper-validator-identifier": "^7.12.11", "lodash": "^4.17.19", @@ -12714,11 +13288,22 @@ } } }, + "@fluidware-it/opentracing-injector": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@fluidware-it/opentracing-injector/-/opentracing-injector-0.2.1.tgz", + "integrity": "sha512-WEuuVc+P20eXFPfvJJb24S8Nt3HZJsO0wsyvUs0M5j6dibbKxWxi//S3vXziHwiulO88Ekh0gI6tQdy7dqBAtQ==", + "optional": true, + "requires": { + "jaeger-client": "^3.18.1", + "opentracing": "^0.14.5" + } + }, "@istanbuljs/nyc-config-babel": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@istanbuljs/nyc-config-babel/-/nyc-config-babel-2.1.1.tgz", "integrity": "sha512-cWcUCqHOYB+Mpumsv03uaE7rMvtmJn7pZ3llc+9gyqMFC93IVcUuuJ/mknoWsiuajcEjRCqKmhGaiAaXG6kzLA==", - "dev": true + "dev": true, + "requires": {} }, "@nicolo-ribaudo/chokidar-2": { "version": "2.1.8-no-fsevents", @@ -12895,6 +13480,12 @@ } } }, + "ansi-color": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ansi-color/-/ansi-color-0.2.1.tgz", + "integrity": "sha1-PnXAN0dSF1RO12Oo21cJ+prlv5o=", + "optional": true + }, "ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", @@ -12928,6 +13519,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "devOptional": true, "requires": { "color-convert": "^1.9.0" } @@ -13118,6 +13710,7 @@ "version": "10.1.0", "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", + "optional": true, "requires": { "@babel/code-frame": "^7.0.0", "@babel/parser": "^7.7.0", @@ -13484,10 +14077,27 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, + "buffer-writer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", + "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==" + }, + "bufrw": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/bufrw/-/bufrw-1.3.0.tgz", + "integrity": "sha512-jzQnSbdJqhIltU9O5KUiTtljP9ccw2u5ix59McQy4pV2xGhVLhRZIndY8GIrgh5HjXa6+QJ9AQhOd2QWQizJFQ==", + "optional": true, + "requires": { + "ansi-color": "^0.2.1", + "error": "^7.0.0", + "hexer": "^1.5.0", + "xtend": "^4.0.0" + } + }, "bunyan": { - "version": "1.8.14", - "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.14.tgz", - "integrity": "sha512-LlahJUxXzZLuw/hetUQJmRgZ1LF6+cr5TPpRj6jf327AsiIq2jhYEH4oqUUkVKTor+9w2BT3oxVwhzE5lw9tcg==", + "version": "1.8.15", + "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.15.tgz", + "integrity": "sha512-0tECWShh6wUysgucJcBAoYegf3JJoZWibxdqhTm7OHPeT42qdjkZ29QCMcKwbgU1kiH+auSIasNRXMLWXafXig==", "requires": { "dtrace-provider": "~0.8", "moment": "^2.19.3", @@ -13624,6 +14234,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "devOptional": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -13843,6 +14454,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "devOptional": true, "requires": { "color-name": "1.1.3" } @@ -13850,7 +14462,8 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "devOptional": true }, "colorette": { "version": "1.2.2", @@ -14356,6 +14969,16 @@ } } }, + "error": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/error/-/error-7.0.2.tgz", + "integrity": "sha1-pfdf/02ZJhJt2sDqXcOOaJFTywI=", + "optional": true, + "requires": { + "string-template": "~0.2.1", + "xtend": "~4.0.0" + } + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -14422,7 +15045,8 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "devOptional": true }, "eslint": { "version": "7.21.0", @@ -14759,7 +15383,8 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.1.0.tgz", "integrity": "sha512-ZL7+QRixjTR6/528YNGyDotyffm5OQst/sGxKDwGb9Uqs4In5Egi4+jbobhqJoyoCM6/7v/1A5fhQ7ScMtDjaQ==", - "optional": true + "optional": true, + "requires": {} }, "eslint-scope": { "version": "5.1.1", @@ -14783,7 +15408,8 @@ "eslint-visitor-keys": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "devOptional": true }, "espree": { "version": "7.3.1", @@ -15443,7 +16069,8 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "devOptional": true }, "functional-red-black-tree": { "version": "1.0.1", @@ -15602,7 +16229,8 @@ "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "devOptional": true }, "got": { "version": "9.6.0", @@ -15655,6 +16283,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "devOptional": true, "requires": { "function-bind": "^1.1.1" } @@ -15662,7 +16291,8 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "devOptional": true }, "has-symbols": { "version": "1.0.1", @@ -15740,6 +16370,18 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, + "hexer": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/hexer/-/hexer-1.5.0.tgz", + "integrity": "sha1-uGzoCFmOip0YksVx887dhvyfBlM=", + "optional": true, + "requires": { + "ansi-color": "^0.2.1", + "minimist": "^1.1.0", + "process": "^0.10.0", + "xtend": "^4.0.0" + } + }, "homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", @@ -16009,6 +16651,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "devOptional": true, "requires": { "has": "^1.0.3" } @@ -16414,10 +17057,24 @@ "retry": "0.6.0" } }, + "jaeger-client": { + "version": "3.18.1", + "resolved": "https://registry.npmjs.org/jaeger-client/-/jaeger-client-3.18.1.tgz", + "integrity": "sha512-eZLM2U6rJvYo0XbzQYFeMYfp29gQix7SKlmDReorp9hJkUwXZtTyxW81AcKdmFCjLHO5tFysTX+394BnjEnUZg==", + "optional": true, + "requires": { + "node-int64": "^0.4.0", + "opentracing": "^0.14.4", + "thriftrw": "^3.5.0", + "uuid": "^3.2.1", + "xorshift": "^0.2.0" + } + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "devOptional": true }, "js-yaml": { "version": "3.14.1", @@ -16437,7 +17094,8 @@ "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "devOptional": true }, "json-buffer": { "version": "3.0.0", @@ -16562,7 +17220,8 @@ "lodash": { "version": "4.17.20", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "devOptional": true }, "lodash.debounce": { "version": "4.0.8", @@ -17106,9 +17765,9 @@ } }, "nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", + "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==", "optional": true }, "nanomatch": { @@ -17288,6 +17947,12 @@ } } }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "optional": true + }, "node-modules-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", @@ -17744,6 +18409,12 @@ "mimic-fn": "^2.1.0" } }, + "opentracing": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/opentracing/-/opentracing-0.14.5.tgz", + "integrity": "sha512-XLKtEfHxqrWyF1fzxznsv78w3csW41ucHnjiKnfzZLD5FN8UBDZZL1i4q0FR29zjxXhm+2Hop+5Vr/b8tKIvEg==", + "optional": true + }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -17839,6 +18510,11 @@ } } }, + "packet-reader": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", + "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" + }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -17902,7 +18578,8 @@ "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "devOptional": true }, "path-to-regexp": { "version": "0.1.7", @@ -17924,6 +18601,61 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "optional": true }, + "pg": { + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.7.1.tgz", + "integrity": "sha512-7bdYcv7V6U3KAtWjpQJJBww0UEsWuh4yQ/EjNf2HeO/NnvKjpvhEIe/A/TleP6wtmSKnUnghs5A9jUoK6iDdkA==", + "requires": { + "buffer-writer": "2.0.0", + "packet-reader": "1.0.0", + "pg-connection-string": "^2.5.0", + "pg-pool": "^3.4.1", + "pg-protocol": "^1.5.0", + "pg-types": "^2.1.0", + "pgpass": "1.x" + } + }, + "pg-connection-string": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", + "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" + }, + "pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==" + }, + "pg-pool": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.4.1.tgz", + "integrity": "sha512-TVHxR/gf3MeJRvchgNHxsYsTCHQ+4wm3VIHSS19z8NC0+gioEhq1okDY1sm/TYbfoP6JLFx01s0ShvZ3puP/iQ==", + "requires": {} + }, + "pg-protocol": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz", + "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==" + }, + "pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "requires": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + } + }, + "pgpass": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.4.tgz", + "integrity": "sha512-YmuA56alyBq7M59vxVBfPJrGSozru8QAdoNlWuW3cz8l+UX3cWge0vTvjKhsSHSJpo3Bom8/Mm6hf0TR5GY0+w==", + "requires": { + "split2": "^3.1.1" + } + }, "picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", @@ -17961,6 +18693,29 @@ "dev": true, "optional": true }, + "postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==" + }, + "postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU=" + }, + "postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==" + }, + "postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "requires": { + "xtend": "^4.0.0" + } + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -17988,6 +18743,12 @@ "fast-diff": "^1.1.2" } }, + "process": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/process/-/process-0.10.1.tgz", + "integrity": "sha1-hCRXzFHP7XLcd1r+6vuMYDQ3JyU=", + "optional": true + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -18369,6 +19130,7 @@ "version": "1.19.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "devOptional": true, "requires": { "is-core-module": "^2.1.0", "path-parse": "^1.0.6" @@ -18813,7 +19575,8 @@ "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "devOptional": true }, "source-map-resolve": { "version": "0.5.3", @@ -18935,6 +19698,26 @@ "extend-shallow": "^3.0.0" } }, + "split2": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", + "requires": { + "readable-stream": "^3.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -19008,6 +19791,12 @@ "safe-buffer": "~5.1.0" } }, + "string-template": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", + "integrity": "sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=", + "optional": true + }, "string-width": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.1.tgz", @@ -19083,6 +19872,7 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "devOptional": true, "requires": { "has-flag": "^3.0.0" } @@ -19279,6 +20069,25 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "devOptional": true }, + "thriftrw": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/thriftrw/-/thriftrw-3.12.0.tgz", + "integrity": "sha512-4YZvR4DPEI41n4Opwr4jmrLGG4hndxr7387kzRFIIzxHQjarPusH4lGXrugvgb7TtPrfZVTpZCVe44/xUxowEw==", + "optional": true, + "requires": { + "bufrw": "^1.3.0", + "error": "7.0.2", + "long": "^2.4.0" + }, + "dependencies": { + "long": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/long/-/long-2.4.0.tgz", + "integrity": "sha1-n6GAux2VAM3CnEFWdmoZleH0Uk8=", + "optional": true + } + } + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -19297,7 +20106,8 @@ "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "devOptional": true }, "to-object-path": { "version": "0.3.0", @@ -19886,6 +20696,17 @@ "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", "optional": true }, + "xorshift": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/xorshift/-/xorshift-0.2.1.tgz", + "integrity": "sha1-/NgiZ+k1HBPw+5xzMH8lMx0pxjo=", + "optional": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, "y18n": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", diff --git a/package.json b/package.json index a8afcf3..6daabc0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "theo", - "version": "1.3.0", + "version": "1.4.0-beta.0", "description": "Theo is your AuthorizedKeys manager", "main": "index.js", "repository": "theoapp/theo-node", @@ -25,7 +25,8 @@ "test:upgrade:mysql": "mocha tests/testUpgrade_mysql.js", "test:upgrade:sqlite": "mocha tests/testUpgrade_sqlite.js", "preversion": "npm run lint", - "version": "./scripts/updateVersion.sh" + "version": "./scripts/updateVersion.sh", + "ver": "echo $npm_package_version" }, "nodemonConfig": { "delay": 2000 @@ -33,11 +34,12 @@ "author": "Michele Azzolari (macno)", "license": "Apache-2.0", "dependencies": { - "@authkeys/microservice": "^2.4.3", - "@authkeys/mysql-connman": "^0.6.0", + "@authkeys/microservice": "^2.5.0", + "@authkeys/mysql-connman": "^0.8.2", "dotenv": "^8.2.0", "memcached": "^2.2.2", "node-fetch": "^2.6.1", + "pg": "^8.7.1", "redis": "^3.0.0", "semver": "^7.3.4", "sqlite3": "^5.0.0", diff --git a/runTestsCluster.sh b/runTestsCluster.sh index e4f051b..436d3cf 100755 --- a/runTestsCluster.sh +++ b/runTestsCluster.sh @@ -83,6 +83,30 @@ test_mysql_innodbcluster_redis_core_cluster() { fi } +test_postgres_redis_core_cluster() { + print_test_header postgres_redis_core_cluster + docker-compose -p theotests -f docker-compose/docker-compose-test-postgres-redis-core-cluster.yml up -d + echo ${WAIT_FOR_DB_SEC}s Waiting for db to start.. + sleep $WAIT_FOR_DB_SEC + docker run --network theotests_default --rm --link theo \ + -e "CORE_TOKEN=${CORE_TOKEN}" \ + -e "THEO_URL_1=http://theo1:9100" \ + -e "THEO_URL_2=http://theo2:9100" \ + -e "THEO_URL_3=http://theo3:9100" \ + theo-tester npm run test:cluster + RETVAL=$? + if [[ ${RETVAL} -gt 0 ]]; then + echo "ERR docker-compose-test-postgres-redis-core-cluster FAILED" + docker-compose -p theotests -f docker-compose/docker-compose-test-postgres-redis-core-cluster.yml logs --tail 50 theo1 + fi + docker-compose -p theotests -f docker-compose/docker-compose-test-postgres-redis-core-cluster.yml down + if [[ ${RETVAL} -gt 0 ]]; then + exit ${RETVAL} + fi +} + test_mariadb_redis_core_cluster test_mysql_innodbcluster_redis_core_cluster + +test_postgres_redis_core_cluster \ No newline at end of file diff --git a/runTestsDocker.sh b/runTestsDocker.sh index 9a2b320..fe315ef 100755 --- a/runTestsDocker.sh +++ b/runTestsDocker.sh @@ -280,6 +280,82 @@ test_mariadb_redis_core () { fi } +test_postgres () { + # postgres + print_test_header postgres + docker-compose -p theotests -f docker-compose/docker-compose-test-postgres.yml up -d + echo ${WAIT_FOR_DB_SEC}s Waiting for db to start.. + sleep $WAIT_FOR_DB_SEC + docker run --network theotests_default --rm --link theo \ + -e "THEO_URL=http://theo:9100" \ + -e "ADMIN_TOKEN=${ADMIN_TOKEN}" \ + -e "CLIENT_TOKENS=${CLIENT_TOKENS}" \ + theo-tester npm run test:api + RETVAL=$? + if [[ ${RETVAL} -gt 0 ]]; then + docker logs --tail 30 theo + fi + docker-compose -p theotests -f docker-compose/docker-compose-test-postgres.yml down + if [[ ${RETVAL} -gt 0 ]]; then + echo "ERR docker-compose-test-postgres FAILED" + exit ${RETVAL} + fi +} + +test_postgres_redis () { + # postgres + redis + print_test_header "postgres + redis" + docker-compose -p theotests -f docker-compose/docker-compose-test-postgres-redis.yml up -d + echo ${WAIT_FOR_DB_SEC}s Waiting for db to start.. + sleep $WAIT_FOR_DB_SEC + docker run --network theotests_default --rm --link theo \ + -e "THEO_URL=http://theo:9100" \ + -e "ADMIN_TOKEN=${ADMIN_TOKEN}" \ + -e "CLIENT_TOKENS=${CLIENT_TOKENS}" \ + -e "THEO_USE_CACHE=1" \ + theo-tester npm run test:api + RETVAL=$? + if [[ ${RETVAL} -gt 0 ]]; then + docker logs theo | tail -n 20 + fi + docker-compose -p theotests -f docker-compose/docker-compose-test-postgres-redis.yml down + if [[ ${RETVAL} -gt 0 ]]; then + echo "ERR docker-compose-test-postgres-redis FAILED" + exit ${RETVAL} + fi +} + +test_postgres_redis_core () { + # postgres + redis CORE + print_test_header "postgres + redis CORE" + docker-compose -p theotests -f docker-compose/docker-compose-test-postgres-redis-core.yml up -d + echo ${WAIT_FOR_DB_SEC}s Waiting for db to start.. + sleep $WAIT_FOR_DB_SEC + docker run --network theotests_default --rm --link theo \ + -e "CORE_TOKEN=${CORE_TOKEN}" \ + -e "THEO_URL=http://theo:9100" \ + theo-tester npm run test:core + RETVAL=$? + if [[ ${RETVAL} -gt 0 ]]; then + docker-compose -p theotests -f docker-compose/docker-compose-test-postgres-redis-core.yml down + echo "ERR docker-compose-test-postgres-redis-core FAILED" + exit ${RETVAL} + fi + + print_test_header "postgres + redis CORE AFTER RESTART" + docker-compose -p theotests -f docker-compose/docker-compose-test-postgres-redis-core.yml restart theo + docker run --network theotests_default --rm --link theo \ + -e "THEO_URL=http://theo:9100" \ + -e "CORE_TOKEN=${CORE_TOKEN}" \ + theo-tester npm run test:core:restart + RETVAL=$? + docker-compose -p theotests -f docker-compose/docker-compose-test-postgres-redis-core.yml down + if [[ ${RETVAL} -gt 0 ]]; then + echo "ERR docker-compose-test-postgres-redis-core restart FAILED " + exit ${RETVAL} + fi +} + if [[ "$1" = "" ]]; then test_standalone test_sqlite @@ -291,6 +367,9 @@ if [[ "$1" = "" ]]; then test_mariadb_redis test_mysql test_mariadb_redis_core + test_postgres + test_postgres_redis + test_postgres_redis_core else test_${1} fi diff --git a/scripts/buildDockerImage.sh b/scripts/buildDockerImage.sh index ca37e63..dc0d88a 100755 --- a/scripts/buildDockerImage.sh +++ b/scripts/buildDockerImage.sh @@ -4,8 +4,7 @@ set -x DOCKER_IMAGE=theoapp/theo -dir_path=$(dirname $0) -DOCKER_TAG=$(${dir_path}/getVersion.sh) +DOCKER_TAG=$(npm -s run ver) docker build -t ${DOCKER_IMAGE}:${DOCKER_TAG} . @@ -13,7 +12,7 @@ if [ "$1" = "push" ]; then docker push ${DOCKER_IMAGE}:${DOCKER_TAG} fi -LATEST_TAG=$(git tag | sort --version-sort | tail -n 1) +LATEST_TAG=$(git tag | grep -E '^[0-9]*\.[0-9]*\.[0-9]*$' | sort --version-sort | tail -n 1) if [ "$LATEST_TAG" = "$DOCKER_TAG" ]; then docker tag ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_IMAGE}:latest diff --git a/scripts/buildDockerImages.sh b/scripts/buildDockerImages.sh index 0f1a599..0e0bbf1 100755 --- a/scripts/buildDockerImages.sh +++ b/scripts/buildDockerImages.sh @@ -24,7 +24,7 @@ is_valid_tag () { } is_latest_tag () { - LATEST_GIT_TAG=$(git tag | grep -E '^[0-9]*\.[0-9]*\.[0-9]*$' | sort -V | tail -n 1) + LATEST_GIT_TAG=$(git tag | grep -E '^[0-9]*\.[0-9]*\.[0-9]*$' | sort --version-sort | tail -n 1) if [ "$LATEST_GIT_TAG" = "$DOCKER_TAG" ]; then return 0 else @@ -68,7 +68,7 @@ build_full () { build_sqlite () { TAG_NAME=${DOCKER_TAG}-sqlite - npm uninstall @authkeys/mysql-connman redis memcached + npm uninstall @authkeys/mysql-connman redis memcached pg docker_build "${TAG_NAME}" if [ "$1" = "push" ]; then @@ -82,7 +82,7 @@ build_sqlite () { build_sqlite_redis () { TAG_NAME=${DOCKER_TAG}-sqlite-redis - npm uninstall @authkeys/mysql-connman memcached + npm uninstall @authkeys/mysql-connman memcached pg docker_build "${TAG_NAME}" if [ "$1" = "push" ]; then @@ -96,7 +96,7 @@ build_sqlite_memcached () { TAG_NAME=${DOCKER_TAG}-sqlite-memcached - npm uninstall @authkeys/mysql-connman redis + npm uninstall @authkeys/mysql-connman redis pg docker_build "${TAG_NAME}" if [ "$1" = "push" ]; then @@ -111,7 +111,7 @@ build_mysql () { TAG_NAME=${DOCKER_TAG}-mysql - npm uninstall sqlite3 redis memcached + npm uninstall sqlite3 redis memcached pg docker_build "${TAG_NAME}" if [ "$1" = "push" ]; then @@ -125,7 +125,7 @@ build_mysql () { build_mysql_redis () { TAG_NAME=${DOCKER_TAG}-mysql-redis - npm uninstall sqlite3 memcached + npm uninstall sqlite3 memcached pg docker_build "${TAG_NAME}" if [ "$1" = "push" ]; then @@ -139,7 +139,36 @@ build_mysql_redis () { build_mysql_memcached () { TAG_NAME=${DOCKER_TAG}-mysql-memcached - npm uninstall sqlite3 redis + npm uninstall sqlite3 redis pg + docker_build "${TAG_NAME}" + + if [ "$1" = "push" ]; then + docker_push "${TAG_NAME}" + fi + + git checkout package.json package-lock.json + +} + +build_postgres () { + + TAG_NAME=${DOCKER_TAG}-postgres + + npm uninstall @authkeys/mysql-connman sqlite3 redis memcached + docker_build "${TAG_NAME}" + + if [ "$1" = "push" ]; then + docker_push "${TAG_NAME}" + fi + + git checkout package.json package-lock.json + +} + +build_postgres_redis () { + TAG_NAME=${DOCKER_TAG}-postgres-redis + + npm uninstall @authkeys/mysql-connman sqlite3 memcached docker_build "${TAG_NAME}" if [ "$1" = "push" ]; then @@ -160,6 +189,9 @@ if [ "$1" = "all" ]; then build_mysql_redis "$2" build_mysql_memcached "$2" + build_postgres "$2" + build_postgres_redis "$2" + build_full "$2" else diff --git a/scripts/getVersion.sh b/scripts/getVersion.sh index ee4d257..f0738ee 100755 --- a/scripts/getVersion.sh +++ b/scripts/getVersion.sh @@ -1,9 +1,4 @@ #!/bin/sh dir_path=$(dirname $0) -cat ${dir_path}/../package.json \ - | grep version \ - | head -1 \ - | awk -F: '{ print $2 }' \ - | sed 's/[",]//g' \ - | tr -d '[[:space:]]' \ No newline at end of file +npm -s run ver diff --git a/scripts/updateVersion.sh b/scripts/updateVersion.sh index 3e3d76a..26ab61e 100755 --- a/scripts/updateVersion.sh +++ b/scripts/updateVersion.sh @@ -1,6 +1,12 @@ -dir_path=$(dirname $0) -PACKAGE_VERSION=$(${dir_path}/getVersion.sh) +PACKAGE_VERSION=$(npm -s run ver) + +echo "New version: $PACKAGE_VERSION" + +if [ "" = "$PACKAGE_VERSION" ]; then + echo Something went wrong. Empty version + exit 1 +fi sed -i '' 's/org.opencontainers.image.version=.*/org.opencontainers.image.version="'"${PACKAGE_VERSION}"'" \\/' Dockerfile diff --git a/src/dbInitiator.js b/src/dbInitiator.js index 9fcf078..0820db4 100644 --- a/src/dbInitiator.js +++ b/src/dbInitiator.js @@ -25,3 +25,47 @@ try { export const getLoadDbEnvSettings = function () { return loadDbEnvSettings; }; + +export const loadPostgresEnvSettings = function (dbSettings) { + const { DB_USER, DB_PASSWORD, DB_HOST, DB_NAME, DB_PORT } = process.env; + if (!dbSettings.config) { + dbSettings.config = {}; + } + if (!DB_USER && !dbSettings.config.user) { + throw new Error('DB ERROR! postgres requires DB_USER'); + } + + if (!DB_PASSWORD && !dbSettings.config.password) { + throw new Error('DB ERROR! postgres requires DB_PASSWORD'); + } + + if (!DB_NAME && !dbSettings.config.database) { + throw new Error('DB ERROR! postgres requires DB_NAME'); + } + + if (DB_USER) { + dbSettings.config.user = DB_USER; + } + + if (DB_PASSWORD) { + dbSettings.config.password = DB_PASSWORD; + } + + if (DB_NAME) { + dbSettings.config.database = DB_NAME; + } + + if (DB_HOST) { + dbSettings.config.host = DB_HOST; + } else { + dbSettings.config.host = '127.0.0.1'; + } + + if (DB_PORT) { + dbSettings.config.port = Number(DB_PORT); + } + + if (isNaN(dbSettings.config.port)) { + dbSettings.config.port = 5432; + } +}; diff --git a/src/lib/helpers/DbHelper.js b/src/lib/helpers/DbHelper.js index fe5e958..167356a 100644 --- a/src/lib/helpers/DbHelper.js +++ b/src/lib/helpers/DbHelper.js @@ -136,7 +136,7 @@ class DbHelper { } async _flush(client) { - const done = await this.manager.flushDb(); + const done = await this.manager.flushDb(client); if (done) { EventHelper.emit('theo:flushdb'); try { diff --git a/src/lib/managers/AccountManager.js b/src/lib/managers/AccountManager.js index 2a4a952..946efe4 100644 --- a/src/lib/managers/AccountManager.js +++ b/src/lib/managers/AccountManager.js @@ -169,7 +169,7 @@ class AccountManager extends BaseCacheManager { const lastId = await this.db.insert(sql, [ account.email, account.name, - account.active || 1, + account.active === undefined ? 1 : account.active ? 1 : 0, expire_at, new Date().getTime() ]); @@ -180,7 +180,7 @@ class AccountManager extends BaseCacheManager { async changeStatus(id, active) { const sql = 'update accounts set active = ?, updated_at = ? where id = ? '; active = !!active; - const changes = await this.db.update(sql, [active, new Date().getTime(), id]); + const changes = await this.db.update(sql, [active ? 1 : 0, new Date().getTime(), id]); this.invalidateCache(); return changes; } @@ -196,7 +196,7 @@ class AccountManager extends BaseCacheManager { async update(id, active, expire_at) { expire_at = getTimestampFromISO8601(expire_at); const sql = 'update accounts set active = ?, expire_at = ?, updated_at = ? where id = ? '; - const changes = await this.db.update(sql, [active, expire_at, new Date().getTime(), id]); + const changes = await this.db.update(sql, [active ? 1 : 0, expire_at, new Date().getTime(), id]); this.invalidateCache(); return changes; } diff --git a/src/lib/managers/GroupManager.js b/src/lib/managers/GroupManager.js index 5fead66..04d56d4 100644 --- a/src/lib/managers/GroupManager.js +++ b/src/lib/managers/GroupManager.js @@ -132,7 +132,8 @@ class GroupManager extends BaseCacheManager { create(name, active = 1) { const sql = 'insert into tgroups (name, active, is_internal, created_at) values (?, ?, ?, ?) '; - return this.db.insert(sql, [name, active, name.indexOf('@') > 0, Date.now()]); + const phs = [name, active ? 1 : 0, name.indexOf('@') > 0 ? 1 : 0, Date.now()]; + return this.db.insert(sql, phs); } async delete(id) { @@ -152,7 +153,7 @@ class GroupManager extends BaseCacheManager { async changeStatus(id, active) { const sql = 'update tgroups set active = ?, updated_at = ? where id = ? '; active = !!active; - const changes = await this.db.update(sql, [active, new Date().getTime(), id]); + const changes = await this.db.update(sql, [active ? 1 : 0, new Date().getTime(), id]); this.invalidateCache(); return changes; } diff --git a/src/lib/middlewares/AuthMiddleware.js b/src/lib/middlewares/AuthMiddleware.js index 4f4e427..973d2d9 100644 --- a/src/lib/middlewares/AuthMiddleware.js +++ b/src/lib/middlewares/AuthMiddleware.js @@ -16,7 +16,7 @@ import AppHelper from '../helpers/AppHelper'; import EventHelper from '../helpers/EventHelper'; const checkForBearer = function (req, header) { - const authorization = req.header('Authorization'); + const authorization = req.header(header); if (authorization) { const m = /^[Bb]earer\s+(\S+)$/.exec(authorization); if (m === null) { @@ -87,6 +87,10 @@ export const authMiddleware = (req, res, next) => { } } catch (e) { next(); + } finally { + if (!req.app.envBool(process.env, 'DEBUG_AUTH', false)) { + req.headers.authorization = 'Bearer [***]'; + } } return; } diff --git a/src/lib/rdbms/modules.js b/src/lib/rdbms/modules.js index 4243ca2..042447d 100644 --- a/src/lib/rdbms/modules.js +++ b/src/lib/rdbms/modules.js @@ -29,6 +29,12 @@ try { } catch (e) { common_info('sqlite driver not loaded'); } +try { + const Postgres = require('./postgres'); + modules.postgres = Postgres.default; +} catch (e) { + common_info('postgres driver not loaded'); +} export const getRdbmsModule = name => { return modules[name]; diff --git a/src/lib/rdbms/postgres/client.js b/src/lib/rdbms/postgres/client.js new file mode 100644 index 0000000..efe0589 --- /dev/null +++ b/src/lib/rdbms/postgres/client.js @@ -0,0 +1,121 @@ +// Copyright 2019 AuthKeys srl +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { Client } from 'pg'; +import BaseClient from '../baseclient'; + +// const regrep = /([=><\s])(\?)/g; +const regrepPh = /\?/g; +const regrepUser = /user/g; + +export const convertToPSSyntax = function convertToPSsyntax(sql) { + let c = 0; + const replacer = function () { + c++; + return `$${c}`; + }; + return sql.replace(regrepPh, replacer).replace(regrepUser, 'osuser'); +}; + +const cleanUserRow = function (row) { + row.user = row.osuser; + delete row.osuser; + return row; +}; +export default class PostgresClient extends BaseClient { + constructor(config) { + super(); + this.client = new Client(config); + } + + getServerVersion() { + return 'Postgres'; + } + + query(sql, params) { + const fsql = convertToPSSyntax(sql); + /* + if (params) { + params = params.map(v => { + if (typeof v === 'boolean') { + console.error('using boolean in ', sql, v); + return v ? 1 : 0; + } + return v; + }); + } + */ + return this.client.query(fsql, params); + } + + async all(sql, params) { + const ret = await this.query(sql, params); + if (ret && ret.rows) { + if (sql.indexOf('user') > 0) { + return ret.rows.map(row => { + return cleanUserRow(row); + }); + } + return ret.rows; + } + return []; + } + + async get(sql, params) { + const ret = await this.query(sql, params); + if (ret && ret.rows && ret.rows.length === 1) { + if (sql.indexOf('user') > 0) { + return cleanUserRow(ret.rows[0]); + } + return ret.rows[0]; + } + return null; + } + + async run(sql, params) { + await this.query(sql, params); + return true; + } + + async insert(sql, params) { + if (sql.toLowerCase().indexOf('into auth_tokens') < 0) { + sql += ' returning id'; + } + const ret = await this.query(sql, params); + if (ret && ret.rows && ret.rows.length === 1) { + return ret.rows[0].id; + } + return -1; + } + + async update(sql, params) { + const ret = await this.query(sql, params); + return ret.rowCount; + } + + async delete(sql, params) { + const ret = await this.query(sql, params); + return ret.rowCount; + } + + async open() { + // console.log('\n\nCLIENT.OPEN\n\n'); + await this.client.connect(); + return this.client; + } + + close() { + // console.log('\n\nCLIENT.CLOSE\n\n'); + return this.client.end(); + } +} diff --git a/src/lib/rdbms/postgres/index.js b/src/lib/rdbms/postgres/index.js new file mode 100644 index 0000000..f1972c2 --- /dev/null +++ b/src/lib/rdbms/postgres/index.js @@ -0,0 +1,179 @@ +import DbManager from '../../managers/DbManager'; +import { common_debug, common_error } from '../../utils/logUtils'; +import PostgresClient from './client'; + +export default class PostgresManager extends DbManager { + dbVersion = 17; + + CREATE_TABLE_AUTH_TOKENS = + 'create table auth_tokens (token varchar(128) PRIMARY KEY, assignee varchar(64) NOT NULL, type varchar(5) NOT NULL, created_at BIGINT)'; + + CREATE_TABLE_ACCOUNTS = + 'create table accounts (id SERIAL PRIMARY KEY, email varchar(128) not null, name varchar(128) not null, ' + + 'active smallint not null default 1, expire_at BIGINT not null default 0, updated_at BIGINT, created_at BIGINT, UNIQUE (email))'; + + CREATE_TABLE_GROUPS = + 'create table tgroups (id SERIAL PRIMARY KEY, name varchar(128) not null, is_internal smallint not null default 0, active smallint not null default 1, ' + + 'updated_at BIGINT, created_at BIGINT, UNIQUE (name))'; + + CREATE_TABLE_GROUPS_ACCOUNTS = + 'create table groups_accounts (id SERIAL PRIMARY KEY, ' + + 'account_id INTEGER not null, ' + + 'group_id INTEGER not null, ' + + 'updated_at BIGINT, ' + + 'created_at BIGINT, ' + + 'UNIQUE (account_id, group_id), ' + + 'CONSTRAINT groups_accounts_group_id FOREIGN KEY(group_id) REFERENCES tgroups (id) ON DELETE CASCADE, ' + + 'CONSTRAINT groups_accounts_account_id FOREIGN KEY(account_id) REFERENCES accounts (id) ON DELETE CASCADE)'; + + CREATE_TABLE_PUBLIC_KEYS = + 'create table public_keys (id SERIAL PRIMARY KEY, ' + + 'account_id INTEGER NOT NULL, ' + + 'public_key varchar(1024) not null, ' + + 'public_key_sig varchar(1024), ' + + 'fingerprint varchar(128), ' + + 'key_ssh_options TEXT not null, ' + + 'last_used_at BIGINT, ' + + 'created_at BIGINT, ' + + 'unique (fingerprint), ' + + 'FOREIGN KEY(account_id) REFERENCES accounts(id) ON DELETE CASCADE)'; + + CREATE_TABLE_PERMISSIONS = + 'create table permissions (id SERIAL PRIMARY KEY, ' + + 'group_id INTEGER, ' + + 'user varchar(256) not null, ' + + 'host varchar(256) not null, ' + + 'ssh_options TEXT not null, ' + + 'created_at BIGINT, ' + + 'CONSTRAINT permissions_group_id FOREIGN KEY(group_id) REFERENCES tgroups (id) ON DELETE CASCADE)'; + + CREATE_INDEX_PERMISSION_HOST_USER = 'CREATE INDEX k_permissions_host_user on permissions (host, user)'; + + connectionManager; + + constructor(settings) { + super(settings); + const { config } = settings; + // this.pool = new Pool(config); + this.config = config; + } + + getEngine() { + return 'postgres'; + } + + getClient(pool = false) { + this.client = new PostgresClient(this.config); + return this.client; + } + + setClient(client) { + this.client = client; + } + + async getCurrentVersion() { + const sqlCheck = 'select value from _version'; + if (process.env.CLUSTER_MODE === '1') { + await this.client.run('BEGIN'); + let row; + try { + row = await this.client.get(`${sqlCheck} for update`); + if (row.value === this.dbVersion) { + common_debug('Version is equal: %s vs %s', row.value, this.dbVersion); + await this.client.run('ROLLBACK'); + } + return row; + } catch (e) { + await this.client.run('ROLLBACK'); + if (e.code === '42P01') { + return false; + } + common_error('Ooops: %s', e.message, e.code); + throw e; + } + } else { + try { + return await this.client.get(sqlCheck); + } catch (e) { + if (e.code === '42P01') { + return false; + } + common_error('Ooops: %s', e.message, e.code); + throw e; + } + } + } + + async createVersionTable() { + const sqlCreateTable = 'create table _version (value INTEGER PRIMARY KEY)'; + try { + await this.client.run(sqlCreateTable); + } catch (e) { + await this.client.run('ROLLBACK'); + throw e; + } + try { + const sqlInsertVersionZero = 'insert into _version values (-1)'; + await this.client.run(sqlInsertVersionZero); + if (process.env.CLUSTER_MODE === '1') { + await this.client.run('select value from _version for update'); + } + } catch (e) { + common_error('Unable to insert -1 version in _version table: [%s] %s', e.code, e.message); + throw e; + } + return 0; + } + + async initDb() { + let dbConn; + if (process.env.CLUSTER_MODE === '1') { + dbConn = this.getClient(); + await dbConn.open(); + } else { + dbConn = this.client; + } + await dbConn.run(this.CREATE_TABLE_AUTH_TOKENS); + await dbConn.run(this.CREATE_TABLE_ACCOUNTS); + await dbConn.run(this.CREATE_TABLE_PUBLIC_KEYS); + await dbConn.run(this.CREATE_TABLE_GROUPS); + await dbConn.run(this.CREATE_TABLE_PERMISSIONS); + await dbConn.run(this.CREATE_INDEX_PERMISSION_HOST_USER); + await dbConn.run(this.CREATE_TABLE_GROUPS_ACCOUNTS); + await this.updateVersion(); + if (process.env.CLUSTER_MODE === '1') { + dbConn.close(); + } + } + + async upgradeDb(fromVersion) {} + + async updateVersion() { + const sql = 'update _version set value = ' + this.dbVersion; + if (process.env.CLUSTER_MODE === '1') { + await this.client.run(sql); + await this.client.run('COMMIT'); + } else { + return this.client.run(sql); + } + } + + async flushDb(client) { + console.log('Flushing db...'); + const tables = 'public_keys, groups_accounts, permissions, tgroups, accounts, auth_tokens, _version'.split(','); + for (let i = 0; i < tables.length; i++) { + const sqlDrop = 'drop table ' + tables[i]; + try { + await client.run(sqlDrop); + common_debug('Dropped %s', tables[i]); + } catch (e) { + common_error('Failed to drop %s', tables[i]); + console.error(e); + // it doesn't exists + } + } + return true; + } + + close() {} +} diff --git a/src/settingsInitiator.js b/src/settingsInitiator.js index 48ed94a..2fc234b 100644 --- a/src/settingsInitiator.js +++ b/src/settingsInitiator.js @@ -14,7 +14,7 @@ import { common_error, common_warn } from './lib/utils/logUtils'; import { md5 } from './lib/utils/cryptoUtils'; -import { getLoadDbEnvSettings } from './dbInitiator'; +import { getLoadDbEnvSettings, loadPostgresEnvSettings } from './dbInitiator'; const initSettings = function () { let settings = { @@ -65,6 +65,8 @@ const initSettings = function () { settings.db.storage = sqlite_path; } } + } else if (settings.db.engine === 'postgres') { + loadPostgresEnvSettings(settings.db); } else { const loadDbEnvSettings = getLoadDbEnvSettings(); loadDbEnvSettings(settings.db); diff --git a/src/theoserver.js b/src/theoserver.js index 836b6fb..de209fc 100644 --- a/src/theoserver.js +++ b/src/theoserver.js @@ -61,6 +61,10 @@ class TheoServer extends Microservice { setupRoutes(app, express) { app.disable('x-powered-by'); + app.use((req, res, next) => { + req.app = this; + next(); + }); app.use(authMiddleware); app.use(auditMiddleware); app.use(async (req, res, next) => { diff --git a/tests/testPostgres.js b/tests/testPostgres.js new file mode 100644 index 0000000..46c5454 --- /dev/null +++ b/tests/testPostgres.js @@ -0,0 +1,58 @@ +import assert from 'assert'; +import { describe, it } from 'mocha'; +import { convertToPSSyntax } from '../src/lib/rdbms/postgres'; + +describe('Test postgres', function () { + describe('convertToPSSyntax', function () { + const tests = [ + { + in: 'select a, b, c from t where a = ?', + out: 'select a, b, c from t where a = $1' + }, + { + in: 'select a, b, c from t where a = ? and b > ?', + out: 'select a, b, c from t where a = $1 and b > $2' + }, + { + in: 'update t set a = ? where a = ? and b > ?', + out: 'update t set a = $1 where a = $2 and b > $3' + }, + { + in: 'update t set a =? where a = ? and b >?', + out: 'update t set a =$1 where a = $2 and b >$3' + }, + { + in: 'update t set a=? where a=? and b>?', + out: 'update t set a=$1 where a=$2 and b>$3' + }, + { + in: `select distinct a.id, a.email, p.host, p.user, p.ssh_options + from accounts a, tgroups g, groups_accounts ga, permissions p + where ? like p.host and ? like p.user + and k.account_id = a.id + and g.id = p.group_id + and g.id = ga.group_id + and a.id = ga.account_id + and a.active = 1 + and g.active = 1 + and (a.expire_at = 0 or a.expire_at > ?)`, + out: `select distinct a.id, a.email, p.host, p.user, p.ssh_options + from accounts a, tgroups g, groups_accounts ga, permissions p + where $1 like p.host and $2 like p.user + and k.account_id = a.id + and g.id = p.group_id + and g.id = ga.group_id + and a.id = ga.account_id + and a.active = 1 + and g.active = 1 + and (a.expire_at = 0 or a.expire_at > $3)` + } + ]; + tests.forEach(function (test, i) { + it(`must convert correctly test ${i}`, function () { + const out = convertToPSSyntax(test.in); + assert.strictEqual(out, test.out); + }); + }); + }); +}); diff --git a/tests/testRestKeys.js b/tests/testRestKeys.js index 7e04470..a8e1c98 100644 --- a/tests/testRestKeys.js +++ b/tests/testRestKeys.js @@ -120,7 +120,7 @@ const loadData = async function () { }; describe('REST Check keys', function () { - this.timeout(10000); + this.timeout(30000); before(function (done) { fetch(base_url + '/flushdb', { @@ -238,7 +238,7 @@ describe('REST Check keys', function () { const data = await resAdmin.json(); data.public_keys.forEach(public_key => { if (public_key.fingerprint === fingerprint) { - assert.strictEqual(typeof public_key.last_used_at, 'number'); + assert.notStrictEqual(public_key.last_used_at, null); } else { assert.strictEqual(public_key.last_used_at, null); }