SecurityAdvisoriesFetcher
final class SecurityAdvisoriesFetcher (View source)
Defines a service to get security advisories.
Constants
| protected ADVISORIES_JSON_EXPIRABLE_KEY |
The key to use to store the advisories feed response. |
Properties
| protected ImmutableConfig | $config | The 'system.advisories' configuration. |
|
| protected Client | $httpClient | The HTTP client. |
|
| protected KeyValueStoreExpirableInterface | $keyValueExpirable | The expirable key/value store for the advisories JSON response. |
|
| protected ExtensionList[] | $extensionLists | Array of extension lists, keyed by extension type. |
|
| protected LoggerInterface | $logger | The logger. |
|
| protected bool | $withHttpFallback | Whether to fall back to HTTP if the HTTPS request fails. |
Methods
Constructs a new SecurityAdvisoriesFetcher object.
Gets security advisories that are applicable for the current site.
Deletes the stored JSON feed response, if any.
Determines if an advisory matches the existing version of a project.
Gets the information for an extension affected by the security advisory.
Determines if a security advisory is applicable for the current site.
Makes an HTTPS GET request, with a possible HTTP fallback.
Details
__construct(ConfigFactoryInterface $config_factory, KeyValueExpirableFactoryInterface $key_value_factory, ClientInterface $client, ModuleExtensionList $module_list, ThemeExtensionList $theme_list, ProfileExtensionList $profile_list, LoggerInterface $logger, Settings $settings)
Constructs a new SecurityAdvisoriesFetcher object.
array|null
getSecurityAdvisories(bool $allow_outgoing_request = TRUE, int $timeout = 0)
Gets security advisories that are applicable for the current site.
void
deleteStoredResponse()
Deletes the stored JSON feed response, if any.
protected bool
matchesExistingVersion(SecurityAdvisory $sa)
Determines if an advisory matches the existing version of a project.
protected array|null
getMatchingExtensionInfo(SecurityAdvisory $sa)
Gets the information for an extension affected by the security advisory.
protected string|null
getProjectExistingVersion(SecurityAdvisory $sa)
Gets the existing project version.
protected bool
isApplicable(SecurityAdvisory $sa)
Determines if a security advisory is applicable for the current site.
protected string
doRequest(int $timeout)
Makes an HTTPS GET request, with a possible HTTP fallback.
This method will fall back to HTTP if the HTTPS request fails and the site setting 'update_fetch_with_http_fallback' is set to TRUE.