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,71 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StellaOps.Scheduler.WebService.Options;
|
||||
|
||||
/// <summary>
|
||||
/// Configuration controlling Authority-backed authentication for the Scheduler WebService.
|
||||
/// </summary>
|
||||
public sealed class SchedulerAuthorityOptions
|
||||
{
|
||||
public bool Enabled { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Allows the service to run without enforcing Authority authentication (development/tests only).
|
||||
/// </summary>
|
||||
public bool AllowAnonymousFallback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Authority issuer URL exposed via OpenID discovery.
|
||||
/// </summary>
|
||||
public string Issuer { get; set; } = string.Empty;
|
||||
|
||||
public bool RequireHttpsMetadata { get; set; } = true;
|
||||
|
||||
public string? MetadataAddress { get; set; }
|
||||
|
||||
public int BackchannelTimeoutSeconds { get; set; } = 30;
|
||||
|
||||
public int TokenClockSkewSeconds { get; set; } = 60;
|
||||
|
||||
public IList<string> Audiences { get; } = new List<string>();
|
||||
|
||||
public IList<string> RequiredScopes { get; } = new List<string>();
|
||||
|
||||
public IList<string> RequiredTenants { get; } = new List<string>();
|
||||
|
||||
public IList<string> BypassNetworks { get; } = new List<string>();
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
if (!Enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Issuer))
|
||||
{
|
||||
throw new InvalidOperationException("Scheduler Authority issuer must be configured when Authority is enabled.");
|
||||
}
|
||||
|
||||
if (!Uri.TryCreate(Issuer.Trim(), UriKind.Absolute, out var uri))
|
||||
{
|
||||
throw new InvalidOperationException("Scheduler Authority issuer must be an absolute URI.");
|
||||
}
|
||||
|
||||
if (RequireHttpsMetadata && !uri.IsLoopback && !string.Equals(uri.Scheme, Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
throw new InvalidOperationException("Scheduler Authority issuer must use HTTPS unless targeting loopback development.");
|
||||
}
|
||||
|
||||
if (BackchannelTimeoutSeconds <= 0)
|
||||
{
|
||||
throw new InvalidOperationException("Scheduler Authority back-channel timeout must be greater than zero seconds.");
|
||||
}
|
||||
|
||||
if (TokenClockSkewSeconds < 0 || TokenClockSkewSeconds > 300)
|
||||
{
|
||||
throw new InvalidOperationException("Scheduler Authority token clock skew must be between 0 and 300 seconds.");
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StellaOps.Scheduler.WebService.Options;
|
||||
|
||||
/// <summary>
|
||||
/// Configuration controlling Authority-backed authentication for the Scheduler WebService.
|
||||
/// </summary>
|
||||
public sealed class SchedulerAuthorityOptions
|
||||
{
|
||||
public bool Enabled { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Allows the service to run without enforcing Authority authentication (development/tests only).
|
||||
/// </summary>
|
||||
public bool AllowAnonymousFallback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Authority issuer URL exposed via OpenID discovery.
|
||||
/// </summary>
|
||||
public string Issuer { get; set; } = string.Empty;
|
||||
|
||||
public bool RequireHttpsMetadata { get; set; } = true;
|
||||
|
||||
public string? MetadataAddress { get; set; }
|
||||
|
||||
public int BackchannelTimeoutSeconds { get; set; } = 30;
|
||||
|
||||
public int TokenClockSkewSeconds { get; set; } = 60;
|
||||
|
||||
public IList<string> Audiences { get; } = new List<string>();
|
||||
|
||||
public IList<string> RequiredScopes { get; } = new List<string>();
|
||||
|
||||
public IList<string> RequiredTenants { get; } = new List<string>();
|
||||
|
||||
public IList<string> BypassNetworks { get; } = new List<string>();
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
if (!Enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Issuer))
|
||||
{
|
||||
throw new InvalidOperationException("Scheduler Authority issuer must be configured when Authority is enabled.");
|
||||
}
|
||||
|
||||
if (!Uri.TryCreate(Issuer.Trim(), UriKind.Absolute, out var uri))
|
||||
{
|
||||
throw new InvalidOperationException("Scheduler Authority issuer must be an absolute URI.");
|
||||
}
|
||||
|
||||
if (RequireHttpsMetadata && !uri.IsLoopback && !string.Equals(uri.Scheme, Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
throw new InvalidOperationException("Scheduler Authority issuer must use HTTPS unless targeting loopback development.");
|
||||
}
|
||||
|
||||
if (BackchannelTimeoutSeconds <= 0)
|
||||
{
|
||||
throw new InvalidOperationException("Scheduler Authority back-channel timeout must be greater than zero seconds.");
|
||||
}
|
||||
|
||||
if (TokenClockSkewSeconds < 0 || TokenClockSkewSeconds > 300)
|
||||
{
|
||||
throw new InvalidOperationException("Scheduler Authority token clock skew must be between 0 and 300 seconds.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
namespace StellaOps.Scheduler.WebService.Options;
|
||||
|
||||
public sealed class SchedulerCartographerOptions
|
||||
{
|
||||
public CartographerWebhookOptions Webhook { get; set; } = new();
|
||||
}
|
||||
|
||||
public sealed class CartographerWebhookOptions
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
public string? Endpoint { get; set; }
|
||||
|
||||
public string? ApiKeyHeader { get; set; }
|
||||
|
||||
public string? ApiKey { get; set; }
|
||||
|
||||
public int TimeoutSeconds { get; set; } = 10;
|
||||
}
|
||||
namespace StellaOps.Scheduler.WebService.Options;
|
||||
|
||||
public sealed class SchedulerCartographerOptions
|
||||
{
|
||||
public CartographerWebhookOptions Webhook { get; set; } = new();
|
||||
}
|
||||
|
||||
public sealed class CartographerWebhookOptions
|
||||
{
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
public string? Endpoint { get; set; }
|
||||
|
||||
public string? ApiKeyHeader { get; set; }
|
||||
|
||||
public string? ApiKey { get; set; }
|
||||
|
||||
public int TimeoutSeconds { get; set; } = 10;
|
||||
}
|
||||
|
||||
@@ -1,70 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StellaOps.Scheduler.WebService.Options;
|
||||
|
||||
/// <summary>
|
||||
/// Scheduler host configuration defaults consumed at startup for cross-cutting concerns
|
||||
/// such as plug-in discovery.
|
||||
/// </summary>
|
||||
public sealed class SchedulerOptions
|
||||
{
|
||||
public PluginOptions Plugins { get; set; } = new();
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
Plugins.Validate();
|
||||
}
|
||||
|
||||
public sealed class PluginOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Base directory resolving relative plug-in paths. Defaults to solution root.
|
||||
/// </summary>
|
||||
public string? BaseDirectory { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Directory containing plug-in binaries. Defaults to <c>plugins/scheduler</c>.
|
||||
/// </summary>
|
||||
public string? Directory { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Controls whether sub-directories are scanned for plug-ins.
|
||||
/// </summary>
|
||||
public bool RecursiveSearch { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Ensures the plug-in directory exists on startup.
|
||||
/// </summary>
|
||||
public bool EnsureDirectoryExists { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Explicit plug-in discovery patterns (supports globbing).
|
||||
/// </summary>
|
||||
public IList<string> SearchPatterns { get; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Optional ordered plug-in assembly names (without extension).
|
||||
/// </summary>
|
||||
public IList<string> OrderedPlugins { get; } = new List<string>();
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
foreach (var pattern in SearchPatterns)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(pattern))
|
||||
{
|
||||
throw new InvalidOperationException("Scheduler plug-in search patterns cannot contain null or whitespace entries.");
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var assemblyName in OrderedPlugins)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(assemblyName))
|
||||
{
|
||||
throw new InvalidOperationException("Scheduler ordered plug-in entries cannot contain null or whitespace values.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StellaOps.Scheduler.WebService.Options;
|
||||
|
||||
/// <summary>
|
||||
/// Scheduler host configuration defaults consumed at startup for cross-cutting concerns
|
||||
/// such as plug-in discovery.
|
||||
/// </summary>
|
||||
public sealed class SchedulerOptions
|
||||
{
|
||||
public PluginOptions Plugins { get; set; } = new();
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
Plugins.Validate();
|
||||
}
|
||||
|
||||
public sealed class PluginOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Base directory resolving relative plug-in paths. Defaults to solution root.
|
||||
/// </summary>
|
||||
public string? BaseDirectory { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Directory containing plug-in binaries. Defaults to <c>plugins/scheduler</c>.
|
||||
/// </summary>
|
||||
public string? Directory { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Controls whether sub-directories are scanned for plug-ins.
|
||||
/// </summary>
|
||||
public bool RecursiveSearch { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Ensures the plug-in directory exists on startup.
|
||||
/// </summary>
|
||||
public bool EnsureDirectoryExists { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Explicit plug-in discovery patterns (supports globbing).
|
||||
/// </summary>
|
||||
public IList<string> SearchPatterns { get; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Optional ordered plug-in assembly names (without extension).
|
||||
/// </summary>
|
||||
public IList<string> OrderedPlugins { get; } = new List<string>();
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
foreach (var pattern in SearchPatterns)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(pattern))
|
||||
{
|
||||
throw new InvalidOperationException("Scheduler plug-in search patterns cannot contain null or whitespace entries.");
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var assemblyName in OrderedPlugins)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(assemblyName))
|
||||
{
|
||||
throw new InvalidOperationException("Scheduler ordered plug-in entries cannot contain null or whitespace values.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user