feat: Implement console session management with tenant and profile handling
- 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.
This commit is contained in:
		| @@ -13,7 +13,12 @@ internal static class CliMetrics | ||||
|     private static readonly Counter<long> OfflineKitDownloadCounter = Meter.CreateCounter<long>("stellaops.cli.offline.kit.download.count"); | ||||
|     private static readonly Counter<long> OfflineKitImportCounter = Meter.CreateCounter<long>("stellaops.cli.offline.kit.import.count"); | ||||
|     private static readonly Counter<long> PolicySimulationCounter = Meter.CreateCounter<long>("stellaops.cli.policy.simulate.count"); | ||||
|     private static readonly Counter<long> PolicyActivationCounter = Meter.CreateCounter<long>("stellaops.cli.policy.activate.count"); | ||||
|     private static readonly Counter<long> SourcesDryRunCounter = Meter.CreateCounter<long>("stellaops.cli.sources.dryrun.count"); | ||||
|     private static readonly Counter<long> AocVerifyCounter = Meter.CreateCounter<long>("stellaops.cli.aoc.verify.count"); | ||||
|     private static readonly Counter<long> PolicyFindingsListCounter = Meter.CreateCounter<long>("stellaops.cli.policy.findings.list.count"); | ||||
|     private static readonly Counter<long> PolicyFindingsGetCounter = Meter.CreateCounter<long>("stellaops.cli.policy.findings.get.count"); | ||||
|     private static readonly Counter<long> PolicyFindingsExplainCounter = Meter.CreateCounter<long>("stellaops.cli.policy.findings.explain.count"); | ||||
|     private static readonly Histogram<double> CommandDurationHistogram = Meter.CreateHistogram<double>("stellaops.cli.command.duration.ms"); | ||||
|  | ||||
|     public static void RecordScannerDownload(string channel, bool fromCache) | ||||
| @@ -52,12 +57,42 @@ internal static class CliMetrics | ||||
|             new("outcome", string.IsNullOrWhiteSpace(outcome) ? "unknown" : outcome) | ||||
|         }); | ||||
|  | ||||
|     public static void RecordPolicyActivation(string outcome) | ||||
|         => PolicyActivationCounter.Add(1, new KeyValuePair<string, object?>[] | ||||
|         { | ||||
|             new("outcome", string.IsNullOrWhiteSpace(outcome) ? "unknown" : outcome) | ||||
|         }); | ||||
|  | ||||
|     public static void RecordSourcesDryRun(string status) | ||||
|         => SourcesDryRunCounter.Add(1, new KeyValuePair<string, object?>[] | ||||
|         { | ||||
|             new("status", string.IsNullOrWhiteSpace(status) ? "unknown" : status) | ||||
|         }); | ||||
|  | ||||
|     public static void RecordAocVerify(string outcome) | ||||
|         => AocVerifyCounter.Add(1, new KeyValuePair<string, object?>[] | ||||
|         { | ||||
|             new("outcome", string.IsNullOrWhiteSpace(outcome) ? "unknown" : outcome) | ||||
|         }); | ||||
|  | ||||
|     public static void RecordPolicyFindingsList(string outcome) | ||||
|         => PolicyFindingsListCounter.Add(1, new KeyValuePair<string, object?>[] | ||||
|         { | ||||
|             new("outcome", string.IsNullOrWhiteSpace(outcome) ? "unknown" : outcome) | ||||
|         }); | ||||
|  | ||||
|     public static void RecordPolicyFindingsGet(string outcome) | ||||
|         => PolicyFindingsGetCounter.Add(1, new KeyValuePair<string, object?>[] | ||||
|         { | ||||
|             new("outcome", string.IsNullOrWhiteSpace(outcome) ? "unknown" : outcome) | ||||
|         }); | ||||
|  | ||||
|     public static void RecordPolicyFindingsExplain(string outcome) | ||||
|         => PolicyFindingsExplainCounter.Add(1, new KeyValuePair<string, object?>[] | ||||
|         { | ||||
|             new("outcome", string.IsNullOrWhiteSpace(outcome) ? "unknown" : outcome) | ||||
|         }); | ||||
|  | ||||
|     public static IDisposable MeasureCommandDuration(string command) | ||||
|     { | ||||
|         var start = DateTime.UtcNow; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user