diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ae36b08..b0a1f99d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,14 @@ * **tests:** switch from insist to chai for assertions (#2608) r=@vladikoff ([1b47186](https://github.com/mozilla/fxa-auth-server/commit/1b47186)), closes [#2608](https://github.com/mozilla/fxa-auth-server/issues/2608) + +## [1.119.4](https://github.com/mozilla/fxa-auth-server/compare/v1.119.3...v1.119.4) (2018-09-06) + +* **push:** support port numbers in push urls ([8a9859f](https://github.com/mozilla/fxa-auth-server/commit/8a9859f)) +* **tests:** add port test ([f258387](https://github.com/mozilla/fxa-auth-server/commit/f258387)) +* **tests:** adjust geodb city for now ([fd751b2](https://github.com/mozilla/fxa-auth-server/commit/fd751b2)) + + ## [1.119.3](https://github.com/mozilla/fxa-auth-server/compare/v1.119.1...v1.119.3) (2018-08-23) diff --git a/config/index.js b/config/index.js index 712fe756..beeca3c0 100644 --- a/config/index.js +++ b/config/index.js @@ -753,7 +753,7 @@ var conf = convict({ allowedServerRegex: { doc: 'RegExp that validates the URI format of the Push Server', format: RegExp, - default: /^https:\/\/[a-zA-Z0-9._-]+(\.services\.mozilla\.com|autopush\.dev\.mozaws\.net|autopush\.stage\.mozaws\.net)(\/.*)?$/ + default: /^https:\/\/[a-zA-Z0-9._-]+(\.services\.mozilla\.com|autopush\.dev\.mozaws\.net|autopush\.stage\.mozaws\.net)(?:\:\d+)?(\/.*)?$/ } }, pushbox: { diff --git a/test/local/geodb.js b/test/local/geodb.js index ac517946..a247db94 100644 --- a/test/local/geodb.js +++ b/test/local/geodb.js @@ -27,8 +27,8 @@ describe('geodb', () => { const thisMockLog = mockLog({}) const getGeoData = proxyquire(modulePath, moduleMocks)(thisMockLog) - const geoData = getGeoData('63.245.221.32') // MTV - assert.equal(geoData.location.city, 'Mountain View') + const geoData = getGeoData('63.245.221.32') // Oakland + assert.equal(geoData.location.city, 'Oakland') assert.equal(geoData.location.country, 'United States') assert.equal(geoData.location.countryCode, 'US') assert.equal(geoData.timeZone, 'America/Los_Angeles') diff --git a/test/local/server.js b/test/local/server.js index 315e4fec..2ea370b6 100644 --- a/test/local/server.js +++ b/test/local/server.js @@ -192,7 +192,7 @@ describe('lib/server', () => { it('parsed location correctly', () => { const geo = request.app.geo assert.ok(geo) - assert.equal(geo.location.city, 'Mountain View') + assert.equal(geo.location.city, 'Oakland') assert.equal(geo.location.country, 'United States') assert.equal(geo.location.countryCode, 'US') assert.equal(geo.location.state, 'California') @@ -269,7 +269,7 @@ describe('lib/server', () => { it('second request has its own location info', () => { const geo = secondRequest.app.geo assert.notEqual(request.app.geo, secondRequest.app.geo) - assert.equal(geo.location.city, 'Mountain View') + assert.equal(geo.location.city, 'Oakland') assert.equal(geo.location.country, 'United States') assert.equal(geo.location.countryCode, 'US') assert.equal(geo.location.state, 'California') diff --git a/test/remote/device_tests.js b/test/remote/device_tests.js index f092bc20..357667e6 100644 --- a/test/remote/device_tests.js +++ b/test/remote/device_tests.js @@ -375,6 +375,44 @@ describe('remote device', function () { } ) + it( + 'update device works with callback urls that have ports', + () => { + var goodPushCallback = 'https://updates.push.services.mozilla.com:433' + var email = server.uniqueEmail() + var password = 'test password' + return Client.create(config.publicUrl, email, password) + .then( + function (client) { + var deviceInfo = { + name: 'test device', + type: 'mobile', + pushCallback: goodPushCallback, + pushPublicKey: '', + pushAuthKey: '' + } + return client.devices() + .then( + function (devices) { + assert.equal(devices.length, 0, 'devices returned no items') + return client.updateDevice(deviceInfo) + } + ) + .then( + function (device) { + assert.ok(device.id, 'device.id was set') + assert.equal(device.pushCallback, deviceInfo.pushCallback, 'device.pushCallback is correct') + } + ) + .catch( + function (err) { + assert.fail(err, 'request should have worked') + } + ) + }) + } + ) + it( 'update device fails with bad dev callbackUrl', () => {