Merge pull request #2881 from mozilla/train-129 r=@shane-tomlinson

Release v1.129.0
This commit is contained in:
Shane Tomlinson 2019-01-25 11:44:09 +00:00 коммит произвёл GitHub
Родитель 18963b7065 2097c951d6
Коммит 30fd3d5e46
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 336 добавлений и 255 удалений

Просмотреть файл

@ -1,3 +1,47 @@
<a name="1.129.2"></a>
## [1.129.2](https://github.com/mozilla/fxa-auth-server/compare/v1.129.1...v1.129.2) (2019-01-24)
### Bug Fixes
* **email:** add missing query params to link in new device email ([f13de2f](https://github.com/mozilla/fxa-auth-server/commit/f13de2f))
* **tests:** ensure assertions cause test failures in local email tests ([3b2e946](https://github.com/mozilla/fxa-auth-server/commit/3b2e946))
<a name="1.129.1"></a>
## [1.129.1](https://github.com/mozilla/fxa-auth-server/compare/v1.129.0...v1.129.1) (2019-01-24)
### Bug Fixes
* **metrics:** stop emitting route flow events for status endpoints ([39c6d31](https://github.com/mozilla/fxa-auth-server/commit/39c6d31))
### chore
* **package:** update shrinkwrap ([4db4081](https://github.com/mozilla/fxa-auth-server/commit/4db4081))
<a name="1.129.0"></a>
# [1.129.0](https://github.com/mozilla/fxa-auth-server/compare/v1.128.3...v1.129.0) (2019-01-24)
### Bug Fixes
* **circle:** version.json "source" should be code repository ([3966cbb](https://github.com/mozilla/fxa-auth-server/commit/3966cbb))
* **config:** remove deprecated urls ([871fdda](https://github.com/mozilla/fxa-auth-server/commit/871fdda)), closes [#2646](https://github.com/mozilla/fxa-auth-server/issues/2646)
* **config:** use local redirect for the reference browser ([33cac8e](https://github.com/mozilla/fxa-auth-server/commit/33cac8e))
* **oauth:** Redirect GET /authorization directly to content server ([69f8f3a](https://github.com/mozilla/fxa-auth-server/commit/69f8f3a)), closes [mozilla/fxa-auth-server#2862](https://github.com/mozilla/fxa-auth-server/issues/2862)
### chore
* **deps:** Update to fxa-shared@1.0.15 ([b8f5b22](https://github.com/mozilla/fxa-auth-server/commit/b8f5b22))
* **package:** disable security advisory 766 for sandbox dependency ([0a5e7f6](https://github.com/mozilla/fxa-auth-server/commit/0a5e7f6))
* **package:** disable security advisory 766 for sandbox dependency ([737be65](https://github.com/mozilla/fxa-auth-server/commit/737be65))
<a name="1.128.4"></a>
## [1.128.4](https://github.com/mozilla/fxa-auth-server/compare/v1.128.3...v1.128.4) (2019-01-17)

Просмотреть файл

@ -911,7 +911,7 @@ module.exports = function (log, config, oauthdb) {
Mailer.prototype.newDeviceLoginEmail = function (message) {
log.trace({ op: 'mailer.newDeviceLoginEmail', email: message.email, uid: message.uid })
var templateName = 'newDeviceLoginEmail'
var links = this._generateLinks(this.accountSettingsUrl, message.email, {}, templateName)
var links = this._generateSettingLinks(message, templateName)
var translator = this.translator(message.acceptLanguage)
var headers = {

291
npm-shrinkwrap.json сгенерированный
Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "fxa-auth-server",
"version": "1.128.4",
"version": "1.129.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -14,12 +14,12 @@
}
},
"@babel/generator": {
"version": "7.2.2",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.2.2.tgz",
"integrity": "sha512-I4o675J/iS8k+P38dvJ3IBGqObLXyQLTxtrR4u9cSUJOURvafeEWb/pFMOTwtNrmq73mJzyF6ueTbO1BtN0Zeg==",
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.0.tgz",
"integrity": "sha512-dZTwMvTgWfhmibq4V9X+LMf6Bgl7zAodRn9PvcPdhlzFMbvUutx74dbEv7Atz3ToeEpevYEJtAwfxq/bDCzHWg==",
"dev": true,
"requires": {
"@babel/types": "^7.2.2",
"@babel/types": "^7.3.0",
"jsesc": "^2.5.1",
"lodash": "^4.17.10",
"source-map": "^0.5.0",
@ -76,9 +76,9 @@
}
},
"chalk": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
@ -104,9 +104,9 @@
}
},
"@babel/parser": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.2.3.tgz",
"integrity": "sha512-0LyEcVlfCoFmci8mXx8A5oIkpkOgyo8dRHtxBnK9RRBwxO2+JZPNsqtVEZQ7mJFPxnXF9lfmU24mHOPI0qnlkA==",
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.1.tgz",
"integrity": "sha512-ATz6yX/L8LEnC3dtLQnIx4ydcPxhLcoy9Vl6re00zb2w5lG6itY6Vhnr1KFRPq/FHNsgl/gh2mjNN20f9iJTTA==",
"dev": true
},
"@babel/template": {
@ -147,9 +147,9 @@
}
},
"globals": {
"version": "11.9.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz",
"integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==",
"version": "11.10.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz",
"integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==",
"dev": true
},
"ms": {
@ -161,9 +161,9 @@
}
},
"@babel/types": {
"version": "7.2.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.2.2.tgz",
"integrity": "sha512-fKCuD6UFUMkR541eDWL+2ih/xFZBXPOg/7EQFeTluMDebfqR4jrpaCjLhkWlQS4hT6nRa2PMEgXKbRB5/H2fpg==",
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.0.tgz",
"integrity": "sha512-QkFPw68QqWU1/RVPyBe8SO7lXbPfjtqAxRYQKpFpaB8yMq7X2qAqfwK5LKoQufEkSmO5NQ70O6Kc3Afk03RwXw==",
"dev": true,
"requires": {
"esutils": "^2.0.2",
@ -172,9 +172,9 @@
}
},
"@newrelic/koa": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/@newrelic/koa/-/koa-1.0.7.tgz",
"integrity": "sha512-hQfICL9fe95JZrIFAfGys5AX/TZHhtNb0VKxaXwtVebZVhp6307AuAi5Plpf7pcqpUnvyQvhXKR07gE3ZJRt6g==",
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/@newrelic/koa/-/koa-1.0.8.tgz",
"integrity": "sha512-kY//FlLQkGdUIKEeGJlyY3dJRU63EG77YIa48ACMGZxQbWRd3WZMikyft33f8XScTq6WpCDo9xa0viNo8zeYkg==",
"requires": {
"methods": "^1.1.2"
}
@ -190,9 +190,9 @@
}
},
"@newrelic/superagent": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@newrelic/superagent/-/superagent-1.0.1.tgz",
"integrity": "sha512-2U04J/c155LDry5CYShGY6lkM87D7keEmM25lZ+hatrI6dcMoVKGJGT5xC1rGeemlPl3sn2/fzFYoUkzXTTRhw==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@newrelic/superagent/-/superagent-1.0.2.tgz",
"integrity": "sha512-B2fM48kfY+5L6pwk6Yt79yk1JzMWKu1wV73If2shAzMsujNqSA4P+mLKCnTthIuKlhE78OfB1MzSpRMeB7kgWw==",
"requires": {
"methods": "^1.1.2"
}
@ -672,9 +672,9 @@
}
},
"big-integer": {
"version": "1.6.40",
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.40.tgz",
"integrity": "sha512-CjhtJp0BViLzP1ZkEnoywjgtFQXS2pomKjAJtIISTCnuHILkLcAXLdFLG/nxsHc4s9kJfc+82Xpg8WNyhfACzQ=="
"version": "1.6.41",
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.41.tgz",
"integrity": "sha512-d5AT9lMTYJ/ZE/4gzxb+5ttPcRWljVsvv7lF1w9KzkPhVUhBtHrjDo1J8swfZKepfLsliDhYa31zRYwcD0Yg9w=="
},
"big-time": {
"version": "2.0.1",
@ -2014,15 +2014,16 @@
}
},
"es-abstract": {
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz",
"integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==",
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz",
"integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==",
"requires": {
"es-to-primitive": "^1.1.1",
"es-to-primitive": "^1.2.0",
"function-bind": "^1.1.1",
"has": "^1.0.1",
"is-callable": "^1.1.3",
"is-regex": "^1.0.4"
"has": "^1.0.3",
"is-callable": "^1.1.4",
"is-regex": "^1.0.4",
"object-keys": "^1.0.12"
}
},
"es-to-primitive": {
@ -2036,9 +2037,9 @@
}
},
"es5-ext": {
"version": "0.10.46",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.46.tgz",
"integrity": "sha512-24XxRvJXNFwEMpJb3nOkiRJKRoupmjYmOPVlI65Qy2SrtxwOTB+g6ODjBKOtwEHbYrhWRty9xxOWLNdClT2djw==",
"version": "0.10.47",
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.47.tgz",
"integrity": "sha512-/1TItLfj+TTfWoeRcDn/0FbGV6SNo4R+On2GGVucPU/j3BWnXE2Co8h8CTo4Tu34gFJtnmwS9xiScKs4EjZhdw==",
"dev": true,
"requires": {
"es6-iterator": "~2.0.3",
@ -2196,9 +2197,12 @@
}
},
"eslint-plugin-fxa": {
"version": "git+https://github.com/mozilla/eslint-plugin-fxa.git#e082927b4c6dc17d21414e35f4c94312adbaba92",
"version": "git+https://github.com/mozilla/eslint-plugin-fxa.git#1153ff4bbf7e2c074363253c555fb7f71bac09a1",
"from": "git+https://github.com/mozilla/eslint-plugin-fxa.git#master",
"dev": true
"dev": true,
"requires": {
"ramda": "0.25.0"
}
},
"espree": {
"version": "3.5.4",
@ -2515,9 +2519,9 @@
"dev": true
},
"fsevents": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz",
"integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==",
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz",
"integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==",
"optional": true,
"requires": {
"nan": "^2.9.2",
@ -2539,7 +2543,7 @@
"optional": true
},
"are-we-there-yet": {
"version": "1.1.4",
"version": "1.1.5",
"bundled": true,
"optional": true,
"requires": {
@ -2560,7 +2564,7 @@
}
},
"chownr": {
"version": "1.0.1",
"version": "1.1.1",
"bundled": true,
"optional": true
},
@ -2590,7 +2594,7 @@
}
},
"deep-extend": {
"version": "0.5.1",
"version": "0.6.0",
"bundled": true,
"optional": true
},
@ -2633,7 +2637,7 @@
}
},
"glob": {
"version": "7.1.2",
"version": "7.1.3",
"bundled": true,
"optional": true,
"requires": {
@ -2651,11 +2655,11 @@
"optional": true
},
"iconv-lite": {
"version": "0.4.21",
"version": "0.4.24",
"bundled": true,
"optional": true,
"requires": {
"safer-buffer": "^2.1.0"
"safer-buffer": ">= 2.1.2 < 3"
}
},
"ignore-walk": {
@ -2708,15 +2712,15 @@
"bundled": true
},
"minipass": {
"version": "2.2.4",
"version": "2.3.5",
"bundled": true,
"requires": {
"safe-buffer": "^5.1.1",
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
}
},
"minizlib": {
"version": "1.1.0",
"version": "1.2.1",
"bundled": true,
"optional": true,
"requires": {
@ -2736,7 +2740,7 @@
"optional": true
},
"needle": {
"version": "2.2.0",
"version": "2.2.4",
"bundled": true,
"optional": true,
"requires": {
@ -2746,17 +2750,17 @@
}
},
"node-pre-gyp": {
"version": "0.10.0",
"version": "0.10.3",
"bundled": true,
"optional": true,
"requires": {
"detect-libc": "^1.0.2",
"mkdirp": "^0.5.1",
"needle": "^2.2.0",
"needle": "^2.2.1",
"nopt": "^4.0.1",
"npm-packlist": "^1.1.6",
"npmlog": "^4.0.2",
"rc": "^1.1.7",
"rc": "^1.2.7",
"rimraf": "^2.6.1",
"semver": "^5.3.0",
"tar": "^4"
@ -2772,12 +2776,12 @@
}
},
"npm-bundled": {
"version": "1.0.3",
"version": "1.0.5",
"bundled": true,
"optional": true
},
"npm-packlist": {
"version": "1.1.10",
"version": "1.2.0",
"bundled": true,
"optional": true,
"requires": {
@ -2842,11 +2846,11 @@
"optional": true
},
"rc": {
"version": "1.2.7",
"version": "1.2.8",
"bundled": true,
"optional": true,
"requires": {
"deep-extend": "^0.5.1",
"deep-extend": "^0.6.0",
"ini": "~1.3.0",
"minimist": "^1.2.0",
"strip-json-comments": "~2.0.1"
@ -2874,15 +2878,15 @@
}
},
"rimraf": {
"version": "2.6.2",
"version": "2.6.3",
"bundled": true,
"optional": true,
"requires": {
"glob": "^7.0.5"
"glob": "^7.1.3"
}
},
"safe-buffer": {
"version": "5.1.1",
"version": "5.1.2",
"bundled": true
},
"safer-buffer": {
@ -2896,7 +2900,7 @@
"optional": true
},
"semver": {
"version": "5.5.0",
"version": "5.6.0",
"bundled": true,
"optional": true
},
@ -2940,16 +2944,16 @@
"optional": true
},
"tar": {
"version": "4.4.1",
"version": "4.4.8",
"bundled": true,
"optional": true,
"requires": {
"chownr": "^1.0.1",
"chownr": "^1.1.1",
"fs-minipass": "^1.2.5",
"minipass": "^2.2.4",
"minizlib": "^1.1.0",
"minipass": "^2.3.4",
"minizlib": "^1.1.1",
"mkdirp": "^0.5.0",
"safe-buffer": "^5.1.1",
"safe-buffer": "^5.1.2",
"yallist": "^3.0.2"
}
},
@ -2959,11 +2963,11 @@
"optional": true
},
"wide-align": {
"version": "1.1.2",
"version": "1.1.3",
"bundled": true,
"optional": true,
"requires": {
"string-width": "^1.0.2"
"string-width": "^1.0.2 || 2"
}
},
"wrappy": {
@ -2971,7 +2975,7 @@
"bundled": true
},
"yallist": {
"version": "3.0.2",
"version": "3.0.3",
"bundled": true
}
}
@ -2982,7 +2986,7 @@
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"fxa-auth-db-mysql": {
"version": "git+https://github.com/mozilla/fxa-auth-db-mysql.git#6440de56b082f00cb3c7a3a02067228905918d35",
"version": "git+https://github.com/mozilla/fxa-auth-db-mysql.git#25fbd76e94f0cd995d8b7642e78dabbf291850d8",
"from": "git+https://github.com/mozilla/fxa-auth-db-mysql.git#master",
"dev": true,
"requires": {
@ -3073,9 +3077,9 @@
}
},
"chalk": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
@ -3093,9 +3097,9 @@
}
},
"@babel/parser": {
"version": "7.2.2",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.2.2.tgz",
"integrity": "sha512-UNTmQ5cSLDeBGBl+s7JeowkqIHgmFAGBnLDdIzFmUNSuS5JF0XBcN59jsh/vJO/YjfsBqMxhMjoFGmNExmf0FA=="
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.2.3.tgz",
"integrity": "sha512-0LyEcVlfCoFmci8mXx8A5oIkpkOgyo8dRHtxBnK9RRBwxO2+JZPNsqtVEZQ7mJFPxnXF9lfmU24mHOPI0qnlkA=="
},
"@babel/template": {
"version": "7.2.2",
@ -3108,15 +3112,15 @@
}
},
"@babel/traverse": {
"version": "7.2.2",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.2.2.tgz",
"integrity": "sha512-E5Bn9FSwHpSkUhthw/XEuvFZxIgrqb9M8cX8j5EUQtrUG5DQUy6bFyl7G7iQ1D1Czudor+xkmp81JbLVVM0Sjg==",
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.2.3.tgz",
"integrity": "sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw==",
"requires": {
"@babel/code-frame": "^7.0.0",
"@babel/generator": "^7.2.2",
"@babel/helper-function-name": "^7.1.0",
"@babel/helper-split-export-declaration": "^7.0.0",
"@babel/parser": "^7.2.2",
"@babel/parser": "^7.2.3",
"@babel/types": "^7.2.2",
"debug": "^4.1.0",
"globals": "^11.1.0",
@ -3124,17 +3128,17 @@
},
"dependencies": {
"debug": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz",
"integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==",
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
"requires": {
"ms": "^2.1.1"
}
},
"globals": {
"version": "11.9.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz",
"integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg=="
"version": "11.10.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz",
"integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ=="
}
}
},
@ -3149,9 +3153,9 @@
}
},
"@newrelic/koa": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/@newrelic/koa/-/koa-1.0.7.tgz",
"integrity": "sha512-hQfICL9fe95JZrIFAfGys5AX/TZHhtNb0VKxaXwtVebZVhp6307AuAi5Plpf7pcqpUnvyQvhXKR07gE3ZJRt6g==",
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/@newrelic/koa/-/koa-1.0.8.tgz",
"integrity": "sha512-kY//FlLQkGdUIKEeGJlyY3dJRU63EG77YIa48ACMGZxQbWRd3WZMikyft33f8XScTq6WpCDo9xa0viNo8zeYkg==",
"dev": true,
"requires": {
"methods": "^1.1.2"
@ -3169,9 +3173,9 @@
}
},
"@newrelic/superagent": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@newrelic/superagent/-/superagent-1.0.1.tgz",
"integrity": "sha512-2U04J/c155LDry5CYShGY6lkM87D7keEmM25lZ+hatrI6dcMoVKGJGT5xC1rGeemlPl3sn2/fzFYoUkzXTTRhw==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@newrelic/superagent/-/superagent-1.0.2.tgz",
"integrity": "sha512-B2fM48kfY+5L6pwk6Yt79yk1JzMWKu1wV73If2shAzMsujNqSA4P+mLKCnTthIuKlhE78OfB1MzSpRMeB7kgWw==",
"dev": true,
"requires": {
"methods": "^1.1.2"
@ -4433,8 +4437,11 @@
}
},
"eslint-plugin-fxa": {
"version": "git+https://github.com/mozilla/eslint-plugin-fxa.git#e082927b4c6dc17d21414e35f4c94312adbaba92",
"from": "git+https://github.com/mozilla/eslint-plugin-fxa.git#master"
"version": "git+https://github.com/mozilla/eslint-plugin-fxa.git#1153ff4bbf7e2c074363253c555fb7f71bac09a1",
"from": "git+https://github.com/mozilla/eslint-plugin-fxa.git#master",
"requires": {
"ramda": "0.25.0"
}
},
"espree": {
"version": "3.5.4",
@ -4629,11 +4636,11 @@
}
},
"rimraf": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
"integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
"requires": {
"glob": "^7.0.5"
"glob": "^7.1.3"
}
}
}
@ -5115,11 +5122,26 @@
}
},
"rimraf": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
"integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
"requires": {
"glob": "^7.0.5"
"glob": "^7.1.3"
},
"dependencies": {
"glob": {
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
}
}
}
}
@ -5192,9 +5214,9 @@
}
},
"chalk": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
@ -7500,6 +7522,11 @@
"resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz",
"integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g="
},
"ramda": {
"version": "0.25.0",
"resolved": "https://registry.npmjs.org/ramda/-/ramda-0.25.0.tgz",
"integrity": "sha512-GXpfrYVPwx3K7RQ6aYT8KPS8XViSXUVJT1ONhoKPE9VAleW42YE+U+8VEyGWt41EnEQW7gwecYJriTI0pKoecQ=="
},
"raven": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/raven/-/raven-2.6.4.tgz",
@ -7888,9 +7915,9 @@
}
},
"spdx-license-ids": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz",
"integrity": "sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg=="
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz",
"integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g=="
},
"spdy": {
"version": "3.4.7",
@ -7983,9 +8010,9 @@
"dev": true
},
"sshpk": {
"version": "1.15.2",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.2.tgz",
"integrity": "sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA==",
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.0.tgz",
"integrity": "sha512-Zhev35/y7hRMcID/upReIvRse+I9SVhyVre/KTJSJQWMz3C3+G+HpO7m1wK/yckEtujKZ7dS4hkVxAnmHaIGVQ==",
"dev": true,
"requires": {
"asn1": "~0.2.3",
@ -9062,9 +9089,9 @@
}
},
"chalk": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
@ -9253,9 +9280,9 @@
},
"dependencies": {
"ajv": {
"version": "6.6.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.2.tgz",
"integrity": "sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g==",
"version": "6.7.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz",
"integrity": "sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg==",
"requires": {
"fast-deep-equal": "^2.0.1",
"fast-json-stable-stringify": "^2.0.0",
@ -9608,9 +9635,9 @@
}
},
"interpret": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz",
"integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=",
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz",
"integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==",
"dev": true
},
"invert-kv": {
@ -10559,9 +10586,9 @@
}
},
"math-random": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz",
"integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w="
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz",
"integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A=="
},
"maxmind": {
"version": "2.8.0",
@ -11179,7 +11206,7 @@
"from": "git+https://github.com/vladikoff/node-uap.git#9cdd16247",
"requires": {
"array.prototype.find": "2.0.0",
"uap-core": "git://github.com/ua-parser/uap-core.git#010ccdc7303546cd22b9da687c29f4a996990014",
"uap-core": "git://github.com/ua-parser/uap-core.git#6cfb915779a6b707b4f622cc1ebb70c15000bfb2",
"uap-ref-impl": "0.2.0",
"yamlparser": "0.0.2"
}
@ -13095,6 +13122,12 @@
"integrity": "sha1-jM/QFND5YIYw3XPBm45LBXdUpqY=",
"dev": true
},
"ramda": {
"version": "0.25.0",
"resolved": "https://registry.npmjs.org/ramda/-/ramda-0.25.0.tgz",
"integrity": "sha512-GXpfrYVPwx3K7RQ6aYT8KPS8XViSXUVJT1ONhoKPE9VAleW42YE+U+8VEyGWt41EnEQW7gwecYJriTI0pKoecQ==",
"dev": true
},
"randomatic": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz",
@ -14124,9 +14157,9 @@
"integrity": "sha1-UluKT9Jtb3GqYegipsr5dtMa0qg="
},
"sshpk": {
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.0.tgz",
"integrity": "sha512-Zhev35/y7hRMcID/upReIvRse+I9SVhyVre/KTJSJQWMz3C3+G+HpO7m1wK/yckEtujKZ7dS4hkVxAnmHaIGVQ==",
"version": "1.16.1",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
"integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==",
"requires": {
"asn1": "~0.2.3",
"assert-plus": "^1.0.0",
@ -14515,7 +14548,7 @@
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
},
"uap-core": {
"version": "git://github.com/ua-parser/uap-core.git#010ccdc7303546cd22b9da687c29f4a996990014",
"version": "git://github.com/ua-parser/uap-core.git#6cfb915779a6b707b4f622cc1ebb70c15000bfb2",
"from": "git://github.com/ua-parser/uap-core.git"
},
"uap-ref-impl": {

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "fxa-auth-server",
"version": "1.128.4",
"version": "1.129.2",
"description": "Firefox Accounts, an identity provider for Mozilla cloud services",
"bin": {
"fxa-auth": "./bin/key_server.js"

Просмотреть файл

@ -178,6 +178,17 @@ function sesMessageTagsHeaderValue(templateName, serviceName) {
return `messageType=fxa-${templateName}, app=fxa, service=${serviceName}`
}
function stubSendMail (stub, status) {
return (emailConfig, callback) => {
try {
stub(emailConfig)
return callback(null, status)
} catch (err) {
return callback(err, status)
}
}
}
describe(
'lib/senders/email:',
() => {
@ -228,7 +239,7 @@ describe(
it(
'Contains template header for ' + type,
function () {
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.equal(emailConfig.from, config.get('smtp.sender'), 'from header is correct')
assert.equal(emailConfig.sender, config.get('smtp.sender'), 'sender header is correct')
const templateName = emailConfig.headers['X-Template-Name']
@ -242,13 +253,13 @@ describe(
}
assert.equal(templateVersion, TEMPLATE_VERSIONS[templateName], 'template version is correct')
}
mailer[type](message)
})
return mailer[type](message)
}
)
it(`Contains metrics headers for ${type}`, () => {
mailer.mailer.sendMail = emailConfig => {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
const headers = emailConfig.headers
assert.equal(headers['X-Device-Id'], message.deviceId, 'device id header is correct')
assert.equal(headers['X-Flow-Id'], message.flowId, 'flow id header is correct')
@ -256,8 +267,8 @@ describe(
assert.equal(headers['X-Service-Id'], message.service, 'service id header is correct')
assert.equal(headers['X-Uid'], message.uid, 'uid header is correct')
assert.equal(headers['X-Email-Service'], 'fxa-auth-server')
}
mailer[type](message)
})
return mailer[type](message)
})
it(
@ -265,11 +276,11 @@ describe(
function () {
var privacyLink = mailer.createPrivacyLink(type)
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, privacyLink))
assert.ok(includes(emailConfig.text, privacyLink))
}
mailer[type](message)
})
return mailer[type](message)
}
)
@ -277,15 +288,15 @@ describe(
it(
'contains correct type ' + type,
function () {
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.headers['X-Link'], 'type=secondary'))
assert.ok(includes(emailConfig.html, 'type=secondary'))
assert.ok(includes(emailConfig.text, 'type=secondary'))
assert.ok(! includes(emailConfig.headers['X-Link'], 'utm_source=email'))
assert.ok(! includes(emailConfig.html, 'utm_source=email'))
assert.ok(! includes(emailConfig.text, 'utm_source=email'))
}
mailer[type](message)
})
return mailer[type](message)
}
)
}
@ -294,14 +305,14 @@ describe(
'If sesConfigurationSet is not defined, then outgoing email does not contain X-SES* headers, for type ' + type,
function () {
assert.ok('sesConfigurationSet' in mailer, 'configuration key exists')
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
var sesConfigurationSetHeader = emailConfig.headers['X-SES-CONFIGURATION-SET']
assert.ok(! sesConfigurationSetHeader)
var sesMessageTags = emailConfig.headers['X-SES-MESSAGE-TAGS']
assert.ok(! sesMessageTags)
}
})
mailer[type](message) // invoke
return mailer[type](message)
}
)
@ -312,7 +323,7 @@ describe(
var savedSesConfigurationSet = mailer.sesConfigurationSet
mailer.sesConfigurationSet = 'some-defined-value'
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
var sesConfigurationSetHeader = emailConfig.headers['X-SES-CONFIGURATION-SET']
assert.equal(sesConfigurationSetHeader, 'some-defined-value')
@ -321,9 +332,9 @@ describe(
assert.equal(sesMessageTags, expectedSesMessageTags)
mailer.sesConfigurationSet = savedSesConfigurationSet
}
})
mailer[type](message) // invoke
return mailer[type](message)
}
)
@ -333,11 +344,11 @@ describe(
function () {
var supportTextLink = mailer.createSupportLink(type)
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, supportTextLink))
assert.ok(includes(emailConfig.text, supportTextLink))
}
mailer[type](message)
})
return mailer[type](message)
}
)
}
@ -348,13 +359,13 @@ describe(
function () {
var resetPasswordLink = mailer.createPasswordResetLink(message.email, type)
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, resetPasswordLink))
assert.ok(includes(emailConfig.text, resetPasswordLink))
assert.ok(! includes(emailConfig.html, 'utm_source=email'))
assert.ok(! includes(emailConfig.text, 'utm_source=email'))
}
mailer[type](message)
})
return mailer[type](message)
}
)
}
@ -365,13 +376,13 @@ describe(
function () {
var passwordChangeLink = mailer.createPasswordChangeLink(message.email, type)
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, passwordChangeLink))
assert.ok(includes(emailConfig.text, passwordChangeLink))
assert.ok(! includes(emailConfig.html, 'utm_source=email'))
assert.ok(! includes(emailConfig.text, 'utm_source=email'))
}
mailer[type](message)
})
return mailer[type](message)
}
)
}
@ -380,11 +391,11 @@ describe(
it(
'unblock code is in email template output for ' + type,
function () {
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, message.unblockCode))
assert.ok(includes(emailConfig.text, message.unblockCode))
}
mailer[type](message)
})
return mailer[type](message)
}
)
}
@ -393,11 +404,11 @@ describe(
it(`can prepend verification subdomain for ${type}`, () => {
mailer.prependVerificationSubdomain.enabled = true
const subdomain = mailer.prependVerificationSubdomain.subdomain
mailer.mailer.sendMail = (emailConfig) => {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
const link = emailConfig.headers['X-Link'];
assert.equal(link.indexOf(`http://${subdomain}.`), 0, 'link prepend with domain')
}
mailer[type](message)
})
return mailer[type](message)
})
}
@ -405,11 +416,11 @@ describe(
it(
'login code is in email template output for ' + type,
function () {
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, message.tokenCode))
assert.ok(includes(emailConfig.text, message.tokenCode))
}
mailer[type](message)
})
return mailer[type](message)
}
)
}
@ -418,42 +429,42 @@ describe(
it(
'report sign-in link is in email template output for ' + type,
function () {
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
var reportSignInLink =
mailer.createReportSignInLink(type, message)
assert.ok(includes(emailConfig.html, reportSignInLink))
assert.ok(includes(emailConfig.text, reportSignInLink))
assert.ok(! includes(emailConfig.html, 'utm_source=email'))
assert.ok(! includes(emailConfig.text, 'utm_source=email'))
}
mailer[type](message)
})
return mailer[type](message)
}
)
}
if (includes(typesContainRevokeAccountRecoveryLinks, type)) {
it('revoke account recovery link is in email template output for ' + type, () => {
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
const link = mailer.createRevokeAccountRecoveryLink(type, message)
assert.ok(includes(emailConfig.html, link))
assert.ok(includes(emailConfig.text, link))
assert.ok(! includes(emailConfig.html, 'utm_source=email'))
assert.ok(! includes(emailConfig.text, 'utm_source=email'))
}
mailer[type](message)
})
return mailer[type](message)
})
}
if (includes(typesContainCreateAccountRecoveryLinks, type)) {
it('create account recovery link is in email template output for ' + type, () => {
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
const link = mailer._generateCreateAccountRecoveryLinks(message, type).link
assert.ok(includes(emailConfig.html, link))
assert.ok(includes(emailConfig.text, link))
assert.ok(! includes(emailConfig.html, 'utm_source=email'))
assert.ok(! includes(emailConfig.text, 'utm_source=email'))
}
mailer[type](message)
})
return mailer[type](message)
})
}
@ -463,12 +474,12 @@ describe(
function () {
var androidStoreLink = mailer.androidUrl
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, androidStoreLink))
assert.ok(includes(emailConfig.html, 'utm_source=email'))
// only the html email contains links to the store
}
mailer[type](message)
})
return mailer[type](message)
}
)
}
@ -479,12 +490,12 @@ describe(
function () {
var iosStoreLink = mailer.iosUrl
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, iosStoreLink))
assert.ok(includes(emailConfig.html, 'utm_source=email'))
// only the html email contains links to the store
}
mailer[type](message)
})
return mailer[type](message)
}
)
}
@ -495,13 +506,13 @@ describe(
function () {
var passwordManagerInfoUrl = mailer._generateLinks(config.get('smtp').passwordManagerInfoUrl, message.email, {}, type).passwordManagerInfoUrl
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, passwordManagerInfoUrl))
assert.ok(includes(emailConfig.text, passwordManagerInfoUrl))
assert.ok(! includes(emailConfig.html, 'utm_source=email'))
assert.ok(! includes(emailConfig.text, 'utm_source=email'))
}
mailer[type](message)
})
return mailer[type](message)
}
)
}
@ -510,13 +521,13 @@ describe(
it('account settings info link is in email template output for ' + type, () => {
const accountSettingsUrl = mailer._generateSettingLinks(message, type).link
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, accountSettingsUrl))
assert.ok(includes(emailConfig.text, accountSettingsUrl))
assert.ok(! includes(emailConfig.html, 'utm_source=email'))
assert.ok(! includes(emailConfig.text, 'utm_source=email'))
}
mailer[type](message)
})
return mailer[type](message)
})
}
@ -524,13 +535,13 @@ describe(
it('recovery code settings info link is in email template output for ' + type, () => {
const url = mailer._generateLowRecoveryCodesLinks(message, type).link
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, url))
assert.ok(includes(emailConfig.text, url))
assert.ok(! includes(emailConfig.html, 'utm_source=email'))
assert.ok(! includes(emailConfig.text, 'utm_source=email'))
}
mailer[type](message)
})
return mailer[type](message)
})
}
@ -548,13 +559,13 @@ describe(
function () {
var message = getLocationMessage(defaultLocation)
message.primaryEmail = 'user@email.com'
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, message.primaryEmail))
assert.ok(includes(emailConfig.html, message.email))
assert.ok(includes(emailConfig.text, message.primaryEmail))
assert.ok(includes(emailConfig.text, message.email))
}
mailer[type](message)
})
return mailer[type](message)
}
)
}
@ -564,12 +575,12 @@ describe(
function () {
var message = getLocationMessage(defaultLocation)
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, message.ip))
assert.ok(includes(emailConfig.text, message.ip))
}
mailer[type](message)
})
return mailer[type](message)
}
)
@ -579,11 +590,11 @@ describe(
var location = defaultLocation
var message = getLocationMessage(defaultLocation)
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, location.city + ', ' + location.stateCode + ', ' + location.country))
assert.ok(includes(emailConfig.text, location.city + ', ' + location.stateCode + ', ' + location.country))
}
mailer[type](message)
})
return mailer[type](message)
}
)
@ -595,11 +606,11 @@ describe(
var message = getLocationMessage(location)
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, location.city + ', ' + location.country))
assert.ok(includes(emailConfig.text, location.city + ', ' + location.country))
}
mailer[type](message)
})
return mailer[type](message)
}
)
@ -610,11 +621,11 @@ describe(
delete location.city
var message = getLocationMessage(location)
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, location.stateCode + ', ' + location.country))
assert.ok(includes(emailConfig.text, location.stateCode + ', ' + location.country))
}
mailer[type](message)
})
return mailer[type](message)
}
)
@ -627,11 +638,11 @@ describe(
var message = getLocationMessage(location)
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, location.country))
assert.ok(includes(emailConfig.text, location.country))
}
mailer[type](message)
})
return mailer[type](message)
}
)
@ -643,11 +654,11 @@ describe(
message.uaOS = 'BeOS'
message.uaOSVersion = '1.0'
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, 'Firefox on BeOS 1.0'))
assert.ok(includes(emailConfig.text, 'Firefox on BeOS 1.0'))
}
mailer[type](message)
})
return mailer[type](message)
}
)
@ -656,13 +667,13 @@ describe(
message.uaBrowser = '<a>Firefox</a>'
message.uaOS = 'Android'
mailer.mailer.sendMail = emailConfig => {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(! includes(emailConfig.html, '<a>Firefox</a> on Android'))
assert.ok(includes(emailConfig.html, 'Android'))
assert.ok(! includes(emailConfig.text, '<a>Firefox</a> on Android'))
assert.ok(includes(emailConfig.text, 'Android'))
}
mailer[type](message)
})
return mailer[type](message)
})
it(`drops dodgy-looking uaOS property for ${type}`, () => {
@ -670,11 +681,11 @@ describe(
message.uaBrowser = 'Firefox'
message.uaOS = 'http://example.com'
mailer.mailer.sendMail = emailConfig => {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(! includes(emailConfig.html, 'http://example.com'))
assert.ok(! includes(emailConfig.text, 'http://example.com'))
}
mailer[type](message)
})
return mailer[type](message)
})
it(`drops dodgy-looking uaOSVersion property for ${type}`, () => {
@ -683,11 +694,11 @@ describe(
message.uaOS = 'Android'
message.uaOSVersion = 'dodgy-looking'
mailer.mailer.sendMail = emailConfig => {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(! includes(emailConfig.html, 'dodgy-looking'))
assert.ok(! includes(emailConfig.text, 'dodgy-looking'))
}
mailer[type](message)
})
return mailer[type](message)
})
}
@ -695,23 +706,23 @@ describe(
it(
'test verify token email',
function () {
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
var verifyLoginUrl = config.get('smtp').verifyLoginUrl
assert.equal(emailConfig.subject, 'Confirm new sign-in to Firefox')
assert.ok(emailConfig.html.indexOf(verifyLoginUrl) > 0)
assert.ok(emailConfig.text.indexOf(verifyLoginUrl) > 0)
}
mailer[type](message)
})
return mailer[type](message)
}
)
} else if (type === 'newDeviceLoginEmail') {
it(
'test new device login email',
function () {
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.equal(emailConfig.subject, 'New sign-in to Firefox')
}
mailer[type](message)
})
return mailer[type](message)
}
)
} else if (type === 'postVerifyEmail') {
@ -722,25 +733,25 @@ describe(
var androidLink = mailer._generateUTMLink(config.get('smtp').androidUrl, {}, type, 'connect-android')
var iosLink = mailer._generateUTMLink(config.get('smtp').iosUrl, {}, type, 'connect-ios')
mailer.mailer.sendMail = function (emailConfig) {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.ok(includes(emailConfig.html, syncLink))
assert.ok(includes(emailConfig.html, androidLink))
assert.ok(includes(emailConfig.html, iosLink))
assert.ok(includes(emailConfig.html, 'utm_source=email'))
}
mailer[type](message)
})
return mailer[type](message)
}
)
} else if (type === 'verifyPrimaryEmail') {
it('test verify token email', () => {
mailer.mailer.sendMail = (emailConfig) => {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
const verifyPrimaryEmailUrl = config.get('smtp').verifyPrimaryEmailUrl
assert.ok(emailConfig.html.indexOf(verifyPrimaryEmailUrl) > 0)
assert.ok(emailConfig.text.indexOf(verifyPrimaryEmailUrl) > 0)
assert.ok(! includes(emailConfig.html, 'utm_source=email'))
assert.ok(! includes(emailConfig.text, 'utm_source=email'))
}
mailer[type](message)
})
return mailer[type](message)
})
}
}
@ -901,10 +912,10 @@ describe(
}
it(`uses default template version for ${type}`, () => {
mailer.mailer.sendMail = emailConfig => {
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.equal(emailConfig.headers['X-Template-Version'], 1, 'template version defaults to 1')
}
mailer[type](message)
})
return mailer[type](message)
})
})
})
@ -1984,32 +1995,25 @@ describe('email translations', () => {
it('arabic emails are translated', () => {
return setupMailerWithTranslations('ar').then(() => {
return new Promise((resolve) => {
mailer.mailer.sendMail = (emailConfig) => {
assert.equal(emailConfig.headers['Content-Language'], 'ar', 'language header is correct')
// NOTE: translation might change, but we use the subject, we don't change that often.
assert.equal(emailConfig.subject, 'أكّد حساب فَيَرفُكس الخاص بك', 'translation is correct')
resolve()
}
mailer['verifyEmail'](message)
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.equal(emailConfig.headers['Content-Language'], 'ar', 'language header is correct')
// NOTE: translation might change, but we use the subject, we don't change that often.
assert.equal(emailConfig.subject, 'أكّد حساب فَيَرفُكس الخاص بك', 'translation is correct')
})
return mailer['verifyEmail'](message)
})
})
it('russian emails are translated', () => {
return setupMailerWithTranslations('ru').then(() => {
return new Promise((resolve) => {
mailer.mailer.sendMail = (emailConfig) => {
assert.equal(emailConfig.headers['Content-Language'], 'ru', 'language header is correct')
// NOTE: translation might change, but we use the subject, we don't change that often.
assert.equal(emailConfig.subject, 'Подтвердите ваш Аккаунт Firefox', 'translation is correct')
resolve()
}
mailer['verifyEmail'](message)
mailer.mailer.sendMail = stubSendMail(emailConfig => {
assert.equal(emailConfig.headers['Content-Language'], 'ru', 'language header is correct')
// NOTE: translation might change, but we use the subject, we don't change that often.
assert.equal(emailConfig.subject, 'Подтвердите ваш Аккаунт Firefox', 'translation is correct')
})
return mailer['verifyEmail'](message)
})
})
})

Просмотреть файл

@ -564,7 +564,7 @@ describe('userAgent, real dependency', () => {
assert.deepEqual(userAgent('<a>foo</a>-iPhone/2 CFNetwork'), {
browser: null,
browserVersion: '2',
os: undefined,
os: 'iOS',
osVersion: null,
deviceType: 'mobile',
formFactor: 'iPhone'