31 lines
1.4 KiB
C#
31 lines
1.4 KiB
C#
// SPDX-License-Identifier: BUSL-1.1
|
|
// Copyright (c) StellaOps
|
|
|
|
using StellaOps.Scanner.Core.Epss;
|
|
|
|
namespace StellaOps.Scanner.Worker.Processing;
|
|
|
|
/// <summary>
|
|
/// Null implementation of IEpssProvider for when EPSS storage is not configured.
|
|
/// </summary>
|
|
internal sealed class NullEpssProvider : IEpssProvider
|
|
{
|
|
public Task<EpssEvidence?> GetCurrentAsync(string cveId, CancellationToken cancellationToken = default)
|
|
=> Task.FromResult<EpssEvidence?>(null);
|
|
|
|
public Task<EpssBatchResult> GetCurrentBatchAsync(IEnumerable<string> cveIds, CancellationToken cancellationToken = default)
|
|
=> Task.FromResult(new EpssBatchResult { Found = [], NotFound = cveIds.ToList(), ModelDate = DateOnly.MinValue });
|
|
|
|
public Task<EpssEvidence?> GetAsOfDateAsync(string cveId, DateOnly asOfDate, CancellationToken cancellationToken = default)
|
|
=> Task.FromResult<EpssEvidence?>(null);
|
|
|
|
public Task<IReadOnlyList<EpssEvidence>> GetHistoryAsync(string cveId, DateOnly startDate, DateOnly endDate, CancellationToken cancellationToken = default)
|
|
=> Task.FromResult<IReadOnlyList<EpssEvidence>>([]);
|
|
|
|
public Task<DateOnly?> GetLatestModelDateAsync(CancellationToken cancellationToken = default)
|
|
=> Task.FromResult<DateOnly?>(null);
|
|
|
|
public Task<bool> IsAvailableAsync(CancellationToken cancellationToken = default)
|
|
=> Task.FromResult(false);
|
|
}
|