- Add ConsoleSessionStore for managing console session state including tenants, profile, and token information. - Create OperatorContextService to manage operator context for orchestrator actions. - Implement OperatorMetadataInterceptor to enrich HTTP requests with operator context metadata. - Develop ConsoleProfileComponent to display user profile and session details, including tenant information and access tokens. - Add corresponding HTML and SCSS for ConsoleProfileComponent to enhance UI presentation. - Write unit tests for ConsoleProfileComponent to ensure correct rendering and functionality.
118 lines
3.5 KiB
C#
118 lines
3.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace StellaOps.Cli.Services.Models;
|
|
|
|
internal sealed record AdvisoryObservationsQuery(
|
|
string Tenant,
|
|
IReadOnlyList<string> ObservationIds,
|
|
IReadOnlyList<string> Aliases,
|
|
IReadOnlyList<string> Purls,
|
|
IReadOnlyList<string> Cpes,
|
|
int? Limit,
|
|
string? Cursor);
|
|
|
|
internal sealed class AdvisoryObservationsResponse
|
|
{
|
|
[JsonPropertyName("observations")]
|
|
public IReadOnlyList<AdvisoryObservationDocument> Observations { get; init; } =
|
|
Array.Empty<AdvisoryObservationDocument>();
|
|
|
|
[JsonPropertyName("linkset")]
|
|
public AdvisoryObservationLinksetAggregate Linkset { get; init; } =
|
|
new();
|
|
|
|
[JsonPropertyName("nextCursor")]
|
|
public string? NextCursor { get; init; }
|
|
|
|
[JsonPropertyName("hasMore")]
|
|
public bool HasMore { get; init; }
|
|
}
|
|
|
|
internal sealed class AdvisoryObservationDocument
|
|
{
|
|
[JsonPropertyName("observationId")]
|
|
public string ObservationId { get; init; } = string.Empty;
|
|
|
|
[JsonPropertyName("tenant")]
|
|
public string Tenant { get; init; } = string.Empty;
|
|
|
|
[JsonPropertyName("source")]
|
|
public AdvisoryObservationSource Source { get; init; } = new();
|
|
|
|
[JsonPropertyName("upstream")]
|
|
public AdvisoryObservationUpstream Upstream { get; init; } = new();
|
|
|
|
[JsonPropertyName("linkset")]
|
|
public AdvisoryObservationLinkset Linkset { get; init; } = new();
|
|
|
|
[JsonPropertyName("createdAt")]
|
|
public DateTimeOffset CreatedAt { get; init; }
|
|
}
|
|
|
|
internal sealed class AdvisoryObservationSource
|
|
{
|
|
[JsonPropertyName("vendor")]
|
|
public string Vendor { get; init; } = string.Empty;
|
|
|
|
[JsonPropertyName("stream")]
|
|
public string Stream { get; init; } = string.Empty;
|
|
|
|
[JsonPropertyName("api")]
|
|
public string Api { get; init; } = string.Empty;
|
|
|
|
[JsonPropertyName("collectorVersion")]
|
|
public string? CollectorVersion { get; init; }
|
|
}
|
|
|
|
internal sealed class AdvisoryObservationUpstream
|
|
{
|
|
[JsonPropertyName("upstreamId")]
|
|
public string UpstreamId { get; init; } = string.Empty;
|
|
|
|
[JsonPropertyName("documentVersion")]
|
|
public string? DocumentVersion { get; init; }
|
|
}
|
|
|
|
internal sealed class AdvisoryObservationLinkset
|
|
{
|
|
[JsonPropertyName("aliases")]
|
|
public IReadOnlyList<string> Aliases { get; init; } = Array.Empty<string>();
|
|
|
|
[JsonPropertyName("purls")]
|
|
public IReadOnlyList<string> Purls { get; init; } = Array.Empty<string>();
|
|
|
|
[JsonPropertyName("cpes")]
|
|
public IReadOnlyList<string> Cpes { get; init; } = Array.Empty<string>();
|
|
|
|
[JsonPropertyName("references")]
|
|
public IReadOnlyList<AdvisoryObservationReference> References { get; init; } =
|
|
Array.Empty<AdvisoryObservationReference>();
|
|
}
|
|
|
|
internal sealed class AdvisoryObservationReference
|
|
{
|
|
[JsonPropertyName("type")]
|
|
public string Type { get; init; } = string.Empty;
|
|
|
|
[JsonPropertyName("url")]
|
|
public string Url { get; init; } = string.Empty;
|
|
}
|
|
|
|
internal sealed class AdvisoryObservationLinksetAggregate
|
|
{
|
|
[JsonPropertyName("aliases")]
|
|
public IReadOnlyList<string> Aliases { get; init; } = Array.Empty<string>();
|
|
|
|
[JsonPropertyName("purls")]
|
|
public IReadOnlyList<string> Purls { get; init; } = Array.Empty<string>();
|
|
|
|
[JsonPropertyName("cpes")]
|
|
public IReadOnlyList<string> Cpes { get; init; } = Array.Empty<string>();
|
|
|
|
[JsonPropertyName("references")]
|
|
public IReadOnlyList<AdvisoryObservationReference> References { get; init; } =
|
|
Array.Empty<AdvisoryObservationReference>();
|
|
}
|