Add tests and implement StubBearer authentication for Signer endpoints
- Created SignerEndpointsTests to validate the SignDsse and VerifyReferrers endpoints. - Implemented StubBearerAuthenticationDefaults and StubBearerAuthenticationHandler for token-based authentication. - Developed ConcelierExporterClient for managing Trivy DB settings and export operations. - Added TrivyDbSettingsPageComponent for UI interactions with Trivy DB settings, including form handling and export triggering. - Implemented styles and HTML structure for Trivy DB settings page. - Created NotifySmokeCheck tool for validating Redis event streams and Notify deliveries.
This commit is contained in:
		@@ -0,0 +1,75 @@
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Text.Json.Serialization;
 | 
			
		||||
 | 
			
		||||
namespace StellaOps.Scanner.WebService.Contracts;
 | 
			
		||||
 | 
			
		||||
public sealed record RuntimePolicyRequestDto
 | 
			
		||||
{
 | 
			
		||||
    [JsonPropertyName("namespace")]
 | 
			
		||||
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
 | 
			
		||||
    public string? Namespace { get; init; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("labels")]
 | 
			
		||||
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
 | 
			
		||||
    public IDictionary<string, string>? Labels { get; init; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("images")]
 | 
			
		||||
    public IReadOnlyList<string> Images { get; init; } = Array.Empty<string>();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
public sealed record RuntimePolicyResponseDto
 | 
			
		||||
{
 | 
			
		||||
    [JsonPropertyName("ttlSeconds")]
 | 
			
		||||
    public int TtlSeconds { get; init; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("expiresAtUtc")]
 | 
			
		||||
    public DateTimeOffset ExpiresAtUtc { get; init; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("policyRevision")]
 | 
			
		||||
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
 | 
			
		||||
    public string? PolicyRevision { get; init; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("results")]
 | 
			
		||||
    public IReadOnlyDictionary<string, RuntimePolicyImageResponseDto> Results { get; init; } = new Dictionary<string, RuntimePolicyImageResponseDto>(StringComparer.Ordinal);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
public sealed record RuntimePolicyImageResponseDto
 | 
			
		||||
{
 | 
			
		||||
    [JsonPropertyName("policyVerdict")]
 | 
			
		||||
    public string PolicyVerdict { get; init; } = "unknown";
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("signed")]
 | 
			
		||||
    public bool Signed { get; init; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("hasSbomReferrers")]
 | 
			
		||||
    public bool HasSbomReferrers { get; init; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("hasSbom")]
 | 
			
		||||
    public bool HasSbomLegacy { get; init; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("reasons")]
 | 
			
		||||
    public IReadOnlyList<string> Reasons { get; init; } = Array.Empty<string>();
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("rekor")]
 | 
			
		||||
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
 | 
			
		||||
    public RuntimePolicyRekorDto? Rekor { get; init; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("metadata")]
 | 
			
		||||
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
 | 
			
		||||
    public IDictionary<string, object?>? Metadata { get; init; }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
public sealed record RuntimePolicyRekorDto
 | 
			
		||||
{
 | 
			
		||||
    [JsonPropertyName("uuid")]
 | 
			
		||||
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
 | 
			
		||||
    public string? Uuid { get; init; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("url")]
 | 
			
		||||
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
 | 
			
		||||
    public string? Url { get; init; }
 | 
			
		||||
 | 
			
		||||
    [JsonPropertyName("verified")]
 | 
			
		||||
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
 | 
			
		||||
    public bool? Verified { get; init; }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user