Add OpenCorporates collector for org targets, gated on an API token

Closes the last coverage gap for org (person remains intentionally
unaddressed — no good free/non-scraping option exists). Unlike the
other 8 sources, OpenCorporates now requires an API token even on its
free tier (confirmed: keyless request gets 401). RunnerRegistry::has()
checks services.opencorporates.token is configured before exposing the
source as runnable, so it degrades to "not yet integrated" in the UI
rather than a broken Run button, until OPENCORPORATES_API_TOKEN is set.

Also fixes a real bug hit while building this: a RunnerRegistry::REQUIRES
class constant mapping source key to a closure crashed on file load
(PHP class constants can't hold closures) — inlined the one check
instead of building an abstraction for a single case.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
cedry2k1992
2026-07-20 12:10:27 +03:00
co-authored by Claude Sonnet 5
parent 86f73c46b2
commit dc4388eabf
9 changed files with 261 additions and 3 deletions
+8
View File
@@ -35,4 +35,12 @@ return [
],
],
'opencorporates' => [
// Free tier requires registering for an account at
// opencorporates.com/api_accounts/new — 50 requests/day, 200/month.
// Left blank, the source is hidden from "runnable" (see
// RunnerRegistry::has()) rather than shown broken.
'token' => env('OPENCORPORATES_API_TOKEN'),
],
];