107 Commits
Author SHA1 Message Date
Pierre-Yves Bigourdan 462c04c375 Remove global-agent dependency (#12315) 2026-11-09 23:32:08 +00:00
Pierre-Yves Bigourdan 66d0740e9e Retire [YouTube] badges (#12113) 2026-08-30 20:28:01 +00:00
bgh-githubandbgh e17cb9894f Fix Explicitly disable broken server SPDY mode (#12108)
Co-authored-by: bgh <git@bgh.io>
2026-08-11 19:26:01 +00:00
Kerolos Atallah 6f9809502c [OutageDeck] Add provider status badge (#12096)
* Add OutageDeck provider status badge

* Add optional OutageDeck API authentication

* Use live missing-provider test
2026-08-11 19:18:26 +00:00
Abduaziz Umarov 2591ec1ba5 [Dynamic Endpoint] Allow self-hosters to disable open-ended badges (#12064)
* docs: reproduce issue 8944 URL fetching

* docs: plan issue 8944 route controls

* Add open-ended badge route control

* Test disabled Dynamic and Endpoint routes

* Consolidate route control test coverage

* Document disabling open-ended badge routes

* Remove course artifacts from upstream diff

* Expand route control integration coverage
2026-08-01 14:58:12 +00:00
LitoMore 5126ca2389 [readthedocs] Move to readthedocs API v3 (#11995)
* [readthedocs] Move to readthedocs API v3

* Add live test & fix validation fields

* Handle missing Read the Docs builds
2026-07-23 15:00:47 +00:00
Pierre-Yves Bigourdan 8c838ea90c Remove cors.allowedOrigin config (#11723) 2026-03-07 21:06:00 +00:00
jNullj c647f05307 Remove deprecated fetchLimit from configuration (#11684) 2026-02-17 21:56:32 +00:00
jNulljandPierre-Yves Bigourdan fcfbf895c1 Improve our approach for testing auth (part 2) - basicAuth (#9983)
* improve stackexchange auth testing

Change auth tests to include all shields of the base class.
The code is formated to be used in more general cases and increases code reuseability.

* Remove dummy auth test

We already test all existing classes, no need for a dummy

* Add getBadgeExampleCall to test-helpers

Add getBadgeExampleCall to extract the first OpenAPI example then reformat it for service invoke function.

* Use getBadgeExampleCall in stackexchange-base tests

* Fix getBadgeExampleCall Errors

* Add testAuth to test-helpers

Add the testAuth function which tests auth of a service (badge) using a provided dummy response.

* Refactor stackexchange-base.spec.js to use testAuth from test-helpers

* Split stackexchange-base.spec into per service test file

* Add all auth methods to testAuth

Add all auth methods used to testAuth to be generic and used by all services.
Add helper functions to make testAuth more readable

* Handle non-default bearer and api headers

* Add discord.spec.js as first attempt for bearer auth

* Fix basic auth user

* Add dynamic authorizedOrigins

* Add header optional argument

* Add obs as basicAuth example

* Use apiHeaderKey and bearerHeaderKey function params

Use apiHeaderKey & bearerHeaderKey as function params rather then extracting them with regex from function strings.

Those options are now part of an options object param joined with the contentType that replaces header.

header was originaly added for setting content type of the reply, so it makes more sense to directly set the content type

* Remove old comment

* Allow any pass & user key for QueryStringAuth

Before this commit the QueryStringAuth would only work for the key of stackexchange.
This commit makes the testAuth function generic and allows passing user and pass keys.

* Add auth test for PepyDownloads

* Fix wrong header for jwt login

Might set wrong header for jwt login request.
This commit fixes that.

* Support multiple authOrigins in testAuth

Some services might have more then one authOrigin.
This commit makes sure we test for redundent authOrigins as well as support requests to them if needed.

* Add docker-automated auth test

* Fix JwtAuth testing by introducing mandatory jwtLoginEndpoint

Prior to this change, JwtAuth testing would lead to erros due to the absence of a specified login endpoint,
Nock would be dumplicated for both login and non login hosts and indicate a missing request.

This commit enforces the requirement for a new jwtLoginEndpoint argument when testing JwtAuth.
The argument seperates the endpoint nock scope from the behavior of the request nock.

* Fix type test in generateFakeConfig

* Add exampleOverride to testAuth

Introduce `exampleOverride` to test authentication scenarios.
Allows providing custom examples for testAuth via an object.
Simulates service requests that trigger desiered condition paths in tests.

* Add authOverride to testAuth

Some classes can change the auth based on badge inputs.
This parameter allows the flexability of overriding the default auth for testing those cases.

* Add configOverride to testAuth

Some tests might require non default config for cases where these are set.
This allows creating tests for those cases.

* Fix example params by split into path and query

Splits testAuth example params into path and query params.
Introduce paramType to getBadgeExampleCall

* Refactor BitbucketPullRequest for testAuth

Refactor to add auth static properties.
for better integration with testAuth.

Refactor bitbucketpullrequest for testAuth

* Refactor: use testAuth for BitbucketPullRequest

* Fix BitbucketPullRequest tests using authOverride

* Add auth testing for jenkins services with testAuth

* Add auth testing for Jira services with testAuth

* Add auth testing for Nexus services with testAuth

* Improve error handling in getServiceClassAuthOrigin

Enhance reliability by throwing a TypeError when a service key definition is missing.
It's common for a key to be missing and might require the developer that writes tests to provide a fake on that fits the examples used.

Key changes:
- Added a check for missing service key definitions in getServiceClassAuthOrigin.
- Throws a TypeError with a clear message if the key is not found.
- Guides devs to use an override if needed which is often.

* Fix edge case in testAuth for user only auth

Addresses a scenario where generateFakeConfig/testAuth would fail for classes using auth.userKey without auth.passKey.
Ensures proper handling of user-specific authentication even if a password key is not present.
Throws a TypeError only when both fakeKey and fakeUser are missing.
Better fit for AuthHelper behivor.

* Add option to not import openApi example in testAuth

Added for services without openApi examples.
Dev can use example override to add example inputs in those cases.

* Add auth testing for Sonar services with testAuth

* Add auth testing for SymfonyInsight services with testAuth

* Refactor TeamCity auth tests for use of testAuth

* Refactor testAuth function to handle defaultToEmptyStringForUser auth option

* Add support for multiple requests in testAuth function

Some services might have more then one request to auth with the server for the same shield.
This commit adds support for those requests in testAuth using the new multipleRequests option.

* Add auth testing for AzureDevOps services with testAuth

* Fix async mocha tests

Missing return for async mocha tests caused the tests to run async and throw errors of one test in another.
This commit makes sure all testAuth tests return a promise to mocha for it to await.

* Remove ignoreOpenApiExample option in testAuth function

The `ignoreOpenApiExample` option in the `testAuth` function is no longer needed and has been removed. This option was used to ignore OpenAPI examples for classes without OpenAPI, but it is no longer necessary as the function now handles this case correctly.
BaseService defines by dafault empty object for openApi so if nothing is set we expect empty obj.
Warn devs about missing openApi as openApi is standard for services now.

* handle extraction of openApi boolean examples

Improve authTest by handeling boolean example extractions.
Remove example override not needed after this change.

* Use static headers in base service classes and remove contentType option from testAuth

Refactor the base service classes (BaseGraphqlService, BaseJsonService, BaseSvgScrapingService, BaseTomlService, BaseXmlService, BaseYamlService) to use static headers for access from other function to header types.
Remove testAuth contentType option and use the new headers veriable to extract headers insted.

* Remove contentType option tests using testAuth

This option is removed

* Update jenkinsCoverage response

Example changed at 62ed7c3a27
The new example schema differ from old one
This caused test to fail
Update example response to fit new schema

* remove BitbucketPullReuqest tests

remove for adding these changes in a later PR.
this test adds the authOverride we try to get rid of.
This blocks testAuth development and is planned for a later time.

* fix: fix wrong exception message & check order

* fix typo

Co-authored-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>

* fix typo cleanup -> clean up

Co-authored-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>

* fix exception error text 'object' -> 'boolean'

Co-authored-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>

* fix: return merged authorizedOrigins in getServiceClassAuthOrigin

* update JenkinsTests origin

Was outdated after merging with master.
This commit fixes origin test to openapi example.

* fix(docs): docstring origins type

* fix typo

* fix(auth): reduce strictness for JwtAuth test

Avoid exact body match requirement.
We are only intrested in username and password values to match, not exact one to one object.

---------

Co-authored-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>
2026-01-11 19:32:38 +00:00
Pierre-Yves Bigourdan 9fcc44a1ee Remove cors.allowedOrigin config (#11611)
* Remove cors.allowedOrigin config

* Put deprecation warning
2026-01-04 08:05:18 +00:00
Pierre-Yves Bigourdan 3ff2e5bd20 Drop support for fetchLimit config (#11569) 2025-12-09 20:43:57 +00:00
LitoMore 52df4da7de Treat img.shields.io/favicon.ico as 404 resource (#11576) 2025-12-08 20:02:48 +00:00
jNulljandPierre-Yves Bigourdan 817b04794f Add allowUnsecuredEndpointRequests config option for [Endpoint] (#11530)
* add allowUnsecuredEndpointRequests config option

* allow http endpoint request using new config

fixes endpoint.svg requires https for localhost
Fixes #2891

base of feedback from pr #2903

* add tests for new allowUnsecuredEndpointRequests config

* convert class veriable allowUnsecured into instence private veriable

Co-authored-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>

* add missing rename

continues prev commit

Co-authored-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>

* rewrite endpoint spec tests

---------

Co-authored-by: Pierre-Yves Bigourdan <10694593+PyvesB@users.noreply.github.com>
2025-12-02 19:01:11 +00:00
Pierre-Yves Bigourdan d3db94d637 Separate GitHub token metrics and debug logging (#11504) 2025-11-15 22:25:49 +00:00
Pierre-Yves Bigourdan 3dbe091aa3 Introduce fileSizeBytes config (#11430) 2025-11-15 13:28:07 +01:00
Pierre-Yves Bigourdan 2095c5c218 Fix GitHub token pool debug logging and add metrics (#11500) 2025-11-15 10:59:51 +00:00
Pierre-Yves Bigourdan d366857800 Remove legacy configuration checks (#11424) 2025-11-13 22:34:41 +01:00
Pierre-Yves Bigourdan e948cd54b9 Return 200 status code for not found badges (#11479) 2025-11-08 18:32:56 +00:00
chris48s 954147f7d9 URL validator tidyup; affects [discourse dynamic endpoint gerrit jira maven nexus osslifecycle python vpm website] securityheaders sonar swagger w3c (#10810)
* add a required url validator

* replace occurrences of optionalUrl.required() with url

* use standard validators in server.js
2025-01-18 19:16:41 +00:00
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 c67c8f0505 send Cross-Origin-Resource-Policy header on all responses (#10420)
* send Cross-Origin-Resource-Policy header on all responses

* don't re-add Access-Control-Allow-Origin on json responses

this is re-adding a header we've already set earlier in the process

* update tests
2024-07-28 08:22:24 +00:00
Leo Qandchris48s 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 19b50a66a6 call [pepy] with auth (#9748) 2023-11-19 19:24:56 +00:00
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
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 c7efb27086 exclude assets dir from raster redirects (#9409) 2023-07-24 13:15:05 +01:00
dependabot[bot]andchris48s b9d96755ec chore(deps-dev): bump prettier from 2.8.8 to 3.0.0 (#9357)
* chore(deps-dev): bump prettier from 2.8.8 to 3.0.0

Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* reformat all the things (prettier 3)

* update tests to await calls to prettier.format()

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: chris48s <git@chris-shaw.dev>
2023-07-10 09:27:51 +00:00
chris48s 50ea7068a8 migrate frontend to docusaurus (#9014)
* delete loads of really important stuff that we definitely need

* v basic MVP smoosh docusaurus PoC into repo

* TODO

* delete more really important stuff

* TODO

* tidyup: use run-s

* don't redirect images used in frontend to raster proxy

* fix routing

* preserve the /endpoint link

* delete the blog (for now)

I would quite like to re-add this at some point
but its not really the top priority thing right now

* content edits

* appease the lint gods

* update danger rules

* remove placeholder

* cypress tests

* dockerhub --> ghcr

* Revert "dockerhub --> ghcr"

This reverts commit ef74cbb26b.

* downgrade lockfile format

* implement defs/BASE_URL

* fix e2e build

* actually fix cypress tests

* always run cypress tests on build

* this never worked

* add command for docusaurus:clear

* delete more code we don't need any more

* update ESLint/prettier config

* delete unsused exports

* documentation updates

* delete a fairly large chunk of our dependency tree

* allow base_url as build arg to Dockerfile

* fixup dockerfile

* work out base url at runtime if not set

doing this at image build time is not the right approach

* remove gatsby monorepo from closebot

* rename HomepageFeatures to homepage-features
2023-06-17 10:59:07 +01:00
chris48s 091ccfdbcd migrate token pooling to postgres (#8922)
* add ability to store token pool in Postgres DB

* update transitive ansi-regex dependencies
2023-02-23 17:18:39 +00:00
chris48sandrepo-ranger[bot] c3d08f7f8b Send X-GitHub-Api-Version when calling [GitHub] v3 API (#8669)
* send X-GitHub-Api-Version when calling GitHub v3 API

* TODO: invesitgate

* read baseUrl from config.service.baseUri

* add workflow to check for new GH api releases on schedule

* format config/default.yml to match yaml.dump() format

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-12-31 15:56:04 +00:00
chris48sandrepo-ranger[bot] 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
chris48sandrepo-ranger[bot] 5305e11f79 Remove 'suggest badges' feature (#8311)
* remove 'suggest badges' feature

* remove allowedOrigin/ALLOWED_ORIGIN setting

* keep allowedOrigin for now

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-11-09 18:15:59 +00:00
chris48sandrepo-ranger[bot] d78a2f4155 allow/validate bitbucket_username / bitbucket_password in private config schema (#8472)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2022-10-08 10:37:05 +00:00
chris48s 8821ff85fc handle missing 'fly-client-ip' (#7814) 2022-04-05 20:29:28 +01:00
chris48s ca1e77436b allow requireCloudflare setting to work when hosted on fly.io (#7781) 2022-03-26 20:08:22 +00:00
Caleb Cartwright 38c1e2df16 restore cors header injection from #4171, run [npm travis] (#4255)
* fix: restore cors header injection from #4171

* tests: move test into describe

* prettier
2021-12-05 15:40:48 -06:00
chris48s feb1682814 Clean up cache module; affects [feedz jenkinsplugin myget node nuget packagist travis wordpress] (#7319)
* update terminology
    - "regular update" to "cached resource"
    - "interval" to "ttl"
    - move file and update imports

* set a default TTL, don't explicitly pass params if we want the default

* add tests

* update docs
2021-11-29 21:21:03 +00:00
chris48sandrepo-ranger[bot] 99bffd3a86 Send better user-agent values (and got config changes) (#7309)
* expose fetchLimitBytes/userAgent in got-config module

* export a function not a factory

* send better user-agent values

- add userAgentBase setting
- send short SHA in user agent on heroku
- set a version (tag or short SHA) in Dockefile and use
  it to report server version in UA for docker users

* add a comment explaining fileSize

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-11-25 17:11:49 +00:00
Caleb Cartwrightandrepo-ranger[bot] 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
chris48s 0ce98396d7 remove [github] admin routes (#7105) 2021-10-05 17:17:26 +01:00
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
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 Falcoandrepo-ranger[bot] 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
chris48sandrepo-ranger[bot] 8983c39f74 Re-apply 'Migrate request to got (part 1)' (#6755)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-07-11 13:28:14 +00:00
Pierre-Yves B 23c0406bed Migrate from CommonJS to ESM (#6651) 2021-07-09 12:53:55 +01:00
Pierre-Yves B 59dcdf24f3 Remove rate limiting functionality (#6513) 2021-05-20 08:02:44 +01:00
Pierre-Yves B 9c7baa26ab Deprecate [Bintray] service (#6423) 2021-04-24 18:05:59 +01:00