Merge branch 'master' into private-master

This commit is contained in:
Ryan Kelly 2016-03-17 14:11:50 +11:00
Родитель d4b36a7421 5150cb2699
Коммит 671ee4b740
6 изменённых файлов: 86 добавлений и 7 удалений

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

@ -1,9 +1,24 @@
<a name="1.58.0"></a>
# [1.58.0](https://github.com/mozilla/fxa-auth-server/compare/v1.57.0...v1.58.0) (2016-03-17)
### Bug Fixes
* **api:** permit null lastAccessTime in devices response ([474032d](https://github.com/mozilla/fxa-auth-server/commit/474032d))
* **api:** reject emails without a dot in the domain ([434e460](https://github.com/mozilla/fxa-auth-server/commit/434e460))
* **tests:** sanely handle unicode email addresses in account tests ([71e4126](https://github.com/mozilla/fxa-auth-server/commit/71e4126))
### chore
* **api:** Add signin config value ([0beade7](https://github.com/mozilla/fxa-auth-server/commit/0beade7))
<a name="1.57.1"></a>
## [1.57.1](https://github.com/mozilla/fxa-auth-server/compare/v1.57.0...v1.57.1) (2016-03-04)
### Bug Fixes
* **email:** Restrict unicode chars allowed in email addresses. ([81a42de](https://github.com/mozilla/fxa-auth-server/commit/81a42de))

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

@ -184,6 +184,11 @@ var conf = convict({
format: String,
default: 'https://www.mozilla.org/firefox/ios/'
},
signInUrl: {
doc: 'Deprecated. uses contentServer.url',
format: String,
default: 'undefined'
},
supportUrl: {
doc: 'url to Mozilla Support product page',
format: String,
@ -364,6 +369,7 @@ conf.validate({ strict: true })
conf.set('domain', url.parse(conf.get('publicUrl')).host)
// derive fxa-auth-mailer configuration from our content-server url
conf.set('smtp.signInUrl', conf.get('contentServer.url') + '/signin')
conf.set('smtp.verificationUrl', conf.get('contentServer.url') + '/v1/verify_email')
conf.set('smtp.passwordResetUrl', conf.get('contentServer.url') + '/v1/complete_reset_password')
conf.set('smtp.accountUnlockUrl', conf.get('contentServer.url') + '/v1/complete_unlock_account')

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

@ -823,7 +823,7 @@ module.exports = function (
schema: isA.array().items(isA.object({
id: isA.string().length(32).regex(HEX_STRING).required(),
isCurrentDevice: isA.boolean().required(),
lastAccessTime: isA.number().min(0).required(),
lastAccessTime: isA.number().min(0).required().allow(null),
name: isA.string().max(255).required(),
type: isA.string().max(16).required(),
pushCallback: isA.string().uri({ scheme: 'https' }).max(255).optional().allow('').allow(null),

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

@ -1,6 +1,6 @@
{
"name": "fxa-auth-server",
"version": "1.57.1",
"version": "1.58.0",
"dependencies": {
"ass": {
"version": "1.0.0",
@ -369,8 +369,8 @@
},
"fxa-auth-db-mysql": {
"version": "0.55.0",
"from": "git+https://github.com/mozilla/fxa-auth-db-mysql.git#3f5521976498fe1e7b260aeffc03dd828cf2b04f",
"resolved": "git+https://github.com/mozilla/fxa-auth-db-mysql.git#3f5521976498fe1e7b260aeffc03dd828cf2b04f",
"from": "git+https://github.com/mozilla/fxa-auth-db-mysql.git#87903a7d15401277b12e4b30fbecc56e70bf7b1f",
"resolved": "git+https://github.com/mozilla/fxa-auth-db-mysql.git#87903a7d15401277b12e4b30fbecc56e70bf7b1f",
"dependencies": {
"bluebird": {
"version": "2.1.3",

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

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

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

@ -6,7 +6,7 @@ var test = require('../ptaptest')
var url = require('url')
var Client = require('../client')
var TestServer = require('../test_server')
var crypto = require('crypto')
var config = require('../../config').getProperties()
@ -358,6 +358,64 @@ TestServer.start(config)
}
)
test(
'forgot password, then get device list',
function (t) {
var email = server.uniqueEmail()
var newPassword = 'foo'
var client
return Client.createAndVerify(config.publicUrl, email, 'bar', server.mailbox, {
device: {
name: 'baz',
type: 'mobile',
pushCallback: 'https://example.com/qux',
pushPublicKey: crypto.randomBytes(32).toString('hex')
}
})
.then(
function (c) {
client = c
return client.devices()
}
)
.then(
function (devices) {
t.equal(devices.length, 1, 'devices list contains 1 item')
}
)
.then(
function () {
return client.forgotPassword()
}
)
.then(
function () {
return server.mailbox.waitForCode(email)
}
)
.then(
function (code) {
return resetPassword(client, code, newPassword)
}
)
.then(
function () {
return Client.login(config.publicUrl, email, newPassword)
}
)
.then(
function (client) {
return client.devices()
}
)
.then(
function (devices) {
t.equal(devices.length, 0, 'devices list is empty')
}
)
}
)
test(
'teardown',
function (t) {