27 Commits

Author SHA1 Message Date
Pierre-Yves Bigourdan
4a75cf09a7 Add auth support to [Reddit] badges (#10790)
* Add auth support to [Reddit] badges

* Simplify token response schema
2025-01-18 16:13:53 +01:00
chris48s
9eaa2ed507 deprecate [wheelmap] service (#10538)
* deprecate [wheelmap] service

* remove app.json
2024-09-15 15:20:22 +00:00
chris48s
f562fe7c03 clarify yml paths in server-secrets docs (#10106) 2024-05-06 18:57:46 +00:00
Leo Q
e8671be7f2 support setting pypiBaseUrl by environment variables and queryParameters; affects [pypi] (#10044)
* support setting pypiBaseUrl by environment variables

* Add support for pypiBaseUrl configuration

* Update Pypi services to include pypiBaseUrl parameter

* change package name example to a more well-known package

* Update custom-environment-variables.yml

* Update Pypi services to include pypiBaseUrl parameter

* fix openapi mismatch

* Update doc/server-secrets.md

---------

Co-authored-by: chris48s <chris48s@users.noreply.github.com>
2024-04-21 16:33:42 +00:00
chris48s
880c1fb49c call [docker] with auth (#9803)
* allow user to set dockerhub credentials

* add withJwtAuth function to AuthHelper

* use withJwtAuth in DockerHub badges

* add unit tests for JWT auth

* use auth when calling docker cloud

* refactor and assert fetch helpers call withJwtAuth

* store token for a max duration (defaults to 1 hour)

* tangent: update test example
2023-12-31 14:55:18 +00:00
CanisHelix
8f1f787ceb [GITEA] add new gitea service (release/languages) (#9781)
* add gitea service based on gitlab

* update gitea to use mocks

* add gitea release test

* move tests to use public repo on codeberg and fixes

* add pagination, update tests to live, set gitea_url as required

* add auth test (wip)

* fix base auth test

* fix required optionalUrl, remove default, assume semver from firstpage

* update example to use stable repository
2023-12-18 12:39:17 +00:00
chris48s
78f83249fa fix typo in docs (#9804) 2023-12-11 19:05:11 +00:00
chris48s
19b50a66a6 call [pepy] with auth (#9748) 2023-11-19 19:24:56 +00:00
chris48s
8f76982e1c Switch [OpenCollective] badges to use GraphQL and auth (#9387)
* [OpenCollective] update opencollective to api v2 (#9346)

* update opencollective to api v2

* fix tests

* fix: do not filter by accountType for opencollective/all

* remove 404

* remove required in schema

* cnt -> count

* keep by-tier code as-is

---------

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>

* allow calling OpenCollective api with an auth token

* add test for opencollective auth

* cache OpenCollective badges for longer

---------

Co-authored-by: xxchan <xxchan22f@gmail.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-08-20 18:24:38 +00:00
Sandro Marques
96e9e130de Add [CurseForge] badges (#9252)
* add curseforge downloads badge

* Add more [CurseForge] badges

Adds the following badges:
 - /curseforge/dt/:projectId (downloads)
 - /curseforge/game-versions/:projectId (game versions)
 - /curseforge/v/:projectId (version)

The following secret:
 - CURSEFORGE_API_KEY (yml: private.curseforge_api_key)

* Remove default logo from badges

* Linter fixes

* Rename `errorMessages` to `httpErrors`

* Remove namedLogo from ModrinthGameVersions badge

* Remove namedLogo from ModrinthVersion badge

* Remove namedLogo from ModrinthFollowers badge

---------

Co-authored-by: Minecraftschurli <minecraftschurli@gmail.com>
Co-authored-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>
2023-08-13 18:00:40 +00:00
chris48s
026e675dcf add a note about fine-grained PATs in the docs (#8823)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-01-23 19:46:19 +00:00
chris48s
53c5cfa94d allow passing key to [stackexchange] (#8539)
* refactoring groundwork

* add stackapps_api_key setting

* add test for stackexchange auth

* clarify docs

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-12-04 10:53:59 +00:00
Caleb Cartwright
ae58e4a211 Add authentication for Libraries.io-based badges, run [Libraries Bower] (#7080)
* feat: support authentication on Libraries.io requests

* feat: wire up libraries.io config and api provider instantiation

* feat: create libraries.io and bower base classes

* refactor: tweak libraries/bower service classes and tests

* rename request fetcher function/arg

* throw exception when no tokens available

* cleanup old value

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-10-28 19:21:24 -05:00
Florian "sp1rit
8a9efb2fc9 [OBS] add Open Build Service service-badge (#6993)
* service: add obs service

* service: obs: replaced replaceAll with replace and global regex

* service: obs: added space between class members

* service: obs: support for multiple instances

* service: obs: removed user prefix from auth vars

obs_userName is now called obs_user and obs_userPass is called obs_pass

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>

* service: obs: removed constructor hack in favour of serviceKey

* service: obs: apply suggestions from @calebcartwright

* service: obs: remove unneccesary http status mappings

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-09-25 17:44:56 +00:00
Caleb Cartwright
961e13b229 Add API-based support for [GitLab] badges, add new GitLab Tag badge (#6988)
* Added GitLab Tag service

* Added prettyMessage for when repo has no tags

* Added pretty message for repo not found

* core: esm-ify gitlab tag service

* feat: support gitlab auth

* feat: support custom gitlab url on tag badges

* tests: add auth test for gitlab

* docs: fix gitlab config key references

* feat: support gitlab tag sorting options

* docs: add custom gitlab instance example for tags badge

* use v in gitlab route

* fix: gitlab tag examples

Co-authored-by: Ideotec <guille@ideotec.es>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-09-14 23:06:57 +00:00
Seth Falco
bd6f4ee146 fix: authenticate weblate requests (#6790)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-07-25 15:53:41 +00:00
Seth Falco
856c71c1da docs: broken links and typos (#6676)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-06-30 02:29:38 +00:00
Pierre-Yves B
9c7baa26ab Deprecate [Bintray] service (#6423) 2021-04-24 18:05:59 +01:00
Pierre-Yves B
135b842946 Migrate [Discord] implementation to use bot token (#5346)
* Migrate [Discord] implementation to use bot token

* Rework authorization field creation

* Revert "Rework authorization field creation"

This reverts commit caf65bde5d.

* Add LGTM exclusion for hardcoded credentials
2020-07-24 18:04:12 +02:00
Pierre-Yves B
0fd557d7bb Implement [YouTube] badge (#5132)
* Implement [YouTube] badge

* Update production-hosting.md with account owner

* Add votes badge variant

* Add links to tests

* Switch to social badge style
2020-06-10 18:44:21 +02:00
chris48s
d8831729cb Check request origin before sending credentials (#4729)
Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
Co-authored-by: Paul Melnikow <github@paulmelnikow.com>
Co-authored-by: chris48s <chris48s@users.noreply.github.com>

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
Co-authored-by: Paul Melnikow <github@paulmelnikow.com>
Co-authored-by: chris48s <chris48s@users.noreply.github.com>
2020-03-04 20:42:27 +00:00
Andy Li
4b9053d2d5 add [twitch] user status badge (#3683)
* add /twitch/status/:user badge

* update comments

* use a proper schema for the Twitch API calls

* use a token to make Twitch api calls

* fix handling of rate-limit error and bad token error

* [twitch] get a token as soon as creating a Twitch service

* [twitch] start both requests to users and stream before awaiting

* [twitch] set a timeout to replace the token before it expires

* [twitch] use authHelper

* [twitch] skip tests when no credentials

* [twitch] add one more status test

* twitch: do not check whether a user exists
2019-09-09 16:41:32 -05:00
Paul Melnikow
8ad0b105b1 Make the config from env more obvious at first glance; explain cascading config (#3355) 2019-04-23 13:57:23 -04:00
Cedric van Putten
483ecf24de [Drone] Add Drone build badge (#3240)
* Add drone build badge based on travis

* Fix wrong mocked endpoint for done builder

* Refactor service tester using helper method

* Add missing failure status to red statuses

* Remove extraneous invalid svg test from drone

* Test on failure red status in build status spec

* refactor(drone): use json service instead of svg

* refactor(drone): remove status text and extraneous build path in test

* refactor(drone): allow defining self-hosted drone instances

* fix(drone): use proper urls in drone examples

* fix(drone): add drone token authorization for self-hosted instances

* refactor(drone): call render build status badge directly instead of render

* refactor(drone): use server query parameter for self-hosted instances

* fix(drone): separate url and query params in example

* fix(drone): use actual build status message in examples

* fix(drone): add missing message for status code 401

Co-Authored-By: byCedric <me@bycedric.com>

* refactor(drone): remove color from drone tests

* refactor(drone): remove extraneous comments from drone tests

* refactor(drone): remove unused static preview method

* refactor(drone): remove unused static render method

* refactor(drone): reuse render build status badge helper in static previews

* fix(drone): test inaccessible repos on new message
2019-04-16 11:33:15 -05:00
Paul Melnikow
8c7404a571 Run Prettier on the rest of the things (#2662) 2019-01-07 18:33:17 -05:00
Paul Melnikow
fa5309400d PaaS, CI, and production-friendly config (#2626)
This implements the configuration mechanism I described in #2621. The heavy lifting is delegated to [node-config](https://github.com/lorenwest/node-config) with a minor assist from [dotenv](https://github.com/motdotla/dotenv).

`private/secret.json` has been replaced with environment variables and/or `config/local.yml`. See `doc/server-secrets.md`.
2019-01-06 10:42:09 -05:00
chris48s
d96d8ae193 Document private/secret.json; affects [bower jira] (#2599)
* don't use a libraries.io token for bower integration

The libraries.io docs claim you need to be authenticated
to make any API request: https://libraries.io/api#authentication

In practice we can call https://libraries.io/api/bower/jquery
just fine with no token and based on chucking a load of
requests at it and examining the `x-ratelimit-remaining`
headers you actually seem to get a better limit with no
authentication.

All of our libraries.io badges in `services/librariesio`
seem to have been running fine with no token for some time.


* change jira auth settings to jira_user, jira_pass

All the other services use servicename_user, servicename_pass

This switches JIRA to use that convention by preference
but supports _username and _password for legacy users.


* add docs for server secrets


* add danger rule for server-secrets.md

this rule prompts users to update server-secrets.md
if 'serverSecrets' is in the diff
2019-01-02 20:49:42 +00:00