up
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Export Center CI / export-ci (push) Has been cancelled
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Export Center CI / export-ci (push) Has been cancelled
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
This commit is contained in:
@@ -1,87 +1,87 @@
|
||||
using System;
|
||||
|
||||
namespace StellaOps.Concelier.Connector.Distro.Debian.Configuration;
|
||||
|
||||
public sealed class DebianOptions
|
||||
{
|
||||
public const string HttpClientName = "concelier.debian";
|
||||
|
||||
/// <summary>
|
||||
/// Raw advisory list published by the Debian security tracker team.
|
||||
/// Defaults to the Salsa Git raw endpoint to avoid HTML scraping.
|
||||
/// </summary>
|
||||
public Uri ListEndpoint { get; set; } = new("https://salsa.debian.org/security-tracker-team/security-tracker/-/raw/master/data/DSA/list");
|
||||
|
||||
/// <summary>
|
||||
/// Base URI for advisory detail pages. Connector appends {AdvisoryId}.
|
||||
/// </summary>
|
||||
public Uri DetailBaseUri { get; set; } = new("https://security-tracker.debian.org/tracker/");
|
||||
|
||||
/// <summary>
|
||||
/// Maximum advisories fetched per run to cap backfill effort.
|
||||
/// </summary>
|
||||
public int MaxAdvisoriesPerFetch { get; set; } = 40;
|
||||
|
||||
/// <summary>
|
||||
/// Initial history window pulled on first run.
|
||||
/// </summary>
|
||||
public TimeSpan InitialBackfill { get; set; } = TimeSpan.FromDays(30);
|
||||
|
||||
/// <summary>
|
||||
/// Resume overlap to accommodate late edits of existing advisories.
|
||||
/// </summary>
|
||||
public TimeSpan ResumeOverlap { get; set; } = TimeSpan.FromDays(2);
|
||||
|
||||
/// <summary>
|
||||
/// Request timeout used for list/detail fetches unless overridden via HTTP client.
|
||||
/// </summary>
|
||||
public TimeSpan FetchTimeout { get; set; } = TimeSpan.FromSeconds(45);
|
||||
|
||||
/// <summary>
|
||||
/// Optional pacing delay between detail fetches.
|
||||
/// </summary>
|
||||
public TimeSpan RequestDelay { get; set; } = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// Custom user-agent for Debian tracker courtesy.
|
||||
/// </summary>
|
||||
public string UserAgent { get; set; } = "StellaOps.Concelier.Debian/0.1 (+https://stella-ops.org)";
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
if (ListEndpoint is null || !ListEndpoint.IsAbsoluteUri)
|
||||
{
|
||||
throw new InvalidOperationException("Debian list endpoint must be an absolute URI.");
|
||||
}
|
||||
|
||||
if (DetailBaseUri is null || !DetailBaseUri.IsAbsoluteUri)
|
||||
{
|
||||
throw new InvalidOperationException("Debian detail base URI must be an absolute URI.");
|
||||
}
|
||||
|
||||
if (MaxAdvisoriesPerFetch <= 0 || MaxAdvisoriesPerFetch > 200)
|
||||
{
|
||||
throw new InvalidOperationException("MaxAdvisoriesPerFetch must be between 1 and 200.");
|
||||
}
|
||||
|
||||
if (InitialBackfill < TimeSpan.Zero || InitialBackfill > TimeSpan.FromDays(365))
|
||||
{
|
||||
throw new InvalidOperationException("InitialBackfill must be between 0 and 365 days.");
|
||||
}
|
||||
|
||||
if (ResumeOverlap < TimeSpan.Zero || ResumeOverlap > TimeSpan.FromDays(14))
|
||||
{
|
||||
throw new InvalidOperationException("ResumeOverlap must be between 0 and 14 days.");
|
||||
}
|
||||
|
||||
if (FetchTimeout <= TimeSpan.Zero || FetchTimeout > TimeSpan.FromMinutes(5))
|
||||
{
|
||||
throw new InvalidOperationException("FetchTimeout must be positive and less than five minutes.");
|
||||
}
|
||||
|
||||
if (RequestDelay < TimeSpan.Zero || RequestDelay > TimeSpan.FromSeconds(10))
|
||||
{
|
||||
throw new InvalidOperationException("RequestDelay must be between 0 and 10 seconds.");
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
|
||||
namespace StellaOps.Concelier.Connector.Distro.Debian.Configuration;
|
||||
|
||||
public sealed class DebianOptions
|
||||
{
|
||||
public const string HttpClientName = "concelier.debian";
|
||||
|
||||
/// <summary>
|
||||
/// Raw advisory list published by the Debian security tracker team.
|
||||
/// Defaults to the Salsa Git raw endpoint to avoid HTML scraping.
|
||||
/// </summary>
|
||||
public Uri ListEndpoint { get; set; } = new("https://salsa.debian.org/security-tracker-team/security-tracker/-/raw/master/data/DSA/list");
|
||||
|
||||
/// <summary>
|
||||
/// Base URI for advisory detail pages. Connector appends {AdvisoryId}.
|
||||
/// </summary>
|
||||
public Uri DetailBaseUri { get; set; } = new("https://security-tracker.debian.org/tracker/");
|
||||
|
||||
/// <summary>
|
||||
/// Maximum advisories fetched per run to cap backfill effort.
|
||||
/// </summary>
|
||||
public int MaxAdvisoriesPerFetch { get; set; } = 40;
|
||||
|
||||
/// <summary>
|
||||
/// Initial history window pulled on first run.
|
||||
/// </summary>
|
||||
public TimeSpan InitialBackfill { get; set; } = TimeSpan.FromDays(30);
|
||||
|
||||
/// <summary>
|
||||
/// Resume overlap to accommodate late edits of existing advisories.
|
||||
/// </summary>
|
||||
public TimeSpan ResumeOverlap { get; set; } = TimeSpan.FromDays(2);
|
||||
|
||||
/// <summary>
|
||||
/// Request timeout used for list/detail fetches unless overridden via HTTP client.
|
||||
/// </summary>
|
||||
public TimeSpan FetchTimeout { get; set; } = TimeSpan.FromSeconds(45);
|
||||
|
||||
/// <summary>
|
||||
/// Optional pacing delay between detail fetches.
|
||||
/// </summary>
|
||||
public TimeSpan RequestDelay { get; set; } = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// Custom user-agent for Debian tracker courtesy.
|
||||
/// </summary>
|
||||
public string UserAgent { get; set; } = "StellaOps.Concelier.Debian/0.1 (+https://stella-ops.org)";
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
if (ListEndpoint is null || !ListEndpoint.IsAbsoluteUri)
|
||||
{
|
||||
throw new InvalidOperationException("Debian list endpoint must be an absolute URI.");
|
||||
}
|
||||
|
||||
if (DetailBaseUri is null || !DetailBaseUri.IsAbsoluteUri)
|
||||
{
|
||||
throw new InvalidOperationException("Debian detail base URI must be an absolute URI.");
|
||||
}
|
||||
|
||||
if (MaxAdvisoriesPerFetch <= 0 || MaxAdvisoriesPerFetch > 200)
|
||||
{
|
||||
throw new InvalidOperationException("MaxAdvisoriesPerFetch must be between 1 and 200.");
|
||||
}
|
||||
|
||||
if (InitialBackfill < TimeSpan.Zero || InitialBackfill > TimeSpan.FromDays(365))
|
||||
{
|
||||
throw new InvalidOperationException("InitialBackfill must be between 0 and 365 days.");
|
||||
}
|
||||
|
||||
if (ResumeOverlap < TimeSpan.Zero || ResumeOverlap > TimeSpan.FromDays(14))
|
||||
{
|
||||
throw new InvalidOperationException("ResumeOverlap must be between 0 and 14 days.");
|
||||
}
|
||||
|
||||
if (FetchTimeout <= TimeSpan.Zero || FetchTimeout > TimeSpan.FromMinutes(5))
|
||||
{
|
||||
throw new InvalidOperationException("FetchTimeout must be positive and less than five minutes.");
|
||||
}
|
||||
|
||||
if (RequestDelay < TimeSpan.Zero || RequestDelay > TimeSpan.FromSeconds(10))
|
||||
{
|
||||
throw new InvalidOperationException("RequestDelay must be between 0 and 10 seconds.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user