Compare commits

...

35 Commits

Author SHA1 Message Date
standardci 951d965304 chore(release): publish new version
- @standardnotes/home-server@1.16.35
 - @standardnotes/revisions-server@1.40.2
 - @standardnotes/syncing-server@1.112.3
2023-10-09 06:45:04 +00:00
Karol Sójko 29e8de3238 fix: logs in transition 2023-10-09 08:26:18 +02:00
standardci eeeacabaa8 chore(release): publish new version
- @standardnotes/home-server@1.16.34
 - @standardnotes/syncing-server@1.112.2
2023-10-06 14:30:24 +00:00
Karol Sójko 51ca8229b8 fix(syncing-server): calling auth server for user key params 2023-10-06 15:56:10 +02:00
Karol Sójko a6a19a391e fix(syncing-server): error log on email backup requested 2023-10-06 15:44:11 +02:00
standardci f6cdb7916c chore(release): publish new version
- @standardnotes/auth-server@1.152.1
 - @standardnotes/home-server@1.16.33
 - @standardnotes/revisions-server@1.40.1
 - @standardnotes/syncing-server@1.112.1
2023-10-06 13:34:07 +00:00
Karol Sójko eafb064d79 fix(syncing-server): increase axios timeout on calling auth 2023-10-06 15:18:26 +02:00
Karol Sójko ba050681f7 fix(syncing-server): logs on request backup handler 2023-10-06 15:16:38 +02:00
Karol Sójko 4780629549 fix(revisions): casting creation date from MongoDB 2023-10-06 15:14:11 +02:00
Karol Sójko 79a44aa51f fix(auth): checking for transition role when triggering transition 2023-10-06 14:56:45 +02:00
standardci dd72769841 chore(release): publish new version
- @standardnotes/auth-server@1.152.0
 - @standardnotes/home-server@1.16.32
 - @standardnotes/revisions-server@1.40.0
 - @standardnotes/syncing-server@1.112.0
2023-10-06 11:22:47 +00:00
Karol Sójko d8f1c66fd5 fix: enable TransitionRequestedEventHandler 2023-10-06 13:02:37 +02:00
Karol Sójko afe9967d26 fix(auth): strip user from transition role after migration 2023-10-06 12:59:18 +02:00
Karol Sójko 27bea444cc feat: switch transition direction 2023-10-06 12:48:08 +02:00
standardci 7a571dec0a chore(release): publish new version
- @standardnotes/home-server@1.16.31
 - @standardnotes/syncing-server@1.111.5
2023-10-06 08:48:31 +00:00
Karol Sójko 8c57f505be fix(syncing-server): add more logs on successfull email backups requested 2023-10-06 10:28:50 +02:00
standardci 973612bf4f chore(release): publish new version
- @standardnotes/analytics@2.28.1
 - @standardnotes/auth-server@1.151.2
 - @standardnotes/home-server@1.16.30
 - @standardnotes/scheduler-server@1.22.1
 - @standardnotes/syncing-server@1.111.4
2023-10-06 08:01:50 +00:00
Karol Sójko 702a1286eb fix(syncing-server): error log on email backup request handler 2023-10-06 09:40:27 +02:00
Karol Sójko a45b5b69b5 fix: add xray-sdk to background processors 2023-10-06 09:33:15 +02:00
standardci 321353f26c chore(release): publish new version
- @standardnotes/analytics@2.28.0
 - @standardnotes/api-gateway@1.77.1
 - @standardnotes/auth-server@1.151.1
 - @standardnotes/domain-core@1.35.0
 - @standardnotes/domain-events-infra@1.14.8
 - @standardnotes/event-store@1.12.11
 - @standardnotes/files-server@1.26.3
 - @standardnotes/home-server@1.16.29
 - @standardnotes/revisions-server@1.39.5
 - @standardnotes/scheduler-server@1.22.0
 - @standardnotes/settings@1.21.43
 - @standardnotes/syncing-server@1.111.3
 - @standardnotes/websockets-server@1.12.0
2023-10-06 05:44:00 +00:00
Karol Sójko db4607d4aa chore: upgrade sqs-consumer 2023-10-06 07:26:59 +02:00
Karol Sójko f0531d68cb feat: add xray to analytics scheduler and websockets 2023-10-06 07:23:06 +02:00
Karol Sójko 8a00d159a6 Revert "fix: naming of segments for sqs handlers"
This reverts commit d244cc0d5f.
2023-10-06 06:50:14 +02:00
Karol Sójko d244cc0d5f fix: naming of segments for sqs handlers 2023-10-05 18:06:17 +02:00
standardci 6a2aa4b148 chore(release): publish new version
- @standardnotes/api-gateway@1.77.0
 - @standardnotes/auth-server@1.151.0
 - @standardnotes/home-server@1.16.28
2023-10-05 14:42:25 +00:00
Karol Sójko 3ee49416f8 feat: setting xray segment user on api-gateway level 2023-10-05 16:25:09 +02:00
standardci ae1e86e19f chore(release): publish new version
- @standardnotes/home-server@1.16.27
 - @standardnotes/revisions-server@1.39.4
2023-10-05 13:20:33 +00:00
Karol Sójko 9f76e389e2 fix(revisions): capture mysql to xray 2023-10-05 13:22:39 +02:00
standardci 6e2240e60c chore(release): publish new version
- @standardnotes/analytics@2.27.10
 - @standardnotes/api-gateway@1.76.2
 - @standardnotes/auth-server@1.150.9
 - @standardnotes/domain-events-infra@1.14.7
 - @standardnotes/event-store@1.12.10
 - @standardnotes/files-server@1.26.2
 - @standardnotes/home-server@1.16.26
 - @standardnotes/revisions-server@1.39.3
 - @standardnotes/scheduler-server@1.21.10
 - @standardnotes/syncing-server@1.111.2
 - @standardnotes/websockets-server@1.11.10
2023-10-05 07:17:33 +00:00
Karol Sójko cd37c951bb Revert "fix(domain-events-infra): setting user metadata on workers"
This reverts commit c4b6f17ebc.
2023-10-05 09:00:47 +02:00
standardci c4c3dfb823 chore(release): publish new version
- @standardnotes/analytics@2.27.9
 - @standardnotes/api-gateway@1.76.1
 - @standardnotes/auth-server@1.150.8
 - @standardnotes/domain-events-infra@1.14.6
 - @standardnotes/event-store@1.12.9
 - @standardnotes/files-server@1.26.1
 - @standardnotes/home-server@1.16.25
 - @standardnotes/revisions-server@1.39.2
 - @standardnotes/scheduler-server@1.21.9
 - @standardnotes/syncing-server@1.111.1
 - @standardnotes/websockets-server@1.11.9
2023-10-05 05:36:39 +00:00
Karol Sójko c4b6f17ebc fix(domain-events-infra): setting user metadata on workers 2023-10-05 07:16:18 +02:00
standardci 71ce938cb1 chore(release): publish new version
- @standardnotes/api-gateway@1.76.0
 - @standardnotes/files-server@1.26.0
 - @standardnotes/home-server@1.16.24
 - @standardnotes/syncing-server@1.111.0
