- 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.
		
			
				
	
	
		
			41 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using Microsoft.Extensions.DependencyInjection;
 | |
| using Microsoft.Extensions.DependencyInjection.Extensions;
 | |
| using Microsoft.Extensions.Options;
 | |
| using StellaOps.Aoc;
 | |
| 
 | |
| namespace StellaOps.Concelier.Core.Aoc;
 | |
| 
 | |
| public static class AocServiceCollectionExtensions
 | |
| {
 | |
|     /// <summary>
 | |
|     /// Registers Aggregation-Only Contract guard services for raw advisory ingestion.
 | |
|     /// </summary>
 | |
|     /// <param name="services">Service collection to configure.</param>
 | |
|     /// <param name="configure">Optional guard configuration.</param>
 | |
|     public static IServiceCollection AddConcelierAocGuards(
 | |
|         this IServiceCollection services,
 | |
|         Action<AocGuardOptions>? configure = null)
 | |
|     {
 | |
|         if (services is null)
 | |
|         {
 | |
|             throw new ArgumentNullException(nameof(services));
 | |
|         }
 | |
| 
 | |
|         services.AddAocGuard();
 | |
| 
 | |
|         if (configure is not null)
 | |
|         {
 | |
|             services.Configure(configure);
 | |
|         }
 | |
| 
 | |
|         services.TryAddSingleton<IAdvisoryRawWriteGuard>(sp =>
 | |
|         {
 | |
|             var guard = sp.GetRequiredService<IAocGuard>();
 | |
|             var options = sp.GetService<IOptions<AocGuardOptions>>();
 | |
|             return new AdvisoryRawWriteGuard(guard, options);
 | |
|         });
 | |
| 
 | |
|         return services;
 | |
|     }
 | |
| }
 |