Skip to content
PHP Ecosystem
Explore

GitHubAdvisoryCveResolver

API reference › Foxy › Audit › GitHubAdvisoryCveResolver

final readonly classFoxy\Audit\GitHubAdvisoryCveResolver
ImplementsCveResolverInterface
Sourcesrc/Audit/GitHubAdvisoryCveResolver.php

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.

MethodDescriptionDefined 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
public function __construct(Composer\Util\HttpDownloader $httpDownloader)

Creates a resolver using Composer’s asynchronous HTTP downloader.

Parameters

ParameterTypeDescription
$httpDownloaderComposer\Util\HttpDownloader
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

ParameterTypeDescription
$ghsaIdslist<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