GitHubAdvisoryCveResolver
API reference › Foxy › Audit › GitHubAdvisoryCveResolver
Resolves the CVE identifiers of GitHub security advisories through the GitHub global security advisories API.
The lookups run concurrently, so the downloader must be the async-enabled instance returned by
Composer::getLoop()->getHttpDownloader(); any other instance throws a LogicException on the first request.
See also: https://docs.github.com/en/rest/security-advisories/global-advisories.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a resolver using Composer’s asynchronous HTTP downloader. | GitHubAdvisoryCveResolver |
resolveMany() | Resolves the CVE identifiers of several advisories with one concurrent request per identifier. | GitHubAdvisoryCveResolver |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(Composer\Util\HttpDownloader $httpDownloader)Creates a resolver using Composer’s asynchronous HTTP downloader.
Parameters
| Parameter | Type | Description |
|---|---|---|
$httpDownloader | Composer\ |
resolveMany()
Section titled “resolveMany() ”public function resolveMany(list<string> $ghsaIds): array<string, Foxy\Audit\CveResolution|Throwable>Resolves the CVE identifiers of several advisories with one concurrent request per identifier.
Parameters
| Parameter | Type | Description |
|---|---|---|
$ghsaIds | list<string> | GHSA identifiers to resolve, trimmed and compared case-insensitively. |
Returns
array<string, CveResolution|Throwable>: Resolutions keyed by canonical GHSA identifier; a Throwable is the transport, JSON, or document error of that lookup.
Throws
Foxy\Exception\RuntimeException: if an identifier is not a GHSA identifier; nothing is requested in that case.