mirror of
https://github.com/standardnotes/server
synced 2026-01-23 14:01:09 -05:00
Compare commits
8 Commits
@standardn
...
@standardn
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32c667b22d | ||
|
|
a6b062f638 | ||
|
|
f9183b4c62 | ||
|
|
c7d575a0ff | ||
|
|
a575e62519 | ||
|
|
3761d60f41 | ||
|
|
fd629d43ba | ||
|
|
76b1cb0f5a |
3
.github/workflows/common-e2e.yml
vendored
3
.github/workflows/common-e2e.yml
vendored
@@ -83,6 +83,7 @@ jobs:
|
||||
sed -i "s/AUTH_JWT_SECRET=/AUTH_JWT_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||
sed -i "s/ENCRYPTION_SERVER_KEY=/ENCRYPTION_SERVER_KEY=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||
sed -i "s/PSEUDO_KEY_PARAMS_KEY=/PSEUDO_KEY_PARAMS_KEY=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||
sed -i "s/VALET_TOKEN_SECRET=/VALET_TOKEN_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||
echo "ACCESS_TOKEN_AGE=4" >> packages/home-server/.env
|
||||
echo "REFRESH_TOKEN_AGE=7" >> packages/home-server/.env
|
||||
echo "REVISIONS_FREQUENCY=5" >> packages/home-server/.env
|
||||
@@ -93,7 +94,7 @@ jobs:
|
||||
PORT: 3123
|
||||
|
||||
- name: Wait for server to start
|
||||
run: docker/is-available.sh http://localhost:3123 $(pwd)/logs
|
||||
run: for i in {1..30}; do curl -s http://localhost:3123/healthcheck && break || sleep 1; done
|
||||
|
||||
- name: Run E2E Test Suite
|
||||
run: yarn dlx mocha-headless-chrome --timeout 1200000 -f http://localhost:9001/mocha/test.html?skip_paid_features=true
|
||||
|
||||
60
.pnp.cjs
generated
60
.pnp.cjs
generated
@@ -129,13 +129,13 @@ const RAW_RUNTIME_STATE =
|
||||
["@lerna-lite/version", "npm:2.3.0"],\
|
||||
["@types/jest", "npm:29.5.1"],\
|
||||
["@types/newrelic", "npm:9.13.0"],\
|
||||
["@types/node", "npm:20.1.0"],\
|
||||
["@types/node", "npm:20.2.5"],\
|
||||
["eslint", "npm:8.39.0"],\
|
||||
["eslint-config-prettier", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:8.8.0"],\
|
||||
["ini", "npm:3.0.1"],\
|
||||
["newrelic", "npm:10.1.0"],\
|
||||
["npm-check-updates", "npm:16.10.9"],\
|
||||
["ts-node", "virtual:ef6136dc31186c42f92851afb237eadaa9d36085920cabb6ed6ea317680c8271d6b94afcb795fd7e58c08243e470be87ece6bb707daf3ecb0604f7fd8c1aa682#npm:10.9.1"],\
|
||||
["ts-node", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:10.9.1"],\
|
||||
["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin<compat/typescript>::version=5.0.4&hash=b5f058"]\
|
||||
],\
|
||||
"linkType": "SOFT"\
|
||||
@@ -4259,7 +4259,7 @@ const RAW_RUNTIME_STATE =
|
||||
["@types/jest", "npm:29.5.1"],\
|
||||
["@types/mixpanel", "npm:2.14.4"],\
|
||||
["@types/newrelic", "npm:9.13.0"],\
|
||||
["@types/node", "npm:20.1.0"],\
|
||||
["@types/node", "npm:20.2.5"],\
|
||||
["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\
|
||||
["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\
|
||||
["dayjs", "npm:1.11.7"],\
|
||||
@@ -4419,7 +4419,7 @@ const RAW_RUNTIME_STATE =
|
||||
"packageDependencies": [\
|
||||
["@standardnotes/common", "workspace:packages/common"],\
|
||||
["@types/jest", "npm:29.5.1"],\
|
||||
["@types/node", "npm:20.1.0"],\
|
||||
["@types/node", "npm:20.2.5"],\
|
||||
["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\
|
||||
["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\
|
||||
["eslint", "npm:8.39.0"],\
|
||||
@@ -4626,6 +4626,7 @@ const RAW_RUNTIME_STATE =
|
||||
["@standardnotes/auth-server", "workspace:packages/auth"],\
|
||||
["@standardnotes/domain-core", "workspace:packages/domain-core"],\
|
||||
["@standardnotes/domain-events-infra", "workspace:packages/domain-events-infra"],\
|
||||
["@standardnotes/files-server", "workspace:packages/files"],\
|
||||
["@standardnotes/revisions-server", "workspace:packages/revisions"],\
|
||||
["@standardnotes/syncing-server", "workspace:packages/syncing-server"],\
|
||||
["@types/cors", "npm:2.8.13"],\
|
||||
@@ -4757,7 +4758,7 @@ const RAW_RUNTIME_STATE =
|
||||
["@types/ioredis", "npm:5.0.0"],\
|
||||
["@types/jest", "npm:29.5.1"],\
|
||||
["@types/newrelic", "npm:9.13.0"],\
|
||||
["@types/node", "npm:20.1.0"],\
|
||||
["@types/node", "npm:20.2.5"],\
|
||||
["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\
|
||||
["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\
|
||||
["dayjs", "npm:1.11.7"],\
|
||||
@@ -4814,13 +4815,13 @@ const RAW_RUNTIME_STATE =
|
||||
["@lerna-lite/version", "npm:2.3.0"],\
|
||||
["@types/jest", "npm:29.5.1"],\
|
||||
["@types/newrelic", "npm:9.13.0"],\
|
||||
["@types/node", "npm:20.1.0"],\
|
||||
["@types/node", "npm:20.2.5"],\
|
||||
["eslint", "npm:8.39.0"],\
|
||||
["eslint-config-prettier", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:8.8.0"],\
|
||||
["ini", "npm:3.0.1"],\
|
||||
["newrelic", "npm:10.1.0"],\
|
||||
["npm-check-updates", "npm:16.10.9"],\
|
||||
["ts-node", "virtual:ef6136dc31186c42f92851afb237eadaa9d36085920cabb6ed6ea317680c8271d6b94afcb795fd7e58c08243e470be87ece6bb707daf3ecb0604f7fd8c1aa682#npm:10.9.1"],\
|
||||
["ts-node", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:10.9.1"],\
|
||||
["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin<compat/typescript>::version=5.0.4&hash=b5f058"]\
|
||||
],\
|
||||
"linkType": "SOFT"\
|
||||
@@ -4860,7 +4861,7 @@ const RAW_RUNTIME_STATE =
|
||||
["@standardnotes/sncrypto-node", "workspace:packages/sncrypto-node"],\
|
||||
["@standardnotes/sncrypto-common", "npm:1.13.3"],\
|
||||
["@types/jest", "npm:29.5.1"],\
|
||||
["@types/node", "npm:20.1.0"],\
|
||||
["@types/node", "npm:20.2.5"],\
|
||||
["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\
|
||||
["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:5.59.2"],\
|
||||
["eslint", "npm:8.39.0"],\
|
||||
@@ -5461,6 +5462,13 @@ const RAW_RUNTIME_STATE =
|
||||
["@types/node", "npm:20.1.0"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}],\
|
||||
["npm:20.2.5", {\
|
||||
"packageLocation": "./.yarn/cache/@types-node-npm-20.2.5-0014d2d9ce-55e4f8d08e.zip/node_modules/@types/node/",\
|
||||
"packageDependencies": [\
|
||||
["@types/node", "npm:20.2.5"]\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}]\
|
||||
]],\
|
||||
["@types/nodemailer", [\
|
||||
@@ -14867,6 +14875,42 @@ const RAW_RUNTIME_STATE =
|
||||
],\
|
||||
"linkType": "SOFT"\
|
||||
}],\
|
||||
["virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:10.9.1", {\
|
||||
"packageLocation": "./.yarn/__virtual__/ts-node-virtual-ac01688ebc/0/cache/ts-node-npm-10.9.1-6c268be7f4-c4caff4b9b.zip/node_modules/ts-node/",\
|
||||
"packageDependencies": [\
|
||||
["ts-node", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:10.9.1"],\
|
||||
["@cspotcode/source-map-support", "npm:0.8.1"],\
|
||||
["@swc/core", null],\
|
||||
["@swc/wasm", null],\
|
||||
["@tsconfig/node10", "npm:1.0.9"],\
|
||||
["@tsconfig/node12", "npm:1.0.11"],\
|
||||
["@tsconfig/node14", "npm:1.0.3"],\
|
||||
["@tsconfig/node16", "npm:1.0.3"],\
|
||||
["@types/node", "npm:20.2.5"],\
|
||||
["@types/swc__core", null],\
|
||||
["@types/swc__wasm", null],\
|
||||
["@types/typescript", null],\
|
||||
["acorn", "npm:8.8.2"],\
|
||||
["acorn-walk", "npm:8.2.0"],\
|
||||
["arg", "npm:4.1.3"],\
|
||||
["create-require", "npm:1.1.1"],\
|
||||
["diff", "npm:4.0.2"],\
|
||||
["make-error", "npm:1.3.6"],\
|
||||
["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin<compat/typescript>::version=5.0.4&hash=b5f058"],\
|
||||
["v8-compile-cache-lib", "npm:3.0.1"],\
|
||||
["yn", "npm:3.1.1"]\
|
||||
],\
|
||||
"packagePeers": [\
|
||||
"@swc/core",\
|
||||
"@swc/wasm",\
|
||||
"@types/node",\
|
||||
"@types/swc__core",\
|
||||
"@types/swc__wasm",\
|
||||
"@types/typescript",\
|
||||
"typescript"\
|
||||
],\
|
||||
"linkType": "HARD"\
|
||||
}],\
|
||||
["virtual:ef6136dc31186c42f92851afb237eadaa9d36085920cabb6ed6ea317680c8271d6b94afcb795fd7e58c08243e470be87ece6bb707daf3ecb0604f7fd8c1aa682#npm:10.9.1", {\
|
||||
"packageLocation": "./.yarn/__virtual__/ts-node-virtual-4c9d9a7987/0/cache/ts-node-npm-10.9.1-6c268be7f4-c4caff4b9b.zip/node_modules/ts-node/",\
|
||||
"packageDependencies": [\
|
||||
|
||||
BIN
.yarn/cache/@types-node-npm-20.2.5-0014d2d9ce-55e4f8d08e.zip
vendored
Normal file
BIN
.yarn/cache/@types-node-npm-20.2.5-0014d2d9ce-55e4f8d08e.zip
vendored
Normal file
Binary file not shown.
@@ -331,8 +331,8 @@ ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
|
||||
endif
|
||||
|
||||
quiet_cmd_regen_makefile = ACTION Regenerating $@
|
||||
cmd_regen_makefile = cd $(srcdir); /Users/karolsojko/workspace/server/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/karolsojko/Library/Caches/node-gyp/20.1.0" "-Dnode_gyp_dir=/Users/karolsojko/workspace/server/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp" "-Dnode_lib_file=/Users/karolsojko/Library/Caches/node-gyp/20.1.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/karolsojko/workspace/server/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/Users/karolsojko/workspace/server/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/config.gypi -I/Users/karolsojko/workspace/server/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/addon.gypi -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/common.gypi "--toplevel-dir=." binding.gyp
|
||||
Makefile: $(srcdir)/binding.gyp $(srcdir)/build/config.gypi $(srcdir)/../../../../node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/addon.gypi $(srcdir)/../../../../../../../../Library/Caches/node-gyp/20.1.0/include/node/common.gypi
|
||||
cmd_regen_makefile = cd $(srcdir); /Users/karolsojko/workspace/server/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/karolsojko/Library/Caches/node-gyp/20.2.0" "-Dnode_gyp_dir=/Users/karolsojko/workspace/server/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp" "-Dnode_lib_file=/Users/karolsojko/Library/Caches/node-gyp/20.2.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/karolsojko/workspace/server/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/Users/karolsojko/workspace/server/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/config.gypi -I/Users/karolsojko/workspace/server/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/addon.gypi -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/common.gypi "--toplevel-dir=." binding.gyp
|
||||
Makefile: $(srcdir)/build/config.gypi $(srcdir)/../../../../node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/addon.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../../../../Library/Caches/node-gyp/20.2.0/include/node/common.gypi
|
||||
$(call do_cmd,regen_makefile)
|
||||
|
||||
# "all" is a concatenation of the "all" targets from all the included
|
||||
|
||||
@@ -1,69 +1,69 @@
|
||||
cmd_Release/obj.target/native_metrics/src/GCBinder.o := c++ -o Release/obj.target/native_metrics/src/GCBinder.o ../src/GCBinder.cpp '-DNODE_GYP_MODULE_NAME=native_metrics' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNOMINMAX' '-DBUILDING_NODE_EXTENSION' -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/src -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/openssl/config -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/openssl/openssl/include -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/uv/include -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/zlib -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/v8/include -I../src -I../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan -O3 -gdwarf-2 -mmacosx-version-min=10.15 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/native_metrics/src/GCBinder.o.d.raw -c
|
||||
cmd_Release/obj.target/native_metrics/src/GCBinder.o := c++ -o Release/obj.target/native_metrics/src/GCBinder.o ../src/GCBinder.cpp '-DNODE_GYP_MODULE_NAME=native_metrics' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNOMINMAX' '-DBUILDING_NODE_EXTENSION' -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/src -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/config -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/openssl/include -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/uv/include -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/zlib -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/v8/include -I../src -I../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan -O3 -gdwarf-2 -mmacosx-version-min=10.15 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/native_metrics/src/GCBinder.o.d.raw -c
|
||||
Release/obj.target/native_metrics/src/GCBinder.o: ../src/GCBinder.cpp \
|
||||
../src/GCBinder.hpp \
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/errno.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/unix.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/threadpool.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/darwin.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/cppgc/common.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8config.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-array-buffer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-local-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-internal.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-object.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-maybe.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-persistent-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-weak-callback-info.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-primitive.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-data.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-value.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-traced-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-container.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-context.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-snapshot.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-date.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-debug.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-script.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-callbacks.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-promise.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-message.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-exception.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-extension.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-external.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-function.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-function-callback.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-template.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-memory-span.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-initialization.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-isolate.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-embedder-heap.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-microtask.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-statistics.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-unwinder.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-embedder-state-scope.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-platform.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-json.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-locker.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-microtask-queue.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-primitive-object.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-proxy.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-regexp.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-typed-array.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-value-serializer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-wasm.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_api.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/js_native_api.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/js_native_api_types.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_api_types.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_buffer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_object_wrap.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/errno.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/unix.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/threadpool.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/darwin.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/cppgc/common.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8config.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-array-buffer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-local-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-internal.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-object.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-maybe.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-persistent-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-weak-callback-info.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-data.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-traced-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-container.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-context.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-snapshot.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-date.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-debug.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-script.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-callbacks.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-promise.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-message.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-exception.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-extension.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-external.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function-callback.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-template.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-memory-span.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-initialization.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-isolate.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-heap.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-statistics.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-unwinder.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-state-scope.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-platform.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-json.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-locker.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask-queue.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive-object.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-proxy.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-regexp.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-typed-array.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value-serializer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-wasm.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api_types.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api_types.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_buffer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_object_wrap.h \
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h \
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h \
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h \
|
||||
@@ -82,68 +82,68 @@ Release/obj.target/native_metrics/src/GCBinder.o: ../src/GCBinder.cpp \
|
||||
../src/GCBinder.cpp:
|
||||
../src/GCBinder.hpp:
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/errno.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/unix.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/threadpool.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/darwin.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/cppgc/common.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8config.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-array-buffer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-local-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-internal.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-object.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-maybe.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-persistent-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-weak-callback-info.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-primitive.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-data.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-value.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-traced-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-container.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-context.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-snapshot.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-date.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-debug.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-script.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-callbacks.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-promise.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-message.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-exception.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-extension.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-external.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-function.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-function-callback.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-template.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-memory-span.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-initialization.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-isolate.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-embedder-heap.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-microtask.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-statistics.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-unwinder.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-embedder-state-scope.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-platform.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-json.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-locker.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-microtask-queue.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-primitive-object.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-proxy.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-regexp.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-typed-array.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-value-serializer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-wasm.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_api.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/js_native_api.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/js_native_api_types.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_api_types.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_buffer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_object_wrap.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/errno.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/unix.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/threadpool.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/darwin.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/cppgc/common.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8config.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-array-buffer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-local-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-internal.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-object.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-maybe.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-persistent-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-weak-callback-info.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-data.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-traced-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-container.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-context.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-snapshot.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-date.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-debug.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-script.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-callbacks.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-promise.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-message.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-exception.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-extension.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-external.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function-callback.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-template.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-memory-span.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-initialization.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-isolate.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-heap.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-statistics.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-unwinder.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-state-scope.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-platform.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-json.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-locker.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask-queue.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive-object.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-proxy.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-regexp.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-typed-array.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value-serializer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-wasm.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api_types.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api_types.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_buffer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_object_wrap.h:
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h:
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h:
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h:
|
||||
|
||||
@@ -1,70 +1,70 @@
|
||||
cmd_Release/obj.target/native_metrics/src/LoopChecker.o := c++ -o Release/obj.target/native_metrics/src/LoopChecker.o ../src/LoopChecker.cpp '-DNODE_GYP_MODULE_NAME=native_metrics' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNOMINMAX' '-DBUILDING_NODE_EXTENSION' -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/src -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/openssl/config -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/openssl/openssl/include -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/uv/include -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/zlib -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/v8/include -I../src -I../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan -O3 -gdwarf-2 -mmacosx-version-min=10.15 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/native_metrics/src/LoopChecker.o.d.raw -c
|
||||
cmd_Release/obj.target/native_metrics/src/LoopChecker.o := c++ -o Release/obj.target/native_metrics/src/LoopChecker.o ../src/LoopChecker.cpp '-DNODE_GYP_MODULE_NAME=native_metrics' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNOMINMAX' '-DBUILDING_NODE_EXTENSION' -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/src -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/config -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/openssl/include -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/uv/include -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/zlib -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/v8/include -I../src -I../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan -O3 -gdwarf-2 -mmacosx-version-min=10.15 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/native_metrics/src/LoopChecker.o.d.raw -c
|
||||
Release/obj.target/native_metrics/src/LoopChecker.o: \
|
||||
../src/LoopChecker.cpp \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/errno.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/unix.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/threadpool.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/darwin.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/errno.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/unix.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/threadpool.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/darwin.h \
|
||||
../src/LoopChecker.hpp \
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/cppgc/common.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8config.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-array-buffer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-local-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-internal.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-object.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-maybe.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-persistent-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-weak-callback-info.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-primitive.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-data.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-value.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-traced-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-container.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-context.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-snapshot.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-date.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-debug.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-script.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-callbacks.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-promise.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-message.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-exception.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-extension.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-external.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-function.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-function-callback.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-template.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-memory-span.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-initialization.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-isolate.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-embedder-heap.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-microtask.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-statistics.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-unwinder.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-embedder-state-scope.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-platform.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-json.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-locker.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-microtask-queue.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-primitive-object.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-proxy.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-regexp.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-typed-array.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-value-serializer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-wasm.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_api.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/js_native_api.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/js_native_api_types.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_api_types.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_buffer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_object_wrap.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/cppgc/common.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8config.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-array-buffer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-local-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-internal.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-object.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-maybe.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-persistent-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-weak-callback-info.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-data.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-traced-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-container.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-context.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-snapshot.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-date.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-debug.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-script.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-callbacks.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-promise.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-message.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-exception.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-extension.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-external.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function-callback.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-template.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-memory-span.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-initialization.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-isolate.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-heap.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-statistics.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-unwinder.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-state-scope.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-platform.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-json.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-locker.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask-queue.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive-object.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-proxy.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-regexp.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-typed-array.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value-serializer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-wasm.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api_types.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api_types.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_buffer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_object_wrap.h \
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h \
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h \
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h \
|
||||
@@ -81,70 +81,70 @@ Release/obj.target/native_metrics/src/LoopChecker.o: \
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_scriptorigin.h \
|
||||
../src/Metric.hpp
|
||||
../src/LoopChecker.cpp:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/errno.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/unix.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/threadpool.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/darwin.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/errno.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/unix.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/threadpool.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/darwin.h:
|
||||
../src/LoopChecker.hpp:
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/cppgc/common.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8config.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-array-buffer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-local-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-internal.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-object.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-maybe.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-persistent-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-weak-callback-info.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-primitive.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-data.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-value.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-traced-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-container.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-context.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-snapshot.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-date.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-debug.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-script.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-callbacks.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-promise.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-message.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-exception.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-extension.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-external.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-function.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-function-callback.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-template.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-memory-span.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-initialization.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-isolate.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-embedder-heap.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-microtask.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-statistics.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-unwinder.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-embedder-state-scope.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-platform.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-json.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-locker.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-microtask-queue.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-primitive-object.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-proxy.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-regexp.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-typed-array.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-value-serializer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-wasm.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_api.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/js_native_api.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/js_native_api_types.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_api_types.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_buffer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_object_wrap.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/cppgc/common.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8config.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-array-buffer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-local-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-internal.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-object.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-maybe.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-persistent-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-weak-callback-info.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-data.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-traced-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-container.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-context.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-snapshot.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-date.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-debug.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-script.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-callbacks.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-promise.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-message.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-exception.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-extension.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-external.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function-callback.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-template.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-memory-span.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-initialization.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-isolate.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-heap.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-statistics.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-unwinder.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-state-scope.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-platform.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-json.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-locker.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask-queue.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive-object.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-proxy.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-regexp.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-typed-array.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value-serializer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-wasm.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api_types.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api_types.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_buffer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_object_wrap.h:
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h:
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h:
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h:
|
||||
|
||||
@@ -1,69 +1,69 @@
|
||||
cmd_Release/obj.target/native_metrics/src/native_metrics.o := c++ -o Release/obj.target/native_metrics/src/native_metrics.o ../src/native_metrics.cpp '-DNODE_GYP_MODULE_NAME=native_metrics' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNOMINMAX' '-DBUILDING_NODE_EXTENSION' -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/src -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/openssl/config -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/openssl/openssl/include -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/uv/include -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/zlib -I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/v8/include -I../src -I../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan -O3 -gdwarf-2 -mmacosx-version-min=10.15 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/native_metrics/src/native_metrics.o.d.raw -c
|
||||
cmd_Release/obj.target/native_metrics/src/native_metrics.o := c++ -o Release/obj.target/native_metrics/src/native_metrics.o ../src/native_metrics.cpp '-DNODE_GYP_MODULE_NAME=native_metrics' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNOMINMAX' '-DBUILDING_NODE_EXTENSION' -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/src -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/config -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/openssl/include -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/uv/include -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/zlib -I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/v8/include -I../src -I../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan -O3 -gdwarf-2 -mmacosx-version-min=10.15 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/native_metrics/src/native_metrics.o.d.raw -c
|
||||
Release/obj.target/native_metrics/src/native_metrics.o: \
|
||||
../src/native_metrics.cpp \
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/errno.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/unix.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/threadpool.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/darwin.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/cppgc/common.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8config.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-array-buffer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-local-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-internal.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-object.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-maybe.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-persistent-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-weak-callback-info.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-primitive.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-data.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-value.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-traced-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-container.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-context.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-snapshot.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-date.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-debug.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-script.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-callbacks.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-promise.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-message.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-exception.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-extension.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-external.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-function.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-function-callback.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-template.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-memory-span.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-initialization.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-isolate.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-embedder-heap.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-microtask.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-statistics.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-unwinder.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-embedder-state-scope.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-platform.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-json.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-locker.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-microtask-queue.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-primitive-object.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-proxy.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-regexp.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-typed-array.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-value-serializer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-wasm.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_api.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/js_native_api.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/js_native_api_types.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_api_types.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_buffer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_object_wrap.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/errno.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/unix.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/threadpool.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/darwin.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/cppgc/common.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8config.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-array-buffer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-local-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-internal.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-version.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-object.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-maybe.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-persistent-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-weak-callback-info.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-data.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-traced-handle.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-container.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-context.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-snapshot.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-date.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-debug.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-script.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-callbacks.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-promise.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-message.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-exception.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-extension.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-external.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function-callback.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-template.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-memory-span.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-initialization.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-isolate.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-heap.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-statistics.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-unwinder.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-state-scope.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-platform.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-json.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-locker.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask-queue.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive-object.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-proxy.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-regexp.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-typed-array.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value-serializer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-wasm.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api_types.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api_types.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_buffer.h \
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_object_wrap.h \
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h \
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h \
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h \
|
||||
@@ -81,68 +81,68 @@ Release/obj.target/native_metrics/src/native_metrics.o: \
|
||||
../src/GCBinder.hpp ../src/Metric.hpp ../src/LoopChecker.hpp
|
||||
../src/native_metrics.cpp:
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/errno.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/unix.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/threadpool.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/uv/darwin.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/cppgc/common.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8config.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-array-buffer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-local-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-internal.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-object.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-maybe.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-persistent-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-weak-callback-info.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-primitive.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-data.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-value.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-traced-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-container.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-context.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-snapshot.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-date.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-debug.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-script.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-callbacks.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-promise.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-message.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-exception.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-extension.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-external.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-function.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-function-callback.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-template.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-memory-span.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-initialization.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-isolate.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-embedder-heap.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-microtask.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-statistics.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-unwinder.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-embedder-state-scope.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-platform.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-json.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-locker.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-microtask-queue.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-primitive-object.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-proxy.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-regexp.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-typed-array.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-value-serializer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/v8-wasm.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_api.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/js_native_api.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/js_native_api_types.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_api_types.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_buffer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node/node_object_wrap.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/errno.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/unix.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/threadpool.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/uv/darwin.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/cppgc/common.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8config.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-array-buffer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-local-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-internal.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-version.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-object.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-maybe.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-persistent-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-weak-callback-info.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-data.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-traced-handle.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-container.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-context.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-snapshot.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-date.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-debug.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-script.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-callbacks.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-promise.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-message.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-exception.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-extension.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-external.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-function-callback.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-template.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-memory-span.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-initialization.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-isolate.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-heap.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-statistics.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-unwinder.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-embedder-state-scope.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-platform.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-json.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-locker.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-microtask-queue.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-primitive-object.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-proxy.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-regexp.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-typed-array.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-value-serializer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/v8-wasm.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/js_native_api_types.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_api_types.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_buffer.h:
|
||||
/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node/node_object_wrap.h:
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks.h:
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_callbacks_12_inl.h:
|
||||
../../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan/nan_maybe_43_inl.h:
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -278,14 +278,11 @@
|
||||
"lib/internal/test_runner/reporter/dot.js",
|
||||
"lib/internal/test_runner/reporter/spec.js",
|
||||
"lib/internal/test_runner/reporter/tap.js",
|
||||
"lib/internal/test_runner/reporter/v8-serializer.js",
|
||||
"lib/internal/test_runner/runner.js",
|
||||
"lib/internal/test_runner/tap_checker.js",
|
||||
"lib/internal/test_runner/tap_lexer.js",
|
||||
"lib/internal/test_runner/tap_parser.js",
|
||||
"lib/internal/test_runner/test.js",
|
||||
"lib/internal/test_runner/tests_stream.js",
|
||||
"lib/internal/test_runner/utils.js",
|
||||
"lib/internal/test_runner/yaml_to_js.js",
|
||||
"lib/internal/timers.js",
|
||||
"lib/internal/tls/secure-context.js",
|
||||
"lib/internal/tls/secure-pair.js",
|
||||
@@ -408,8 +405,8 @@
|
||||
"v8_use_siphash": 1,
|
||||
"want_separate_host_toolset": 0,
|
||||
"xcode_version": "13.0",
|
||||
"nodedir": "/Users/karolsojko/Library/Caches/node-gyp/20.1.0",
|
||||
"nodedir": "/Users/karolsojko/Library/Caches/node-gyp/20.2.0",
|
||||
"standalone_static_library": 1,
|
||||
"user_agent": "yarn/4.0.0-rc.43 npm/? node/v20.1.0 darwin arm64"
|
||||
"user_agent": "yarn/4.0.0-rc.43 npm/? node/v20.2.0 darwin arm64"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,13 +51,13 @@ CFLAGS_OBJC_Debug :=
|
||||
CFLAGS_OBJCC_Debug :=
|
||||
|
||||
INCS_Debug := \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/src \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/openssl/config \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/openssl/openssl/include \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/uv/include \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/zlib \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/v8/include \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/src \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/config \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/openssl/include \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/uv/include \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/zlib \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/v8/include \
|
||||
-I$(srcdir)/src \
|
||||
-I$(srcdir)/../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan
|
||||
|
||||
@@ -107,13 +107,13 @@ CFLAGS_OBJC_Release :=
|
||||
CFLAGS_OBJCC_Release :=
|
||||
|
||||
INCS_Release := \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/include/node \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/src \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/openssl/config \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/openssl/openssl/include \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/uv/include \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/zlib \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.1.0/deps/v8/include \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/include/node \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/src \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/config \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/openssl/openssl/include \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/uv/include \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/zlib \
|
||||
-I/Users/karolsojko/Library/Caches/node-gyp/20.2.0/deps/v8/include \
|
||||
-I$(srcdir)/src \
|
||||
-I$(srcdir)/../../../../nan-npm-2.17.0-bf36a21d6f/node_modules/nan
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
FROM node:20.1.0-alpine
|
||||
FROM node:20.2.0-alpine
|
||||
|
||||
ENV NODE_ENV production
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
"@lerna-lite/version": "^2.3.0",
|
||||
"@types/jest": "^29.5.1",
|
||||
"@types/newrelic": "^9.13.0",
|
||||
"@types/node": "^20.1.0",
|
||||
"@types/node": "^20.2.0",
|
||||
"eslint": "^8.39.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"ini": "^3.0.0",
|
||||
|
||||
@@ -3,6 +3,16 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [2.23.0](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.22.5...@standardnotes/analytics@2.23.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
* upgrade to node 20.2.0 ([#616](https://github.com/standardnotes/server/issues/616)) ([a6b062f](https://github.com/standardnotes/server/commit/a6b062f638595537e1ece28bc79bded41d875e18))
|
||||
|
||||
## [2.22.5](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.22.4...@standardnotes/analytics@2.22.5) (2023-05-29)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/analytics
|
||||
|
||||
## [2.22.4](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.22.3...@standardnotes/analytics@2.22.4) (2023-05-17)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/analytics
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM node:20.1.0-alpine
|
||||
FROM node:20.2.0-alpine
|
||||
|
||||
RUN apk add --update \
|
||||
curl \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/analytics",
|
||||
"version": "2.22.4",
|
||||
"version": "2.23.0",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
@@ -29,7 +29,7 @@
|
||||
"@types/jest": "^29.5.1",
|
||||
"@types/mixpanel": "^2.14.4",
|
||||
"@types/newrelic": "^9.13.0",
|
||||
"@types/node": "^20.1.0",
|
||||
"@types/node": "^20.2.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
||||
"@typescript-eslint/parser": "^5.59.2",
|
||||
"eslint": "^8.39.0",
|
||||
|
||||
@@ -3,6 +3,18 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [1.60.0](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.59.0...@standardnotes/api-gateway@1.60.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
* upgrade to node 20.2.0 ([#616](https://github.com/standardnotes/api-gateway/issues/616)) ([a6b062f](https://github.com/standardnotes/api-gateway/commit/a6b062f638595537e1ece28bc79bded41d875e18))
|
||||
|
||||
# [1.59.0](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.58.0...@standardnotes/api-gateway@1.59.0) (2023-05-29)
|
||||
|
||||
### Features
|
||||
|
||||
* add files server as a service to home-server ([#614](https://github.com/standardnotes/api-gateway/issues/614)) ([c7d575a](https://github.com/standardnotes/api-gateway/commit/c7d575a0ffc7eb3e8799c3835da5727584f4f67b))
|
||||
|
||||
# [1.58.0](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.57.0...@standardnotes/api-gateway@1.58.0) (2023-05-25)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM node:20.1.0-alpine
|
||||
FROM node:20.2.0-alpine
|
||||
|
||||
RUN apk add --update \
|
||||
curl \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/api-gateway",
|
||||
"version": "1.58.0",
|
||||
"version": "1.60.0",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
export * from './Container'
|
||||
export * from './Service'
|
||||
export * from './Types'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
export * from './AuthMiddleware'
|
||||
export * from './HealthCheckController'
|
||||
export * from './LegacyController'
|
||||
export * from './SubscriptionTokenAuthMiddleware'
|
||||
export * from './TokenAuthenticationMethod'
|
||||
export * from './WebSocketAuthMiddleware'
|
||||
|
||||
@@ -3,6 +3,18 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [1.113.0](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.112.0...@standardnotes/auth-server@1.113.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
* upgrade to node 20.2.0 ([#616](https://github.com/standardnotes/server/issues/616)) ([a6b062f](https://github.com/standardnotes/server/commit/a6b062f638595537e1ece28bc79bded41d875e18))
|
||||
|
||||
# [1.112.0](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.111.0...@standardnotes/auth-server@1.112.0) (2023-05-29)
|
||||
|
||||
### Features
|
||||
|
||||
* add files server as a service to home-server ([#614](https://github.com/standardnotes/server/issues/614)) ([c7d575a](https://github.com/standardnotes/server/commit/c7d575a0ffc7eb3e8799c3835da5727584f4f67b))
|
||||
|
||||
# [1.111.0](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.110.0...@standardnotes/auth-server@1.111.0) (2023-05-25)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM node:20.1.0-alpine
|
||||
FROM node:20.2.0-alpine
|
||||
|
||||
RUN apk add --update \
|
||||
curl \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/auth-server",
|
||||
"version": "1.111.0",
|
||||
"version": "1.113.0",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
|
||||
@@ -228,29 +228,28 @@ import { TypeORMEphemeralSessionRepository } from '../Infra/TypeORM/TypeORMEphem
|
||||
import { TypeORMOfflineSubscriptionTokenRepository } from '../Infra/TypeORM/TypeORMOfflineSubscriptionTokenRepository'
|
||||
import { TypeORMPKCERepository } from '../Infra/TypeORM/TypeORMPKCERepository'
|
||||
import { TypeORMSubscriptionTokenRepository } from '../Infra/TypeORM/TypeORMSubscriptionTokenRepository'
|
||||
import { InversifyExpressAuthController } from '../Infra/InversifyExpressUtils/InversifyExpressAuthController'
|
||||
import { InversifyExpressAuthenticatorsController } from '../Infra/InversifyExpressUtils/InversifyExpressAuthenticatorsController'
|
||||
import { InversifyExpressSubscriptionInvitesController } from '../Infra/InversifyExpressUtils/InversifyExpressSubscriptionInvitesController'
|
||||
import { InversifyExpressUserRequestsController } from '../Infra/InversifyExpressUtils/InversifyExpressUserRequestsController'
|
||||
import { InversifyExpressWebSocketsController } from '../Infra/InversifyExpressUtils/InversifyExpressWebSocketsController'
|
||||
import { InversifyExpressSessionsController } from '../Infra/InversifyExpressUtils/InversifyExpressSessionsController'
|
||||
import { InversifyExpressValetTokenController } from '../Infra/InversifyExpressUtils/InversifyExpressValetTokenController'
|
||||
import { InversifyExpressUsersController } from '../Infra/InversifyExpressUtils/InversifyExpressUsersController'
|
||||
import { InversifyExpressAdminController } from '../Infra/InversifyExpressUtils/InversifyExpressAdminController'
|
||||
import { InversifyExpressSubscriptionTokensController } from '../Infra/InversifyExpressUtils/InversifyExpressSubscriptionTokensController'
|
||||
import { InversifyExpressSubscriptionSettingsController } from '../Infra/InversifyExpressUtils/InversifyExpressSubscriptionSettingsController'
|
||||
import { InversifyExpressSettingsController } from '../Infra/InversifyExpressUtils/InversifyExpressSettingsController'
|
||||
import { SessionMiddleware } from '../Infra/InversifyExpressUtils/Middleware/SessionMiddleware'
|
||||
import { ApiGatewayOfflineAuthMiddleware } from '../Infra/InversifyExpressUtils/Middleware/ApiGatewayOfflineAuthMiddleware'
|
||||
import { OfflineUserAuthMiddleware } from '../Infra/InversifyExpressUtils/Middleware/OfflineUserAuthMiddleware'
|
||||
import { LockMiddleware } from '../Infra/InversifyExpressUtils/Middleware/LockMiddleware'
|
||||
import { InversifyExpressSessionController } from '../Infra/InversifyExpressUtils/InversifyExpressSessionController'
|
||||
import { InversifyExpressOfflineController } from '../Infra/InversifyExpressUtils/InversifyExpressOfflineController'
|
||||
import { InversifyExpressListedController } from '../Infra/InversifyExpressUtils/InversifyExpressListedController'
|
||||
import { InversifyExpressInternalController } from '../Infra/InversifyExpressUtils/InversifyExpressInternalController'
|
||||
import { InversifyExpressFeaturesController } from '../Infra/InversifyExpressUtils/InversifyExpressFeaturesController'
|
||||
import { RequiredCrossServiceTokenMiddleware } from '../Infra/InversifyExpressUtils/Middleware/RequiredCrossServiceTokenMiddleware'
|
||||
import { OptionalCrossServiceTokenMiddleware } from '../Infra/InversifyExpressUtils/Middleware/OptionalCrossServiceTokenMiddleware'
|
||||
import { HomeServerSettingsController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerSettingsController'
|
||||
import { HomeServerAdminController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerAdminController'
|
||||
import { HomeServerAuthController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerAuthController'
|
||||
import { HomeServerAuthenticatorsController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerAuthenticatorsController'
|
||||
import { HomeServerFeaturesController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerFeaturesController'
|
||||
import { HomeServerListedController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerListedController'
|
||||
import { HomeServerOfflineController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerOfflineController'
|
||||
import { HomeServerSessionController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerSessionController'
|
||||
import { HomeServerSubscriptionInvitesController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerSubscriptionInvitesController'
|
||||
import { HomeServerSubscriptionSettingsController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerSubscriptionSettingsController'
|
||||
import { HomeServerSubscriptionTokensController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerSubscriptionTokensController'
|
||||
import { HomeServerUserRequestsController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerUserRequestsController'
|
||||
import { HomeServerUsersController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerUsersController'
|
||||
import { HomeServerValetTokenController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerValetTokenController'
|
||||
import { HomeServerWebSocketsController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerWebSocketsController'
|
||||
import { HomeServerSessionsController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerSessionsController'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const newrelicFormatter = require('@newrelic/winston-enricher')
|
||||
@@ -1012,9 +1011,9 @@ export class ContainerConfigLoader {
|
||||
}
|
||||
|
||||
container
|
||||
.bind<InversifyExpressAuthController>(TYPES.Auth_InversifyExpressAuthController)
|
||||
.bind<HomeServerAuthController>(TYPES.Auth_HomeServerAuthController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressAuthController(
|
||||
new HomeServerAuthController(
|
||||
container.get(TYPES.Auth_VerifyMFA),
|
||||
container.get(TYPES.Auth_SignIn),
|
||||
container.get(TYPES.Auth_GetUserKeyParams),
|
||||
@@ -1029,42 +1028,42 @@ export class ContainerConfigLoader {
|
||||
// Inversify Controllers
|
||||
if (isConfiguredForHomeServer) {
|
||||
container
|
||||
.bind<InversifyExpressAuthenticatorsController>(TYPES.Auth_InversifyExpressAuthenticatorsController)
|
||||
.bind<HomeServerAuthenticatorsController>(TYPES.Auth_HomeServerAuthenticatorsController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressAuthenticatorsController(
|
||||
new HomeServerAuthenticatorsController(
|
||||
container.get(TYPES.Auth_AuthenticatorsController),
|
||||
container.get(TYPES.Auth_ControllerContainer),
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressSubscriptionInvitesController>(TYPES.Auth_InversifyExpressSubscriptionInvitesController)
|
||||
.bind<HomeServerSubscriptionInvitesController>(TYPES.Auth_HomeServerSubscriptionInvitesController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressSubscriptionInvitesController(
|
||||
new HomeServerSubscriptionInvitesController(
|
||||
container.get(TYPES.Auth_SubscriptionInvitesController),
|
||||
container.get(TYPES.Auth_ControllerContainer),
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressUserRequestsController>(TYPES.Auth_InversifyExpressUserRequestsController)
|
||||
.bind<HomeServerUserRequestsController>(TYPES.Auth_HomeServerUserRequestsController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressUserRequestsController(
|
||||
new HomeServerUserRequestsController(
|
||||
container.get(TYPES.Auth_UserRequestsController),
|
||||
container.get(TYPES.Auth_ControllerContainer),
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressWebSocketsController>(TYPES.Auth_InversifyExpressWebSocketsController)
|
||||
.bind<HomeServerWebSocketsController>(TYPES.Auth_HomeServerWebSocketsController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressWebSocketsController(
|
||||
new HomeServerWebSocketsController(
|
||||
container.get(TYPES.Auth_CreateCrossServiceToken),
|
||||
container.get(TYPES.Auth_WebSocketConnectionTokenDecoder),
|
||||
container.get(TYPES.Auth_ControllerContainer),
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressSessionsController>(TYPES.Auth_SessionsController)
|
||||
.bind<HomeServerSessionsController>(TYPES.Auth_HomeServerSessionsController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressSessionsController(
|
||||
new HomeServerSessionsController(
|
||||
container.get(TYPES.Auth_GetActiveSessionsForUser),
|
||||
container.get(TYPES.Auth_AuthenticateRequest),
|
||||
container.get(TYPES.Auth_SessionProjector),
|
||||
@@ -1073,17 +1072,17 @@ export class ContainerConfigLoader {
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressValetTokenController>(TYPES.Auth_InversifyExpressValetTokenController)
|
||||
.bind<HomeServerValetTokenController>(TYPES.Auth_HomeServerValetTokenController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressValetTokenController(
|
||||
new HomeServerValetTokenController(
|
||||
container.get(TYPES.Auth_CreateValetToken),
|
||||
container.get(TYPES.Auth_ControllerContainer),
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressUsersController>(TYPES.Auth_InversifyExpressUsersController)
|
||||
.bind<HomeServerUsersController>(TYPES.Auth_HomeServerUsersController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressUsersController(
|
||||
new HomeServerUsersController(
|
||||
container.get(TYPES.Auth_UpdateUser),
|
||||
container.get(TYPES.Auth_GetUserKeyParams),
|
||||
container.get(TYPES.Auth_DeleteAccount),
|
||||
@@ -1095,9 +1094,9 @@ export class ContainerConfigLoader {
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressAdminController>(TYPES.Auth_InversifyExpressAdminController)
|
||||
.bind<HomeServerAdminController>(TYPES.Auth_HomeServerAdminController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressAdminController(
|
||||
new HomeServerAdminController(
|
||||
container.get(TYPES.Auth_DeleteSetting),
|
||||
container.get(TYPES.Auth_UserRepository),
|
||||
container.get(TYPES.Auth_CreateSubscriptionToken),
|
||||
@@ -1106,9 +1105,9 @@ export class ContainerConfigLoader {
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressSubscriptionTokensController>(TYPES.Auth_InversifyExpressSubscriptionTokensController)
|
||||
.bind<HomeServerSubscriptionTokensController>(TYPES.Auth_HomeServerSubscriptionTokensController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressSubscriptionTokensController(
|
||||
new HomeServerSubscriptionTokensController(
|
||||
container.get(TYPES.Auth_CreateSubscriptionToken),
|
||||
container.get(TYPES.Auth_AuthenticateSubscriptionToken),
|
||||
container.get(TYPES.Auth_SettingService),
|
||||
@@ -1120,17 +1119,17 @@ export class ContainerConfigLoader {
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressSubscriptionSettingsController>(TYPES.Auth_InversifyExpressSubscriptionSettingsController)
|
||||
.bind<HomeServerSubscriptionSettingsController>(TYPES.Auth_HomeServerSubscriptionSettingsController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressSubscriptionSettingsController(
|
||||
new HomeServerSubscriptionSettingsController(
|
||||
container.get(TYPES.Auth_GetSetting),
|
||||
container.get(TYPES.Auth_ControllerContainer),
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressSettingsController>(TYPES.Auth_InversifyExpressSettingsController)
|
||||
.bind<HomeServerSettingsController>(TYPES.Auth_HomeServerSettingsController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressSettingsController(
|
||||
new HomeServerSettingsController(
|
||||
container.get(TYPES.Auth_GetSettings),
|
||||
container.get(TYPES.Auth_GetSetting),
|
||||
container.get(TYPES.Auth_UpdateSetting),
|
||||
@@ -1139,9 +1138,9 @@ export class ContainerConfigLoader {
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressSessionController>(TYPES.Auth_InversifyExpressSessionController)
|
||||
.bind<HomeServerSessionController>(TYPES.Auth_HomeServerSessionController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressSessionController(
|
||||
new HomeServerSessionController(
|
||||
container.get(TYPES.Auth_DeleteSessionForUser),
|
||||
container.get(TYPES.Auth_DeletePreviousSessionsForUser),
|
||||
container.get(TYPES.Auth_RefreshSessionToken),
|
||||
@@ -1149,9 +1148,9 @@ export class ContainerConfigLoader {
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressOfflineController>(TYPES.Auth_InversifyExpressOfflineController)
|
||||
.bind<HomeServerOfflineController>(TYPES.Auth_HomeServerOfflineController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressOfflineController(
|
||||
new HomeServerOfflineController(
|
||||
container.get(TYPES.Auth_GetUserFeatures),
|
||||
container.get(TYPES.Auth_GetUserOfflineSubscription),
|
||||
container.get(TYPES.Auth_CreateOfflineSubscriptionToken),
|
||||
@@ -1163,25 +1162,17 @@ export class ContainerConfigLoader {
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressListedController>(TYPES.Auth_InversifyExpressListedController)
|
||||
.bind<HomeServerListedController>(TYPES.Auth_HomeServerListedController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressListedController(
|
||||
new HomeServerListedController(
|
||||
container.get(TYPES.Auth_CreateListedAccount),
|
||||
container.get(TYPES.Auth_ControllerContainer),
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressInternalController>(TYPES.Auth_InversifyExpressInternalController)
|
||||
.bind<HomeServerFeaturesController>(TYPES.Auth_HomeServerFeaturesController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressInternalController(
|
||||
container.get(TYPES.Auth_GetUserFeatures),
|
||||
container.get(TYPES.Auth_GetSetting),
|
||||
),
|
||||
)
|
||||
container
|
||||
.bind<InversifyExpressFeaturesController>(TYPES.Auth_InversifyExpressFeaturesController)
|
||||
.toConstantValue(
|
||||
new InversifyExpressFeaturesController(
|
||||
new HomeServerFeaturesController(
|
||||
container.get(TYPES.Auth_GetUserFeatures),
|
||||
container.get(TYPES.Auth_ControllerContainer),
|
||||
),
|
||||
|
||||
@@ -216,25 +216,22 @@ const TYPES = {
|
||||
Auth_ProtocolVersionSelector: Symbol.for('Auth_ProtocolVersionSelector'),
|
||||
Auth_BooleanSelector: Symbol.for('Auth_BooleanSelector'),
|
||||
Auth_UserSubscriptionService: Symbol.for('Auth_UserSubscriptionService'),
|
||||
Auth_InversifyExpressAuthController: Symbol.for('Auth_InversifyExpressAuthController'),
|
||||
Auth_InversifyExpressAuthenticatorsController: Symbol.for('Auth_InversifyExpressAuthenticatorsController'),
|
||||
Auth_InversifyExpressSubscriptionInvitesController: Symbol.for('Auth_InversifyExpressSubscriptionInvitesController'),
|
||||
Auth_InversifyExpressUserRequestsController: Symbol.for('Auth_InversifyExpressUserRequestsController'),
|
||||
Auth_InversifyExpressWebSocketsController: Symbol.for('Auth_InversifyExpressWebSocketsController'),
|
||||
Auth_SessionsController: Symbol.for('Auth_SessionsController'),
|
||||
Auth_InversifyExpressValetTokenController: Symbol.for('Auth_InversifyExpressValetTokenController'),
|
||||
Auth_InversifyExpressUsersController: Symbol.for('Auth_InversifyExpressUsersController'),
|
||||
Auth_InversifyExpressAdminController: Symbol.for('Auth_InversifyExpressAdminController'),
|
||||
Auth_InversifyExpressSubscriptionTokensController: Symbol.for('Auth_InversifyExpressSubscriptionTokensController'),
|
||||
Auth_InversifyExpressSubscriptionSettingsController: Symbol.for(
|
||||
'Auth_InversifyExpressSubscriptionSettingsController',
|
||||
),
|
||||
Auth_InversifyExpressSettingsController: Symbol.for('Auth_InversifyExpressSettingsController'),
|
||||
Auth_InversifyExpressSessionController: Symbol.for('Auth_InversifyExpressSessionController'),
|
||||
Auth_InversifyExpressOfflineController: Symbol.for('Auth_InversifyExpressOfflineController'),
|
||||
Auth_InversifyExpressListedController: Symbol.for('Auth_InversifyExpressListedController'),
|
||||
Auth_InversifyExpressInternalController: Symbol.for('Auth_InversifyExpressInternalController'),
|
||||
Auth_InversifyExpressFeaturesController: Symbol.for('Auth_InversifyExpressFeaturesController'),
|
||||
Auth_HomeServerAuthController: Symbol.for('Auth_HomeServerAuthController'),
|
||||
Auth_HomeServerAuthenticatorsController: Symbol.for('Auth_HomeServerAuthenticatorsController'),
|
||||
Auth_HomeServerSubscriptionInvitesController: Symbol.for('Auth_HomeServerSubscriptionInvitesController'),
|
||||
Auth_HomeServerUserRequestsController: Symbol.for('Auth_HomeServerUserRequestsController'),
|
||||
Auth_HomeServerWebSocketsController: Symbol.for('Auth_HomeServerWebSocketsController'),
|
||||
Auth_HomeServerSessionsController: Symbol.for('Auth_HomeServerSessionsController'),
|
||||
Auth_HomeServerValetTokenController: Symbol.for('Auth_HomeServerValetTokenController'),
|
||||
Auth_HomeServerUsersController: Symbol.for('Auth_HomeServerUsersController'),
|
||||
Auth_HomeServerAdminController: Symbol.for('Auth_HomeServerAdminController'),
|
||||
Auth_HomeServerSubscriptionTokensController: Symbol.for('Auth_HomeServerSubscriptionTokensController'),
|
||||
Auth_HomeServerSubscriptionSettingsController: Symbol.for('Auth_HomeServerSubscriptionSettingsController'),
|
||||
Auth_HomeServerSettingsController: Symbol.for('Auth_HomeServerSettingsController'),
|
||||
Auth_HomeServerSessionController: Symbol.for('Auth_HomeServerSessionController'),
|
||||
Auth_HomeServerOfflineController: Symbol.for('Auth_HomeServerOfflineController'),
|
||||
Auth_HomeServerListedController: Symbol.for('Auth_HomeServerListedController'),
|
||||
Auth_HomeServerFeaturesController: Symbol.for('Auth_HomeServerFeaturesController'),
|
||||
}
|
||||
|
||||
export default TYPES
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
import { ControllerContainerInterface, Username } from '@standardnotes/domain-core'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
import { SettingName } from '@standardnotes/settings'
|
||||
import { Request } from 'express'
|
||||
|
||||
import { CreateOfflineSubscriptionToken } from '../../../Domain/UseCase/CreateOfflineSubscriptionToken/CreateOfflineSubscriptionToken'
|
||||
import { CreateSubscriptionToken } from '../../../Domain/UseCase/CreateSubscriptionToken/CreateSubscriptionToken'
|
||||
import { DeleteSetting } from '../../../Domain/UseCase/DeleteSetting/DeleteSetting'
|
||||
import { UserRepositoryInterface } from '../../../Domain/User/UserRepositoryInterface'
|
||||
|
||||
export class HomeServerAdminController extends BaseHttpController {
|
||||
constructor(
|
||||
protected doDeleteSetting: DeleteSetting,
|
||||
protected userRepository: UserRepositoryInterface,
|
||||
protected createSubscriptionToken: CreateSubscriptionToken,
|
||||
protected createOfflineSubscriptionToken: CreateOfflineSubscriptionToken,
|
||||
private controllerContainer?: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('admin.getUser', this.getUser.bind(this))
|
||||
this.controllerContainer.register('admin.deleteMFASetting', this.deleteMFASetting.bind(this))
|
||||
this.controllerContainer.register('admin.createToken', this.createToken.bind(this))
|
||||
this.controllerContainer.register('admin.createOfflineToken', this.createOfflineToken.bind(this))
|
||||
this.controllerContainer.register('admin.disableEmailBackups', this.disableEmailBackups.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
async getUser(request: Request): Promise<results.JsonResult> {
|
||||
const usernameOrError = Username.create(request.params.email ?? '')
|
||||
if (usernameOrError.isFailed()) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Missing email parameter.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
const username = usernameOrError.getValue()
|
||||
|
||||
const user = await this.userRepository.findOneByUsernameOrEmail(username)
|
||||
|
||||
if (!user) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: `No user with email '${username.value}'.`,
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
return this.json({
|
||||
uuid: user.uuid,
|
||||
})
|
||||
}
|
||||
|
||||
async deleteMFASetting(request: Request): Promise<results.JsonResult> {
|
||||
const { userUuid } = request.params
|
||||
const { uuid, updatedAt } = request.body
|
||||
|
||||
const result = await this.doDeleteSetting.execute({
|
||||
uuid,
|
||||
userUuid,
|
||||
settingName: SettingName.NAMES.MfaSecret,
|
||||
timestamp: updatedAt,
|
||||
softDelete: true,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
}
|
||||
|
||||
async createToken(request: Request): Promise<results.JsonResult> {
|
||||
const { userUuid } = request.params
|
||||
const result = await this.createSubscriptionToken.execute({
|
||||
userUuid,
|
||||
})
|
||||
|
||||
return this.json({
|
||||
token: result.subscriptionToken.token,
|
||||
})
|
||||
}
|
||||
|
||||
async createOfflineToken(request: Request): Promise<results.JsonResult | results.BadRequestResult> {
|
||||
const { email } = request.params
|
||||
const result = await this.createOfflineSubscriptionToken.execute({
|
||||
userEmail: email,
|
||||
})
|
||||
|
||||
if (!result.success) {
|
||||
return this.badRequest()
|
||||
}
|
||||
|
||||
return this.json({
|
||||
token: result.offlineSubscriptionToken.token,
|
||||
})
|
||||
}
|
||||
|
||||
async disableEmailBackups(request: Request): Promise<results.BadRequestErrorMessageResult | results.OkResult> {
|
||||
const { userUuid } = request.params
|
||||
|
||||
const result = await this.doDeleteSetting.execute({
|
||||
userUuid,
|
||||
settingName: SettingName.NAMES.EmailBackupFrequency,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.ok()
|
||||
}
|
||||
|
||||
return this.badRequest('No email backups found')
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { Request, Response } from 'express'
|
||||
import { Logger } from 'winston'
|
||||
|
||||
import { ClearLoginAttempts } from '../../../Domain/UseCase/ClearLoginAttempts'
|
||||
import { GetUserKeyParams } from '../../../Domain/UseCase/GetUserKeyParams/GetUserKeyParams'
|
||||
import { IncreaseLoginAttempts } from '../../../Domain/UseCase/IncreaseLoginAttempts'
|
||||
import { SignIn } from '../../../Domain/UseCase/SignIn'
|
||||
import { VerifyMFA } from '../../../Domain/UseCase/VerifyMFA'
|
||||
import { AuthController } from '../../../Controller/AuthController'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
|
||||
export class HomeServerAuthController extends BaseHttpController {
|
||||
constructor(
|
||||
protected verifyMFA: VerifyMFA,
|
||||
protected signInUseCase: SignIn,
|
||||
protected getUserKeyParams: GetUserKeyParams,
|
||||
protected clearLoginAttempts: ClearLoginAttempts,
|
||||
protected increaseLoginAttempts: IncreaseLoginAttempts,
|
||||
protected logger: Logger,
|
||||
protected authController: AuthController,
|
||||
private controllerContainer?: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.params', this.params.bind(this))
|
||||
this.controllerContainer.register('auth.signIn', this.signIn.bind(this))
|
||||
this.controllerContainer.register('auth.pkceParams', this.pkceParams.bind(this))
|
||||
this.controllerContainer.register('auth.pkceSignIn', this.pkceSignIn.bind(this))
|
||||
this.controllerContainer.register('auth.users.register', this.register.bind(this))
|
||||
this.controllerContainer.register('auth.generateRecoveryCodes', this.generateRecoveryCodes.bind(this))
|
||||
this.controllerContainer.register('auth.signInWithRecoveryCodes', this.recoveryLogin.bind(this))
|
||||
this.controllerContainer.register('auth.recoveryKeyParams', this.recoveryParams.bind(this))
|
||||
this.controllerContainer.register('auth.signOut', this.signOut.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
async params(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (response.locals.session) {
|
||||
const result = await this.getUserKeyParams.execute({
|
||||
email: response.locals.user.email,
|
||||
authenticated: true,
|
||||
})
|
||||
|
||||
return this.json(result.keyParams)
|
||||
}
|
||||
|
||||
if (!request.query.email) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Please provide an email address.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
const verifyMFAResponse = await this.verifyMFA.execute({
|
||||
email: <string>request.query.email,
|
||||
requestParams: request.query,
|
||||
preventOTPFromFurtherUsage: false,
|
||||
})
|
||||
|
||||
if (!verifyMFAResponse.success) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: verifyMFAResponse.errorTag,
|
||||
message: verifyMFAResponse.errorMessage,
|
||||
payload: verifyMFAResponse.errorPayload,
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.getUserKeyParams.execute({
|
||||
email: <string>request.query.email,
|
||||
authenticated: false,
|
||||
})
|
||||
|
||||
return this.json(result.keyParams)
|
||||
}
|
||||
|
||||
async signIn(request: Request): Promise<results.JsonResult> {
|
||||
if (!request.body.email || !request.body.password) {
|
||||
this.logger.debug('/auth/sign_in request missing credentials: %O', request.body)
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: 'invalid-auth',
|
||||
message: 'Invalid login credentials.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const verifyMFAResponse = await this.verifyMFA.execute({
|
||||
email: request.body.email,
|
||||
requestParams: request.body,
|
||||
preventOTPFromFurtherUsage: true,
|
||||
})
|
||||
|
||||
if (!verifyMFAResponse.success) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: verifyMFAResponse.errorTag,
|
||||
message: verifyMFAResponse.errorMessage,
|
||||
payload: verifyMFAResponse.errorPayload,
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const signInResult = await this.signInUseCase.execute({
|
||||
apiVersion: request.body.api,
|
||||
userAgent: <string>request.headers['user-agent'],
|
||||
email: request.body.email,
|
||||
password: request.body.password,
|
||||
ephemeralSession: request.body.ephemeral ?? false,
|
||||
})
|
||||
|
||||
if (!signInResult.success) {
|
||||
await this.increaseLoginAttempts.execute({ email: request.body.email })
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: signInResult.errorMessage,
|
||||
},
|
||||
},
|
||||
signInResult.errorCode ?? 401,
|
||||
)
|
||||
}
|
||||
|
||||
await this.clearLoginAttempts.execute({ email: request.body.email })
|
||||
|
||||
return this.json(signInResult.authResponse)
|
||||
}
|
||||
|
||||
async pkceParams(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (!request.body.code_challenge) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Please provide the code challenge parameter.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
if (response.locals.session) {
|
||||
const result = await this.getUserKeyParams.execute({
|
||||
email: response.locals.user.email,
|
||||
authenticated: true,
|
||||
codeChallenge: request.body.code_challenge as string,
|
||||
})
|
||||
|
||||
return this.json(result.keyParams)
|
||||
}
|
||||
|
||||
if (!request.body.email) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Please provide an email address.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
const verifyMFAResponse = await this.verifyMFA.execute({
|
||||
email: <string>request.body.email,
|
||||
requestParams: request.body,
|
||||
preventOTPFromFurtherUsage: true,
|
||||
})
|
||||
|
||||
if (!verifyMFAResponse.success) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: verifyMFAResponse.errorTag,
|
||||
message: verifyMFAResponse.errorMessage,
|
||||
payload: verifyMFAResponse.errorPayload,
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.getUserKeyParams.execute({
|
||||
email: <string>request.body.email,
|
||||
authenticated: false,
|
||||
codeChallenge: request.body.code_challenge as string,
|
||||
})
|
||||
|
||||
return this.json(result.keyParams)
|
||||
}
|
||||
|
||||
async pkceSignIn(request: Request): Promise<results.JsonResult> {
|
||||
if (!request.body.email || !request.body.password || !request.body.code_verifier) {
|
||||
this.logger.debug('/auth/sign_in request missing credentials: %O', request.body)
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: 'invalid-auth',
|
||||
message: 'Invalid login credentials.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const signInResult = await this.signInUseCase.execute({
|
||||
apiVersion: request.body.api,
|
||||
userAgent: <string>request.headers['user-agent'],
|
||||
email: request.body.email,
|
||||
password: request.body.password,
|
||||
ephemeralSession: request.body.ephemeral ?? false,
|
||||
codeVerifier: request.body.code_verifier,
|
||||
})
|
||||
|
||||
if (!signInResult.success) {
|
||||
await this.increaseLoginAttempts.execute({ email: request.body.email })
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: signInResult.errorMessage,
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
await this.clearLoginAttempts.execute({ email: request.body.email })
|
||||
|
||||
return this.json(signInResult.authResponse)
|
||||
}
|
||||
|
||||
async generateRecoveryCodes(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.authController.generateRecoveryCodes({
|
||||
userUuid: response.locals.user.uuid,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
}
|
||||
|
||||
async recoveryLogin(request: Request): Promise<results.JsonResult> {
|
||||
const result = await this.authController.signInWithRecoveryCodes({
|
||||
apiVersion: request.body.api_version,
|
||||
userAgent: <string>request.headers['user-agent'],
|
||||
codeVerifier: request.body.code_verifier,
|
||||
username: request.body.username,
|
||||
recoveryCodes: request.body.recovery_codes,
|
||||
password: request.body.password,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
}
|
||||
|
||||
async recoveryParams(request: Request): Promise<results.JsonResult> {
|
||||
const result = await this.authController.recoveryKeyParams({
|
||||
apiVersion: request.body.api_version,
|
||||
username: request.body.username,
|
||||
codeChallenge: request.body.code_challenge,
|
||||
recoveryCodes: request.body.recovery_codes,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
}
|
||||
|
||||
async signOut(request: Request, response: Response): Promise<results.JsonResult | void> {
|
||||
const result = await this.authController.signOut({
|
||||
readOnlyAccess: response.locals.readOnlyAccess,
|
||||
authorizationHeader: <string>request.headers.authorization,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
}
|
||||
|
||||
async register(request: Request): Promise<results.JsonResult> {
|
||||
const response = await this.authController.register({
|
||||
...request.body,
|
||||
userAgent: <string>request.headers['user-agent'],
|
||||
})
|
||||
|
||||
return this.json(response.data, response.status)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { Request, Response } from 'express'
|
||||
|
||||
import { AuthenticatorsController } from '../../../Controller/AuthenticatorsController'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
|
||||
export class HomeServerAuthenticatorsController extends BaseHttpController {
|
||||
constructor(
|
||||
protected authenticatorsController: AuthenticatorsController,
|
||||
private controllerContainer?: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.authenticators.list', this.list.bind(this))
|
||||
this.controllerContainer.register('auth.authenticators.delete', this.delete.bind(this))
|
||||
this.controllerContainer.register(
|
||||
'auth.authenticators.generateRegistrationOptions',
|
||||
this.generateRegistrationOptions.bind(this),
|
||||
)
|
||||
this.controllerContainer.register(
|
||||
'auth.authenticators.verifyRegistrationResponse',
|
||||
this.verifyRegistration.bind(this),
|
||||
)
|
||||
this.controllerContainer.register(
|
||||
'auth.authenticators.generateAuthenticationOptions',
|
||||
this.generateAuthenticationOptions.bind(this),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
async list(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.authenticatorsController.list({
|
||||
userUuid: response.locals.user.uuid,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
}
|
||||
|
||||
async delete(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.authenticatorsController.delete({
|
||||
userUuid: response.locals.user.uuid,
|
||||
authenticatorId: request.params.authenticatorId,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
}
|
||||
|
||||
async generateRegistrationOptions(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.authenticatorsController.generateRegistrationOptions({
|
||||
username: response.locals.user.email,
|
||||
userUuid: response.locals.user.uuid,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
}
|
||||
|
||||
async verifyRegistration(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.authenticatorsController.verifyRegistrationResponse({
|
||||
userUuid: response.locals.user.uuid,
|
||||
attestationResponse: request.body.attestationResponse,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
}
|
||||
|
||||
async generateAuthenticationOptions(request: Request): Promise<results.JsonResult> {
|
||||
const result = await this.authenticatorsController.generateAuthenticationOptions({
|
||||
username: request.body.username,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { Request, Response } from 'express'
|
||||
|
||||
import { GetUserFeatures } from '../../../Domain/UseCase/GetUserFeatures/GetUserFeatures'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
|
||||
export class HomeServerFeaturesController extends BaseHttpController {
|
||||
constructor(
|
||||
protected doGetUserFeatures: GetUserFeatures,
|
||||
private controllerContainer?: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.users.getFeatures', this.getFeatures.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
async getFeatures(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (request.params.userUuid !== response.locals.user.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Operation not allowed.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.doGetUserFeatures.execute({
|
||||
userUuid: request.params.userUuid,
|
||||
offline: false,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { ErrorTag } from '@standardnotes/responses'
|
||||
import { Request, Response } from 'express'
|
||||
|
||||
import { CreateListedAccount } from '../../../Domain/UseCase/CreateListedAccount/CreateListedAccount'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
|
||||
export class HomeServerListedController extends BaseHttpController {
|
||||
constructor(
|
||||
protected doCreateListedAccount: CreateListedAccount,
|
||||
private controllerContainer?: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.users.createListedAccount', this.createListedAccount.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
async createListedAccount(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
await this.doCreateListedAccount.execute({
|
||||
userUuid: response.locals.user.uuid,
|
||||
userEmail: response.locals.user.email,
|
||||
})
|
||||
|
||||
return this.json({
|
||||
message: 'Listed account creation requested successfully.',
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { Request, Response } from 'express'
|
||||
import { TokenEncoderInterface, OfflineUserTokenData } from '@standardnotes/security'
|
||||
import { Logger } from 'winston'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
|
||||
import { AuthenticateOfflineSubscriptionToken } from '../../../Domain/UseCase/AuthenticateOfflineSubscriptionToken/AuthenticateOfflineSubscriptionToken'
|
||||
import { CreateOfflineSubscriptionToken } from '../../../Domain/UseCase/CreateOfflineSubscriptionToken/CreateOfflineSubscriptionToken'
|
||||
import { GetUserFeatures } from '../../../Domain/UseCase/GetUserFeatures/GetUserFeatures'
|
||||
import { GetUserOfflineSubscription } from '../../../Domain/UseCase/GetUserOfflineSubscription/GetUserOfflineSubscription'
|
||||
|
||||
export class HomeServerOfflineController extends BaseHttpController {
|
||||
constructor(
|
||||
protected doGetUserFeatures: GetUserFeatures,
|
||||
protected getUserOfflineSubscription: GetUserOfflineSubscription,
|
||||
protected createOfflineSubscriptionToken: CreateOfflineSubscriptionToken,
|
||||
protected authenticateToken: AuthenticateOfflineSubscriptionToken,
|
||||
protected tokenEncoder: TokenEncoderInterface<OfflineUserTokenData>,
|
||||
protected jwtTTL: number,
|
||||
protected logger: Logger,
|
||||
private controllerContainer?: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.offline.features', this.getOfflineFeatures.bind(this))
|
||||
this.controllerContainer.register('auth.offline.subscriptionTokens.create', this.createToken.bind(this))
|
||||
this.controllerContainer.register('auth.users.getOfflineSubscriptionByToken', this.getSubscription.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
async getOfflineFeatures(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.doGetUserFeatures.execute({
|
||||
email: response.locals.offlineUserEmail,
|
||||
offline: true,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
}
|
||||
|
||||
async createToken(request: Request): Promise<results.JsonResult> {
|
||||
if (!request.body.email) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: 'invalid-request',
|
||||
message: 'Invalid request parameters.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
const response = await this.createOfflineSubscriptionToken.execute({
|
||||
userEmail: request.body.email,
|
||||
})
|
||||
|
||||
if (!response.success) {
|
||||
return this.json({ success: false, error: { tag: response.error } })
|
||||
}
|
||||
|
||||
return this.json({ success: true })
|
||||
}
|
||||
|
||||
async validate(request: Request): Promise<results.JsonResult> {
|
||||
if (!request.body.email) {
|
||||
this.logger.debug('[Offline Subscription Token Validation] Missing email')
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: 'invalid-request',
|
||||
message: 'Invalid request parameters.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
const authenticateTokenResponse = await this.authenticateToken.execute({
|
||||
token: request.params.token,
|
||||
userEmail: request.body.email,
|
||||
})
|
||||
|
||||
if (!authenticateTokenResponse.success) {
|
||||
this.logger.debug('[Offline Subscription Token Validation] invalid token')
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: 'invalid-auth',
|
||||
message: 'Invalid login credentials.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const offlineAuthTokenData: OfflineUserTokenData = {
|
||||
userEmail: authenticateTokenResponse.email,
|
||||
featuresToken: authenticateTokenResponse.featuresToken,
|
||||
}
|
||||
|
||||
const authToken = this.tokenEncoder.encodeExpirableToken(offlineAuthTokenData, this.jwtTTL)
|
||||
|
||||
this.logger.debug(
|
||||
`[Offline Subscription Token Validation] authenticated token for user ${authenticateTokenResponse.email}`,
|
||||
)
|
||||
|
||||
return this.json({ authToken })
|
||||
}
|
||||
|
||||
async getSubscription(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.getUserOfflineSubscription.execute({
|
||||
userEmail: response.locals.userEmail,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { Request, Response } from 'express'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
import { ErrorTag } from '@standardnotes/responses'
|
||||
|
||||
import { DeletePreviousSessionsForUser } from '../../../Domain/UseCase/DeletePreviousSessionsForUser'
|
||||
import { DeleteSessionForUser } from '../../../Domain/UseCase/DeleteSessionForUser'
|
||||
import { RefreshSessionToken } from '../../../Domain/UseCase/RefreshSessionToken'
|
||||
|
||||
export class HomeServerSessionController extends BaseHttpController {
|
||||
constructor(
|
||||
protected deleteSessionForUser: DeleteSessionForUser,
|
||||
protected deletePreviousSessionsForUser: DeletePreviousSessionsForUser,
|
||||
protected refreshSessionToken: RefreshSessionToken,
|
||||
private controllerContainer?: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.sessions.delete', this.deleteSession.bind(this))
|
||||
this.controllerContainer.register('auth.sessions.deleteAll', this.deleteAllSessions.bind(this))
|
||||
this.controllerContainer.register('auth.sessions.refresh', this.refresh.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
async deleteSession(request: Request, response: Response): Promise<results.JsonResult | results.StatusCodeResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
if (!request.body.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Please provide the session identifier.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
if (request.body.uuid === response.locals.session.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'You can not delete your current session.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
const useCaseResponse = await this.deleteSessionForUser.execute({
|
||||
userUuid: response.locals.user.uuid,
|
||||
sessionUuid: request.body.uuid,
|
||||
})
|
||||
|
||||
if (!useCaseResponse.success) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: useCaseResponse.errorMessage,
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
response.setHeader('x-invalidate-cache', response.locals.user.uuid)
|
||||
|
||||
return this.statusCode(204)
|
||||
}
|
||||
|
||||
async deleteAllSessions(
|
||||
_request: Request,
|
||||
response: Response,
|
||||
): Promise<results.JsonResult | results.StatusCodeResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
if (!response.locals.user) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'No session exists with the provided identifier.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
await this.deletePreviousSessionsForUser.execute({
|
||||
userUuid: response.locals.user.uuid,
|
||||
currentSessionUuid: response.locals.session.uuid,
|
||||
})
|
||||
|
||||
response.setHeader('x-invalidate-cache', response.locals.user.uuid)
|
||||
|
||||
return this.statusCode(204)
|
||||
}
|
||||
|
||||
async refresh(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (!request.body.access_token || !request.body.refresh_token) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Please provide all required parameters.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.refreshSessionToken.execute({
|
||||
accessToken: request.body.access_token,
|
||||
refreshToken: request.body.refresh_token,
|
||||
})
|
||||
|
||||
if (!result.success) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: result.errorTag,
|
||||
message: result.errorMessage,
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
response.setHeader('x-invalidate-cache', result.userUuid as string)
|
||||
return this.json({
|
||||
session: result.sessionPayload,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { Request, Response } from 'express'
|
||||
|
||||
import { AuthenticateRequest } from '../../../Domain/UseCase/AuthenticateRequest'
|
||||
import { CreateCrossServiceToken } from '../../../Domain/UseCase/CreateCrossServiceToken/CreateCrossServiceToken'
|
||||
import { GetActiveSessionsForUser } from '../../../Domain/UseCase/GetActiveSessionsForUser'
|
||||
import { ProjectorInterface } from '../../../Projection/ProjectorInterface'
|
||||
import { Session } from '../../../Domain/Session/Session'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
import { User } from '../../../Domain/User/User'
|
||||
import { SessionProjector } from '../../../Projection/SessionProjector'
|
||||
|
||||
export class HomeServerSessionsController extends BaseHttpController {
|
||||
constructor(
|
||||
protected getActiveSessionsForUser: GetActiveSessionsForUser,
|
||||
protected authenticateRequest: AuthenticateRequest,
|
||||
protected sessionProjector: ProjectorInterface<Session>,
|
||||
protected createCrossServiceToken: CreateCrossServiceToken,
|
||||
private controllerContainer?: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.sessions.list', this.getSessions.bind(this))
|
||||
this.controllerContainer.register('auth.sessions.validate', this.validate.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
async validate(request: Request): Promise<results.JsonResult> {
|
||||
const authenticateRequestResponse = await this.authenticateRequest.execute({
|
||||
authorizationHeader: request.headers.authorization,
|
||||
})
|
||||
|
||||
if (!authenticateRequestResponse.success) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: authenticateRequestResponse.errorTag,
|
||||
message: authenticateRequestResponse.errorMessage,
|
||||
},
|
||||
},
|
||||
authenticateRequestResponse.responseCode,
|
||||
)
|
||||
}
|
||||
|
||||
const user = authenticateRequestResponse.user as User
|
||||
|
||||
const result = await this.createCrossServiceToken.execute({
|
||||
user,
|
||||
session: authenticateRequestResponse.session,
|
||||
})
|
||||
|
||||
return this.json({ authToken: result.token })
|
||||
}
|
||||
|
||||
async getSessions(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json([])
|
||||
}
|
||||
|
||||
const useCaseResponse = await this.getActiveSessionsForUser.execute({
|
||||
userUuid: response.locals.user.uuid,
|
||||
})
|
||||
|
||||
return this.json(
|
||||
useCaseResponse.sessions.map((session) =>
|
||||
this.sessionProjector.projectCustom(
|
||||
SessionProjector.CURRENT_SESSION_PROJECTION.toString(),
|
||||
session,
|
||||
response.locals.session,
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { ErrorTag } from '@standardnotes/responses'
|
||||
import { Request, Response } from 'express'
|
||||
|
||||
import { DeleteSetting } from '../../../Domain/UseCase/DeleteSetting/DeleteSetting'
|
||||
import { GetSetting } from '../../../Domain/UseCase/GetSetting/GetSetting'
|
||||
import { GetSettings } from '../../../Domain/UseCase/GetSettings/GetSettings'
|
||||
import { UpdateSetting } from '../../../Domain/UseCase/UpdateSetting/UpdateSetting'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
import { EncryptionVersion } from '../../../Domain/Encryption/EncryptionVersion'
|
||||
|
||||
export class HomeServerSettingsController extends BaseHttpController {
|
||||
constructor(
|
||||
protected doGetSettings: GetSettings,
|
||||
protected doGetSetting: GetSetting,
|
||||
protected doUpdateSetting: UpdateSetting,
|
||||
protected doDeleteSetting: DeleteSetting,
|
||||
private controllerContainer?: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.users.getSettings', this.getSettings.bind(this))
|
||||
this.controllerContainer.register('auth.users.getSetting', this.getSetting.bind(this))
|
||||
this.controllerContainer.register('auth.users.updateSetting', this.updateSetting.bind(this))
|
||||
this.controllerContainer.register('auth.users.deleteSetting', this.deleteSetting.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
async getSettings(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (request.params.userUuid !== response.locals.user.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Operation not allowed.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const { userUuid } = request.params
|
||||
const result = await this.doGetSettings.execute({ userUuid })
|
||||
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
async getSetting(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (request.params.userUuid !== response.locals.user.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Operation not allowed.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const { userUuid, settingName } = request.params
|
||||
const result = await this.doGetSetting.execute({ userUuid, settingName: settingName.toUpperCase() })
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
}
|
||||
|
||||
async updateSetting(request: Request, response: Response): Promise<results.JsonResult | results.StatusCodeResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
if (request.params.userUuid !== response.locals.user.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Operation not allowed.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const { name, value, serverEncryptionVersion = EncryptionVersion.Default, sensitive = false } = request.body
|
||||
|
||||
const props = {
|
||||
name,
|
||||
unencryptedValue: value,
|
||||
serverEncryptionVersion,
|
||||
sensitive,
|
||||
}
|
||||
|
||||
const { userUuid } = request.params
|
||||
const result = await this.doUpdateSetting.execute({
|
||||
userUuid,
|
||||
props,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json({ setting: result.setting }, result.statusCode)
|
||||
}
|
||||
|
||||
return this.json(result, result.statusCode)
|
||||
}
|
||||
|
||||
async deleteSetting(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
if (request.params.userUuid !== response.locals.user.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Operation not allowed.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const { userUuid, settingName } = request.params
|
||||
|
||||
const result = await this.doDeleteSetting.execute({
|
||||
userUuid,
|
||||
settingName,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { Request, Response } from 'express'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
import { ApiVersion } from '@standardnotes/api'
|
||||
|
||||
import { SubscriptionInvitesController } from '../../../Controller/SubscriptionInvitesController'
|
||||
import { Role } from '../../../Domain/Role/Role'
|
||||
|
||||
export class HomeServerSubscriptionInvitesController extends BaseHttpController {
|
||||
constructor(
|
||||
protected subscriptionInvitesController: SubscriptionInvitesController,
|
||||
private controllerContainer?: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.subscriptionInvites.accept', this.acceptInvite.bind(this))
|
||||
this.controllerContainer.register('auth.subscriptionInvites.declineInvite', this.declineInvite.bind(this))
|
||||
this.controllerContainer.register('auth.subscriptionInvites.create', this.inviteToSubscriptionSharing.bind(this))
|
||||
this.controllerContainer.register('auth.subscriptionInvites.delete', this.cancelSubscriptionSharing.bind(this))
|
||||
this.controllerContainer.register('auth.subscriptionInvites.list', this.listInvites.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
async acceptInvite(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.subscriptionInvitesController.acceptInvite({
|
||||
api: request.query.api as ApiVersion,
|
||||
inviteUuid: request.params.inviteUuid,
|
||||
})
|
||||
|
||||
response.setHeader('x-invalidate-cache', response.locals.user.uuid)
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
}
|
||||
|
||||
async declineInvite(request: Request): Promise<results.JsonResult> {
|
||||
const response = await this.subscriptionInvitesController.declineInvite({
|
||||
api: request.query.api as ApiVersion,
|
||||
inviteUuid: request.params.inviteUuid,
|
||||
})
|
||||
|
||||
return this.json(response.data, response.status)
|
||||
}
|
||||
|
||||
async inviteToSubscriptionSharing(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.subscriptionInvitesController.invite({
|
||||
...request.body,
|
||||
inviterEmail: response.locals.user.email,
|
||||
inviterUuid: response.locals.user.uuid,
|
||||
inviterRoles: response.locals.roles.map((role: Role) => role.name),
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
}
|
||||
|
||||
async cancelSubscriptionSharing(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.subscriptionInvitesController.cancelInvite({
|
||||
...request.body,
|
||||
inviteUuid: request.params.inviteUuid,
|
||||
inviterEmail: response.locals.user.email,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
}
|
||||
|
||||
async listInvites(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.subscriptionInvitesController.listInvites({
|
||||
...request.body,
|
||||
inviterEmail: response.locals.user.email,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
import { Request, Response } from 'express'
|
||||
|
||||
import { GetSetting } from '../../../Domain/UseCase/GetSetting/GetSetting'
|
||||
|
||||
export class HomeServerSubscriptionSettingsController extends BaseHttpController {
|
||||
constructor(protected doGetSetting: GetSetting, private controllerContainer?: ControllerContainerInterface) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.users.getSubscriptionSetting', this.getSubscriptionSetting.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
async getSubscriptionSetting(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.doGetSetting.execute({
|
||||
userUuid: response.locals.user.uuid,
|
||||
settingName: request.params.subscriptionSettingName.toUpperCase(),
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { ErrorTag } from '@standardnotes/responses'
|
||||
import { Role, TokenEncoderInterface, CrossServiceTokenData } from '@standardnotes/security'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
import { Request, Response } from 'express'
|
||||
|
||||
import { SettingServiceInterface } from '../../../Domain/Setting/SettingServiceInterface'
|
||||
import { AuthenticateSubscriptionToken } from '../../../Domain/UseCase/AuthenticateSubscriptionToken/AuthenticateSubscriptionToken'
|
||||
import { CreateSubscriptionToken } from '../../../Domain/UseCase/CreateSubscriptionToken/CreateSubscriptionToken'
|
||||
import { ProjectorInterface } from '../../../Projection/ProjectorInterface'
|
||||
import { SettingName } from '@standardnotes/settings'
|
||||
import { User } from '../../../Domain/User/User'
|
||||
|
||||
export class HomeServerSubscriptionTokensController extends BaseHttpController {
|
||||
constructor(
|
||||
protected createSubscriptionToken: CreateSubscriptionToken,
|
||||
protected authenticateToken: AuthenticateSubscriptionToken,
|
||||
protected settingService: SettingServiceInterface,
|
||||
protected userProjector: ProjectorInterface<User>,
|
||||
protected roleProjector: ProjectorInterface<Role>,
|
||||
protected tokenEncoder: TokenEncoderInterface<CrossServiceTokenData>,
|
||||
protected jwtTTL: number,
|
||||
private controllerContainer?: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.subscription-tokens.create', this.createToken.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
async createToken(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.createSubscriptionToken.execute({
|
||||
userUuid: response.locals.user.uuid,
|
||||
})
|
||||
|
||||
return this.json({
|
||||
token: result.subscriptionToken.token,
|
||||
})
|
||||
}
|
||||
|
||||
async validate(request: Request): Promise<results.JsonResult> {
|
||||
const authenticateTokenResponse = await this.authenticateToken.execute({
|
||||
token: request.params.token,
|
||||
})
|
||||
|
||||
if (!authenticateTokenResponse.success) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: 'invalid-auth',
|
||||
message: 'Invalid login credentials.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const user = authenticateTokenResponse.user as User
|
||||
let extensionKey = undefined
|
||||
const extensionKeySetting = await this.settingService.findSettingWithDecryptedValue({
|
||||
settingName: SettingName.create(SettingName.NAMES.ExtensionKey).getValue(),
|
||||
userUuid: user.uuid,
|
||||
})
|
||||
if (extensionKeySetting !== null) {
|
||||
extensionKey = extensionKeySetting.value as string
|
||||
}
|
||||
|
||||
const roles = await user.roles
|
||||
|
||||
const authTokenData: CrossServiceTokenData = {
|
||||
user: await this.projectUser(user),
|
||||
roles: await this.projectRoles(roles),
|
||||
extensionKey,
|
||||
}
|
||||
|
||||
const authToken = this.tokenEncoder.encodeExpirableToken(authTokenData, this.jwtTTL)
|
||||
|
||||
return this.json({ authToken })
|
||||
}
|
||||
|
||||
private async projectUser(user: User): Promise<{ uuid: string; email: string }> {
|
||||
return <{ uuid: string; email: string }>await this.userProjector.projectSimple(user)
|
||||
}
|
||||
|
||||
private async projectRoles(roles: Array<Role>): Promise<Array<{ uuid: string; name: string }>> {
|
||||
const roleProjections = []
|
||||
for (const role of roles) {
|
||||
roleProjections.push(<{ uuid: string; name: string }>await this.roleProjector.projectSimple(role))
|
||||
}
|
||||
|
||||
return roleProjections
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
import { Request, Response } from 'express'
|
||||
|
||||
import { UserRequestsController } from '../../../Controller/UserRequestsController'
|
||||
|
||||
export class HomeServerUserRequestsController extends BaseHttpController {
|
||||
constructor(
|
||||
protected userRequestsController: UserRequestsController,
|
||||
private controllerContainer?: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.users.createRequest', this.submitRequest.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
async submitRequest(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.userRequestsController.submitUserRequest({
|
||||
requestType: request.body.requestType,
|
||||
userUuid: response.locals.user.uuid,
|
||||
userEmail: response.locals.user.email,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
import { ControllerContainerInterface, Username } from '@standardnotes/domain-core'
|
||||
import { Request, Response } from 'express'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
|
||||
import { ChangeCredentials } from '../../../Domain/UseCase/ChangeCredentials/ChangeCredentials'
|
||||
import { ClearLoginAttempts } from '../../../Domain/UseCase/ClearLoginAttempts'
|
||||
import { DeleteAccount } from '../../../Domain/UseCase/DeleteAccount/DeleteAccount'
|
||||
import { GetUserKeyParams } from '../../../Domain/UseCase/GetUserKeyParams/GetUserKeyParams'
|
||||
import { GetUserSubscription } from '../../../Domain/UseCase/GetUserSubscription/GetUserSubscription'
|
||||
import { IncreaseLoginAttempts } from '../../../Domain/UseCase/IncreaseLoginAttempts'
|
||||
import { UpdateUser } from '../../../Domain/UseCase/UpdateUser'
|
||||
import { ErrorTag } from '@standardnotes/responses'
|
||||
|
||||
export class HomeServerUsersController extends BaseHttpController {
|
||||
constructor(
|
||||
protected updateUser: UpdateUser,
|
||||
protected getUserKeyParams: GetUserKeyParams,
|
||||
protected doDeleteAccount: DeleteAccount,
|
||||
protected doGetUserSubscription: GetUserSubscription,
|
||||
protected clearLoginAttempts: ClearLoginAttempts,
|
||||
protected increaseLoginAttempts: IncreaseLoginAttempts,
|
||||
protected changeCredentialsUseCase: ChangeCredentials,
|
||||
private controllerContainer?: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.users.update', this.update.bind(this))
|
||||
this.controllerContainer.register('auth.users.getKeyParams', this.keyParams.bind(this))
|
||||
this.controllerContainer.register('auth.users.getSubscription', this.getSubscription.bind(this))
|
||||
this.controllerContainer.register('auth.users.updateCredentials', this.changeCredentials.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
async update(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
if (request.params.userId !== response.locals.user.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Operation not allowed.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const updateResult = await this.updateUser.execute({
|
||||
user: response.locals.user,
|
||||
updatedWithUserAgent: <string>request.headers['user-agent'],
|
||||
apiVersion: request.body.api,
|
||||
pwFunc: request.body.pw_func,
|
||||
pwAlg: request.body.pw_alg,
|
||||
pwCost: request.body.pw_cost,
|
||||
pwKeySize: request.body.pw_key_size,
|
||||
pwNonce: request.body.pw_nonce,
|
||||
pwSalt: request.body.pw_salt,
|
||||
kpOrigination: request.body.origination,
|
||||
kpCreated: request.body.created,
|
||||
version: request.body.version,
|
||||
})
|
||||
|
||||
if (updateResult.success) {
|
||||
response.setHeader('x-invalidate-cache', response.locals.user.uuid)
|
||||
|
||||
return this.json(updateResult.authResponse)
|
||||
}
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Could not update user.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
async keyParams(request: Request): Promise<results.JsonResult> {
|
||||
const email = 'email' in request.query ? <string>request.query.email : undefined
|
||||
const userUuid = 'uuid' in request.query ? <string>request.query.uuid : undefined
|
||||
|
||||
if (!email && !userUuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Missing mandatory request query parameters.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.getUserKeyParams.execute({
|
||||
email,
|
||||
userUuid,
|
||||
authenticated: request.query.authenticated === 'true',
|
||||
})
|
||||
|
||||
return this.json(result.keyParams)
|
||||
}
|
||||
|
||||
async deleteAccount(request: Request): Promise<results.JsonResult> {
|
||||
const result = await this.doDeleteAccount.execute({
|
||||
email: request.params.email,
|
||||
})
|
||||
|
||||
return this.json({ message: result.message }, result.responseCode)
|
||||
}
|
||||
|
||||
async getSubscription(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (request.params.userUuid !== response.locals.user.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Operation not allowed.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.doGetUserSubscription.execute({
|
||||
userUuid: request.params.userUuid,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
}
|
||||
|
||||
async changeCredentials(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
if (!request.body.current_password) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message:
|
||||
'Your current password is required to change your password. Please update your application if you do not see this option.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
if (!request.body.new_password) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Your new password is required to change your password. Please try again.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
if (!request.body.pw_nonce) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'The change password request is missing new auth parameters. Please try again.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
const usernameOrError = Username.create(response.locals.user.email)
|
||||
if (usernameOrError.isFailed()) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Invalid username.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
const username = usernameOrError.getValue()
|
||||
|
||||
const changeCredentialsResult = await this.changeCredentialsUseCase.execute({
|
||||
username,
|
||||
apiVersion: request.body.api,
|
||||
currentPassword: request.body.current_password,
|
||||
newPassword: request.body.new_password,
|
||||
newEmail: request.body.new_email,
|
||||
pwNonce: request.body.pw_nonce,
|
||||
kpCreated: request.body.created,
|
||||
kpOrigination: request.body.origination,
|
||||
updatedWithUserAgent: <string>request.headers['user-agent'],
|
||||
protocolVersion: request.body.version,
|
||||
})
|
||||
|
||||
if (!changeCredentialsResult.success) {
|
||||
await this.increaseLoginAttempts.execute({ email: response.locals.user.email })
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: changeCredentialsResult.errorMessage,
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
await this.clearLoginAttempts.execute({ email: response.locals.user.email })
|
||||
|
||||
response.setHeader('x-invalidate-cache', response.locals.user.uuid)
|
||||
|
||||
return this.json(changeCredentialsResult.authResponse)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import { ControllerContainerInterface, Uuid } from '@standardnotes/domain-core'
|
||||
import { Request, Response } from 'express'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
|
||||
import { CreateValetToken } from '../../../Domain/UseCase/CreateValetToken/CreateValetToken'
|
||||
import { CreateValetTokenPayload, ErrorTag } from '@standardnotes/responses'
|
||||
import { ValetTokenOperation } from '@standardnotes/security'
|
||||
|
||||
export class HomeServerValetTokenController extends BaseHttpController {
|
||||
constructor(protected createValetKey: CreateValetToken, private controllerContainer?: ControllerContainerInterface) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.valet-tokens.create', this.create.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
public async create(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const payload: CreateValetTokenPayload = request.body
|
||||
|
||||
if (response.locals.readOnlyAccess && payload.operation !== 'read') {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
for (const resource of payload.resources) {
|
||||
const resourceUuidOrError = Uuid.create(resource.remoteIdentifier)
|
||||
if (resourceUuidOrError.isFailed()) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ParametersInvalid,
|
||||
message: 'Invalid remote resource identifier.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const createValetKeyResponse = await this.createValetKey.execute({
|
||||
userUuid: response.locals.user.uuid,
|
||||
operation: payload.operation as ValetTokenOperation,
|
||||
resources: payload.resources,
|
||||
})
|
||||
|
||||
if (!createValetKeyResponse.success) {
|
||||
return this.json(createValetKeyResponse, 403)
|
||||
}
|
||||
|
||||
return this.json(createValetKeyResponse)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { TokenDecoderInterface, WebSocketConnectionTokenData } from '@standardnotes/security'
|
||||
import { Request } from 'express'
|
||||
import { BaseHttpController, results } from 'inversify-express-utils'
|
||||
|
||||
import { CreateCrossServiceToken } from '../../../Domain/UseCase/CreateCrossServiceToken/CreateCrossServiceToken'
|
||||
import { ErrorTag } from '@standardnotes/responses'
|
||||
|
||||
export class HomeServerWebSocketsController extends BaseHttpController {
|
||||
constructor(
|
||||
protected createCrossServiceToken: CreateCrossServiceToken,
|
||||
protected tokenDecoder: TokenDecoderInterface<WebSocketConnectionTokenData>,
|
||||
private controllerContainer?: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
if (this.controllerContainer !== undefined) {
|
||||
this.controllerContainer.register('auth.webSockets.validateToken', this.validateToken.bind(this))
|
||||
}
|
||||
}
|
||||
|
||||
async validateToken(request: Request): Promise<results.JsonResult> {
|
||||
if (!request.headers.authorization) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.AuthInvalid,
|
||||
message: 'Invalid authorization token.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const token: WebSocketConnectionTokenData | undefined = this.tokenDecoder.decodeToken(request.headers.authorization)
|
||||
|
||||
if (token === undefined) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.AuthInvalid,
|
||||
message: 'Invalid authorization token.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.createCrossServiceToken.execute({
|
||||
userUuid: token.userUuid,
|
||||
})
|
||||
|
||||
return this.json({ authToken: result.token })
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import * as express from 'express'
|
||||
import { DeleteSetting } from '../../Domain/UseCase/DeleteSetting/DeleteSetting'
|
||||
import { CreateSubscriptionToken } from '../../Domain/UseCase/CreateSubscriptionToken/CreateSubscriptionToken'
|
||||
import { CreateOfflineSubscriptionToken } from '../../Domain/UseCase/CreateOfflineSubscriptionToken/CreateOfflineSubscriptionToken'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
|
||||
describe('InversifyExpressAdminController', () => {
|
||||
let deleteSetting: DeleteSetting
|
||||
@@ -17,7 +16,6 @@ describe('InversifyExpressAdminController', () => {
|
||||
let createOfflineSubscriptionToken: CreateOfflineSubscriptionToken
|
||||
let request: express.Request
|
||||
let user: User
|
||||
let controllerContainer: ControllerContainerInterface
|
||||
|
||||
const createController = () =>
|
||||
new InversifyExpressAdminController(
|
||||
@@ -25,7 +23,6 @@ describe('InversifyExpressAdminController', () => {
|
||||
userRepository,
|
||||
createSubscriptionToken,
|
||||
createOfflineSubscriptionToken,
|
||||
controllerContainer,
|
||||
)
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -58,9 +55,6 @@ describe('InversifyExpressAdminController', () => {
|
||||
body: {},
|
||||
params: {},
|
||||
} as jest.Mocked<express.Request>
|
||||
|
||||
controllerContainer = {} as jest.Mocked<ControllerContainerInterface>
|
||||
controllerContainer.register = jest.fn()
|
||||
})
|
||||
|
||||
it('should return error if missing email parameter', async () => {
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import { ControllerContainerInterface, Username } from '@standardnotes/domain-core'
|
||||
import { SettingName } from '@standardnotes/settings'
|
||||
import { Request } from 'express'
|
||||
import { inject } from 'inversify'
|
||||
import {
|
||||
BaseHttpController,
|
||||
controller,
|
||||
httpDelete,
|
||||
httpGet,
|
||||
@@ -12,124 +9,48 @@ import {
|
||||
results,
|
||||
} from 'inversify-express-utils'
|
||||
import TYPES from '../../Bootstrap/Types'
|
||||
import { HomeServerAdminController } from './HomeServer/HomeServerAdminController'
|
||||
import { CreateOfflineSubscriptionToken } from '../../Domain/UseCase/CreateOfflineSubscriptionToken/CreateOfflineSubscriptionToken'
|
||||
import { CreateSubscriptionToken } from '../../Domain/UseCase/CreateSubscriptionToken/CreateSubscriptionToken'
|
||||
import { DeleteSetting } from '../../Domain/UseCase/DeleteSetting/DeleteSetting'
|
||||
import { UserRepositoryInterface } from '../../Domain/User/UserRepositoryInterface'
|
||||
|
||||
@controller('/admin')
|
||||
export class InversifyExpressAdminController extends BaseHttpController {
|
||||
export class InversifyExpressAdminController extends HomeServerAdminController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_DeleteSetting) private doDeleteSetting: DeleteSetting,
|
||||
@inject(TYPES.Auth_UserRepository) private userRepository: UserRepositoryInterface,
|
||||
@inject(TYPES.Auth_CreateSubscriptionToken) private createSubscriptionToken: CreateSubscriptionToken,
|
||||
@inject(TYPES.Auth_DeleteSetting) override doDeleteSetting: DeleteSetting,
|
||||
@inject(TYPES.Auth_UserRepository) override userRepository: UserRepositoryInterface,
|
||||
@inject(TYPES.Auth_CreateSubscriptionToken) override createSubscriptionToken: CreateSubscriptionToken,
|
||||
@inject(TYPES.Auth_CreateOfflineSubscriptionToken)
|
||||
private createOfflineSubscriptionToken: CreateOfflineSubscriptionToken,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
override createOfflineSubscriptionToken: CreateOfflineSubscriptionToken,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('admin.getUser', this.getUser.bind(this))
|
||||
this.controllerContainer.register('admin.deleteMFASetting', this.deleteMFASetting.bind(this))
|
||||
this.controllerContainer.register('admin.createToken', this.createToken.bind(this))
|
||||
this.controllerContainer.register('admin.createOfflineToken', this.createOfflineToken.bind(this))
|
||||
this.controllerContainer.register('admin.disableEmailBackups', this.disableEmailBackups.bind(this))
|
||||
super(doDeleteSetting, userRepository, createSubscriptionToken, createOfflineSubscriptionToken)
|
||||
}
|
||||
|
||||
@httpGet('/user/:email')
|
||||
async getUser(request: Request): Promise<results.JsonResult> {
|
||||
const usernameOrError = Username.create(request.params.email ?? '')
|
||||
if (usernameOrError.isFailed()) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Missing email parameter.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
const username = usernameOrError.getValue()
|
||||
|
||||
const user = await this.userRepository.findOneByUsernameOrEmail(username)
|
||||
|
||||
if (!user) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: `No user with email '${username.value}'.`,
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
return this.json({
|
||||
uuid: user.uuid,
|
||||
})
|
||||
override async getUser(request: Request): Promise<results.JsonResult> {
|
||||
return super.getUser(request)
|
||||
}
|
||||
|
||||
@httpDelete('/users/:userUuid/mfa')
|
||||
async deleteMFASetting(request: Request): Promise<results.JsonResult> {
|
||||
const { userUuid } = request.params
|
||||
const { uuid, updatedAt } = request.body
|
||||
|
||||
const result = await this.doDeleteSetting.execute({
|
||||
uuid,
|
||||
userUuid,
|
||||
settingName: SettingName.NAMES.MfaSecret,
|
||||
timestamp: updatedAt,
|
||||
softDelete: true,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
override async deleteMFASetting(request: Request): Promise<results.JsonResult> {
|
||||
return super.deleteMFASetting(request)
|
||||
}
|
||||
|
||||
@httpPost('/users/:userUuid/subscription-token')
|
||||
async createToken(request: Request): Promise<results.JsonResult> {
|
||||
const { userUuid } = request.params
|
||||
const result = await this.createSubscriptionToken.execute({
|
||||
userUuid,
|
||||
})
|
||||
|
||||
return this.json({
|
||||
token: result.subscriptionToken.token,
|
||||
})
|
||||
override async createToken(request: Request): Promise<results.JsonResult> {
|
||||
return super.createToken(request)
|
||||
}
|
||||
|
||||
@httpPost('/users/:email/offline-subscription-token')
|
||||
async createOfflineToken(request: Request): Promise<results.JsonResult | results.BadRequestResult> {
|
||||
const { email } = request.params
|
||||
const result = await this.createOfflineSubscriptionToken.execute({
|
||||
userEmail: email,
|
||||
})
|
||||
|
||||
if (!result.success) {
|
||||
return this.badRequest()
|
||||
}
|
||||
|
||||
return this.json({
|
||||
token: result.offlineSubscriptionToken.token,
|
||||
})
|
||||
override async createOfflineToken(request: Request): Promise<results.JsonResult | results.BadRequestResult> {
|
||||
return super.createOfflineToken(request)
|
||||
}
|
||||
|
||||
@httpPost('/users/:userUuid/email-backups')
|
||||
async disableEmailBackups(request: Request): Promise<results.BadRequestErrorMessageResult | results.OkResult> {
|
||||
const { userUuid } = request.params
|
||||
|
||||
const result = await this.doDeleteSetting.execute({
|
||||
userUuid,
|
||||
settingName: SettingName.NAMES.EmailBackupFrequency,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.ok()
|
||||
}
|
||||
|
||||
return this.badRequest('No email backups found')
|
||||
override async disableEmailBackups(
|
||||
request: Request,
|
||||
): Promise<results.BadRequestErrorMessageResult | results.OkResult> {
|
||||
return super.disableEmailBackups(request)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Request, Response } from 'express'
|
||||
import {
|
||||
BaseHttpController,
|
||||
controller,
|
||||
httpGet,
|
||||
httpPost,
|
||||
@@ -16,301 +15,65 @@ import { IncreaseLoginAttempts } from '../../Domain/UseCase/IncreaseLoginAttempt
|
||||
import { Logger } from 'winston'
|
||||
import { GetUserKeyParams } from '../../Domain/UseCase/GetUserKeyParams/GetUserKeyParams'
|
||||
import { AuthController } from '../../Controller/AuthController'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { inject } from 'inversify'
|
||||
import { HomeServerAuthController } from './HomeServer/HomeServerAuthController'
|
||||
|
||||
@controller('/auth')
|
||||
export class InversifyExpressAuthController extends BaseHttpController {
|
||||
export class InversifyExpressAuthController extends HomeServerAuthController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_VerifyMFA) private verifyMFA: VerifyMFA,
|
||||
@inject(TYPES.Auth_SignIn) private signInUseCase: SignIn,
|
||||
@inject(TYPES.Auth_GetUserKeyParams) private getUserKeyParams: GetUserKeyParams,
|
||||
@inject(TYPES.Auth_ClearLoginAttempts) private clearLoginAttempts: ClearLoginAttempts,
|
||||
@inject(TYPES.Auth_IncreaseLoginAttempts) private increaseLoginAttempts: IncreaseLoginAttempts,
|
||||
@inject(TYPES.Auth_Logger) private logger: Logger,
|
||||
@inject(TYPES.Auth_AuthController) private authController: AuthController,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
@inject(TYPES.Auth_VerifyMFA) override verifyMFA: VerifyMFA,
|
||||
@inject(TYPES.Auth_SignIn) override signInUseCase: SignIn,
|
||||
@inject(TYPES.Auth_GetUserKeyParams) override getUserKeyParams: GetUserKeyParams,
|
||||
@inject(TYPES.Auth_ClearLoginAttempts) override clearLoginAttempts: ClearLoginAttempts,
|
||||
@inject(TYPES.Auth_IncreaseLoginAttempts) override increaseLoginAttempts: IncreaseLoginAttempts,
|
||||
@inject(TYPES.Auth_Logger) override logger: Logger,
|
||||
@inject(TYPES.Auth_AuthController) override authController: AuthController,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.params', this.params.bind(this))
|
||||
this.controllerContainer.register('auth.signIn', this.signIn.bind(this))
|
||||
this.controllerContainer.register('auth.pkceParams', this.pkceParams.bind(this))
|
||||
this.controllerContainer.register('auth.pkceSignIn', this.pkceSignIn.bind(this))
|
||||
this.controllerContainer.register('auth.users.register', this.register.bind(this))
|
||||
this.controllerContainer.register('auth.generateRecoveryCodes', this.generateRecoveryCodes.bind(this))
|
||||
this.controllerContainer.register('auth.signInWithRecoveryCodes', this.recoveryLogin.bind(this))
|
||||
this.controllerContainer.register('auth.recoveryKeyParams', this.recoveryParams.bind(this))
|
||||
this.controllerContainer.register('auth.signOut', this.signOut.bind(this))
|
||||
super(verifyMFA, signInUseCase, getUserKeyParams, clearLoginAttempts, increaseLoginAttempts, logger, authController)
|
||||
}
|
||||
|
||||
@httpGet('/params', TYPES.Auth_OptionalCrossServiceTokenMiddleware)
|
||||
async params(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (response.locals.session) {
|
||||
const result = await this.getUserKeyParams.execute({
|
||||
email: response.locals.user.email,
|
||||
authenticated: true,
|
||||
})
|
||||
|
||||
return this.json(result.keyParams)
|
||||
}
|
||||
|
||||
if (!request.query.email) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Please provide an email address.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
const verifyMFAResponse = await this.verifyMFA.execute({
|
||||
email: <string>request.query.email,
|
||||
requestParams: request.query,
|
||||
preventOTPFromFurtherUsage: false,
|
||||
})
|
||||
|
||||
if (!verifyMFAResponse.success) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: verifyMFAResponse.errorTag,
|
||||
message: verifyMFAResponse.errorMessage,
|
||||
payload: verifyMFAResponse.errorPayload,
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.getUserKeyParams.execute({
|
||||
email: <string>request.query.email,
|
||||
authenticated: false,
|
||||
})
|
||||
|
||||
return this.json(result.keyParams)
|
||||
override async params(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.params(request, response)
|
||||
}
|
||||
|
||||
@httpPost('/sign_in', TYPES.Auth_LockMiddleware)
|
||||
async signIn(request: Request): Promise<results.JsonResult> {
|
||||
if (!request.body.email || !request.body.password) {
|
||||
this.logger.debug('/auth/sign_in request missing credentials: %O', request.body)
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: 'invalid-auth',
|
||||
message: 'Invalid login credentials.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const verifyMFAResponse = await this.verifyMFA.execute({
|
||||
email: request.body.email,
|
||||
requestParams: request.body,
|
||||
preventOTPFromFurtherUsage: true,
|
||||
})
|
||||
|
||||
if (!verifyMFAResponse.success) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: verifyMFAResponse.errorTag,
|
||||
message: verifyMFAResponse.errorMessage,
|
||||
payload: verifyMFAResponse.errorPayload,
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const signInResult = await this.signInUseCase.execute({
|
||||
apiVersion: request.body.api,
|
||||
userAgent: <string>request.headers['user-agent'],
|
||||
email: request.body.email,
|
||||
password: request.body.password,
|
||||
ephemeralSession: request.body.ephemeral ?? false,
|
||||
})
|
||||
|
||||
if (!signInResult.success) {
|
||||
await this.increaseLoginAttempts.execute({ email: request.body.email })
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: signInResult.errorMessage,
|
||||
},
|
||||
},
|
||||
signInResult.errorCode ?? 401,
|
||||
)
|
||||
}
|
||||
|
||||
await this.clearLoginAttempts.execute({ email: request.body.email })
|
||||
|
||||
return this.json(signInResult.authResponse)
|
||||
override async signIn(request: Request): Promise<results.JsonResult> {
|
||||
return super.signIn(request)
|
||||
}
|
||||
|
||||
@httpPost('/pkce_params', TYPES.Auth_OptionalCrossServiceTokenMiddleware)
|
||||
async pkceParams(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (!request.body.code_challenge) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Please provide the code challenge parameter.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
if (response.locals.session) {
|
||||
const result = await this.getUserKeyParams.execute({
|
||||
email: response.locals.user.email,
|
||||
authenticated: true,
|
||||
codeChallenge: request.body.code_challenge as string,
|
||||
})
|
||||
|
||||
return this.json(result.keyParams)
|
||||
}
|
||||
|
||||
if (!request.body.email) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Please provide an email address.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
const verifyMFAResponse = await this.verifyMFA.execute({
|
||||
email: <string>request.body.email,
|
||||
requestParams: request.body,
|
||||
preventOTPFromFurtherUsage: true,
|
||||
})
|
||||
|
||||
if (!verifyMFAResponse.success) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: verifyMFAResponse.errorTag,
|
||||
message: verifyMFAResponse.errorMessage,
|
||||
payload: verifyMFAResponse.errorPayload,
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.getUserKeyParams.execute({
|
||||
email: <string>request.body.email,
|
||||
authenticated: false,
|
||||
codeChallenge: request.body.code_challenge as string,
|
||||
})
|
||||
|
||||
return this.json(result.keyParams)
|
||||
override async pkceParams(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.pkceParams(request, response)
|
||||
}
|
||||
|
||||
@httpPost('/pkce_sign_in', TYPES.Auth_LockMiddleware)
|
||||
async pkceSignIn(request: Request): Promise<results.JsonResult> {
|
||||
if (!request.body.email || !request.body.password || !request.body.code_verifier) {
|
||||
this.logger.debug('/auth/sign_in request missing credentials: %O', request.body)
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: 'invalid-auth',
|
||||
message: 'Invalid login credentials.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const signInResult = await this.signInUseCase.execute({
|
||||
apiVersion: request.body.api,
|
||||
userAgent: <string>request.headers['user-agent'],
|
||||
email: request.body.email,
|
||||
password: request.body.password,
|
||||
ephemeralSession: request.body.ephemeral ?? false,
|
||||
codeVerifier: request.body.code_verifier,
|
||||
})
|
||||
|
||||
if (!signInResult.success) {
|
||||
await this.increaseLoginAttempts.execute({ email: request.body.email })
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: signInResult.errorMessage,
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
await this.clearLoginAttempts.execute({ email: request.body.email })
|
||||
|
||||
return this.json(signInResult.authResponse)
|
||||
override async pkceSignIn(request: Request): Promise<results.JsonResult> {
|
||||
return super.pkceSignIn(request)
|
||||
}
|
||||
|
||||
@httpPost('/recovery/codes', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async generateRecoveryCodes(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.authController.generateRecoveryCodes({
|
||||
userUuid: response.locals.user.uuid,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
override async generateRecoveryCodes(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.generateRecoveryCodes(_request, response)
|
||||
}
|
||||
|
||||
@httpPost('/recovery/login', TYPES.Auth_LockMiddleware)
|
||||
async recoveryLogin(request: Request): Promise<results.JsonResult> {
|
||||
const result = await this.authController.signInWithRecoveryCodes({
|
||||
apiVersion: request.body.api_version,
|
||||
userAgent: <string>request.headers['user-agent'],
|
||||
codeVerifier: request.body.code_verifier,
|
||||
username: request.body.username,
|
||||
recoveryCodes: request.body.recovery_codes,
|
||||
password: request.body.password,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
override async recoveryLogin(request: Request): Promise<results.JsonResult> {
|
||||
return super.recoveryLogin(request)
|
||||
}
|
||||
|
||||
@httpPost('/recovery/params')
|
||||
async recoveryParams(request: Request): Promise<results.JsonResult> {
|
||||
const result = await this.authController.recoveryKeyParams({
|
||||
apiVersion: request.body.api_version,
|
||||
username: request.body.username,
|
||||
codeChallenge: request.body.code_challenge,
|
||||
recoveryCodes: request.body.recovery_codes,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
override async recoveryParams(request: Request): Promise<results.JsonResult> {
|
||||
return super.recoveryParams(request)
|
||||
}
|
||||
|
||||
@httpPost('/sign_out', TYPES.Auth_OptionalCrossServiceTokenMiddleware)
|
||||
async signOut(request: Request, response: Response): Promise<results.JsonResult | void> {
|
||||
const result = await this.authController.signOut({
|
||||
readOnlyAccess: response.locals.readOnlyAccess,
|
||||
authorizationHeader: <string>request.headers.authorization,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
override async signOut(request: Request, response: Response): Promise<results.JsonResult | void> {
|
||||
return super.signOut(request, response)
|
||||
}
|
||||
|
||||
@httpPost('/')
|
||||
async register(request: Request): Promise<results.JsonResult> {
|
||||
const response = await this.authController.register({
|
||||
...request.body,
|
||||
userAgent: <string>request.headers['user-agent'],
|
||||
})
|
||||
|
||||
return this.json(response.data, response.status)
|
||||
override async register(request: Request): Promise<results.JsonResult> {
|
||||
return super.register(request)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Request, Response } from 'express'
|
||||
import {
|
||||
BaseHttpController,
|
||||
controller,
|
||||
httpDelete,
|
||||
httpGet,
|
||||
@@ -10,78 +9,39 @@ import {
|
||||
} from 'inversify-express-utils'
|
||||
import TYPES from '../../Bootstrap/Types'
|
||||
import { AuthenticatorsController } from '../../Controller/AuthenticatorsController'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { inject } from 'inversify'
|
||||
import { HomeServerAuthenticatorsController } from './HomeServer/HomeServerAuthenticatorsController'
|
||||
|
||||
@controller('/authenticators')
|
||||
export class InversifyExpressAuthenticatorsController extends BaseHttpController {
|
||||
export class InversifyExpressAuthenticatorsController extends HomeServerAuthenticatorsController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_AuthenticatorsController) private authenticatorsController: AuthenticatorsController,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
@inject(TYPES.Auth_AuthenticatorsController) override authenticatorsController: AuthenticatorsController,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.authenticators.list', this.list.bind(this))
|
||||
this.controllerContainer.register('auth.authenticators.delete', this.delete.bind(this))
|
||||
this.controllerContainer.register(
|
||||
'auth.authenticators.generateRegistrationOptions',
|
||||
this.generateRegistrationOptions.bind(this),
|
||||
)
|
||||
this.controllerContainer.register(
|
||||
'auth.authenticators.verifyRegistrationResponse',
|
||||
this.verifyRegistration.bind(this),
|
||||
)
|
||||
this.controllerContainer.register(
|
||||
'auth.authenticators.generateAuthenticationOptions',
|
||||
this.generateAuthenticationOptions.bind(this),
|
||||
)
|
||||
super(authenticatorsController)
|
||||
}
|
||||
|
||||
@httpGet('/', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async list(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.authenticatorsController.list({
|
||||
userUuid: response.locals.user.uuid,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
override async list(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.list(_request, response)
|
||||
}
|
||||
|
||||
@httpDelete('/:authenticatorId', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async delete(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.authenticatorsController.delete({
|
||||
userUuid: response.locals.user.uuid,
|
||||
authenticatorId: request.params.authenticatorId,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
override async delete(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.delete(request, response)
|
||||
}
|
||||
|
||||
@httpGet('/generate-registration-options', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async generateRegistrationOptions(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.authenticatorsController.generateRegistrationOptions({
|
||||
username: response.locals.user.email,
|
||||
userUuid: response.locals.user.uuid,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
override async generateRegistrationOptions(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.generateRegistrationOptions(_request, response)
|
||||
}
|
||||
|
||||
@httpPost('/verify-registration', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async verifyRegistration(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.authenticatorsController.verifyRegistrationResponse({
|
||||
userUuid: response.locals.user.uuid,
|
||||
attestationResponse: request.body.attestationResponse,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
override async verifyRegistration(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.verifyRegistration(request, response)
|
||||
}
|
||||
|
||||
@httpPost('/generate-authentication-options')
|
||||
async generateAuthenticationOptions(request: Request): Promise<results.JsonResult> {
|
||||
const result = await this.authenticatorsController.generateAuthenticationOptions({
|
||||
username: request.body.username,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
override async generateAuthenticationOptions(request: Request): Promise<results.JsonResult> {
|
||||
return super.generateAuthenticationOptions(request)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import { InversifyExpressFeaturesController } from './InversifyExpressFeaturesCo
|
||||
import { results } from 'inversify-express-utils'
|
||||
import { User } from '../../Domain/User/User'
|
||||
import { GetUserFeatures } from '../../Domain/UseCase/GetUserFeatures/GetUserFeatures'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
|
||||
describe('InversifyExpressFeaturesController', () => {
|
||||
let getUserFeatures: GetUserFeatures
|
||||
@@ -14,14 +13,10 @@ describe('InversifyExpressFeaturesController', () => {
|
||||
let request: express.Request
|
||||
let response: express.Response
|
||||
let user: User
|
||||
let controllerContainer: ControllerContainerInterface
|
||||
|
||||
const createController = () => new InversifyExpressFeaturesController(getUserFeatures, controllerContainer)
|
||||
const createController = () => new InversifyExpressFeaturesController(getUserFeatures)
|
||||
|
||||
beforeEach(() => {
|
||||
controllerContainer = {} as jest.Mocked<ControllerContainerInterface>
|
||||
controllerContainer.register = jest.fn()
|
||||
|
||||
user = {} as jest.Mocked<User>
|
||||
user.uuid = '123'
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Request, Response } from 'express'
|
||||
import { inject } from 'inversify'
|
||||
import {
|
||||
BaseHttpController,
|
||||
controller,
|
||||
httpGet,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
@@ -9,41 +8,16 @@ import {
|
||||
} from 'inversify-express-utils'
|
||||
import TYPES from '../../Bootstrap/Types'
|
||||
import { GetUserFeatures } from '../../Domain/UseCase/GetUserFeatures/GetUserFeatures'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { HomeServerFeaturesController } from './HomeServer/HomeServerFeaturesController'
|
||||
|
||||
@controller('/users/:userUuid/features')
|
||||
export class InversifyExpressFeaturesController extends BaseHttpController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_GetUserFeatures) private doGetUserFeatures: GetUserFeatures,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.users.getFeatures', this.getFeatures.bind(this))
|
||||
export class InversifyExpressFeaturesController extends HomeServerFeaturesController {
|
||||
constructor(@inject(TYPES.Auth_GetUserFeatures) override doGetUserFeatures: GetUserFeatures) {
|
||||
super(doGetUserFeatures)
|
||||
}
|
||||
|
||||
@httpGet('/', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async getFeatures(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (request.params.userUuid !== response.locals.user.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Operation not allowed.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.doGetUserFeatures.execute({
|
||||
userUuid: request.params.userUuid,
|
||||
offline: false,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
override async getFeatures(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.getFeatures(request, response)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import { results } from 'inversify-express-utils'
|
||||
import { InversifyExpressListedController } from './InversifyExpressListedController'
|
||||
import { User } from '../../Domain/User/User'
|
||||
import { CreateListedAccount } from '../../Domain/UseCase/CreateListedAccount/CreateListedAccount'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
|
||||
describe('InversifyExpressListedController', () => {
|
||||
let createListedAccount: CreateListedAccount
|
||||
@@ -14,14 +13,10 @@ describe('InversifyExpressListedController', () => {
|
||||
let request: express.Request
|
||||
let response: express.Response
|
||||
let user: User
|
||||
let controllerContainer: ControllerContainerInterface
|
||||
|
||||
const createController = () => new InversifyExpressListedController(createListedAccount, controllerContainer)
|
||||
const createController = () => new InversifyExpressListedController(createListedAccount)
|
||||
|
||||
beforeEach(() => {
|
||||
controllerContainer = {} as jest.Mocked<ControllerContainerInterface>
|
||||
controllerContainer.register = jest.fn()
|
||||
|
||||
user = {} as jest.Mocked<User>
|
||||
user.uuid = '123'
|
||||
|
||||
|
||||
@@ -1,44 +1,19 @@
|
||||
import { inject } from 'inversify'
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
import { BaseHttpController, controller, httpPost, results } from 'inversify-express-utils'
|
||||
import { controller, httpPost, results } from 'inversify-express-utils'
|
||||
import { Request, Response } from 'express'
|
||||
import TYPES from '../../Bootstrap/Types'
|
||||
import { CreateListedAccount } from '../../Domain/UseCase/CreateListedAccount/CreateListedAccount'
|
||||
import { ErrorTag } from '@standardnotes/responses'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { HomeServerListedController } from './HomeServer/HomeServerListedController'
|
||||
|
||||
@controller('/listed')
|
||||
export class InversifyExpressListedController extends BaseHttpController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_CreateListedAccount) private doCreateListedAccount: CreateListedAccount,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.users.createListedAccount', this.createListedAccount.bind(this))
|
||||
export class InversifyExpressListedController extends HomeServerListedController {
|
||||
constructor(@inject(TYPES.Auth_CreateListedAccount) override doCreateListedAccount: CreateListedAccount) {
|
||||
super(doCreateListedAccount)
|
||||
}
|
||||
|
||||
@httpPost('/', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async createListedAccount(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
await this.doCreateListedAccount.execute({
|
||||
userUuid: response.locals.user.uuid,
|
||||
userEmail: response.locals.user.email,
|
||||
})
|
||||
|
||||
return this.json({
|
||||
message: 'Listed account creation requested successfully.',
|
||||
})
|
||||
override async createListedAccount(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.createListedAccount(_request, response)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import { GetUserOfflineSubscription } from '../../Domain/UseCase/GetUserOfflineS
|
||||
import { OfflineUserTokenData, TokenEncoderInterface } from '@standardnotes/security'
|
||||
import { SubscriptionName } from '@standardnotes/common'
|
||||
import { Logger } from 'winston'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
|
||||
describe('InversifyExpressOfflineController', () => {
|
||||
let getUserFeatures: GetUserFeatures
|
||||
@@ -29,8 +28,6 @@ describe('InversifyExpressOfflineController', () => {
|
||||
let response: express.Response
|
||||
let user: User
|
||||
|
||||
let controllerContainer: ControllerContainerInterface
|
||||
|
||||
const createController = () =>
|
||||
new InversifyExpressOfflineController(
|
||||
getUserFeatures,
|
||||
@@ -40,13 +37,9 @@ describe('InversifyExpressOfflineController', () => {
|
||||
tokenEncoder,
|
||||
jwtTTL,
|
||||
logger,
|
||||
controllerContainer,
|
||||
)
|
||||
|
||||
beforeEach(() => {
|
||||
controllerContainer = {} as jest.Mocked<ControllerContainerInterface>
|
||||
controllerContainer.register = jest.fn()
|
||||
|
||||
user = {} as jest.Mocked<User>
|
||||
user.uuid = '123'
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Request, Response } from 'express'
|
||||
import { inject } from 'inversify'
|
||||
import {
|
||||
BaseHttpController,
|
||||
controller,
|
||||
httpGet,
|
||||
httpPost,
|
||||
@@ -10,132 +9,54 @@ import {
|
||||
} from 'inversify-express-utils'
|
||||
import { Logger } from 'winston'
|
||||
import { OfflineUserTokenData, TokenEncoderInterface } from '@standardnotes/security'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import TYPES from '../../Bootstrap/Types'
|
||||
import { AuthenticateOfflineSubscriptionToken } from '../../Domain/UseCase/AuthenticateOfflineSubscriptionToken/AuthenticateOfflineSubscriptionToken'
|
||||
import { CreateOfflineSubscriptionToken } from '../../Domain/UseCase/CreateOfflineSubscriptionToken/CreateOfflineSubscriptionToken'
|
||||
import { GetUserFeatures } from '../../Domain/UseCase/GetUserFeatures/GetUserFeatures'
|
||||
import { GetUserOfflineSubscription } from '../../Domain/UseCase/GetUserOfflineSubscription/GetUserOfflineSubscription'
|
||||
import { HomeServerOfflineController } from './HomeServer/HomeServerOfflineController'
|
||||
|
||||
@controller('/offline')
|
||||
export class InversifyExpressOfflineController extends BaseHttpController {
|
||||
export class InversifyExpressOfflineController extends HomeServerOfflineController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_GetUserFeatures) private doGetUserFeatures: GetUserFeatures,
|
||||
@inject(TYPES.Auth_GetUserOfflineSubscription) private getUserOfflineSubscription: GetUserOfflineSubscription,
|
||||
@inject(TYPES.Auth_GetUserFeatures) override doGetUserFeatures: GetUserFeatures,
|
||||
@inject(TYPES.Auth_GetUserOfflineSubscription) override getUserOfflineSubscription: GetUserOfflineSubscription,
|
||||
@inject(TYPES.Auth_CreateOfflineSubscriptionToken)
|
||||
private createOfflineSubscriptionToken: CreateOfflineSubscriptionToken,
|
||||
override createOfflineSubscriptionToken: CreateOfflineSubscriptionToken,
|
||||
@inject(TYPES.Auth_AuthenticateOfflineSubscriptionToken)
|
||||
private authenticateToken: AuthenticateOfflineSubscriptionToken,
|
||||
@inject(TYPES.Auth_OfflineUserTokenEncoder) private tokenEncoder: TokenEncoderInterface<OfflineUserTokenData>,
|
||||
@inject(TYPES.Auth_AUTH_JWT_TTL) private jwtTTL: number,
|
||||
@inject(TYPES.Auth_Logger) private logger: Logger,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
override authenticateToken: AuthenticateOfflineSubscriptionToken,
|
||||
@inject(TYPES.Auth_OfflineUserTokenEncoder) override tokenEncoder: TokenEncoderInterface<OfflineUserTokenData>,
|
||||
@inject(TYPES.Auth_AUTH_JWT_TTL) override jwtTTL: number,
|
||||
@inject(TYPES.Auth_Logger) override logger: Logger,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.offline.features', this.getOfflineFeatures.bind(this))
|
||||
this.controllerContainer.register('auth.offline.subscriptionTokens.create', this.createToken.bind(this))
|
||||
this.controllerContainer.register('auth.users.getOfflineSubscriptionByToken', this.getSubscription.bind(this))
|
||||
super(
|
||||
doGetUserFeatures,
|
||||
getUserOfflineSubscription,
|
||||
createOfflineSubscriptionToken,
|
||||
authenticateToken,
|
||||
tokenEncoder,
|
||||
jwtTTL,
|
||||
logger,
|
||||
)
|
||||
}
|
||||
|
||||
@httpGet('/features', TYPES.Auth_OfflineUserAuthMiddleware)
|
||||
async getOfflineFeatures(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.doGetUserFeatures.execute({
|
||||
email: response.locals.offlineUserEmail,
|
||||
offline: true,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
override async getOfflineFeatures(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.getOfflineFeatures(_request, response)
|
||||
}
|
||||
|
||||
@httpPost('/subscription-tokens')
|
||||
async createToken(request: Request): Promise<results.JsonResult> {
|
||||
if (!request.body.email) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: 'invalid-request',
|
||||
message: 'Invalid request parameters.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
const response = await this.createOfflineSubscriptionToken.execute({
|
||||
userEmail: request.body.email,
|
||||
})
|
||||
|
||||
if (!response.success) {
|
||||
return this.json({ success: false, error: { tag: response.error } })
|
||||
}
|
||||
|
||||
return this.json({ success: true })
|
||||
override async createToken(request: Request): Promise<results.JsonResult> {
|
||||
return super.createToken(request)
|
||||
}
|
||||
|
||||
@httpPost('/subscription-tokens/:token/validate')
|
||||
async validate(request: Request): Promise<results.JsonResult> {
|
||||
if (!request.body.email) {
|
||||
this.logger.debug('[Offline Subscription Token Validation] Missing email')
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: 'invalid-request',
|
||||
message: 'Invalid request parameters.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
const authenticateTokenResponse = await this.authenticateToken.execute({
|
||||
token: request.params.token,
|
||||
userEmail: request.body.email,
|
||||
})
|
||||
|
||||
if (!authenticateTokenResponse.success) {
|
||||
this.logger.debug('[Offline Subscription Token Validation] invalid token')
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: 'invalid-auth',
|
||||
message: 'Invalid login credentials.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const offlineAuthTokenData: OfflineUserTokenData = {
|
||||
userEmail: authenticateTokenResponse.email,
|
||||
featuresToken: authenticateTokenResponse.featuresToken,
|
||||
}
|
||||
|
||||
const authToken = this.tokenEncoder.encodeExpirableToken(offlineAuthTokenData, this.jwtTTL)
|
||||
|
||||
this.logger.debug(
|
||||
`[Offline Subscription Token Validation] authenticated token for user ${authenticateTokenResponse.email}`,
|
||||
)
|
||||
|
||||
return this.json({ authToken })
|
||||
override async validate(request: Request): Promise<results.JsonResult> {
|
||||
return super.validate(request)
|
||||
}
|
||||
|
||||
@httpGet('/users/subscription', TYPES.Auth_ApiGatewayOfflineAuthMiddleware)
|
||||
async getSubscription(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.getUserOfflineSubscription.execute({
|
||||
userEmail: response.locals.userEmail,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
override async getSubscription(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.getSubscription(_request, response)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import * as express from 'express'
|
||||
|
||||
import { InversifyExpressSessionController } from './InversifyExpressSessionController'
|
||||
import { results } from 'inversify-express-utils'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { DeletePreviousSessionsForUser } from '../../Domain/UseCase/DeletePreviousSessionsForUser'
|
||||
import { DeleteSessionForUser } from '../../Domain/UseCase/DeleteSessionForUser'
|
||||
import { RefreshSessionToken } from '../../Domain/UseCase/RefreshSessionToken'
|
||||
@@ -15,20 +14,11 @@ describe('InversifyExpressSessionController', () => {
|
||||
let refreshSessionToken: RefreshSessionToken
|
||||
let request: express.Request
|
||||
let response: express.Response
|
||||
let controllerContainer: ControllerContainerInterface
|
||||
|
||||
const createController = () =>
|
||||
new InversifyExpressSessionController(
|
||||
deleteSessionForUser,
|
||||
deletePreviousSessionsForUser,
|
||||
refreshSessionToken,
|
||||
controllerContainer,
|
||||
)
|
||||
new InversifyExpressSessionController(deleteSessionForUser, deletePreviousSessionsForUser, refreshSessionToken)
|
||||
|
||||
beforeEach(() => {
|
||||
controllerContainer = {} as jest.Mocked<ControllerContainerInterface>
|
||||
controllerContainer.register = jest.fn()
|
||||
|
||||
deleteSessionForUser = {} as jest.Mocked<DeleteSessionForUser>
|
||||
deleteSessionForUser.execute = jest.fn().mockReturnValue({ success: true })
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { ErrorTag } from '@standardnotes/responses'
|
||||
import { Request, Response } from 'express'
|
||||
import { inject } from 'inversify'
|
||||
import {
|
||||
BaseHttpController,
|
||||
controller,
|
||||
httpDelete,
|
||||
httpPost,
|
||||
@@ -13,152 +11,37 @@ import TYPES from '../../Bootstrap/Types'
|
||||
import { DeletePreviousSessionsForUser } from '../../Domain/UseCase/DeletePreviousSessionsForUser'
|
||||
import { DeleteSessionForUser } from '../../Domain/UseCase/DeleteSessionForUser'
|
||||
import { RefreshSessionToken } from '../../Domain/UseCase/RefreshSessionToken'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { HomeServerSessionController } from './HomeServer/HomeServerSessionController'
|
||||
|
||||
@controller('/session')
|
||||
export class InversifyExpressSessionController extends BaseHttpController {
|
||||
export class InversifyExpressSessionController extends HomeServerSessionController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_DeleteSessionForUser) private deleteSessionForUser: DeleteSessionForUser,
|
||||
@inject(TYPES.Auth_DeleteSessionForUser) override deleteSessionForUser: DeleteSessionForUser,
|
||||
@inject(TYPES.Auth_DeletePreviousSessionsForUser)
|
||||
private deletePreviousSessionsForUser: DeletePreviousSessionsForUser,
|
||||
@inject(TYPES.Auth_RefreshSessionToken) private refreshSessionToken: RefreshSessionToken,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
override deletePreviousSessionsForUser: DeletePreviousSessionsForUser,
|
||||
@inject(TYPES.Auth_RefreshSessionToken) override refreshSessionToken: RefreshSessionToken,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.sessions.delete', this.deleteSession.bind(this))
|
||||
this.controllerContainer.register('auth.sessions.deleteAll', this.deleteAllSessions.bind(this))
|
||||
this.controllerContainer.register('auth.sessions.refresh', this.refresh.bind(this))
|
||||
super(deleteSessionForUser, deletePreviousSessionsForUser, refreshSessionToken)
|
||||
}
|
||||
|
||||
@httpDelete('/', TYPES.Auth_RequiredCrossServiceTokenMiddleware, TYPES.Auth_SessionMiddleware)
|
||||
async deleteSession(request: Request, response: Response): Promise<results.JsonResult | results.StatusCodeResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
if (!request.body.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Please provide the session identifier.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
if (request.body.uuid === response.locals.session.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'You can not delete your current session.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
const useCaseResponse = await this.deleteSessionForUser.execute({
|
||||
userUuid: response.locals.user.uuid,
|
||||
sessionUuid: request.body.uuid,
|
||||
})
|
||||
|
||||
if (!useCaseResponse.success) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: useCaseResponse.errorMessage,
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
response.setHeader('x-invalidate-cache', response.locals.user.uuid)
|
||||
|
||||
return this.statusCode(204)
|
||||
override async deleteSession(
|
||||
request: Request,
|
||||
response: Response,
|
||||
): Promise<results.JsonResult | results.StatusCodeResult> {
|
||||
return super.deleteSession(request, response)
|
||||
}
|
||||
|
||||
@httpDelete('/all', TYPES.Auth_RequiredCrossServiceTokenMiddleware, TYPES.Auth_SessionMiddleware)
|
||||
async deleteAllSessions(
|
||||
override async deleteAllSessions(
|
||||
_request: Request,
|
||||
response: Response,
|
||||
): Promise<results.JsonResult | results.StatusCodeResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
if (!response.locals.user) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'No session exists with the provided identifier.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
await this.deletePreviousSessionsForUser.execute({
|
||||
userUuid: response.locals.user.uuid,
|
||||
currentSessionUuid: response.locals.session.uuid,
|
||||
})
|
||||
|
||||
response.setHeader('x-invalidate-cache', response.locals.user.uuid)
|
||||
|
||||
return this.statusCode(204)
|
||||
return super.deleteAllSessions(_request, response)
|
||||
}
|
||||
|
||||
@httpPost('/refresh')
|
||||
async refresh(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (!request.body.access_token || !request.body.refresh_token) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Please provide all required parameters.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.refreshSessionToken.execute({
|
||||
accessToken: request.body.access_token,
|
||||
refreshToken: request.body.refresh_token,
|
||||
})
|
||||
|
||||
if (!result.success) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: result.errorTag,
|
||||
message: result.errorMessage,
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
response.setHeader('x-invalidate-cache', result.userUuid as string)
|
||||
return this.json({
|
||||
session: result.sessionPayload,
|
||||
})
|
||||
override async refresh(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.refresh(request, response)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import * as express from 'express'
|
||||
|
||||
import { InversifyExpressSessionsController } from './InversifyExpressSessionsController'
|
||||
import { results } from 'inversify-express-utils'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { User } from '@standardnotes/responses'
|
||||
|
||||
import { AuthenticateRequest } from '../../Domain/UseCase/AuthenticateRequest'
|
||||
@@ -22,7 +21,6 @@ describe('InversifyExpressSessionsController', () => {
|
||||
let response: express.Response
|
||||
let user: User
|
||||
let createCrossServiceToken: CreateCrossServiceToken
|
||||
let controllerContainer: ControllerContainerInterface
|
||||
|
||||
const createController = () =>
|
||||
new InversifyExpressSessionsController(
|
||||
@@ -30,13 +28,9 @@ describe('InversifyExpressSessionsController', () => {
|
||||
authenticateRequest,
|
||||
sessionProjector,
|
||||
createCrossServiceToken,
|
||||
controllerContainer,
|
||||
)
|
||||
|
||||
beforeEach(() => {
|
||||
controllerContainer = {} as jest.Mocked<ControllerContainerInterface>
|
||||
controllerContainer.register = jest.fn()
|
||||
|
||||
session = {} as jest.Mocked<Session>
|
||||
|
||||
user = {} as jest.Mocked<User>
|
||||
|
||||
@@ -1,85 +1,39 @@
|
||||
import { Request, Response } from 'express'
|
||||
import { inject } from 'inversify'
|
||||
import {
|
||||
BaseHttpController,
|
||||
controller,
|
||||
httpGet,
|
||||
httpPost,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
results,
|
||||
} from 'inversify-express-utils'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
|
||||
import TYPES from '../../Bootstrap/Types'
|
||||
import { AuthenticateRequest } from '../../Domain/UseCase/AuthenticateRequest'
|
||||
import { CreateCrossServiceToken } from '../../Domain/UseCase/CreateCrossServiceToken/CreateCrossServiceToken'
|
||||
import { GetActiveSessionsForUser } from '../../Domain/UseCase/GetActiveSessionsForUser'
|
||||
import { ProjectorInterface } from '../../Projection/ProjectorInterface'
|
||||
import { SessionProjector } from '../../Projection/SessionProjector'
|
||||
import { User } from '../../Domain/User/User'
|
||||
import { Session } from '../../Domain/Session/Session'
|
||||
import { HomeServerSessionsController } from './HomeServer/HomeServerSessionsController'
|
||||
|
||||
@controller('/sessions')
|
||||
export class InversifyExpressSessionsController extends BaseHttpController {
|
||||
export class InversifyExpressSessionsController extends HomeServerSessionsController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_GetActiveSessionsForUser) private getActiveSessionsForUser: GetActiveSessionsForUser,
|
||||
@inject(TYPES.Auth_AuthenticateRequest) private authenticateRequest: AuthenticateRequest,
|
||||
@inject(TYPES.Auth_SessionProjector) private sessionProjector: ProjectorInterface<Session>,
|
||||
@inject(TYPES.Auth_CreateCrossServiceToken) private createCrossServiceToken: CreateCrossServiceToken,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
@inject(TYPES.Auth_GetActiveSessionsForUser) override getActiveSessionsForUser: GetActiveSessionsForUser,
|
||||
@inject(TYPES.Auth_AuthenticateRequest) override authenticateRequest: AuthenticateRequest,
|
||||
@inject(TYPES.Auth_SessionProjector) override sessionProjector: ProjectorInterface<Session>,
|
||||
@inject(TYPES.Auth_CreateCrossServiceToken) override createCrossServiceToken: CreateCrossServiceToken,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.sessions.list', this.getSessions.bind(this))
|
||||
this.controllerContainer.register('auth.sessions.validate', this.validate.bind(this))
|
||||
super(getActiveSessionsForUser, authenticateRequest, sessionProjector, createCrossServiceToken)
|
||||
}
|
||||
|
||||
@httpPost('/validate')
|
||||
async validate(request: Request): Promise<results.JsonResult> {
|
||||
const authenticateRequestResponse = await this.authenticateRequest.execute({
|
||||
authorizationHeader: request.headers.authorization,
|
||||
})
|
||||
|
||||
if (!authenticateRequestResponse.success) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: authenticateRequestResponse.errorTag,
|
||||
message: authenticateRequestResponse.errorMessage,
|
||||
},
|
||||
},
|
||||
authenticateRequestResponse.responseCode,
|
||||
)
|
||||
}
|
||||
|
||||
const user = authenticateRequestResponse.user as User
|
||||
|
||||
const result = await this.createCrossServiceToken.execute({
|
||||
user,
|
||||
session: authenticateRequestResponse.session,
|
||||
})
|
||||
|
||||
return this.json({ authToken: result.token })
|
||||
override async validate(request: Request): Promise<results.JsonResult> {
|
||||
return super.validate(request)
|
||||
}
|
||||
|
||||
@httpGet('/', TYPES.Auth_RequiredCrossServiceTokenMiddleware, TYPES.Auth_SessionMiddleware)
|
||||
async getSessions(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json([])
|
||||
}
|
||||
|
||||
const useCaseResponse = await this.getActiveSessionsForUser.execute({
|
||||
userUuid: response.locals.user.uuid,
|
||||
})
|
||||
|
||||
return this.json(
|
||||
useCaseResponse.sessions.map((session) =>
|
||||
this.sessionProjector.projectCustom(
|
||||
SessionProjector.CURRENT_SESSION_PROJECTION.toString(),
|
||||
session,
|
||||
response.locals.session,
|
||||
),
|
||||
),
|
||||
)
|
||||
override async getSessions(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.getSessions(_request, response)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import * as express from 'express'
|
||||
|
||||
import { InversifyExpressSettingsController } from './InversifyExpressSettingsController'
|
||||
import { results } from 'inversify-express-utils'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { EncryptionVersion } from '../../Domain/Encryption/EncryptionVersion'
|
||||
import { DeleteSetting } from '../../Domain/UseCase/DeleteSetting/DeleteSetting'
|
||||
import { GetSetting } from '../../Domain/UseCase/GetSetting/GetSetting'
|
||||
@@ -21,15 +20,11 @@ describe('InversifyExpressSettingsController', () => {
|
||||
let request: express.Request
|
||||
let response: express.Response
|
||||
let user: User
|
||||
let controllerContainer: ControllerContainerInterface
|
||||
|
||||
const createController = () =>
|
||||
new InversifyExpressSettingsController(getSettings, getSetting, updateSetting, deleteSetting, controllerContainer)
|
||||
new InversifyExpressSettingsController(getSettings, getSetting, updateSetting, deleteSetting)
|
||||
|
||||
beforeEach(() => {
|
||||
controllerContainer = {} as jest.Mocked<ControllerContainerInterface>
|
||||
controllerContainer.register = jest.fn()
|
||||
|
||||
deleteSetting = {} as jest.Mocked<DeleteSetting>
|
||||
deleteSetting.execute = jest.fn().mockReturnValue({ success: true })
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { ErrorTag } from '@standardnotes/responses'
|
||||
import { Request, Response } from 'express'
|
||||
import { inject } from 'inversify'
|
||||
import {
|
||||
BaseHttpController,
|
||||
controller,
|
||||
httpDelete,
|
||||
httpGet,
|
||||
@@ -11,155 +9,43 @@ import {
|
||||
results,
|
||||
} from 'inversify-express-utils'
|
||||
import TYPES from '../../Bootstrap/Types'
|
||||
import { EncryptionVersion } from '../../Domain/Encryption/EncryptionVersion'
|
||||
import { DeleteSetting } from '../../Domain/UseCase/DeleteSetting/DeleteSetting'
|
||||
import { GetSetting } from '../../Domain/UseCase/GetSetting/GetSetting'
|
||||
import { GetSettings } from '../../Domain/UseCase/GetSettings/GetSettings'
|
||||
import { UpdateSetting } from '../../Domain/UseCase/UpdateSetting/UpdateSetting'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { HomeServerSettingsController } from './HomeServer/HomeServerSettingsController'
|
||||
|
||||
@controller('/users/:userUuid')
|
||||
export class InversifyExpressSettingsController extends BaseHttpController {
|
||||
export class InversifyExpressSettingsController extends HomeServerSettingsController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_GetSettings) private doGetSettings: GetSettings,
|
||||
@inject(TYPES.Auth_GetSetting) private doGetSetting: GetSetting,
|
||||
@inject(TYPES.Auth_UpdateSetting) private doUpdateSetting: UpdateSetting,
|
||||
@inject(TYPES.Auth_DeleteSetting) private doDeleteSetting: DeleteSetting,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
@inject(TYPES.Auth_GetSettings) override doGetSettings: GetSettings,
|
||||
@inject(TYPES.Auth_GetSetting) override doGetSetting: GetSetting,
|
||||
@inject(TYPES.Auth_UpdateSetting) override doUpdateSetting: UpdateSetting,
|
||||
@inject(TYPES.Auth_DeleteSetting) override doDeleteSetting: DeleteSetting,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.users.getSettings', this.getSettings.bind(this))
|
||||
this.controllerContainer.register('auth.users.getSetting', this.getSetting.bind(this))
|
||||
this.controllerContainer.register('auth.users.updateSetting', this.updateSetting.bind(this))
|
||||
this.controllerContainer.register('auth.users.deleteSetting', this.deleteSetting.bind(this))
|
||||
super(doGetSettings, doGetSetting, doUpdateSetting, doDeleteSetting)
|
||||
}
|
||||
|
||||
@httpGet('/settings', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async getSettings(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (request.params.userUuid !== response.locals.user.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Operation not allowed.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const { userUuid } = request.params
|
||||
const result = await this.doGetSettings.execute({ userUuid })
|
||||
|
||||
return this.json(result)
|
||||
override async getSettings(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.getSettings(request, response)
|
||||
}
|
||||
|
||||
@httpGet('/settings/:settingName', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async getSetting(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (request.params.userUuid !== response.locals.user.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Operation not allowed.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const { userUuid, settingName } = request.params
|
||||
const result = await this.doGetSetting.execute({ userUuid, settingName: settingName.toUpperCase() })
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
override async getSetting(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.getSetting(request, response)
|
||||
}
|
||||
|
||||
@httpPut('/settings', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async updateSetting(request: Request, response: Response): Promise<results.JsonResult | results.StatusCodeResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
if (request.params.userUuid !== response.locals.user.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Operation not allowed.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const { name, value, serverEncryptionVersion = EncryptionVersion.Default, sensitive = false } = request.body
|
||||
|
||||
const props = {
|
||||
name,
|
||||
unencryptedValue: value,
|
||||
serverEncryptionVersion,
|
||||
sensitive,
|
||||
}
|
||||
|
||||
const { userUuid } = request.params
|
||||
const result = await this.doUpdateSetting.execute({
|
||||
userUuid,
|
||||
props,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json({ setting: result.setting }, result.statusCode)
|
||||
}
|
||||
|
||||
return this.json(result, result.statusCode)
|
||||
override async updateSetting(
|
||||
request: Request,
|
||||
response: Response,
|
||||
): Promise<results.JsonResult | results.StatusCodeResult> {
|
||||
return super.updateSetting(request, response)
|
||||
}
|
||||
|
||||
@httpDelete('/settings/:settingName', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async deleteSetting(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
if (request.params.userUuid !== response.locals.user.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Operation not allowed.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const { userUuid, settingName } = request.params
|
||||
|
||||
const result = await this.doDeleteSetting.execute({
|
||||
userUuid,
|
||||
settingName,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
override async deleteSetting(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.deleteSetting(request, response)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import { ApiVersion } from '@standardnotes/api'
|
||||
import { Role } from '@standardnotes/security'
|
||||
import { Request, Response } from 'express'
|
||||
import {
|
||||
BaseHttpController,
|
||||
controller,
|
||||
httpDelete,
|
||||
httpGet,
|
||||
@@ -10,79 +7,43 @@ import {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
results,
|
||||
} from 'inversify-express-utils'
|
||||
import TYPES from '../../Bootstrap/Types'
|
||||
import { SubscriptionInvitesController } from '../../Controller/SubscriptionInvitesController'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { inject } from 'inversify'
|
||||
|
||||
import TYPES from '../../Bootstrap/Types'
|
||||
import { SubscriptionInvitesController } from '../../Controller/SubscriptionInvitesController'
|
||||
import { HomeServerSubscriptionInvitesController } from './HomeServer/HomeServerSubscriptionInvitesController'
|
||||
|
||||
@controller('/subscription-invites')
|
||||
export class InversifyExpressSubscriptionInvitesController extends BaseHttpController {
|
||||
export class InversifyExpressSubscriptionInvitesController extends HomeServerSubscriptionInvitesController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_SubscriptionInvitesController)
|
||||
private subscriptionInvitesController: SubscriptionInvitesController,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
override subscriptionInvitesController: SubscriptionInvitesController,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.subscriptionInvites.accept', this.acceptInvite.bind(this))
|
||||
this.controllerContainer.register('auth.subscriptionInvites.declineInvite', this.declineInvite.bind(this))
|
||||
this.controllerContainer.register('auth.subscriptionInvites.create', this.inviteToSubscriptionSharing.bind(this))
|
||||
this.controllerContainer.register('auth.subscriptionInvites.delete', this.cancelSubscriptionSharing.bind(this))
|
||||
this.controllerContainer.register('auth.subscriptionInvites.list', this.listInvites.bind(this))
|
||||
super(subscriptionInvitesController)
|
||||
}
|
||||
|
||||
@httpPost('/:inviteUuid/accept', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async acceptInvite(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.subscriptionInvitesController.acceptInvite({
|
||||
api: request.query.api as ApiVersion,
|
||||
inviteUuid: request.params.inviteUuid,
|
||||
})
|
||||
|
||||
response.setHeader('x-invalidate-cache', response.locals.user.uuid)
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
override async acceptInvite(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.acceptInvite(request, response)
|
||||
}
|
||||
|
||||
@httpGet('/:inviteUuid/decline')
|
||||
async declineInvite(request: Request): Promise<results.JsonResult> {
|
||||
const response = await this.subscriptionInvitesController.declineInvite({
|
||||
api: request.query.api as ApiVersion,
|
||||
inviteUuid: request.params.inviteUuid,
|
||||
})
|
||||
|
||||
return this.json(response.data, response.status)
|
||||
override async declineInvite(request: Request): Promise<results.JsonResult> {
|
||||
return super.declineInvite(request)
|
||||
}
|
||||
|
||||
@httpPost('/', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async inviteToSubscriptionSharing(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.subscriptionInvitesController.invite({
|
||||
...request.body,
|
||||
inviterEmail: response.locals.user.email,
|
||||
inviterUuid: response.locals.user.uuid,
|
||||
inviterRoles: response.locals.roles.map((role: Role) => role.name),
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
override async inviteToSubscriptionSharing(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.inviteToSubscriptionSharing(request, response)
|
||||
}
|
||||
|
||||
@httpDelete('/:inviteUuid', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async cancelSubscriptionSharing(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.subscriptionInvitesController.cancelInvite({
|
||||
...request.body,
|
||||
inviteUuid: request.params.inviteUuid,
|
||||
inviterEmail: response.locals.user.email,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
override async cancelSubscriptionSharing(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.cancelSubscriptionSharing(request, response)
|
||||
}
|
||||
|
||||
@httpGet('/', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async listInvites(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.subscriptionInvitesController.listInvites({
|
||||
...request.body,
|
||||
inviterEmail: response.locals.user.email,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
override async listInvites(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.listInvites(request, response)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import * as express from 'express'
|
||||
|
||||
import { results } from 'inversify-express-utils'
|
||||
import { InversifyExpressSubscriptionSettingsController } from './InversifyExpressSubscriptionSettingsController'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { User } from '../../Domain/User/User'
|
||||
import { GetSetting } from '../../Domain/UseCase/GetSetting/GetSetting'
|
||||
|
||||
@@ -14,14 +13,10 @@ describe('InversifyExpressSubscriptionSettingsController', () => {
|
||||
let request: express.Request
|
||||
let response: express.Response
|
||||
let user: User
|
||||
let controllerContainer: ControllerContainerInterface
|
||||
|
||||
const createController = () => new InversifyExpressSubscriptionSettingsController(getSetting, controllerContainer)
|
||||
const createController = () => new InversifyExpressSubscriptionSettingsController(getSetting)
|
||||
|
||||
beforeEach(() => {
|
||||
controllerContainer = {} as jest.Mocked<ControllerContainerInterface>
|
||||
controllerContainer.register = jest.fn()
|
||||
|
||||
user = {} as jest.Mocked<User>
|
||||
user.uuid = '123'
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Request, Response } from 'express'
|
||||
import { inject } from 'inversify'
|
||||
import {
|
||||
BaseHttpController,
|
||||
controller,
|
||||
httpGet,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
@@ -9,30 +8,16 @@ import {
|
||||
} from 'inversify-express-utils'
|
||||
import TYPES from '../../Bootstrap/Types'
|
||||
import { GetSetting } from '../../Domain/UseCase/GetSetting/GetSetting'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { HomeServerSubscriptionSettingsController } from './HomeServer/HomeServerSubscriptionSettingsController'
|
||||
|
||||
@controller('/users/:userUuid')
|
||||
export class InversifyExpressSubscriptionSettingsController extends BaseHttpController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_GetSetting) private doGetSetting: GetSetting,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.users.getSubscriptionSetting', this.getSubscriptionSetting.bind(this))
|
||||
export class InversifyExpressSubscriptionSettingsController extends HomeServerSubscriptionSettingsController {
|
||||
constructor(@inject(TYPES.Auth_GetSetting) override doGetSetting: GetSetting) {
|
||||
super(doGetSetting)
|
||||
}
|
||||
|
||||
@httpGet('/subscription-settings/:subscriptionSettingName', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async getSubscriptionSetting(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.doGetSetting.execute({
|
||||
userUuid: response.locals.user.uuid,
|
||||
settingName: request.params.subscriptionSettingName.toUpperCase(),
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
override async getSubscriptionSetting(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.getSubscriptionSetting(request, response)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { results } from 'inversify-express-utils'
|
||||
|
||||
import { InversifyExpressSubscriptionTokensController } from './InversifyExpressSubscriptionTokensController'
|
||||
import { CrossServiceTokenData, TokenEncoderInterface } from '@standardnotes/security'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
|
||||
import { Setting } from '../../Domain/Setting/Setting'
|
||||
import { SettingServiceInterface } from '../../Domain/Setting/SettingServiceInterface'
|
||||
import { AuthenticateSubscriptionToken } from '../../Domain/UseCase/AuthenticateSubscriptionToken/AuthenticateSubscriptionToken'
|
||||
@@ -30,8 +30,6 @@ describe('InversifyExpressSubscriptionTokensController', () => {
|
||||
let user: User
|
||||
let role: Role
|
||||
|
||||
let controllerContainer: ControllerContainerInterface
|
||||
|
||||
const createController = () =>
|
||||
new InversifyExpressSubscriptionTokensController(
|
||||
createSubscriptionToken,
|
||||
@@ -41,13 +39,9 @@ describe('InversifyExpressSubscriptionTokensController', () => {
|
||||
roleProjector,
|
||||
tokenEncoder,
|
||||
jwtTTL,
|
||||
controllerContainer,
|
||||
)
|
||||
|
||||
beforeEach(() => {
|
||||
controllerContainer = {} as jest.Mocked<ControllerContainerInterface>
|
||||
controllerContainer.register = jest.fn()
|
||||
|
||||
user = {} as jest.Mocked<User>
|
||||
user.uuid = '123'
|
||||
user.roles = Promise.resolve([role])
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { CrossServiceTokenData, TokenEncoderInterface } from '@standardnotes/security'
|
||||
import { ErrorTag } from '@standardnotes/responses'
|
||||
import { SettingName } from '@standardnotes/settings'
|
||||
import { Request, Response } from 'express'
|
||||
import { inject } from 'inversify'
|
||||
import {
|
||||
BaseHttpController,
|
||||
controller,
|
||||
httpPost,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
@@ -18,99 +15,37 @@ import { AuthenticateSubscriptionToken } from '../../Domain/UseCase/Authenticate
|
||||
import { CreateSubscriptionToken } from '../../Domain/UseCase/CreateSubscriptionToken/CreateSubscriptionToken'
|
||||
import { User } from '../../Domain/User/User'
|
||||
import { ProjectorInterface } from '../../Projection/ProjectorInterface'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { HomeServerSubscriptionTokensController } from './HomeServer/HomeServerSubscriptionTokensController'
|
||||
|
||||
@controller('/subscription-tokens')
|
||||
export class InversifyExpressSubscriptionTokensController extends BaseHttpController {
|
||||
export class InversifyExpressSubscriptionTokensController extends HomeServerSubscriptionTokensController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_CreateSubscriptionToken) private createSubscriptionToken: CreateSubscriptionToken,
|
||||
@inject(TYPES.Auth_AuthenticateSubscriptionToken) private authenticateToken: AuthenticateSubscriptionToken,
|
||||
@inject(TYPES.Auth_SettingService) private settingService: SettingServiceInterface,
|
||||
@inject(TYPES.Auth_UserProjector) private userProjector: ProjectorInterface<User>,
|
||||
@inject(TYPES.Auth_RoleProjector) private roleProjector: ProjectorInterface<Role>,
|
||||
@inject(TYPES.Auth_CrossServiceTokenEncoder) private tokenEncoder: TokenEncoderInterface<CrossServiceTokenData>,
|
||||
@inject(TYPES.Auth_AUTH_JWT_TTL) private jwtTTL: number,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
@inject(TYPES.Auth_CreateSubscriptionToken) override createSubscriptionToken: CreateSubscriptionToken,
|
||||
@inject(TYPES.Auth_AuthenticateSubscriptionToken) override authenticateToken: AuthenticateSubscriptionToken,
|
||||
@inject(TYPES.Auth_SettingService) override settingService: SettingServiceInterface,
|
||||
@inject(TYPES.Auth_UserProjector) override userProjector: ProjectorInterface<User>,
|
||||
@inject(TYPES.Auth_RoleProjector) override roleProjector: ProjectorInterface<Role>,
|
||||
@inject(TYPES.Auth_CrossServiceTokenEncoder) override tokenEncoder: TokenEncoderInterface<CrossServiceTokenData>,
|
||||
@inject(TYPES.Auth_AUTH_JWT_TTL) override jwtTTL: number,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.subscription-tokens.create', this.createToken.bind(this))
|
||||
super(
|
||||
createSubscriptionToken,
|
||||
authenticateToken,
|
||||
settingService,
|
||||
userProjector,
|
||||
roleProjector,
|
||||
tokenEncoder,
|
||||
jwtTTL,
|
||||
)
|
||||
}
|
||||
|
||||
@httpPost('/', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async createToken(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.createSubscriptionToken.execute({
|
||||
userUuid: response.locals.user.uuid,
|
||||
})
|
||||
|
||||
return this.json({
|
||||
token: result.subscriptionToken.token,
|
||||
})
|
||||
override async createToken(_request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.createToken(_request, response)
|
||||
}
|
||||
|
||||
@httpPost('/:token/validate')
|
||||
async validate(request: Request): Promise<results.JsonResult> {
|
||||
const authenticateTokenResponse = await this.authenticateToken.execute({
|
||||
token: request.params.token,
|
||||
})
|
||||
|
||||
if (!authenticateTokenResponse.success) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: 'invalid-auth',
|
||||
message: 'Invalid login credentials.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const user = authenticateTokenResponse.user as User
|
||||
let extensionKey = undefined
|
||||
const extensionKeySetting = await this.settingService.findSettingWithDecryptedValue({
|
||||
settingName: SettingName.create(SettingName.NAMES.ExtensionKey).getValue(),
|
||||
userUuid: user.uuid,
|
||||
})
|
||||
if (extensionKeySetting !== null) {
|
||||
extensionKey = extensionKeySetting.value as string
|
||||
}
|
||||
|
||||
const roles = await user.roles
|
||||
|
||||
const authTokenData: CrossServiceTokenData = {
|
||||
user: await this.projectUser(user),
|
||||
roles: await this.projectRoles(roles),
|
||||
extensionKey,
|
||||
}
|
||||
|
||||
const authToken = this.tokenEncoder.encodeExpirableToken(authTokenData, this.jwtTTL)
|
||||
|
||||
return this.json({ authToken })
|
||||
}
|
||||
|
||||
private async projectUser(user: User): Promise<{ uuid: string; email: string }> {
|
||||
return <{ uuid: string; email: string }>await this.userProjector.projectSimple(user)
|
||||
}
|
||||
|
||||
private async projectRoles(roles: Array<Role>): Promise<Array<{ uuid: string; name: string }>> {
|
||||
const roleProjections = []
|
||||
for (const role of roles) {
|
||||
roleProjections.push(<{ uuid: string; name: string }>await this.roleProjector.projectSimple(role))
|
||||
}
|
||||
|
||||
return roleProjections
|
||||
override async validate(request: Request): Promise<results.JsonResult> {
|
||||
return super.validate(request)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +1,19 @@
|
||||
import { Request, Response } from 'express'
|
||||
import { BaseHttpController, results, httpPost, controller } from 'inversify-express-utils'
|
||||
import { results, httpPost, controller } from 'inversify-express-utils'
|
||||
|
||||
import TYPES from '../../Bootstrap/Types'
|
||||
import { UserRequestsController } from '../../Controller/UserRequestsController'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { inject } from 'inversify'
|
||||
import { HomeServerUserRequestsController } from './HomeServer/HomeServerUserRequestsController'
|
||||
|
||||
@controller('/users/:userUuid/requests')
|
||||
export class InversifyExpressUserRequestsController extends BaseHttpController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_UserRequestsController) private userRequestsController: UserRequestsController,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.users.createRequest', this.submitRequest.bind(this))
|
||||
export class InversifyExpressUserRequestsController extends HomeServerUserRequestsController {
|
||||
constructor(@inject(TYPES.Auth_UserRequestsController) override userRequestsController: UserRequestsController) {
|
||||
super(userRequestsController)
|
||||
}
|
||||
|
||||
@httpPost('/', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async submitRequest(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const result = await this.userRequestsController.submitUserRequest({
|
||||
requestType: request.body.requestType,
|
||||
userUuid: response.locals.user.uuid,
|
||||
userEmail: response.locals.user.email,
|
||||
})
|
||||
|
||||
return this.json(result.data, result.status)
|
||||
override async submitRequest(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.submitRequest(request, response)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import * as express from 'express'
|
||||
|
||||
import { InversifyExpressUsersController } from './InversifyExpressUsersController'
|
||||
import { results } from 'inversify-express-utils'
|
||||
import { ControllerContainerInterface, Username } from '@standardnotes/domain-core'
|
||||
import { Username } from '@standardnotes/domain-core'
|
||||
import { DeleteAccount } from '../../Domain/UseCase/DeleteAccount/DeleteAccount'
|
||||
import { ChangeCredentials } from '../../Domain/UseCase/ChangeCredentials/ChangeCredentials'
|
||||
import { ClearLoginAttempts } from '../../Domain/UseCase/ClearLoginAttempts'
|
||||
@@ -28,7 +28,6 @@ describe('InversifyExpressUsersController', () => {
|
||||
let request: express.Request
|
||||
let response: express.Response
|
||||
let user: User
|
||||
let controllerContainer: ControllerContainerInterface
|
||||
|
||||
const createController = () =>
|
||||
new InversifyExpressUsersController(
|
||||
@@ -39,13 +38,9 @@ describe('InversifyExpressUsersController', () => {
|
||||
clearLoginAttempts,
|
||||
increaseLoginAttempts,
|
||||
changeCredentials,
|
||||
controllerContainer,
|
||||
)
|
||||
|
||||
beforeEach(() => {
|
||||
controllerContainer = {} as jest.Mocked<ControllerContainerInterface>
|
||||
controllerContainer.register = jest.fn()
|
||||
|
||||
updateUser = {} as jest.Mocked<UpdateUser>
|
||||
updateUser.execute = jest.fn()
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { Request, Response } from 'express'
|
||||
import { inject } from 'inversify'
|
||||
import { ErrorTag } from '@standardnotes/responses'
|
||||
import {
|
||||
BaseHttpController,
|
||||
controller,
|
||||
httpDelete,
|
||||
httpGet,
|
||||
@@ -19,232 +17,52 @@ import { GetUserSubscription } from '../../Domain/UseCase/GetUserSubscription/Ge
|
||||
import { ClearLoginAttempts } from '../../Domain/UseCase/ClearLoginAttempts'
|
||||
import { IncreaseLoginAttempts } from '../../Domain/UseCase/IncreaseLoginAttempts'
|
||||
import { ChangeCredentials } from '../../Domain/UseCase/ChangeCredentials/ChangeCredentials'
|
||||
import { ControllerContainerInterface, Username } from '@standardnotes/domain-core'
|
||||
import { HomeServerUsersController } from './HomeServer/HomeServerUsersController'
|
||||
|
||||
@controller('/users')
|
||||
export class InversifyExpressUsersController extends BaseHttpController {
|
||||
export class InversifyExpressUsersController extends HomeServerUsersController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_UpdateUser) private updateUser: UpdateUser,
|
||||
@inject(TYPES.Auth_GetUserKeyParams) private getUserKeyParams: GetUserKeyParams,
|
||||
@inject(TYPES.Auth_DeleteAccount) private doDeleteAccount: DeleteAccount,
|
||||
@inject(TYPES.Auth_GetUserSubscription) private doGetUserSubscription: GetUserSubscription,
|
||||
@inject(TYPES.Auth_ClearLoginAttempts) private clearLoginAttempts: ClearLoginAttempts,
|
||||
@inject(TYPES.Auth_IncreaseLoginAttempts) private increaseLoginAttempts: IncreaseLoginAttempts,
|
||||
@inject(TYPES.Auth_ChangeCredentials) private changeCredentialsUseCase: ChangeCredentials,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
@inject(TYPES.Auth_UpdateUser) override updateUser: UpdateUser,
|
||||
@inject(TYPES.Auth_GetUserKeyParams) override getUserKeyParams: GetUserKeyParams,
|
||||
@inject(TYPES.Auth_DeleteAccount) override doDeleteAccount: DeleteAccount,
|
||||
@inject(TYPES.Auth_GetUserSubscription) override doGetUserSubscription: GetUserSubscription,
|
||||
@inject(TYPES.Auth_ClearLoginAttempts) override clearLoginAttempts: ClearLoginAttempts,
|
||||
@inject(TYPES.Auth_IncreaseLoginAttempts) override increaseLoginAttempts: IncreaseLoginAttempts,
|
||||
@inject(TYPES.Auth_ChangeCredentials) override changeCredentialsUseCase: ChangeCredentials,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.users.update', this.update.bind(this))
|
||||
this.controllerContainer.register('auth.users.getKeyParams', this.keyParams.bind(this))
|
||||
this.controllerContainer.register('auth.users.getSubscription', this.getSubscription.bind(this))
|
||||
this.controllerContainer.register('auth.users.updateCredentials', this.changeCredentials.bind(this))
|
||||
}
|
||||
|
||||
@httpPatch('/:userId', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async update(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
if (request.params.userId !== response.locals.user.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Operation not allowed.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const updateResult = await this.updateUser.execute({
|
||||
user: response.locals.user,
|
||||
updatedWithUserAgent: <string>request.headers['user-agent'],
|
||||
apiVersion: request.body.api,
|
||||
pwFunc: request.body.pw_func,
|
||||
pwAlg: request.body.pw_alg,
|
||||
pwCost: request.body.pw_cost,
|
||||
pwKeySize: request.body.pw_key_size,
|
||||
pwNonce: request.body.pw_nonce,
|
||||
pwSalt: request.body.pw_salt,
|
||||
kpOrigination: request.body.origination,
|
||||
kpCreated: request.body.created,
|
||||
version: request.body.version,
|
||||
})
|
||||
|
||||
if (updateResult.success) {
|
||||
response.setHeader('x-invalidate-cache', response.locals.user.uuid)
|
||||
|
||||
return this.json(updateResult.authResponse)
|
||||
}
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Could not update user.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
super(
|
||||
updateUser,
|
||||
getUserKeyParams,
|
||||
doDeleteAccount,
|
||||
doGetUserSubscription,
|
||||
clearLoginAttempts,
|
||||
increaseLoginAttempts,
|
||||
changeCredentialsUseCase,
|
||||
)
|
||||
}
|
||||
|
||||
@httpPatch('/:userId', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
override async update(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.update(request, response)
|
||||
}
|
||||
|
||||
@httpGet('/params')
|
||||
async keyParams(request: Request): Promise<results.JsonResult> {
|
||||
const email = 'email' in request.query ? <string>request.query.email : undefined
|
||||
const userUuid = 'uuid' in request.query ? <string>request.query.uuid : undefined
|
||||
|
||||
if (!email && !userUuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Missing mandatory request query parameters.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.getUserKeyParams.execute({
|
||||
email,
|
||||
userUuid,
|
||||
authenticated: request.query.authenticated === 'true',
|
||||
})
|
||||
|
||||
return this.json(result.keyParams)
|
||||
override async keyParams(request: Request): Promise<results.JsonResult> {
|
||||
return super.keyParams(request)
|
||||
}
|
||||
|
||||
@httpDelete('/:email')
|
||||
async deleteAccount(request: Request): Promise<results.JsonResult> {
|
||||
const result = await this.doDeleteAccount.execute({
|
||||
email: request.params.email,
|
||||
})
|
||||
|
||||
return this.json({ message: result.message }, result.responseCode)
|
||||
override async deleteAccount(request: Request): Promise<results.JsonResult> {
|
||||
return super.deleteAccount(request)
|
||||
}
|
||||
|
||||
@httpGet('/:userUuid/subscription', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async getSubscription(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (request.params.userUuid !== response.locals.user.uuid) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Operation not allowed.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.doGetUserSubscription.execute({
|
||||
userUuid: request.params.userUuid,
|
||||
})
|
||||
|
||||
if (result.success) {
|
||||
return this.json(result)
|
||||
}
|
||||
|
||||
return this.json(result, 400)
|
||||
override async getSubscription(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.getSubscription(request, response)
|
||||
}
|
||||
|
||||
@httpPut('/:userId/attributes/credentials', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
async changeCredentials(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
if (response.locals.readOnlyAccess) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
if (!request.body.current_password) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message:
|
||||
'Your current password is required to change your password. Please update your application if you do not see this option.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
if (!request.body.new_password) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Your new password is required to change your password. Please try again.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
|
||||
if (!request.body.pw_nonce) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'The change password request is missing new auth parameters. Please try again.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
const usernameOrError = Username.create(response.locals.user.email)
|
||||
if (usernameOrError.isFailed()) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: 'Invalid username.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
const username = usernameOrError.getValue()
|
||||
|
||||
const changeCredentialsResult = await this.changeCredentialsUseCase.execute({
|
||||
username,
|
||||
apiVersion: request.body.api,
|
||||
currentPassword: request.body.current_password,
|
||||
newPassword: request.body.new_password,
|
||||
newEmail: request.body.new_email,
|
||||
pwNonce: request.body.pw_nonce,
|
||||
kpCreated: request.body.created,
|
||||
kpOrigination: request.body.origination,
|
||||
updatedWithUserAgent: <string>request.headers['user-agent'],
|
||||
protocolVersion: request.body.version,
|
||||
})
|
||||
|
||||
if (!changeCredentialsResult.success) {
|
||||
await this.increaseLoginAttempts.execute({ email: response.locals.user.email })
|
||||
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
message: changeCredentialsResult.errorMessage,
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
await this.clearLoginAttempts.execute({ email: response.locals.user.email })
|
||||
|
||||
response.setHeader('x-invalidate-cache', response.locals.user.uuid)
|
||||
|
||||
return this.json(changeCredentialsResult.authResponse)
|
||||
override async changeCredentials(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.changeCredentials(request, response)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,20 +4,15 @@ import { Request, Response } from 'express'
|
||||
import { results } from 'inversify-express-utils'
|
||||
import { InversifyExpressValetTokenController } from './InversifyExpressValetTokenController'
|
||||
import { CreateValetToken } from '../../Domain/UseCase/CreateValetToken/CreateValetToken'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
|
||||
describe('InversifyExpressValetTokenController', () => {
|
||||
let createValetToken: CreateValetToken
|
||||
let request: Request
|
||||
let response: Response
|
||||
let controllerContainer: ControllerContainerInterface
|
||||
|
||||
const createController = () => new InversifyExpressValetTokenController(createValetToken, controllerContainer)
|
||||
const createController = () => new InversifyExpressValetTokenController(createValetToken)
|
||||
|
||||
beforeEach(() => {
|
||||
controllerContainer = {} as jest.Mocked<ControllerContainerInterface>
|
||||
controllerContainer.register = jest.fn()
|
||||
|
||||
createValetToken = {} as jest.Mocked<CreateValetToken>
|
||||
createValetToken.execute = jest.fn().mockReturnValue({ success: true, valetToken: 'foobar' })
|
||||
|
||||
|
||||
@@ -1,70 +1,23 @@
|
||||
import { inject } from 'inversify'
|
||||
import { Request, Response } from 'express'
|
||||
import {
|
||||
BaseHttpController,
|
||||
controller,
|
||||
httpPost,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
results,
|
||||
} from 'inversify-express-utils'
|
||||
import { CreateValetTokenPayload, ErrorTag } from '@standardnotes/responses'
|
||||
import { ValetTokenOperation } from '@standardnotes/security'
|
||||
import { ControllerContainerInterface, Uuid } from '@standardnotes/domain-core'
|
||||
import TYPES from '../../Bootstrap/Types'
|
||||
import { CreateValetToken } from '../../Domain/UseCase/CreateValetToken/CreateValetToken'
|
||||
import { HomeServerValetTokenController } from './HomeServer/HomeServerValetTokenController'
|
||||
|
||||
@controller('/valet-tokens', TYPES.Auth_RequiredCrossServiceTokenMiddleware)
|
||||
export class InversifyExpressValetTokenController extends BaseHttpController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_CreateValetToken) private createValetKey: CreateValetToken,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.valet-tokens.create', this.create.bind(this))
|
||||
export class InversifyExpressValetTokenController extends HomeServerValetTokenController {
|
||||
constructor(@inject(TYPES.Auth_CreateValetToken) override createValetKey: CreateValetToken) {
|
||||
super(createValetKey)
|
||||
}
|
||||
|
||||
@httpPost('/')
|
||||
public async create(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
const payload: CreateValetTokenPayload = request.body
|
||||
|
||||
if (response.locals.readOnlyAccess && payload.operation !== 'read') {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ReadOnlyAccess,
|
||||
message: 'Session has read-only access.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
for (const resource of payload.resources) {
|
||||
const resourceUuidOrError = Uuid.create(resource.remoteIdentifier)
|
||||
if (resourceUuidOrError.isFailed()) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.ParametersInvalid,
|
||||
message: 'Invalid remote resource identifier.',
|
||||
},
|
||||
},
|
||||
400,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const createValetKeyResponse = await this.createValetKey.execute({
|
||||
userUuid: response.locals.user.uuid,
|
||||
operation: payload.operation as ValetTokenOperation,
|
||||
resources: payload.resources,
|
||||
})
|
||||
|
||||
if (!createValetKeyResponse.success) {
|
||||
return this.json(createValetKeyResponse, 403)
|
||||
}
|
||||
|
||||
return this.json(createValetKeyResponse)
|
||||
override async create(request: Request, response: Response): Promise<results.JsonResult> {
|
||||
return super.create(request, response)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,63 +1,28 @@
|
||||
import { ErrorTag } from '@standardnotes/responses'
|
||||
import { TokenDecoderInterface, WebSocketConnectionTokenData } from '@standardnotes/security'
|
||||
import { Request } from 'express'
|
||||
import {
|
||||
BaseHttpController,
|
||||
controller,
|
||||
httpPost,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
results,
|
||||
} from 'inversify-express-utils'
|
||||
import { CreateCrossServiceToken } from '../../Domain/UseCase/CreateCrossServiceToken/CreateCrossServiceToken'
|
||||
import { ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { inject } from 'inversify'
|
||||
import TYPES from '../../Bootstrap/Types'
|
||||
import { HomeServerWebSocketsController } from './HomeServer/HomeServerWebSocketsController'
|
||||
|
||||
@controller('/sockets')
|
||||
export class InversifyExpressWebSocketsController extends BaseHttpController {
|
||||
export class InversifyExpressWebSocketsController extends HomeServerWebSocketsController {
|
||||
constructor(
|
||||
@inject(TYPES.Auth_CreateCrossServiceToken) private createCrossServiceToken: CreateCrossServiceToken,
|
||||
@inject(TYPES.Auth_CreateCrossServiceToken) override createCrossServiceToken: CreateCrossServiceToken,
|
||||
@inject(TYPES.Auth_WebSocketConnectionTokenDecoder)
|
||||
private tokenDecoder: TokenDecoderInterface<WebSocketConnectionTokenData>,
|
||||
@inject(TYPES.Auth_ControllerContainer) private controllerContainer: ControllerContainerInterface,
|
||||
override tokenDecoder: TokenDecoderInterface<WebSocketConnectionTokenData>,
|
||||
) {
|
||||
super()
|
||||
|
||||
this.controllerContainer.register('auth.webSockets.validateToken', this.validateToken.bind(this))
|
||||
super(createCrossServiceToken, tokenDecoder)
|
||||
}
|
||||
|
||||
@httpPost('/tokens/validate')
|
||||
async validateToken(request: Request): Promise<results.JsonResult> {
|
||||
if (!request.headers.authorization) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.AuthInvalid,
|
||||
message: 'Invalid authorization token.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const token: WebSocketConnectionTokenData | undefined = this.tokenDecoder.decodeToken(request.headers.authorization)
|
||||
|
||||
if (token === undefined) {
|
||||
return this.json(
|
||||
{
|
||||
error: {
|
||||
tag: ErrorTag.AuthInvalid,
|
||||
message: 'Invalid authorization token.',
|
||||
},
|
||||
},
|
||||
401,
|
||||
)
|
||||
}
|
||||
|
||||
const result = await this.createCrossServiceToken.execute({
|
||||
userUuid: token.userUuid,
|
||||
})
|
||||
|
||||
return this.json({ authToken: result.token })
|
||||
override async validateToken(request: Request): Promise<results.JsonResult> {
|
||||
return super.validateToken(request)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [1.48.0](https://github.com/standardnotes/server/compare/@standardnotes/common@1.47.1...@standardnotes/common@1.48.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
* upgrade to node 20.2.0 ([#616](https://github.com/standardnotes/server/issues/616)) ([a6b062f](https://github.com/standardnotes/server/commit/a6b062f638595537e1ece28bc79bded41d875e18))
|
||||
|
||||
## [1.47.1](https://github.com/standardnotes/server/compare/@standardnotes/common@1.47.0...@standardnotes/common@1.47.1) (2023-05-09)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/common",
|
||||
"version": "1.47.1",
|
||||
"version": "1.48.0",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
@@ -24,7 +24,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.1",
|
||||
"@types/node": "^20.1.0",
|
||||
"@types/node": "^20.2.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
||||
"@typescript-eslint/parser": "^5.59.2",
|
||||
"eslint": "^8.39.0",
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [1.16.0](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.15.0...@standardnotes/domain-core@1.16.0) (2023-05-29)
|
||||
|
||||
### Features
|
||||
|
||||
* add files server as a service to home-server ([#614](https://github.com/standardnotes/server/issues/614)) ([c7d575a](https://github.com/standardnotes/server/commit/c7d575a0ffc7eb3e8799c3835da5727584f4f67b))
|
||||
|
||||
# [1.15.0](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.14.2...@standardnotes/domain-core@1.15.0) (2023-05-16)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/domain-core",
|
||||
"version": "1.15.0",
|
||||
"version": "1.16.0",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
|
||||
@@ -8,6 +8,7 @@ export class ServiceIdentifier extends ValueObject<ServiceIdentifierProps> {
|
||||
Auth: 'Auth',
|
||||
SyncingServer: 'SyncingServer',
|
||||
Revisions: 'Revisions',
|
||||
Files: 'Files',
|
||||
}
|
||||
|
||||
get value(): string {
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [1.9.0](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.8.3...@standardnotes/event-store@1.9.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
* upgrade to node 20.2.0 ([#616](https://github.com/standardnotes/server/issues/616)) ([a6b062f](https://github.com/standardnotes/server/commit/a6b062f638595537e1ece28bc79bded41d875e18))
|
||||
|
||||
## [1.8.3](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.8.2...@standardnotes/event-store@1.8.3) (2023-05-17)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/event-store
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM node:20.1.0-alpine
|
||||
FROM node:20.2.0-alpine
|
||||
|
||||
RUN apk add --update \
|
||||
curl \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/event-store",
|
||||
"version": "1.8.3",
|
||||
"version": "1.9.0",
|
||||
"description": "Event Store Service",
|
||||
"private": true,
|
||||
"main": "dist/src/index.js",
|
||||
|
||||
@@ -3,6 +3,18 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [1.14.0](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.13.0...@standardnotes/files-server@1.14.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
* upgrade to node 20.2.0 ([#616](https://github.com/standardnotes/files/issues/616)) ([a6b062f](https://github.com/standardnotes/files/commit/a6b062f638595537e1ece28bc79bded41d875e18))
|
||||
|
||||
# [1.13.0](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.12.5...@standardnotes/files-server@1.13.0) (2023-05-29)
|
||||
|
||||
### Features
|
||||
|
||||
* add files server as a service to home-server ([#614](https://github.com/standardnotes/files/issues/614)) ([c7d575a](https://github.com/standardnotes/files/commit/c7d575a0ffc7eb3e8799c3835da5727584f4f67b))
|
||||
|
||||
## [1.12.5](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.12.4...@standardnotes/files-server@1.12.5) (2023-05-18)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/files-server
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM node:20.1.0-alpine
|
||||
FROM node:20.2.0-alpine
|
||||
|
||||
RUN apk add --update \
|
||||
curl \
|
||||
|
||||
@@ -4,8 +4,8 @@ import 'newrelic'
|
||||
|
||||
import * as busboy from 'connect-busboy'
|
||||
|
||||
import '../src/Controller/HealthCheckController'
|
||||
import '../src/Controller/FilesController'
|
||||
import '../src/Infra/InversifyExpress/InversifyExpressHealthCheckController'
|
||||
import '../src/Infra/InversifyExpress/InversifyExpressFilesController'
|
||||
|
||||
import helmet from 'helmet'
|
||||
import * as cors from 'cors'
|
||||
@@ -28,7 +28,7 @@ void container.load().then((container) => {
|
||||
|
||||
server.setConfig((app) => {
|
||||
app.use((_request: Request, response: Response, next: NextFunction) => {
|
||||
response.setHeader('X-Files-Version', container.get(TYPES.VERSION))
|
||||
response.setHeader('X-Files-Version', container.get(TYPES.Files_VERSION))
|
||||
next()
|
||||
})
|
||||
app.use(
|
||||
@@ -74,7 +74,7 @@ void container.load().then((container) => {
|
||||
)
|
||||
})
|
||||
|
||||
const logger: winston.Logger = container.get(TYPES.Logger)
|
||||
const logger: winston.Logger = container.get(TYPES.Files_Logger)
|
||||
|
||||
server.setErrorConfig((app) => {
|
||||
app.use((error: Record<string, unknown>, _request: Request, response: Response, _next: NextFunction) => {
|
||||
|
||||
@@ -18,11 +18,13 @@ void container.load().then((container) => {
|
||||
const env: Env = new Env()
|
||||
env.load()
|
||||
|
||||
const logger: Logger = container.get(TYPES.Logger)
|
||||
const logger: Logger = container.get(TYPES.Files_Logger)
|
||||
|
||||
logger.info('Starting worker...')
|
||||
|
||||
const subscriberFactory: DomainEventSubscriberFactoryInterface = container.get(TYPES.DomainEventSubscriberFactory)
|
||||
const subscriberFactory: DomainEventSubscriberFactoryInterface = container.get(
|
||||
TYPES.Files_DomainEventSubscriberFactory,
|
||||
)
|
||||
subscriberFactory.create().start()
|
||||
|
||||
setInterval(() => logger.info('Alive and kicking!'), 20 * 60 * 1000)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/files-server",
|
||||
"version": "1.12.5",
|
||||
"version": "1.14.0",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
@@ -18,6 +18,7 @@
|
||||
"setup:env": "cp .env.sample .env",
|
||||
"build": "tsc --build",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"lint:fix": "eslint . --fix --ext .ts",
|
||||
"pretest": "yarn lint && yarn build",
|
||||
"test": "jest --coverage --config=./jest.config.js --maxWorkers=50%",
|
||||
"start": "yarn node dist/bin/server.js",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user