2023-10-04 18:03:38 +00:00
Karol Sójko dc76113915 feat(api-gateaway): configure aws-xray-sdk 2023-10-04 19:44:25 +02:00
Karol Sójko 6583ff6cd9 feat: add xray to syncing server and files 2023-10-04 19:39:16 +02:00
131 changed files with 1683 additions and 501 deletions
Generated
+56 -7
View File
@@ -5740,6 +5740,7 @@ const RAW_RUNTIME_STATE =
["@types/node", "npm:20.5.7"],\ ["@types/node", "npm:20.5.7"],\
["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\ ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\
["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\ ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\
["aws-xray-sdk", "npm:3.5.2"],\
["dayjs", "npm:1.11.7"],\ ["dayjs", "npm:1.11.7"],\
["dotenv", "npm:16.1.3"],\ ["dotenv", "npm:16.1.3"],\
["eslint", "npm:8.41.0"],\ ["eslint", "npm:8.41.0"],\
@@ -5797,6 +5798,7 @@ const RAW_RUNTIME_STATE =
["@types/prettyjson", "npm:0.0.30"],\ ["@types/prettyjson", "npm:0.0.30"],\
["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\ ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\
["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\ ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\
["aws-xray-sdk", "npm:3.5.2"],\
["axios", "npm:1.4.0"],\ ["axios", "npm:1.4.0"],\
["cors", "npm:2.8.5"],\ ["cors", "npm:2.8.5"],\
["dotenv", "npm:16.1.3"],\ ["dotenv", "npm:16.1.3"],\
@@ -5971,7 +5973,7 @@ const RAW_RUNTIME_STATE =
["newrelic", "npm:11.0.0"],\ ["newrelic", "npm:11.0.0"],\
["prettier", "npm:3.0.3"],\ ["prettier", "npm:3.0.3"],\
["reflect-metadata", "npm:0.1.13"],\ ["reflect-metadata", "npm:0.1.13"],\
["sqs-consumer", "virtual:685a6222c3349423674bb7f0684ba34e2ab20912010f352e04dcf707a156e13183fc382e2417cb37a60f3e7b52fd0178c53181674890e1773eb83e190dc13378#npm:6.2.1"],\ ["sqs-consumer", "virtual:685a6222c3349423674bb7f0684ba34e2ab20912010f352e04dcf707a156e13183fc382e2417cb37a60f3e7b52fd0178c53181674890e1773eb83e190dc13378#npm:7.3.0"],\
["ts-jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.1.0"],\ ["ts-jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.1.0"],\
["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin<compat/typescript>::version=5.0.4&hash=b5f058"],\ ["typescript", "patch:typescript@npm%3A5.0.4#optional!builtin<compat/typescript>::version=5.0.4&hash=b5f058"],\
["winston", "npm:3.9.0"]\ ["winston", "npm:3.9.0"]\
@@ -6053,6 +6055,7 @@ const RAW_RUNTIME_STATE =
["@types/uuid", "npm:9.0.3"],\ ["@types/uuid", "npm:9.0.3"],\
["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\ ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\
["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\ ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\
["aws-xray-sdk", "npm:3.5.2"],\
["connect-busboy", "npm:1.0.0"],\ ["connect-busboy", "npm:1.0.0"],\
["cors", "npm:2.8.5"],\ ["cors", "npm:2.8.5"],\
["dayjs", "npm:1.11.7"],\ ["dayjs", "npm:1.11.7"],\
@@ -6184,6 +6187,7 @@ const RAW_RUNTIME_STATE =
["@types/express", "npm:4.17.17"],\ ["@types/express", "npm:4.17.17"],\
["@types/ioredis", "npm:5.0.0"],\ ["@types/ioredis", "npm:5.0.0"],\
["@types/jest", "npm:29.5.2"],\ ["@types/jest", "npm:29.5.2"],\
["@types/mysql", "npm:2.15.22"],\
["@types/newrelic", "npm:9.14.0"],\ ["@types/newrelic", "npm:9.14.0"],\
["@types/node", "npm:20.5.7"],\ ["@types/node", "npm:20.5.7"],\
["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\ ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\
@@ -6199,6 +6203,7 @@ const RAW_RUNTIME_STATE =
["ioredis", "npm:5.3.2"],\ ["ioredis", "npm:5.3.2"],\
["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\ ["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.5.0"],\
["mongodb", "virtual:365b8c88cdf194291829ee28b79556e2328175d26a621363e703848100bea0042e9500db2a1206c9bbc3a4a76a1d169639ef774b2ea3a1a98584a9936b58c6be#npm:6.0.0"],\ ["mongodb", "virtual:365b8c88cdf194291829ee28b79556e2328175d26a621363e703848100bea0042e9500db2a1206c9bbc3a4a76a1d169639ef774b2ea3a1a98584a9936b58c6be#npm:6.0.0"],\
["mysql", "npm:2.18.1"],\
["mysql2", "npm:3.3.3"],\ ["mysql2", "npm:3.3.3"],\
["newrelic", "npm:11.0.0"],\ ["newrelic", "npm:11.0.0"],\
["prettier", "npm:3.0.3"],\ ["prettier", "npm:3.0.3"],\
@@ -6231,6 +6236,7 @@ const RAW_RUNTIME_STATE =
["@types/node", "npm:20.5.7"],\ ["@types/node", "npm:20.5.7"],\
["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\ ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\
["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\ ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\
["aws-xray-sdk", "npm:3.5.2"],\
["dayjs", "npm:1.11.7"],\ ["dayjs", "npm:1.11.7"],\
["dotenv", "npm:16.1.3"],\ ["dotenv", "npm:16.1.3"],\
["eslint", "npm:8.41.0"],\ ["eslint", "npm:8.41.0"],\
@@ -6380,6 +6386,7 @@ const RAW_RUNTIME_STATE =
["@types/uuid", "npm:9.0.3"],\ ["@types/uuid", "npm:9.0.3"],\
["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\ ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\
["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\ ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\
["aws-xray-sdk", "npm:3.5.2"],\
["axios", "npm:1.4.0"],\ ["axios", "npm:1.4.0"],\
["cors", "npm:2.8.5"],\ ["cors", "npm:2.8.5"],\
["dotenv", "npm:16.1.3"],\ ["dotenv", "npm:16.1.3"],\
@@ -6467,6 +6474,7 @@ const RAW_RUNTIME_STATE =
["@types/newrelic", "npm:9.14.0"],\ ["@types/newrelic", "npm:9.14.0"],\
["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\ ["@typescript-eslint/eslint-plugin", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\
["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\ ["@typescript-eslint/parser", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:6.5.0"],\
["aws-xray-sdk", "npm:3.5.2"],\
["axios", "npm:1.4.0"],\ ["axios", "npm:1.4.0"],\
["cors", "npm:2.8.5"],\ ["cors", "npm:2.8.5"],\
["dotenv", "npm:16.1.3"],\ ["dotenv", "npm:16.1.3"],\
@@ -8333,6 +8341,13 @@ const RAW_RUNTIME_STATE =
}]\ }]\
]],\ ]],\
["bignumber.js", [\ ["bignumber.js", [\
["npm:9.0.0", {\
"packageLocation": "./.yarn/cache/bignumber.js-npm-9.0.0-ce190bcd7c-7406d0d11d.zip/node_modules/bignumber.js/",\
"packageDependencies": [\
["bignumber.js", "npm:9.0.0"]\
],\
"linkType": "HARD"\
}],\
["npm:9.1.1", {\ ["npm:9.1.1", {\
"packageLocation": "./.yarn/cache/bignumber.js-npm-9.1.1-5929e8d8dc-1f771bfa88.zip/node_modules/bignumber.js/",\ "packageLocation": "./.yarn/cache/bignumber.js-npm-9.1.1-5929e8d8dc-1f771bfa88.zip/node_modules/bignumber.js/",\
"packageDependencies": [\ "packageDependencies": [\
@@ -13715,6 +13730,19 @@ const RAW_RUNTIME_STATE =
"linkType": "HARD"\ "linkType": "HARD"\
}]\ }]\
]],\ ]],\
["mysql", [\
["npm:2.18.1", {\
"packageLocation": "./.yarn/cache/mysql-npm-2.18.1-8fdb56201f-87d80e3747.zip/node_modules/mysql/",\
"packageDependencies": [\
["mysql", "npm:2.18.1"],\
["bignumber.js", "npm:9.0.0"],\
["readable-stream", "npm:2.3.7"],\
["safe-buffer", "npm:5.1.2"],\
["sqlstring", "npm:2.3.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["mysql2", [\ ["mysql2", [\
["npm:3.3.3", {\ ["npm:3.3.3", {\
"packageLocation": "./.yarn/cache/mysql2-npm-3.3.3-d2fe8cf512-4bf7ace8f1.zip/node_modules/mysql2/",\ "packageLocation": "./.yarn/cache/mysql2-npm-3.3.3-d2fe8cf512-4bf7ace8f1.zip/node_modules/mysql2/",\
@@ -15252,6 +15280,20 @@ const RAW_RUNTIME_STATE =
}]\ }]\
]],\ ]],\
["readable-stream", [\ ["readable-stream", [\
["npm:2.3.7", {\
"packageLocation": "./.yarn/cache/readable-stream-npm-2.3.7-77b22a9818-d04c677c17.zip/node_modules/readable-stream/",\
"packageDependencies": [\
["readable-stream", "npm:2.3.7"],\
["core-util-is", "npm:1.0.3"],\
["inherits", "npm:2.0.4"],\
["isarray", "npm:1.0.0"],\
["process-nextick-args", "npm:2.0.1"],\
["safe-buffer", "npm:5.1.2"],\
["string_decoder", "npm:1.1.1"],\
["util-deprecate", "npm:1.0.2"]\
],\
"linkType": "HARD"\
}],\
["npm:2.3.8", {\ ["npm:2.3.8", {\
"packageLocation": "./.yarn/cache/readable-stream-npm-2.3.8-67a94c2cb1-8500dd3a90.zip/node_modules/readable-stream/",\ "packageLocation": "./.yarn/cache/readable-stream-npm-2.3.8-67a94c2cb1-8500dd3a90.zip/node_modules/readable-stream/",\
"packageDependencies": [\ "packageDependencies": [\
@@ -16019,6 +16061,13 @@ const RAW_RUNTIME_STATE =
}]\ }]\
]],\ ]],\
["sqlstring", [\ ["sqlstring", [\
["npm:2.3.1", {\
"packageLocation": "./.yarn/cache/sqlstring-npm-2.3.1-2d4ffafe98-bc09237002.zip/node_modules/sqlstring/",\
"packageDependencies": [\
["sqlstring", "npm:2.3.1"]\
],\
"linkType": "HARD"\
}],\
["npm:2.3.3", {\ ["npm:2.3.3", {\
"packageLocation": "./.yarn/cache/sqlstring-npm-2.3.3-2db6939570-4e5a25af2d.zip/node_modules/sqlstring/",\ "packageLocation": "./.yarn/cache/sqlstring-npm-2.3.3-2db6939570-4e5a25af2d.zip/node_modules/sqlstring/",\
"packageDependencies": [\ "packageDependencies": [\
@@ -16028,17 +16077,17 @@ const RAW_RUNTIME_STATE =
}]\ }]\
]],\ ]],\
["sqs-consumer", [\ ["sqs-consumer", [\
["npm:6.2.1", {\ ["npm:7.3.0", {\
"packageLocation": "./.yarn/cache/sqs-consumer-npm-6.2.1-857abd3d30-a903daa836.zip/node_modules/sqs-consumer/",\ "packageLocation": "./.yarn/cache/sqs-consumer-npm-7.3.0-a47c08ef71-367ea2a6f3.zip/node_modules/sqs-consumer/",\
"packageDependencies": [\ "packageDependencies": [\
["sqs-consumer", "npm:6.2.1"]\ ["sqs-consumer", "npm:7.3.0"]\
],\ ],\
"linkType": "SOFT"\ "linkType": "SOFT"\
}],\ }],\
["virtual:685a6222c3349423674bb7f0684ba34e2ab20912010f352e04dcf707a156e13183fc382e2417cb37a60f3e7b52fd0178c53181674890e1773eb83e190dc13378#npm:6.2.1", {\ ["virtual:685a6222c3349423674bb7f0684ba34e2ab20912010f352e04dcf707a156e13183fc382e2417cb37a60f3e7b52fd0178c53181674890e1773eb83e190dc13378#npm:7.3.0", {\
"packageLocation": "./.yarn/__virtual__/sqs-consumer-virtual-603a7c5831/0/cache/sqs-consumer-npm-6.2.1-857abd3d30-a903daa836.zip/node_modules/sqs-consumer/",\ "packageLocation": "./.yarn/__virtual__/sqs-consumer-virtual-bf07118bf0/0/cache/sqs-consumer-npm-7.3.0-a47c08ef71-367ea2a6f3.zip/node_modules/sqs-consumer/",\
"packageDependencies": [\ "packageDependencies": [\
["sqs-consumer", "virtual:685a6222c3349423674bb7f0684ba34e2ab20912010f352e04dcf707a156e13183fc382e2417cb37a60f3e7b52fd0178c53181674890e1773eb83e190dc13378#npm:6.2.1"],\ ["sqs-consumer", "virtual:685a6222c3349423674bb7f0684ba34e2ab20912010f352e04dcf707a156e13183fc382e2417cb37a60f3e7b52fd0178c53181674890e1773eb83e190dc13378#npm:7.3.0"],\
["@aws-sdk/client-sqs", "npm:3.342.0"],\ ["@aws-sdk/client-sqs", "npm:3.342.0"],\
["@types/aws-sdk__client-sqs", null],\ ["@types/aws-sdk__client-sqs", null],\
["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"]\ ["debug", "virtual:ac3d8e680759ce54399273724d44e041d6c9b73454d191d411a8c44bb27e22f02aaf6ed9d3ad0ac1c298eac4833cff369c9c7b84c573016112c4f84be2cd8543#npm:4.3.4"]\
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.
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.28.1](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.28.0...@standardnotes/analytics@2.28.1) (2023-10-06)
### Bug Fixes
* add xray-sdk to background processors ([a45b5b6](https://github.com/standardnotes/server/commit/a45b5b69b5d68c2e696c30f0ba5ad22d313321e6))
# [2.28.0](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.27.10...@standardnotes/analytics@2.28.0) (2023-10-06)
### Features
* add xray to analytics scheduler and websockets ([f0531d6](https://github.com/standardnotes/server/commit/f0531d68cb77036222f2a34602819f11e6a2697d))
## [2.27.10](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.27.9...@standardnotes/analytics@2.27.10) (2023-10-05)
**Note:** Version bump only for package @standardnotes/analytics
## [2.27.9](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.27.8...@standardnotes/analytics@2.27.9) (2023-10-05)
**Note:** Version bump only for package @standardnotes/analytics
## [2.27.8](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.27.7...@standardnotes/analytics@2.27.8) (2023-10-04) ## [2.27.8](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.27.7...@standardnotes/analytics@2.27.8) (2023-10-04)
**Note:** Version bump only for package @standardnotes/analytics **Note:** Version bump only for package @standardnotes/analytics
+9
View File
@@ -1,6 +1,7 @@
import 'reflect-metadata' import 'reflect-metadata'
import { Logger } from 'winston' import { Logger } from 'winston'
import * as AWSXRay from 'aws-xray-sdk'
import { EmailLevel } from '@standardnotes/domain-core' import { EmailLevel } from '@standardnotes/domain-core'
import { DomainEventPublisherInterface } from '@standardnotes/domain-events' import { DomainEventPublisherInterface } from '@standardnotes/domain-events'
@@ -253,6 +254,14 @@ void container.load().then((container) => {
const env: Env = new Env() const env: Env = new Env()
env.load() env.load()
const isConfiguredForAWSProduction =
env.get('MODE', true) !== 'home-server' && env.get('MODE', true) !== 'self-hosted'
if (isConfiguredForAWSProduction) {
AWSXRay.enableManualMode()
AWSXRay.config([AWSXRay.plugins.ECSPlugin])
}
const logger: Logger = container.get(TYPES.Logger) const logger: Logger = container.get(TYPES.Logger)
logger.info('Starting usage report generation...') logger.info('Starting usage report generation...')
+9
View File
@@ -1,6 +1,7 @@
import 'reflect-metadata' import 'reflect-metadata'
import { Logger } from 'winston' import { Logger } from 'winston'
import * as AWSXRay from 'aws-xray-sdk'
import { DomainEventSubscriberFactoryInterface } from '@standardnotes/domain-events' import { DomainEventSubscriberFactoryInterface } from '@standardnotes/domain-events'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import * as utc from 'dayjs/plugin/utc' import * as utc from 'dayjs/plugin/utc'
@@ -16,6 +17,14 @@ void container.load().then((container) => {
const env: Env = new Env() const env: Env = new Env()
env.load() env.load()
const isConfiguredForAWSProduction =
env.get('MODE', true) !== 'home-server' && env.get('MODE', true) !== 'self-hosted'
if (isConfiguredForAWSProduction) {
AWSXRay.enableManualMode()
AWSXRay.config([AWSXRay.plugins.ECSPlugin])
}
const logger: Logger = container.get(TYPES.Logger) const logger: Logger = container.get(TYPES.Logger)
logger.info('Starting worker...') logger.info('Starting worker...')
+2 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@standardnotes/analytics", "name": "@standardnotes/analytics",
"version": "2.27.8", "version": "2.28.1",
"engines": { "engines": {
"node": ">=18.0.0 <21.0.0" "node": ">=18.0.0 <21.0.0"
}, },
@@ -46,6 +46,7 @@
"@standardnotes/domain-events": "workspace:*", "@standardnotes/domain-events": "workspace:*",
"@standardnotes/domain-events-infra": "workspace:*", "@standardnotes/domain-events-infra": "workspace:*",
"@standardnotes/time": "workspace:*", "@standardnotes/time": "workspace:*",
"aws-xray-sdk": "^3.5.2",
"dayjs": "^1.11.6", "dayjs": "^1.11.6",
"dotenv": "^16.0.1", "dotenv": "^16.0.1",
"inversify": "^6.0.1", "inversify": "^6.0.1",
+10 -5
View File
@@ -6,7 +6,7 @@ import {
DomainEventMessageHandlerInterface, DomainEventMessageHandlerInterface,
DomainEventSubscriberFactoryInterface, DomainEventSubscriberFactoryInterface,
} from '@standardnotes/domain-events' } from '@standardnotes/domain-events'
import { MapperInterface } from '@standardnotes/domain-core' import { MapperInterface, ServiceIdentifier } from '@standardnotes/domain-core'
// eslint-disable-next-line @typescript-eslint/no-var-requires // eslint-disable-next-line @typescript-eslint/no-var-requires
const Mixpanel = require('mixpanel') const Mixpanel = require('mixpanel')
@@ -18,7 +18,7 @@ import {
SNSDomainEventPublisher, SNSDomainEventPublisher,
SQSDomainEventSubscriberFactory, SQSDomainEventSubscriberFactory,
SQSEventMessageHandler, SQSEventMessageHandler,
SQSNewRelicEventMessageHandler, SQSXRayEventMessageHandler,
} from '@standardnotes/domain-events-infra' } from '@standardnotes/domain-events-infra'
import { Timer, TimerInterface } from '@standardnotes/time' import { Timer, TimerInterface } from '@standardnotes/time'
import { PeriodKeyGeneratorInterface } from '../Domain/Time/PeriodKeyGeneratorInterface' import { PeriodKeyGeneratorInterface } from '../Domain/Time/PeriodKeyGeneratorInterface'
@@ -57,6 +57,7 @@ import { SNSClient, SNSClientConfig } from '@aws-sdk/client-sns'
import { SQSClient, SQSClientConfig } from '@aws-sdk/client-sqs' import { SQSClient, SQSClientConfig } from '@aws-sdk/client-sqs'
import { SessionCreatedEventHandler } from '../Domain/Handler/SessionCreatedEventHandler' import { SessionCreatedEventHandler } from '../Domain/Handler/SessionCreatedEventHandler'
import { SessionRefreshedEventHandler } from '../Domain/Handler/SessionRefreshedEventHandler' import { SessionRefreshedEventHandler } from '../Domain/Handler/SessionRefreshedEventHandler'
import { captureAWSv3Client } from 'aws-xray-sdk'
export class ContainerConfigLoader { export class ContainerConfigLoader {
async load(): Promise<Container> { async load(): Promise<Container> {
@@ -107,7 +108,7 @@ export class ContainerConfigLoader {
secretAccessKey: env.get('SNS_SECRET_ACCESS_KEY', true), secretAccessKey: env.get('SNS_SECRET_ACCESS_KEY', true),
} }
} }
container.bind<SNSClient>(TYPES.SNS).toConstantValue(new SNSClient(snsConfig)) container.bind<SNSClient>(TYPES.SNS).toConstantValue(captureAWSv3Client(new SNSClient(snsConfig)))
if (env.get('SQS_QUEUE_URL', true)) { if (env.get('SQS_QUEUE_URL', true)) {
const sqsConfig: SQSClientConfig = { const sqsConfig: SQSClientConfig = {
@@ -122,7 +123,7 @@ export class ContainerConfigLoader {
secretAccessKey: env.get('SQS_SECRET_ACCESS_KEY', true), secretAccessKey: env.get('SQS_SECRET_ACCESS_KEY', true),
} }
} }
container.bind<SQSClient>(TYPES.SQS).toConstantValue(new SQSClient(sqsConfig)) container.bind<SQSClient>(TYPES.SQS).toConstantValue(captureAWSv3Client(new SQSClient(sqsConfig)))
} }
// env vars // env vars
@@ -246,7 +247,11 @@ export class ContainerConfigLoader {
.bind<DomainEventMessageHandlerInterface>(TYPES.DomainEventMessageHandler) .bind<DomainEventMessageHandlerInterface>(TYPES.DomainEventMessageHandler)
.toConstantValue( .toConstantValue(
env.get('NEW_RELIC_ENABLED', true) === 'true' env.get('NEW_RELIC_ENABLED', true) === 'true'
? new SQSNewRelicEventMessageHandler(eventHandlers, container.get(TYPES.Logger)) ? new SQSXRayEventMessageHandler(
ServiceIdentifier.NAMES.AnalyticsWorker,
eventHandlers,
container.get(TYPES.Logger),
)
: new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Logger)), : new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Logger)),
) )
container container
+24
View File
@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.77.1](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.77.0...@standardnotes/api-gateway@1.77.1) (2023-10-06)
**Note:** Version bump only for package @standardnotes/api-gateway
# [1.77.0](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.76.2...@standardnotes/api-gateway@1.77.0) (2023-10-05)
### Features
* setting xray segment user on api-gateway level ([3ee4941](https://github.com/standardnotes/api-gateway/commit/3ee49416f8e19207540141d98baa7f68880929bd))
## [1.76.2](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.76.1...@standardnotes/api-gateway@1.76.2) (2023-10-05)
**Note:** Version bump only for package @standardnotes/api-gateway
## [1.76.1](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.76.0...@standardnotes/api-gateway@1.76.1) (2023-10-05)
**Note:** Version bump only for package @standardnotes/api-gateway
# [1.76.0](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.75.13...@standardnotes/api-gateway@1.76.0) (2023-10-04)
### Features
* **api-gateaway:** configure aws-xray-sdk ([dc76113](https://github.com/standardnotes/api-gateway/commit/dc7611391515dd49a8e9b7ce8ac5e128cd7af0a8))
## [1.75.13](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.75.12...@standardnotes/api-gateway@1.75.13) (2023-10-04) ## [1.75.13](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.75.12...@standardnotes/api-gateway@1.75.13) (2023-10-04)
**Note:** Version bump only for package @standardnotes/api-gateway **Note:** Version bump only for package @standardnotes/api-gateway
+17
View File
@@ -29,6 +29,7 @@ import helmet from 'helmet'
import * as cors from 'cors' import * as cors from 'cors'
import { text, json, Request, Response, NextFunction } from 'express' import { text, json, Request, Response, NextFunction } from 'express'
import * as winston from 'winston' import * as winston from 'winston'
import * as AWSXRay from 'aws-xray-sdk'
// eslint-disable-next-line @typescript-eslint/no-var-requires // eslint-disable-next-line @typescript-eslint/no-var-requires
const robots = require('express-robots-txt') const robots = require('express-robots-txt')
@@ -36,15 +37,27 @@ import { InversifyExpressServer } from 'inversify-express-utils'
import { ContainerConfigLoader } from '../src/Bootstrap/Container' import { ContainerConfigLoader } from '../src/Bootstrap/Container'
import { TYPES } from '../src/Bootstrap/Types' import { TYPES } from '../src/Bootstrap/Types'
import { Env } from '../src/Bootstrap/Env' import { Env } from '../src/Bootstrap/Env'
import { ServiceIdentifier } from '@standardnotes/domain-core'
const container = new ContainerConfigLoader() const container = new ContainerConfigLoader()
void container.load().then((container) => { void container.load().then((container) => {
const env: Env = new Env() const env: Env = new Env()
env.load() env.load()
const isConfiguredForAWSProduction =
env.get('MODE', true) !== 'home-server' && env.get('MODE', true) !== 'self-hosted'
if (isConfiguredForAWSProduction) {
AWSXRay.config([AWSXRay.plugins.ECSPlugin])
}
const server = new InversifyExpressServer(container) const server = new InversifyExpressServer(container)
server.setConfig((app) => { server.setConfig((app) => {
if (isConfiguredForAWSProduction) {
app.use(AWSXRay.express.openSegment(ServiceIdentifier.NAMES.ApiGateway))
}
app.use((_request: Request, response: Response, next: NextFunction) => { app.use((_request: Request, response: Response, next: NextFunction) => {
response.setHeader('X-API-Gateway-Version', container.get(TYPES.ApiGateway_VERSION)) response.setHeader('X-API-Gateway-Version', container.get(TYPES.ApiGateway_VERSION))
next() next()
@@ -104,6 +117,10 @@ void container.load().then((container) => {
const serverInstance = server.build() const serverInstance = server.build()
if (isConfiguredForAWSProduction) {
serverInstance.use(AWSXRay.express.closeSegment())
}
serverInstance.listen(env.get('PORT')) serverInstance.listen(env.get('PORT'))
logger.info(`Server started on port ${process.env.PORT}`) logger.info(`Server started on port ${process.env.PORT}`)
+2 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@standardnotes/api-gateway", "name": "@standardnotes/api-gateway",
"version": "1.75.13", "version": "1.77.1",
"engines": { "engines": {
"node": ">=18.0.0 <21.0.0" "node": ">=18.0.0 <21.0.0"
}, },
@@ -31,6 +31,7 @@
"@standardnotes/domain-events-infra": "workspace:*", "@standardnotes/domain-events-infra": "workspace:*",
"@standardnotes/security": "workspace:*", "@standardnotes/security": "workspace:*",
"@standardnotes/time": "workspace:*", "@standardnotes/time": "workspace:*",
"aws-xray-sdk": "^3.5.2",
"axios": "^1.1.3", "axios": "^1.1.3",
"cors": "2.8.5", "cors": "2.8.5",
"dotenv": "^16.0.1", "dotenv": "^16.0.1",
@@ -35,6 +35,8 @@ export class ContainerConfigLoader {
const container = new Container() const container = new Container()
const isConfiguredForHomeServer = env.get('MODE', true) === 'home-server' const isConfiguredForHomeServer = env.get('MODE', true) === 'home-server'
const isConfiguredForSelfHosting = env.get('MODE', true) === 'self-hosted'
const isConfiguredForAWSProduction = !isConfiguredForHomeServer && !isConfiguredForSelfHosting
const isConfiguredForInMemoryCache = env.get('CACHE_TYPE', true) === 'memory' const isConfiguredForInMemoryCache = env.get('CACHE_TYPE', true) === 'memory'
const winstonFormatters = [winston.format.splat(), winston.format.json()] const winstonFormatters = [winston.format.splat(), winston.format.json()]
@@ -90,6 +92,9 @@ export class ContainerConfigLoader {
.bind(TYPES.ApiGateway_CROSS_SERVICE_TOKEN_CACHE_TTL) .bind(TYPES.ApiGateway_CROSS_SERVICE_TOKEN_CACHE_TTL)
.toConstantValue(+env.get('CROSS_SERVICE_TOKEN_CACHE_TTL', true)) .toConstantValue(+env.get('CROSS_SERVICE_TOKEN_CACHE_TTL', true))
container.bind(TYPES.ApiGateway_IS_CONFIGURED_FOR_HOME_SERVER).toConstantValue(isConfiguredForHomeServer) container.bind(TYPES.ApiGateway_IS_CONFIGURED_FOR_HOME_SERVER).toConstantValue(isConfiguredForHomeServer)
container
.bind<boolean>(TYPES.ApiGateway_IS_CONFIGURED_FOR_AWS_PRODUCTION)
.toConstantValue(isConfiguredForAWSProduction)
// Middleware // Middleware
container container
@@ -15,6 +15,7 @@ export const TYPES = {
ApiGateway_VERSION: Symbol.for('ApiGateway_VERSION'), ApiGateway_VERSION: Symbol.for('ApiGateway_VERSION'),
ApiGateway_CROSS_SERVICE_TOKEN_CACHE_TTL: Symbol.for('ApiGateway_CROSS_SERVICE_TOKEN_CACHE_TTL'), ApiGateway_CROSS_SERVICE_TOKEN_CACHE_TTL: Symbol.for('ApiGateway_CROSS_SERVICE_TOKEN_CACHE_TTL'),
ApiGateway_IS_CONFIGURED_FOR_HOME_SERVER: Symbol.for('ApiGateway_IS_CONFIGURED_FOR_HOME_SERVER'), ApiGateway_IS_CONFIGURED_FOR_HOME_SERVER: Symbol.for('ApiGateway_IS_CONFIGURED_FOR_HOME_SERVER'),
ApiGateway_IS_CONFIGURED_FOR_AWS_PRODUCTION: Symbol.for('ApiGateway_IS_CONFIGURED_FOR_AWS_PRODUCTION'),
// Middleware // Middleware
ApiGateway_RequiredCrossServiceTokenMiddleware: Symbol.for('ApiGateway_RequiredCrossServiceTokenMiddleware'), ApiGateway_RequiredCrossServiceTokenMiddleware: Symbol.for('ApiGateway_RequiredCrossServiceTokenMiddleware'),
ApiGateway_OptionalCrossServiceTokenMiddleware: Symbol.for('ApiGateway_OptionalCrossServiceTokenMiddleware'), ApiGateway_OptionalCrossServiceTokenMiddleware: Symbol.for('ApiGateway_OptionalCrossServiceTokenMiddleware'),
@@ -8,6 +8,7 @@ import { Logger } from 'winston'
import { CrossServiceTokenCacheInterface } from '../Service/Cache/CrossServiceTokenCacheInterface' import { CrossServiceTokenCacheInterface } from '../Service/Cache/CrossServiceTokenCacheInterface'
import { ServiceProxyInterface } from '../Service/Http/ServiceProxyInterface' import { ServiceProxyInterface } from '../Service/Http/ServiceProxyInterface'
import { Segment, getSegment } from 'aws-xray-sdk'
export abstract class AuthMiddleware extends BaseMiddleware { export abstract class AuthMiddleware extends BaseMiddleware {
constructor( constructor(
@@ -16,6 +17,7 @@ export abstract class AuthMiddleware extends BaseMiddleware {
private crossServiceTokenCacheTTL: number, private crossServiceTokenCacheTTL: number,
private crossServiceTokenCache: CrossServiceTokenCacheInterface, private crossServiceTokenCache: CrossServiceTokenCacheInterface,
private timer: TimerInterface, private timer: TimerInterface,
private isConfiguredForAWSProduction: boolean,
protected logger: Logger, protected logger: Logger,
) { ) {
super() super()
@@ -73,6 +75,13 @@ export abstract class AuthMiddleware extends BaseMiddleware {
response.locals.roles = decodedToken.roles response.locals.roles = decodedToken.roles
response.locals.sharedVaultOwnerContext = decodedToken.shared_vault_owner_context response.locals.sharedVaultOwnerContext = decodedToken.shared_vault_owner_context
response.locals.belongsToSharedVaults = decodedToken.belongs_to_shared_vaults ?? [] response.locals.belongsToSharedVaults = decodedToken.belongs_to_shared_vaults ?? []
if (this.isConfiguredForAWSProduction) {
const segment = getSegment()
if (segment instanceof Segment) {
segment.setUser(decodedToken.user.uuid)
}
}
} catch (error) { } catch (error) {
const errorMessage = (error as AxiosError).isAxiosError const errorMessage = (error as AxiosError).isAxiosError
? JSON.stringify((error as AxiosError).response?.data) ? JSON.stringify((error as AxiosError).response?.data)
@@ -16,9 +16,18 @@ export class OptionalCrossServiceTokenMiddleware extends AuthMiddleware {
@inject(TYPES.ApiGateway_CROSS_SERVICE_TOKEN_CACHE_TTL) crossServiceTokenCacheTTL: number, @inject(TYPES.ApiGateway_CROSS_SERVICE_TOKEN_CACHE_TTL) crossServiceTokenCacheTTL: number,
@inject(TYPES.ApiGateway_CrossServiceTokenCache) crossServiceTokenCache: CrossServiceTokenCacheInterface, @inject(TYPES.ApiGateway_CrossServiceTokenCache) crossServiceTokenCache: CrossServiceTokenCacheInterface,
@inject(TYPES.ApiGateway_Timer) timer: TimerInterface, @inject(TYPES.ApiGateway_Timer) timer: TimerInterface,
@inject(TYPES.ApiGateway_IS_CONFIGURED_FOR_AWS_PRODUCTION) isConfiguredForAWSProduction: boolean,
@inject(TYPES.ApiGateway_Logger) logger: Logger, @inject(TYPES.ApiGateway_Logger) logger: Logger,
) { ) {
super(serviceProxy, jwtSecret, crossServiceTokenCacheTTL, crossServiceTokenCache, timer, logger) super(
serviceProxy,
jwtSecret,
crossServiceTokenCacheTTL,
crossServiceTokenCache,
timer,
isConfiguredForAWSProduction,
logger,
)
} }
protected override handleSessionValidationResponse( protected override handleSessionValidationResponse(
@@ -16,9 +16,18 @@ export class RequiredCrossServiceTokenMiddleware extends AuthMiddleware {
@inject(TYPES.ApiGateway_CROSS_SERVICE_TOKEN_CACHE_TTL) crossServiceTokenCacheTTL: number, @inject(TYPES.ApiGateway_CROSS_SERVICE_TOKEN_CACHE_TTL) crossServiceTokenCacheTTL: number,
@inject(TYPES.ApiGateway_CrossServiceTokenCache) crossServiceTokenCache: CrossServiceTokenCacheInterface, @inject(TYPES.ApiGateway_CrossServiceTokenCache) crossServiceTokenCache: CrossServiceTokenCacheInterface,
@inject(TYPES.ApiGateway_Timer) timer: TimerInterface, @inject(TYPES.ApiGateway_Timer) timer: TimerInterface,
@inject(TYPES.ApiGateway_IS_CONFIGURED_FOR_AWS_PRODUCTION) isConfiguredForAWSProduction: boolean,
@inject(TYPES.ApiGateway_Logger) logger: Logger, @inject(TYPES.ApiGateway_Logger) logger: Logger,
) { ) {
super(serviceProxy, jwtSecret, crossServiceTokenCacheTTL, crossServiceTokenCache, timer, logger) super(
serviceProxy,
jwtSecret,
crossServiceTokenCacheTTL,
crossServiceTokenCache,
timer,
isConfiguredForAWSProduction,
logger,
)
} }
protected override handleSessionValidationResponse( protected override handleSessionValidationResponse(
+40
View File
@@ -3,6 +3,46 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.152.1](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.152.0...@standardnotes/auth-server@1.152.1) (2023-10-06)
### Bug Fixes
* **auth:** checking for transition role when triggering transition ([79a44aa](https://github.com/standardnotes/server/commit/79a44aa51f15311fcaf76c39f93d1934ec1d135d))
# [1.152.0](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.151.2...@standardnotes/auth-server@1.152.0) (2023-10-06)
### Bug Fixes
* **auth:** strip user from transition role after migration ([afe9967](https://github.com/standardnotes/server/commit/afe9967d26b5be02d1dc76a740df614d81a6984e))
### Features
* switch transition direction ([27bea44](https://github.com/standardnotes/server/commit/27bea444cce4964feda04bad64e5f12a07415e0c))
## [1.151.2](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.151.1...@standardnotes/auth-server@1.151.2) (2023-10-06)
### Bug Fixes
* add xray-sdk to background processors ([a45b5b6](https://github.com/standardnotes/server/commit/a45b5b69b5d68c2e696c30f0ba5ad22d313321e6))
## [1.151.1](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.151.0...@standardnotes/auth-server@1.151.1) (2023-10-06)
**Note:** Version bump only for package @standardnotes/auth-server
# [1.151.0](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.150.9...@standardnotes/auth-server@1.151.0) (2023-10-05)
### Features
* setting xray segment user on api-gateway level ([3ee4941](https://github.com/standardnotes/server/commit/3ee49416f8e19207540141d98baa7f68880929bd))
## [1.150.9](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.150.8...@standardnotes/auth-server@1.150.9) (2023-10-05)
**Note:** Version bump only for package @standardnotes/auth-server
## [1.150.8](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.150.7...@standardnotes/auth-server@1.150.8) (2023-10-05)
**Note:** Version bump only for package @standardnotes/auth-server
## [1.150.7](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.150.6...@standardnotes/auth-server@1.150.7) (2023-10-04) ## [1.150.7](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.150.6...@standardnotes/auth-server@1.150.7) (2023-10-04)
### Bug Fixes ### Bug Fixes
+9
View File
@@ -5,6 +5,7 @@ import { Stream } from 'stream'
import { Logger } from 'winston' import { Logger } from 'winston'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import * as utc from 'dayjs/plugin/utc' import * as utc from 'dayjs/plugin/utc'
import * as AWSXRay from 'aws-xray-sdk'
import { ContainerConfigLoader } from '../src/Bootstrap/Container' import { ContainerConfigLoader } from '../src/Bootstrap/Container'
import TYPES from '../src/Bootstrap/Types' import TYPES from '../src/Bootstrap/Types'
@@ -82,6 +83,14 @@ void container.load().then((container) => {
const env: Env = new Env() const env: Env = new Env()
env.load() env.load()
const isConfiguredForAWSProduction =
env.get('MODE', true) !== 'home-server' && env.get('MODE', true) !== 'self-hosted'
if (isConfiguredForAWSProduction) {
AWSXRay.enableManualMode()
AWSXRay.config([AWSXRay.plugins.ECSPlugin])
}
const logger: Logger = container.get(TYPES.Auth_Logger) const logger: Logger = container.get(TYPES.Auth_Logger)
logger.info(`Starting ${backupFrequency} ${backupProvider} backup requesting...`) logger.info(`Starting ${backupFrequency} ${backupProvider} backup requesting...`)
+9
View File
@@ -1,6 +1,7 @@
import 'reflect-metadata' import 'reflect-metadata'
import { Logger } from 'winston' import { Logger } from 'winston'
import * as AWSXRay from 'aws-xray-sdk'
import { ContainerConfigLoader } from '../src/Bootstrap/Container' import { ContainerConfigLoader } from '../src/Bootstrap/Container'
import TYPES from '../src/Bootstrap/Types' import TYPES from '../src/Bootstrap/Types'
@@ -23,6 +24,14 @@ void container.load().then((container) => {
const env: Env = new Env() const env: Env = new Env()
env.load() env.load()
const isConfiguredForAWSProduction =
env.get('MODE', true) !== 'home-server' && env.get('MODE', true) !== 'self-hosted'
if (isConfiguredForAWSProduction) {
AWSXRay.enableManualMode()
AWSXRay.config([AWSXRay.plugins.ECSPlugin])
}
const logger: Logger = container.get(TYPES.Auth_Logger) const logger: Logger = container.get(TYPES.Auth_Logger)
logger.info('Starting sessions and session traces cleanup') logger.info('Starting sessions and session traces cleanup')
+9
View File
@@ -2,6 +2,7 @@ import 'reflect-metadata'
import { Logger } from 'winston' import { Logger } from 'winston'
import { TimerInterface } from '@standardnotes/time' import { TimerInterface } from '@standardnotes/time'
import * as AWSXRay from 'aws-xray-sdk'
import { ContainerConfigLoader } from '../src/Bootstrap/Container' import { ContainerConfigLoader } from '../src/Bootstrap/Container'
import TYPES from '../src/Bootstrap/Types' import TYPES from '../src/Bootstrap/Types'
@@ -13,6 +14,14 @@ void container.load().then((container) => {
const env: Env = new Env() const env: Env = new Env()
env.load() env.load()
const isConfiguredForAWSProduction =
env.get('MODE', true) !== 'home-server' && env.get('MODE', true) !== 'self-hosted'
if (isConfiguredForAWSProduction) {
AWSXRay.enableManualMode()
AWSXRay.config([AWSXRay.plugins.ECSPlugin])
}
const logger: Logger = container.get(TYPES.Auth_Logger) const logger: Logger = container.get(TYPES.Auth_Logger)
logger.info('Starting session traces cleanup') logger.info('Starting session traces cleanup')
+10 -1
View File
@@ -3,6 +3,7 @@ import 'reflect-metadata'
import { Logger } from 'winston' import { Logger } from 'winston'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import * as utc from 'dayjs/plugin/utc' import * as utc from 'dayjs/plugin/utc'
import * as AWSXRay from 'aws-xray-sdk'
import { ContainerConfigLoader } from '../src/Bootstrap/Container' import { ContainerConfigLoader } from '../src/Bootstrap/Container'
import TYPES from '../src/Bootstrap/Types' import TYPES from '../src/Bootstrap/Types'
@@ -49,7 +50,7 @@ const requestTransition = async (
itemsTransitionStatus?.value === TransitionStatus.STATUSES.Verified && itemsTransitionStatus?.value === TransitionStatus.STATUSES.Verified &&
revisionsTransitionStatus?.value === TransitionStatus.STATUSES.Verified revisionsTransitionStatus?.value === TransitionStatus.STATUSES.Verified
if (userHasTransitionRole && bothTransitionStatusesAreVerified) { if (!userHasTransitionRole && bothTransitionStatusesAreVerified) {
continue continue
} }
@@ -102,6 +103,14 @@ void container.load().then((container) => {
const env: Env = new Env() const env: Env = new Env()
env.load() env.load()
const isConfiguredForAWSProduction =
env.get('MODE', true) !== 'home-server' && env.get('MODE', true) !== 'self-hosted'
if (isConfiguredForAWSProduction) {
AWSXRay.enableManualMode()
AWSXRay.config([AWSXRay.plugins.ECSPlugin])
}
const logger: Logger = container.get(TYPES.Auth_Logger) const logger: Logger = container.get(TYPES.Auth_Logger)
logger.info(`Starting transition request for users created between ${startDateString} and ${endDateString}`) logger.info(`Starting transition request for users created between ${startDateString} and ${endDateString}`)
+9
View File
@@ -3,6 +3,7 @@ import 'reflect-metadata'
import { Logger } from 'winston' import { Logger } from 'winston'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import * as utc from 'dayjs/plugin/utc' import * as utc from 'dayjs/plugin/utc'
import * as AWSXRay from 'aws-xray-sdk'
import { ContainerConfigLoader } from '../src/Bootstrap/Container' import { ContainerConfigLoader } from '../src/Bootstrap/Container'
import TYPES from '../src/Bootstrap/Types' import TYPES from '../src/Bootstrap/Types'
@@ -70,6 +71,14 @@ void container.load().then((container) => {
const env: Env = new Env() const env: Env = new Env()
env.load() env.load()
const isConfiguredForAWSProduction =
env.get('MODE', true) !== 'home-server' && env.get('MODE', true) !== 'self-hosted'
if (isConfiguredForAWSProduction) {
AWSXRay.enableManualMode()
AWSXRay.config([AWSXRay.plugins.ECSPlugin])
}
const logger: Logger = container.get(TYPES.Auth_Logger) const logger: Logger = container.get(TYPES.Auth_Logger)
logger.info(`Starting email backup requesting for ${backupEmail} ...`) logger.info(`Starting email backup requesting for ${backupEmail} ...`)
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@standardnotes/auth-server", "name": "@standardnotes/auth-server",
"version": "1.150.7", "version": "1.152.1",
"engines": { "engines": {
"node": ">=18.0.0 <21.0.0" "node": ">=18.0.0 <21.0.0"
}, },
-2
View File
@@ -747,7 +747,6 @@ export class ContainerConfigLoader {
.toConstantValue( .toConstantValue(
new RequiredCrossServiceTokenMiddleware( new RequiredCrossServiceTokenMiddleware(
container.get<TokenDecoderInterface<CrossServiceTokenData>>(TYPES.Auth_CrossServiceTokenDecoder), container.get<TokenDecoderInterface<CrossServiceTokenData>>(TYPES.Auth_CrossServiceTokenDecoder),
isConfiguredForAWSProduction && this.mode === 'server',
container.get<winston.Logger>(TYPES.Auth_Logger), container.get<winston.Logger>(TYPES.Auth_Logger),
), ),
) )
@@ -756,7 +755,6 @@ export class ContainerConfigLoader {
.toConstantValue( .toConstantValue(
new OptionalCrossServiceTokenMiddleware( new OptionalCrossServiceTokenMiddleware(
container.get<TokenDecoderInterface<CrossServiceTokenData>>(TYPES.Auth_CrossServiceTokenDecoder), container.get<TokenDecoderInterface<CrossServiceTokenData>>(TYPES.Auth_CrossServiceTokenDecoder),
isConfiguredForAWSProduction && this.mode === 'server',
container.get<winston.Logger>(TYPES.Auth_Logger), container.get<winston.Logger>(TYPES.Auth_Logger),
), ),
) )
@@ -118,6 +118,40 @@ describe('RoleService', () => {
}) })
}) })
describe('removing roles', () => {
beforeEach(() => {
user = {
uuid: '123',
email: 'test@test.com',
roles: Promise.resolve([basicRole]),
} as jest.Mocked<User>
userRepository.findOneByUuid = jest.fn().mockReturnValue(user)
userRepository.save = jest.fn().mockReturnValue(user)
})
it('should remove a role from a user', async () => {
await createService().removeRoleFromUser(
Uuid.create('00000000-0000-0000-0000-000000000000').getValue(),
RoleName.create(RoleName.NAMES.CoreUser).getValue(),
)
user.roles = Promise.resolve([])
expect(userRepository.save).toHaveBeenCalledWith(user)
})
it('should not remove a role from a user if the user could not be found', async () => {
userRepository.findOneByUuid = jest.fn().mockReturnValue(null)
await createService().removeRoleFromUser(
Uuid.create('00000000-0000-0000-0000-000000000000').getValue(),
RoleName.create(RoleName.NAMES.CoreUser).getValue(),
)
expect(userRepository.save).not.toHaveBeenCalled()
})
})
describe('adding roles based on subscription', () => { describe('adding roles based on subscription', () => {
beforeEach(() => { beforeEach(() => {
user = { user = {
@@ -65,6 +65,17 @@ export class RoleService implements RoleServiceInterface {
await this.addToExistingRoles(user, roleName.value) await this.addToExistingRoles(user, roleName.value)
} }
async removeRoleFromUser(userUuid: Uuid, roleName: RoleName): Promise<void> {
const user = await this.userRepository.findOneByUuid(userUuid)
if (user === null) {
this.logger.error(`Could not find user with uuid ${userUuid.value} to remove role ${roleName.value}`)
return
}
await this.removeUserRole(user, roleName.value)
}
async addUserRoleBasedOnSubscription(user: User, subscriptionName: SubscriptionName): Promise<void> { async addUserRoleBasedOnSubscription(user: User, subscriptionName: SubscriptionName): Promise<void> {
const roleName = this.roleToSubscriptionMap.getRoleNameForSubscriptionName(subscriptionName) const roleName = this.roleToSubscriptionMap.getRoleNameForSubscriptionName(subscriptionName)
@@ -108,9 +119,15 @@ export class RoleService implements RoleServiceInterface {
return return
} }
await this.removeUserRole(user, roleName)
}
private async removeUserRole(user: User, roleName: string): Promise<void> {
const currentRoles = await user.roles const currentRoles = await user.roles
user.roles = Promise.resolve(currentRoles.filter((role) => role.name !== roleName)) user.roles = Promise.resolve(currentRoles.filter((role) => role.name !== roleName))
await this.userRepository.save(user) await this.userRepository.save(user)
await this.webSocketsClientService.sendUserRolesChangedEvent(user) await this.webSocketsClientService.sendUserRolesChangedEvent(user)
} }
@@ -5,6 +5,7 @@ import { User } from '../User/User'
export interface RoleServiceInterface { export interface RoleServiceInterface {
addRoleToUser(userUuid: Uuid, roleName: RoleName): Promise<void> addRoleToUser(userUuid: Uuid, roleName: RoleName): Promise<void>
removeRoleFromUser(userUuid: Uuid, roleName: RoleName): Promise<void>
addUserRoleBasedOnSubscription(user: User, subscriptionName: string): Promise<void> addUserRoleBasedOnSubscription(user: User, subscriptionName: string): Promise<void>
setOfflineUserRole(offlineUserSubscription: OfflineUserSubscription): Promise<void> setOfflineUserRole(offlineUserSubscription: OfflineUserSubscription): Promise<void>
removeUserRoleBasedOnSubscription(user: User, subscriptionName: string): Promise<void> removeUserRoleBasedOnSubscription(user: User, subscriptionName: string): Promise<void>
@@ -21,7 +21,7 @@ describe('UpdateTransitionStatus', () => {
transitionStatusRepository.getStatus = jest.fn().mockResolvedValue(null) transitionStatusRepository.getStatus = jest.fn().mockResolvedValue(null)
roleService = {} as jest.Mocked<RoleServiceInterface> roleService = {} as jest.Mocked<RoleServiceInterface>
roleService.addRoleToUser = jest.fn() roleService.removeRoleFromUser = jest.fn()
}) })
it('should add TRANSITION_USER role', async () => { it('should add TRANSITION_USER role', async () => {
@@ -35,7 +35,7 @@ describe('UpdateTransitionStatus', () => {
}) })
expect(result.isFailed()).toBeFalsy() expect(result.isFailed()).toBeFalsy()
expect(roleService.addRoleToUser).toHaveBeenCalledWith( expect(roleService.removeRoleFromUser).toHaveBeenCalledWith(
Uuid.create('00000000-0000-0000-0000-000000000000').getValue(), Uuid.create('00000000-0000-0000-0000-000000000000').getValue(),
RoleName.create(RoleName.NAMES.TransitionUser).getValue(), RoleName.create(RoleName.NAMES.TransitionUser).getValue(),
) )
@@ -32,7 +32,7 @@ export class UpdateTransitionStatus implements UseCaseInterface<void> {
await this.transitionStatusRepository.updateStatus(dto.userUuid, dto.transitionType, transitionStatus) await this.transitionStatusRepository.updateStatus(dto.userUuid, dto.transitionType, transitionStatus)
if (dto.transitionType === 'items' && transitionStatus.value === TransitionStatus.STATUSES.Verified) { if (dto.transitionType === 'items' && transitionStatus.value === TransitionStatus.STATUSES.Verified) {
await this.roleService.addRoleToUser(userUuid, RoleName.create(RoleName.NAMES.TransitionUser).getValue()) await this.roleService.removeRoleFromUser(userUuid, RoleName.create(RoleName.NAMES.TransitionUser).getValue())
} }
return Result.ok() return Result.ok()
@@ -2,12 +2,10 @@ import { CrossServiceTokenData, TokenDecoderInterface } from '@standardnotes/sec
import { NextFunction, Request, Response } from 'express' import { NextFunction, Request, Response } from 'express'
import { BaseMiddleware } from 'inversify-express-utils' import { BaseMiddleware } from 'inversify-express-utils'
import { Logger } from 'winston' import { Logger } from 'winston'
import { Segment, getSegment } from 'aws-xray-sdk'
export abstract class ApiGatewayAuthMiddleware extends BaseMiddleware { export abstract class ApiGatewayAuthMiddleware extends BaseMiddleware {
constructor( constructor(
private tokenDecoder: TokenDecoderInterface<CrossServiceTokenData>, private tokenDecoder: TokenDecoderInterface<CrossServiceTokenData>,
private isConfiguredForAWSProduction: boolean,
private logger: Logger, private logger: Logger,
) { ) {
super() super()
@@ -41,13 +39,6 @@ export abstract class ApiGatewayAuthMiddleware extends BaseMiddleware {
response.locals.session = token.session response.locals.session = token.session
response.locals.readOnlyAccess = token.session?.readonly_access ?? false response.locals.readOnlyAccess = token.session?.readonly_access ?? false
if (this.isConfiguredForAWSProduction) {
const segment = getSegment()
if (segment instanceof Segment) {
segment.setUser(token.user.uuid)
}
}
return next() return next()
} catch (error) { } catch (error) {
return next(error) return next(error)
@@ -5,12 +5,8 @@ import { Logger } from 'winston'
import { ApiGatewayAuthMiddleware } from './ApiGatewayAuthMiddleware' import { ApiGatewayAuthMiddleware } from './ApiGatewayAuthMiddleware'
export class OptionalCrossServiceTokenMiddleware extends ApiGatewayAuthMiddleware { export class OptionalCrossServiceTokenMiddleware extends ApiGatewayAuthMiddleware {
constructor( constructor(tokenDecoder: TokenDecoderInterface<CrossServiceTokenData>, logger: Logger) {
tokenDecoder: TokenDecoderInterface<CrossServiceTokenData>, super(tokenDecoder, logger)
isConfiguredForAWSProduction: boolean,
logger: Logger,
) {
super(tokenDecoder, isConfiguredForAWSProduction, logger)
} }
protected override handleMissingToken(request: Request, _response: Response, next: NextFunction): boolean { protected override handleMissingToken(request: Request, _response: Response, next: NextFunction): boolean {
@@ -5,12 +5,8 @@ import { Logger } from 'winston'
import { ApiGatewayAuthMiddleware } from './ApiGatewayAuthMiddleware' import { ApiGatewayAuthMiddleware } from './ApiGatewayAuthMiddleware'
export class RequiredCrossServiceTokenMiddleware extends ApiGatewayAuthMiddleware { export class RequiredCrossServiceTokenMiddleware extends ApiGatewayAuthMiddleware {
constructor( constructor(tokenDecoder: TokenDecoderInterface<CrossServiceTokenData>, logger: Logger) {
tokenDecoder: TokenDecoderInterface<CrossServiceTokenData>, super(tokenDecoder, logger)
isConfiguredForAWSProduction: boolean,
logger: Logger,
) {
super(tokenDecoder, isConfiguredForAWSProduction, logger)
} }
protected override handleMissingToken(request: Request, response: Response, _next: NextFunction): boolean { protected override handleMissingToken(request: Request, response: Response, _next: NextFunction): boolean {
@@ -4,7 +4,7 @@ import { TransitionStatusRepositoryInterface } from '../../Domain/Transition/Tra
import { TransitionStatus } from '@standardnotes/domain-core' import { TransitionStatus } from '@standardnotes/domain-core'
export class RedisTransitionStatusRepository implements TransitionStatusRepositoryInterface { export class RedisTransitionStatusRepository implements TransitionStatusRepositoryInterface {
private readonly PREFIX = 'transition' private readonly PREFIX = 'transition-back'
constructor(private redisClient: IORedis.Redis) {} constructor(private redisClient: IORedis.Redis) {}
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.35.0](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.34.2...@standardnotes/domain-core@1.35.0) (2023-10-06)
### Features
* add xray to analytics scheduler and websockets ([f0531d6](https://github.com/standardnotes/server/commit/f0531d68cb77036222f2a34602819f11e6a2697d))
## [1.34.2](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.34.1...@standardnotes/domain-core@1.34.2) (2023-10-04) ## [1.34.2](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.34.1...@standardnotes/domain-core@1.34.2) (2023-10-04)
### Bug Fixes ### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@standardnotes/domain-core", "name": "@standardnotes/domain-core",
"version": "1.34.2", "version": "1.35.0",
"engines": { "engines": {
"node": ">=18.0.0 <21.0.0" "node": ">=18.0.0 <21.0.0"
}, },
@@ -4,6 +4,7 @@ import { ServiceIdentifierProps } from './ServiceIdentifierProps'
export class ServiceIdentifier extends ValueObject<ServiceIdentifierProps> { export class ServiceIdentifier extends ValueObject<ServiceIdentifierProps> {
static readonly NAMES = { static readonly NAMES = {
AnalyticsWorker: 'AnalyticsWorker',
ApiGateway: 'ApiGateway', ApiGateway: 'ApiGateway',
Auth: 'Auth', Auth: 'Auth',
AuthWorker: 'AuthWorker', AuthWorker: 'AuthWorker',
@@ -13,6 +14,11 @@ export class ServiceIdentifier extends ValueObject<ServiceIdentifierProps> {
RevisionsWorker: 'RevisionsWorker', RevisionsWorker: 'RevisionsWorker',
Files: 'Files', Files: 'Files',
FilesWorker: 'FilesWorker', FilesWorker: 'FilesWorker',
SchedulerWorker: 'SchedulerWorker',
Email: 'Email',
EmailWorker: 'EmailWorker',
Websockets: 'Websockets',
WebsocketsWorker: 'WebsocketsWorker',
} }
get value(): string { get value(): string {
+16
View File
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.14.8](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.14.7...@standardnotes/domain-events-infra@1.14.8) (2023-10-06)
**Note:** Version bump only for package @standardnotes/domain-events-infra
## [1.14.7](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.14.6...@standardnotes/domain-events-infra@1.14.7) (2023-10-05)
### Reverts
* Revert "fix(domain-events-infra): setting user metadata on workers" ([cd37c95](https://github.com/standardnotes/server/commit/cd37c951bbec0f1bf6443792db961efd27380eac))
## [1.14.6](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.14.5...@standardnotes/domain-events-infra@1.14.6) (2023-10-05)
### Bug Fixes
* **domain-events-infra:** setting user metadata on workers ([c4b6f17](https://github.com/standardnotes/server/commit/c4b6f17ebcfe7bd77b6741f881a0d1f13ba809a4))
## [1.14.5](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.14.4...@standardnotes/domain-events-infra@1.14.5) (2023-10-04) ## [1.14.5](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.14.4...@standardnotes/domain-events-infra@1.14.5) (2023-10-04)
### Bug Fixes ### Bug Fixes
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@standardnotes/domain-events-infra", "name": "@standardnotes/domain-events-infra",
"version": "1.14.5", "version": "1.14.8",
"engines": { "engines": {
"node": ">=18.0.0 <21.0.0" "node": ">=18.0.0 <21.0.0"
}, },
@@ -30,7 +30,7 @@
"aws-xray-sdk": "^3.5.2", "aws-xray-sdk": "^3.5.2",
"ioredis": "^5.2.4", "ioredis": "^5.2.4",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"sqs-consumer": "^6.2.1", "sqs-consumer": "^7.3.0",
"winston": "^3.8.1" "winston": "^3.8.1"
}, },
"devDependencies": { "devDependencies": {
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.12.11](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.12.10...@standardnotes/event-store@1.12.11) (2023-10-06)
**Note:** Version bump only for package @standardnotes/event-store
## [1.12.10](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.12.9...@standardnotes/event-store@1.12.10) (2023-10-05)
**Note:** Version bump only for package @standardnotes/event-store
## [1.12.9](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.12.8...@standardnotes/event-store@1.12.9) (2023-10-05)
**Note:** Version bump only for package @standardnotes/event-store
## [1.12.8](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.12.7...@standardnotes/event-store@1.12.8) (2023-10-04) ## [1.12.8](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.12.7...@standardnotes/event-store@1.12.8) (2023-10-04)
**Note:** Version bump only for package @standardnotes/event-store **Note:** Version bump only for package @standardnotes/event-store
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@standardnotes/event-store", "name": "@standardnotes/event-store",
"version": "1.12.8", "version": "1.12.11",
"description": "Event Store Service", "description": "Event Store Service",
"private": true, "private": true,
"main": "dist/src/index.js", "main": "dist/src/index.js",
+18
View File
@@ -3,6 +3,24 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.26.3](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.26.2...@standardnotes/files-server@1.26.3) (2023-10-06)
**Note:** Version bump only for package @standardnotes/files-server
## [1.26.2](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.26.1...@standardnotes/files-server@1.26.2) (2023-10-05)
**Note:** Version bump only for package @standardnotes/files-server
## [1.26.1](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.26.0...@standardnotes/files-server@1.26.1) (2023-10-05)
**Note:** Version bump only for package @standardnotes/files-server
# [1.26.0](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.25.6...@standardnotes/files-server@1.26.0) (2023-10-04)
### Features
* add xray to syncing server and files ([6583ff6](https://github.com/standardnotes/files/commit/6583ff6cd90f7881c1a79c0f904f1b1db96fc5b3))
## [1.25.6](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.25.5...@standardnotes/files-server@1.25.6) (2023-10-04) ## [1.25.6](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.25.5...@standardnotes/files-server@1.25.6) (2023-10-04)
**Note:** Version bump only for package @standardnotes/files-server **Note:** Version bump only for package @standardnotes/files-server
+17
View File
@@ -10,6 +10,7 @@ import helmet from 'helmet'
import * as cors from 'cors' import * as cors from 'cors'
import { urlencoded, json, raw, Request, Response, NextFunction } from 'express' import { urlencoded, json, raw, Request, Response, NextFunction } from 'express'
import * as winston from 'winston' import * as winston from 'winston'
import * as AWSXRay from 'aws-xray-sdk'
// eslint-disable-next-line @typescript-eslint/no-var-requires // eslint-disable-next-line @typescript-eslint/no-var-requires
const robots = require('express-robots-txt') const robots = require('express-robots-txt')
@@ -17,15 +18,27 @@ import { InversifyExpressServer } from 'inversify-express-utils'
import { ContainerConfigLoader } from '../src/Bootstrap/Container' import { ContainerConfigLoader } from '../src/Bootstrap/Container'
import TYPES from '../src/Bootstrap/Types' import TYPES from '../src/Bootstrap/Types'
import { Env } from '../src/Bootstrap/Env' import { Env } from '../src/Bootstrap/Env'
import { ServiceIdentifier } from '@standardnotes/domain-core'
const container = new ContainerConfigLoader() const container = new ContainerConfigLoader()
void container.load().then((container) => { void container.load().then((container) => {
const env: Env = new Env() const env: Env = new Env()
env.load() env.load()
const isConfiguredForAWSProduction =
env.get('MODE', true) !== 'home-server' && env.get('MODE', true) !== 'self-hosted'
if (isConfiguredForAWSProduction) {
AWSXRay.config([AWSXRay.plugins.ECSPlugin])
}
const server = new InversifyExpressServer(container) const server = new InversifyExpressServer(container)
server.setConfig((app) => { server.setConfig((app) => {
if (isConfiguredForAWSProduction) {
app.use(AWSXRay.express.openSegment(ServiceIdentifier.NAMES.Files))
}
app.use((_request: Request, response: Response, next: NextFunction) => { app.use((_request: Request, response: Response, next: NextFunction) => {
response.setHeader('X-Files-Version', container.get(TYPES.Files_VERSION)) response.setHeader('X-Files-Version', container.get(TYPES.Files_VERSION))
next() next()
@@ -90,6 +103,10 @@ void container.load().then((container) => {
const serverInstance = server.build() const serverInstance = server.build()
if (isConfiguredForAWSProduction) {
serverInstance.use(AWSXRay.express.closeSegment())
}
serverInstance.listen(env.get('PORT')) serverInstance.listen(env.get('PORT'))
logger.info(`Server started on port ${process.env.PORT}`) logger.info(`Server started on port ${process.env.PORT}`)
+9
View File
@@ -8,6 +8,7 @@ import { Env } from '../src/Bootstrap/Env'
import { DomainEventSubscriberFactoryInterface } from '@standardnotes/domain-events' import { DomainEventSubscriberFactoryInterface } from '@standardnotes/domain-events'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import * as utc from 'dayjs/plugin/utc' import * as utc from 'dayjs/plugin/utc'
import * as AWSXRay from 'aws-xray-sdk'
const container = new ContainerConfigLoader() const container = new ContainerConfigLoader()
void container.load().then((container) => { void container.load().then((container) => {
@@ -16,6 +17,14 @@ void container.load().then((container) => {
const env: Env = new Env() const env: Env = new Env()
env.load() env.load()
const isConfiguredForAWSProduction =
env.get('MODE', true) !== 'home-server' && env.get('MODE', true) !== 'self-hosted'
if (isConfiguredForAWSProduction) {
AWSXRay.enableManualMode()
AWSXRay.config([AWSXRay.plugins.ECSPlugin])
}
const logger: Logger = container.get(TYPES.Files_Logger) const logger: Logger = container.get(TYPES.Files_Logger)
logger.info('Starting worker...') logger.info('Starting worker...')
+2 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@standardnotes/files-server", "name": "@standardnotes/files-server",
"version": "1.25.6", "version": "1.26.3",
"engines": { "engines": {
"node": ">=18.0.0 <21.0.0" "node": ">=18.0.0 <21.0.0"
}, },
@@ -37,6 +37,7 @@
"@standardnotes/sncrypto-common": "^1.13.4", "@standardnotes/sncrypto-common": "^1.13.4",
"@standardnotes/sncrypto-node": "workspace:*", "@standardnotes/sncrypto-node": "workspace:*",
"@standardnotes/time": "workspace:*", "@standardnotes/time": "workspace:*",
"aws-xray-sdk": "^3.5.2",
"connect-busboy": "^1.0.0", "connect-busboy": "^1.0.0",
"cors": "^2.8.5", "cors": "^2.8.5",
"dayjs": "^1.11.6", "dayjs": "^1.11.6",
+24 -5
View File
@@ -1,5 +1,6 @@
import * as winston from 'winston' import * as winston from 'winston'
import Redis from 'ioredis' import Redis from 'ioredis'
import { captureAWSv3Client } from 'aws-xray-sdk'
import { SNSClient, SNSClientConfig } from '@aws-sdk/client-sns' import { SNSClient, SNSClientConfig } from '@aws-sdk/client-sns'
import { SQSClient, SQSClientConfig } from '@aws-sdk/client-sqs' import { SQSClient, SQSClientConfig } from '@aws-sdk/client-sqs'
import { S3Client, S3ClientConfig } from '@aws-sdk/client-s3' import { S3Client, S3ClientConfig } from '@aws-sdk/client-s3'
@@ -19,7 +20,7 @@ import {
SNSDomainEventPublisher, SNSDomainEventPublisher,
SQSDomainEventSubscriberFactory, SQSDomainEventSubscriberFactory,
SQSEventMessageHandler, SQSEventMessageHandler,
SQSNewRelicEventMessageHandler, SQSXRayEventMessageHandler,
} from '@standardnotes/domain-events-infra' } from '@standardnotes/domain-events-infra'
import { StreamDownloadFile } from '../Domain/UseCase/StreamDownloadFile/StreamDownloadFile' import { StreamDownloadFile } from '../Domain/UseCase/StreamDownloadFile/StreamDownloadFile'
import { FileDownloaderInterface } from '../Domain/Services/FileDownloaderInterface' import { FileDownloaderInterface } from '../Domain/Services/FileDownloaderInterface'
@@ -53,6 +54,7 @@ import { S3FileMover } from '../Infra/S3/S3FileMover'
import { FSFileMover } from '../Infra/FS/FSFileMover' import { FSFileMover } from '../Infra/FS/FSFileMover'
import { MoveFile } from '../Domain/UseCase/MoveFile/MoveFile' import { MoveFile } from '../Domain/UseCase/MoveFile/MoveFile'
import { SharedVaultValetTokenAuthMiddleware } from '../Infra/InversifyExpress/Middleware/SharedVaultValetTokenAuthMiddleware' import { SharedVaultValetTokenAuthMiddleware } from '../Infra/InversifyExpress/Middleware/SharedVaultValetTokenAuthMiddleware'
import { ServiceIdentifier } from '@standardnotes/domain-core'
export class ContainerConfigLoader { export class ContainerConfigLoader {
async load(configuration?: { async load(configuration?: {
@@ -83,7 +85,9 @@ export class ContainerConfigLoader {
.toConstantValue(env.get('FILE_UPLOAD_PATH', true) ?? `${__dirname}/../../uploads`) .toConstantValue(env.get('FILE_UPLOAD_PATH', true) ?? `${__dirname}/../../uploads`)
const isConfiguredForHomeServer = env.get('MODE', true) === 'home-server' const isConfiguredForHomeServer = env.get('MODE', true) === 'home-server'
const isConfiguredForSelfHosting = env.get('MODE', true) === 'self-hosted'
const isConfiguredForInMemoryCache = env.get('CACHE_TYPE', true) === 'memory' const isConfiguredForInMemoryCache = env.get('CACHE_TYPE', true) === 'memory'
const isConfiguredForAWSProduction = !isConfiguredForHomeServer && !isConfiguredForSelfHosting
let logger: winston.Logger let logger: winston.Logger
if (configuration?.logger) { if (configuration?.logger) {
@@ -149,7 +153,11 @@ export class ContainerConfigLoader {
secretAccessKey: env.get('SNS_SECRET_ACCESS_KEY', true), secretAccessKey: env.get('SNS_SECRET_ACCESS_KEY', true),
} }
} }
container.bind<SNSClient>(TYPES.Files_SNS).toConstantValue(new SNSClient(snsConfig)) let snsClient = new SNSClient(snsConfig)
if (isConfiguredForAWSProduction) {
snsClient = captureAWSv3Client(snsClient)
}
container.bind<SNSClient>(TYPES.Files_SNS).toConstantValue(snsClient)
} }
if (env.get('SQS_QUEUE_URL', true)) { if (env.get('SQS_QUEUE_URL', true)) {
@@ -165,7 +173,11 @@ export class ContainerConfigLoader {
secretAccessKey: env.get('SQS_SECRET_ACCESS_KEY', true), secretAccessKey: env.get('SQS_SECRET_ACCESS_KEY', true),
} }
} }
container.bind<SQSClient>(TYPES.Files_SQS).toConstantValue(new SQSClient(sqsConfig)) let sqsClient = new SQSClient(sqsConfig)
if (isConfiguredForAWSProduction) {
sqsClient = captureAWSv3Client(sqsClient)
}
container.bind<SQSClient>(TYPES.Files_SQS).toConstantValue(sqsClient)
} }
container container
@@ -185,7 +197,10 @@ export class ContainerConfigLoader {
if (env.get('S3_ENDPOINT', true)) { if (env.get('S3_ENDPOINT', true)) {
s3Opts.endpoint = env.get('S3_ENDPOINT', true) s3Opts.endpoint = env.get('S3_ENDPOINT', true)
} }
const s3Client = new S3Client(s3Opts) let s3Client = new S3Client(s3Opts)
if (isConfiguredForAWSProduction) {
s3Client = captureAWSv3Client(s3Client)
}
container.bind<S3Client>(TYPES.Files_S3).toConstantValue(s3Client) container.bind<S3Client>(TYPES.Files_S3).toConstantValue(s3Client)
container.bind<FileDownloaderInterface>(TYPES.Files_FileDownloader).to(S3FileDownloader) container.bind<FileDownloaderInterface>(TYPES.Files_FileDownloader).to(S3FileDownloader)
container.bind<FileUploaderInterface>(TYPES.Files_FileUploader).to(S3FileUploader) container.bind<FileUploaderInterface>(TYPES.Files_FileUploader).to(S3FileUploader)
@@ -292,7 +307,11 @@ export class ContainerConfigLoader {
.bind<DomainEventMessageHandlerInterface>(TYPES.Files_DomainEventMessageHandler) .bind<DomainEventMessageHandlerInterface>(TYPES.Files_DomainEventMessageHandler)
.toConstantValue( .toConstantValue(
env.get('NEW_RELIC_ENABLED', true) === 'true' env.get('NEW_RELIC_ENABLED', true) === 'true'
? new SQSNewRelicEventMessageHandler(eventHandlers, container.get(TYPES.Files_Logger)) ? new SQSXRayEventMessageHandler(
ServiceIdentifier.NAMES.FilesWorker,
eventHandlers,
container.get(TYPES.Files_Logger),
)
: new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Files_Logger)), : new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Files_Logger)),
) )
container container
+48
View File
@@ -3,6 +3,54 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.16.35](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.34...@standardnotes/home-server@1.16.35) (2023-10-09)
**Note:** Version bump only for package @standardnotes/home-server
## [1.16.34](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.33...@standardnotes/home-server@1.16.34) (2023-10-06)
**Note:** Version bump only for package @standardnotes/home-server
## [1.16.33](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.32...@standardnotes/home-server@1.16.33) (2023-10-06)
**Note:** Version bump only for package @standardnotes/home-server
## [1.16.32](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.31...@standardnotes/home-server@1.16.32) (2023-10-06)
**Note:** Version bump only for package @standardnotes/home-server
## [1.16.31](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.30...@standardnotes/home-server@1.16.31) (2023-10-06)
**Note:** Version bump only for package @standardnotes/home-server
## [1.16.30](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.29...@standardnotes/home-server@1.16.30) (2023-10-06)
**Note:** Version bump only for package @standardnotes/home-server
## [1.16.29](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.28...@standardnotes/home-server@1.16.29) (2023-10-06)
**Note:** Version bump only for package @standardnotes/home-server
## [1.16.28](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.27...@standardnotes/home-server@1.16.28) (2023-10-05)
**Note:** Version bump only for package @standardnotes/home-server
## [1.16.27](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.26...@standardnotes/home-server@1.16.27) (2023-10-05)
**Note:** Version bump only for package @standardnotes/home-server
## [1.16.26](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.25...@standardnotes/home-server@1.16.26) (2023-10-05)
**Note:** Version bump only for package @standardnotes/home-server
## [1.16.25](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.24...@standardnotes/home-server@1.16.25) (2023-10-05)
**Note:** Version bump only for package @standardnotes/home-server
## [1.16.24](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.23...@standardnotes/home-server@1.16.24) (2023-10-04)
**Note:** Version bump only for package @standardnotes/home-server
## [1.16.23](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.22...@standardnotes/home-server@1.16.23) (2023-10-04) ## [1.16.23](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.22...@standardnotes/home-server@1.16.23) (2023-10-04)
**Note:** Version bump only for package @standardnotes/home-server **Note:** Version bump only for package @standardnotes/home-server
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@standardnotes/home-server", "name": "@standardnotes/home-server",
"version": "1.16.23", "version": "1.16.35",
"engines": { "engines": {
"node": ">=18.0.0 <21.0.0" "node": ">=18.0.0 <21.0.0"
}, },

Some files were not shown because too many files have changed in this diff Show More