Closed ajvb closed 4 years ago
I was wondering too if it's be worth adding some test cases specifically around what FxA currently expects as a result from the compatibility methods, to make sure that is accurate.
@ameihm0912 So from looking at FxA's code, they return response.body.reputation
from the get()
call (https://github.com/mozilla/fxa/blob/master/packages/fxa-customs-server/lib/reputationService.js#L56) and check the status code and timing phases of the request (added by the http request lib used in this package). We have tests that test for the reputation
value, timing phases, and tons that check the status code using the compat get()
and sendViolation()
methods, so I think we currently do have tests that cover all of what FxA expects.
Removes the use of legacy iprepd endpoints and makes use of the new typed endpoints. This PR maintains the current API and extends it with new '<_>Typed' functions.
Fixes #39
@g-k There is one part I am still unsure of how to deal with, and that is the change from the response body for "get reputation" calls using
ip
as a key to now usingobject
. The compat code in iprepd for this is here: https://github.com/mozilla-services/iprepd/blob/cd62a1f65e61ff91480ee07a0fa56232e2b471f8/score.go#L162-L172Is there someway for me to include a compat layer in the returned Promise from
getTyped()
? How do I do something like that with Promises?