* Revert "send custom user agent when using got (#6256)"
This reverts commit fd7eddc7bb.
* Revert "Migrate request to got (part 1 of many) (#6160)"
This reverts commit 2359eb278b.
* install got as a prod dependency, allow npm 7
* install new packages
* migrate request to got
* update dynamic json test
This is a behavioural difference between request and got
request will send the request, then we'll get a
`400 Bad Request` back and re-throw at as invalid
got will pick up that the URL is invalid and throw
`RequestError: URI malformed` before attempting to send it
which we'll re-throw as inaccessible
* fix OPM service
* fix wordpress querystring
Got doesn't natively support assmebling a querystring
from nested objects because it uses node's URLSearchParams
internally. Use qs and pass qs a string.
Wordpress is the only service that needs this,
so we could build the string manually in this case
if we don't want to take qs as a prod dependency.
It is mostly hard-coded values anyway.
* fix wercker
got overwrites any ?foo=bar in the URL string if
searchParams is also passed whereas request appends
see https://github.com/sindresorhus/got#url
* fix keybase
* add tests for got wrapper
* bootstrap global agent in server start
This will definitely save time, and ensure more uniformity.
It moves the `createServiceTester()` calls to a different place from where I'd like them, though I'm happy to have them checked by the linter.
Closes#2701
* Add Keybase PGP badge
* Return 'not found' if the key is not present
* Change the default colour
* Add more constraints to the schema
* Render 64-bit fingerprints
* Add example
* Add a 'hex()' constraint to the fingerprint
* Improve error handling
* Add class 'KeybaseProfile'
* Add unit tests for Keybase PGP
* Add Keybase BTC
* Add unit tests for Keybase BTC
* Add Keybase ZEC
* Add unit tests for Keybase ZEC
* Add Keybase XLM
* Add unit tests for Keybase XLM
* Validate the BTC address using a regex
Regex taken from
https://mokagio.github.io/tech-journal/2014/11/21/regex-bitcoin.html.
* Exclude 'not found' from addresses' value in unit tests
* Remove useless keywords
* Add the link to the Keybase API documentation
* Move the colour into 'defaultBadgeData'
* Remove the HTTP method
'GET' is already the default one.
* Improve the error handling for Keybase BTC
* Add more constraints to the Keybase BTC schema
* Update one unit test for Keybase BTC
* Fix the error handling for Keybase BTC
* Add more unit tests for Keybase BTC
* Improve the error handling for Keybase ZEC
* Improve the error handling for Keybase PGP
* Improve the error handling for Keybase XLM
* Display a real username value in the examples
* Include the status code in the schemas
* Move the category to the base class
The same category is used by all badges.
* Add function 'transform' to the base class
The function 'transform' is used to encapsulate the error handling logic
as it is the same in each service.