Added Integration Name in version mismatch emails

refs https://github.com/TryGhost/Toolbox/issues/292

- Providing user-defined Integration name instead of API client's UserAgent gives a lot more control to instance administrators identifying which integration is being used incorrectly.
- It's best practice to create an Integration with a set of API keys per API client - which should be enough to identify an outdated one.
This commit is contained in:
Naz 2022-05-10 17:44:48 +08:00
parent 6cca515eae
commit 6934595053
3 changed files with 25 additions and 15 deletions

View File

@ -14,6 +14,7 @@ const init = () => {
serviceInstance = new APIVersionCompatibilityService({ serviceInstance = new APIVersionCompatibilityService({
UserModel: models.User, UserModel: models.User,
ApiKeyModel: models.ApiKey,
settingsService: settingsService.getSettingsBREADServiceInstance(), settingsService: settingsService.getSettingsBREADServiceInstance(),
sendEmail: (options) => { sendEmail: (options) => {
// NOTE: not using bind here because mockMailer is having trouble mocking bound methods // NOTE: not using bind here because mockMailer is having trouble mocking bound methods

View File

@ -58,7 +58,7 @@
"@sentry/node": "6.19.7", "@sentry/node": "6.19.7",
"@tryghost/adapter-manager": "0.2.30", "@tryghost/adapter-manager": "0.2.30",
"@tryghost/admin-api-schema": "2.16.0", "@tryghost/admin-api-schema": "2.16.0",
"@tryghost/api-version-compatibility-service": "0.3.1", "@tryghost/api-version-compatibility-service": "0.4.0",
"@tryghost/bookshelf-plugins": "0.4.1", "@tryghost/bookshelf-plugins": "0.4.1",
"@tryghost/bootstrap-socket": "0.2.19", "@tryghost/bootstrap-socket": "0.2.19",
"@tryghost/color-utils": "0.1.16", "@tryghost/color-utils": "0.1.16",
@ -93,7 +93,7 @@
"@tryghost/members-stripe-service": "0.10.3", "@tryghost/members-stripe-service": "0.10.3",
"@tryghost/metrics": "1.0.11", "@tryghost/metrics": "1.0.11",
"@tryghost/minifier": "0.1.14", "@tryghost/minifier": "0.1.14",
"@tryghost/mw-api-version-mismatch": "0.1.4", "@tryghost/mw-api-version-mismatch": "0.2.0",
"@tryghost/mw-error-handler": "1.0.0", "@tryghost/mw-error-handler": "1.0.0",
"@tryghost/mw-session-from-token": "0.1.31", "@tryghost/mw-session-from-token": "0.1.31",
"@tryghost/nodemailer": "0.3.22", "@tryghost/nodemailer": "0.3.22",

View File

@ -1727,13 +1727,13 @@
"@tryghost/errors" "^1.0.0" "@tryghost/errors" "^1.0.0"
lodash "^4.17.11" lodash "^4.17.11"
"@tryghost/api-version-compatibility-service@0.3.1": "@tryghost/api-version-compatibility-service@0.4.0":
version "0.3.1" version "0.4.0"
resolved "https://registry.yarnpkg.com/@tryghost/api-version-compatibility-service/-/api-version-compatibility-service-0.3.1.tgz#b7a656c18fdd31131f74d450aa70897f9ed47742" resolved "https://registry.yarnpkg.com/@tryghost/api-version-compatibility-service/-/api-version-compatibility-service-0.4.0.tgz#336585ec9a368e9192dd1c6d990d9bfb4dd72d38"
integrity sha512-LioWdzPbouxHQ+btLz+XpbLvTonF31x2EkbDmjxqoe2V751RMdJHG226HlqQP5vnrC0Jew7gKLMmQzsUSrLkEA== integrity sha512-YSABkGY9vaTxlX7WmfV6q+xqlnYST0qwJICKVPkhQHiBA7CQwvcGE/PAzHZ3K7azuAGo3Oa0+FnkwI0bp9WeRA==
dependencies: dependencies:
"@tryghost/email-content-generator" "^0.1.2" "@tryghost/email-content-generator" "^0.1.2"
"@tryghost/version-notifications-data-service" "^0.1.2" "@tryghost/version-notifications-data-service" "^0.2.0"
"@tryghost/bookshelf-collision@^0.1.22": "@tryghost/bookshelf-collision@^0.1.22":
version "0.1.22" version "0.1.22"
@ -1979,6 +1979,13 @@
cookiejar "^2.1.3" cookiejar "^2.1.3"
reqresnext "^1.7.0" reqresnext "^1.7.0"
"@tryghost/extract-api-key@^0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@tryghost/extract-api-key/-/extract-api-key-0.1.0.tgz#d54963bc1836b582db735b01105807a6d2b90619"
integrity sha512-MkVfY/GmIEPuNDaNrKQupK2yW0TV6Vd9v43ZloXAE/PPIAS2K/w/ImmI1CGNxpVJi1fGzXJY5cU7T+C1UK0fWQ==
dependencies:
jsonwebtoken "^8.5.1"
"@tryghost/helpers@1.1.67": "@tryghost/helpers@1.1.67":
version "1.1.67" version "1.1.67"
resolved "https://registry.yarnpkg.com/@tryghost/helpers/-/helpers-1.1.67.tgz#cbfcf2d6b2c1d0a64b18d859992c3a98f591a441" resolved "https://registry.yarnpkg.com/@tryghost/helpers/-/helpers-1.1.67.tgz#cbfcf2d6b2c1d0a64b18d859992c3a98f591a441"
@ -2306,10 +2313,12 @@
dependencies: dependencies:
lodash "^4.17.11" lodash "^4.17.11"
"@tryghost/mw-api-version-mismatch@0.1.4": "@tryghost/mw-api-version-mismatch@0.2.0":
version "0.1.4" version "0.2.0"
resolved "https://registry.yarnpkg.com/@tryghost/mw-api-version-mismatch/-/mw-api-version-mismatch-0.1.4.tgz#0a8cd94572a6fd45bc327d7bc871b1f8de02c8ec" resolved "https://registry.yarnpkg.com/@tryghost/mw-api-version-mismatch/-/mw-api-version-mismatch-0.2.0.tgz#d4e3a757200c0c949c79766e30a5871e00d2f948"
integrity sha512-V50d2nP3Z+HUialKef9of8UIKEjmTo8ogszgqDy2DH08aNYWUYDRFEWWjUiqdcTXGJMhhPzYlR6cAaYhPj8YwA== integrity sha512-xu45flNJgpPzLWi1I5nrDsmnPHjkPwAamuaVHKB14pkr4WsDDfQm8q8M6HCHDMo4dt5VJWZ87Xtbk1CXiWp7zA==
dependencies:
"@tryghost/extract-api-key" "^0.1.0"
"@tryghost/mw-error-handler@1.0.0": "@tryghost/mw-error-handler@1.0.0":
version "1.0.0" version "1.0.0"
@ -2539,10 +2548,10 @@
"@tryghost/domain-events" "^0.1.12" "@tryghost/domain-events" "^0.1.12"
"@tryghost/member-events" "^0.4.4" "@tryghost/member-events" "^0.4.4"
"@tryghost/version-notifications-data-service@^0.1.2": "@tryghost/version-notifications-data-service@^0.2.0":
version "0.1.2" version "0.2.0"
resolved "https://registry.yarnpkg.com/@tryghost/version-notifications-data-service/-/version-notifications-data-service-0.1.2.tgz#2a99315a721b74a945fc88615f57db1f54483dfb" resolved "https://registry.yarnpkg.com/@tryghost/version-notifications-data-service/-/version-notifications-data-service-0.2.0.tgz#e528ce7450b4cd31c035fa5a47f131cc6e8925d9"
integrity sha512-NjGqYYsZUrT82GAmvGWPWWQ2Z2XJDuFDz0Ep8j1jk/xxhty0Qas6uweQFn9HvbTOF3W7kvbVSEvmevyBWiQfJQ== integrity sha512-Yz9e98kYaW7pb+QnaY0IONTSa4QjiZqGdnawkkCmECuHWIXx2cRnwCrGvhJ0+g3SxZGv5IB9ZBJQzAVrsHxjNA==
"@tryghost/version@0.1.14", "@tryghost/version@^0.1.14": "@tryghost/version@0.1.14", "@tryghost/version@^0.1.14":
version "0.1.14" version "0.1.14"