Граф коммитов

32 Коммитов

Автор SHA1 Сообщение Дата
vladikoff 2e25c45669
feat(oauth): notify push and email on code exchanges
Fixes #2880
Fixes #2955
2019-03-31 22:02:48 -04:00
hritvi 818115f0d7 refactor(fxa-auth-server): Added prefer-arrow-callback rule in .eslintrc 2019-03-26 11:09:35 +05:30
hritvi 1b910f0af9 refactor(fxa-auth-server): Added semicolons(semi rule) 2019-03-26 11:09:35 +05:30
Vlad Filippov 3b33f416ea feat(devices): devices API with refreshTokens
Co-authored-by: Vlad Filippov <vlad.filippov@gmail.com>
Co-authored-by: Ryan Kelly <rfkelly@mozilla.com>

Fixes #2547
2019-03-19 11:00:04 -04:00
Shane Tomlinson 0b3e970de1
refactor(logging): Update to Mozlog format.
Remove all of the `op:` stuff in the logging.

fixes #2940
2019-03-08 17:40:04 +00:00
Shane Tomlinson e41522f732
fix(validation): allow https pushCallback URLs that contain :443 2018-09-07 20:28:13 +01:00
Phil Booth 0bce944b5f
refactor(devices): shortcut redundant tests for spurious device updates
As soon as one property is found to be different, we know an update is
not spurious. At that point any further testing is redundant, so we can
return from isSpuriousUpdate early and save ourselves the extra work to
continue testing other properties.
2018-08-21 12:28:14 +01:00
Phil Booth 71f8c18e2d
fix(devices): treat matching device commands as spurious updates
The logic in devices.isSpuriousUpdate was incorrectly failing to negate
a boolean condition, meaning that matching device commands were being
treated as non-spurious. This change fixes that so they are deemed
spurious instead.
2018-08-21 12:28:14 +01:00
Phil Booth bebee792ce
refactor(devices): extract and write tests for devices.isSpuriousUpdate 2018-08-21 12:28:13 +01:00
Ryan Kelly f359006c87
feat(devices): Introduce infrastructure for "device commands". (#2449); r=philbooth,eoger 2018-06-26 18:04:28 -07:00
Ryan Kelly 9e53247eb6
fix(devices): Remove the unused "device capabilities" API. (#2460); r=eoger
This was never used by production clients and is being replaced
with "device commands" in a future release.
2018-06-05 14:50:35 +10:00
Edouard Oger a9c6e0eab8 chore(devices): Remove notifyUpdate and filter target devices in the /devices/notify handler
We used to filter target devices in the push module, but that's about to be
refactored, so this moves responsibilities around to make the refactor easier.
2018-05-18 08:24:45 +10:00
Ryan Kelly 10e934f5fe
fix(validation): Reject URLs with unexpected characters. (#2370); r=pb
Previously we could accept URLs with unescaped special characters
such as newlines or unicode, which means we were depending on other
layers of the code to handle them correctly.  This change makes the
requestor responsible for properly escaping any special characters
in their URLs before passing them in to us.
2018-03-28 19:34:25 +11:00
Phil Booth 85da7f2271
fix(metrics): include full version information in event data (#2356)
Fixes mozilla/fxa-amplitude-send#58.

The user-agent parser was originally written with synthesized device
names in mind, so it didn't always return the full version string for
browsers and operating systems. Since then, we started using the same
code for our event data, meaning that we're getting an incomplete
picture of the browser/os that our users are on.

This change tweaks the user-agent code so that it returns full version
info, and tweaks the code for synthesizing device names so that it
remains consistent with its old behaviour.
2018-03-22 16:49:05 +00:00
Edouard Oger 2067dba0de
feat(devices): Devices capabilities (#2350) r=@philbooth 2018-03-20 10:31:36 -04:00
Phil Booth 563851faf9
feat(tokens): add city and stateCode to sessionTokens
https://github.com/mozilla/fxa-auth-server/pull/2180
r=vbudhram
2017-10-31 21:11:01 +00:00
Phil Booth b18079f9a0 feat(devices): translate location in devices and sessions response
https://github.com/mozilla/fxa-auth-server/pull/2188
r=vbudhram
2017-10-27 16:21:55 +01:00
Phil Booth 80d3de10e2 refactor(tokens): prefer token.id to token.tokenId
https://github.com/mozilla/fxa-auth-server/pull/2157
r=rfk
2017-10-11 06:55:18 +01:00
Edouard Oger eec0a434fe fix(push): return pushEndpointExpired as a boolean (#2127); r=rfk 2017-09-20 08:19:16 +10:00
Phil Booth f084830bcf feat(server): lazily get devices array on the request object (#2107) r=vladikoff,vbudhram
Fixes #2106.

Prevents us from accidentally calling db.devices more than once per request. I saw one definite case of this in /recovery_email/verify_code and it's possible there were others. I'll also be making use of this property heavily for the amplitude events, so it will get further usage imminently.

Making the change necessitated pulling calls to db.devices out of lib/push, which triggered some refactoring that almost got away from me. I'll add inline commentary to call out why things have changed the way they have, but most push methods now take an extra devices argument and a few other methods became redundant so I deleted them. I don't think I've broken anything.
2017-09-12 15:17:08 -04:00
Vlad Filippov 2e8e6747c6 feat(db): allow BMP chars in device name (#2053) r=rfk,jbuck
Fixes https://github.com/mozilla/fxa-auth-server/issues/1285
2017-09-12 11:14:12 -04:00
Edouard Oger 735f323775 feat(push): add a pushEndpointExpired flag for devices that need to re-register their push endpoint (#2087) r=rfk 2017-08-31 13:25:54 -04:00
Phil Booth f136268dd9 refactor(api): extract device schema to a common definition
https://github.com/mozilla/fxa-auth-server/pull/2074
r=vbudhram
2017-08-25 20:43:08 +01:00
Phil Booth d96f299b8f fix(devices): ditch OS in synthesized name if form factor is present (#2047) r=vladikoff 2017-08-11 13:44:55 -04:00
Phil Booth 5a59afa3a9 feat(devices): include form factor in synthesized device name
https://github.com/mozilla/fxa-auth-server/pull/2041
r=vbudhram
2017-08-07 16:25:44 +01:00
Sean McArthur 0cfd39ca05 refactor(lib): use strings instead of buffers for as much as possible
This settles our dance of `Buffer` vs `String` down to simply this:

> You have a `String`. You should (almost) never have a `Buffer`.

Buffers are useful for talking about a specific set of bytes, without an
encoding. In our app, the places where this is useful are:

- crypto
- mysql

We don't actually speak MySQL in this repo anywhere, so that leaves us
with only crypto. Instead of requiring the mental overhead of "Do I have
a buffer or a string?" throughout all our code base, we can just push
that completely into the crypto code.

This *should* reduce bugs where we aren't sure if we have a `Buffer` or
a `String`. If you're not in crypto, you should just have a `String`.
2017-06-28 16:05:30 -07:00
Edouard Oger 901525b910 fix(push): notify a device connected only when account verified
Fixes #1651
2017-02-13 13:50:44 +01:00
Ryan Kelly 2b4777a78d fix(push): Try to always send a deviceName in the 'device connected' push message. (#1633); r=philbooth 2017-01-31 20:08:34 +11:00
Phil Booth 957a8837f6 refactor(logging): move activity/flow event decision out of log object
#1512

r=seanmonstar,rfk,vbudhram
2016-10-18 20:58:46 +01:00
Phil Booth e12cd08faf fix(server): reinstate placeholder devices for sync sessions
This reverts commit c4c67337bc.

r=seanmonstar
2016-08-09 10:55:15 +01:00
Phil Booth c4c67337bc fix(server): remove placeholder device records for sync sessions
This reverts commit b536fd736b.

See https://github.com/mozilla/fxa-content-server/issues/3933 for
more information.

r=vbudhram
2016-07-18 15:51:40 +01:00
Phil Booth b536fd736b feat(server): synthesize device records for sync sessions 2016-07-13 10:43:44 +01:00