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:
		@@ -179,24 +179,21 @@ internal static class SourceHttpClientConfigurationBinder
 | 
			
		||||
                throw new FileNotFoundException(message, resolvedPath);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            foreach (var certificate in LoadCertificates(resolvedPath))
 | 
			
		||||
            {
 | 
			
		||||
                try
 | 
			
		||||
                {
 | 
			
		||||
                    AddTrustedCertificate(options, certificate);
 | 
			
		||||
                    logger?.LogInformation(
 | 
			
		||||
                        "Source HTTP client '{ClientName}' loaded trusted root certificate '{Thumbprint}' from '{Path}'.",
 | 
			
		||||
                        clientName,
 | 
			
		||||
                        certificate.Thumbprint,
 | 
			
		||||
                        resolvedPath);
 | 
			
		||||
                }
 | 
			
		||||
                finally
 | 
			
		||||
                {
 | 
			
		||||
                    certificate.Dispose();
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
            foreach (var certificate in LoadCertificates(resolvedPath))
 | 
			
		||||
            {
 | 
			
		||||
                var thumbprint = certificate.Thumbprint;
 | 
			
		||||
                var added = AddTrustedCertificate(options, certificate);
 | 
			
		||||
                if (added)
 | 
			
		||||
                {
 | 
			
		||||
                    logger?.LogInformation(
 | 
			
		||||
                        "Source HTTP client '{ClientName}' loaded trusted root certificate '{Thumbprint}' from '{Path}'.",
 | 
			
		||||
                        clientName,
 | 
			
		||||
                        thumbprint,
 | 
			
		||||
                        resolvedPath);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static void ApplyProxyConfiguration(
 | 
			
		||||
        IConfigurationSection section,
 | 
			
		||||
@@ -325,22 +322,31 @@ internal static class SourceHttpClientConfigurationBinder
 | 
			
		||||
        return certificates;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static void AddTrustedCertificate(SourceHttpClientOptions options, X509Certificate2 certificate)
 | 
			
		||||
    {
 | 
			
		||||
        if (certificate is null)
 | 
			
		||||
        {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (options.TrustedRootCertificates.Any(existing =>
 | 
			
		||||
                string.Equals(existing.Thumbprint, certificate.Thumbprint, StringComparison.OrdinalIgnoreCase)))
 | 
			
		||||
        {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        options.TrustedRootCertificates.Add(certificate);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private static bool AddTrustedCertificate(SourceHttpClientOptions options, X509Certificate2 certificate)
 | 
			
		||||
    {
 | 
			
		||||
        if (certificate is null)
 | 
			
		||||
        {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        var thumbprint = certificate.Thumbprint;
 | 
			
		||||
        if (string.IsNullOrWhiteSpace(thumbprint))
 | 
			
		||||
        {
 | 
			
		||||
            certificate.Dispose();
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (options.TrustedRootCertificates.Any(existing =>
 | 
			
		||||
                string.Equals(existing.Thumbprint, thumbprint, StringComparison.OrdinalIgnoreCase)))
 | 
			
		||||
        {
 | 
			
		||||
            certificate.Dispose();
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        options.TrustedRootCertificates.Add(certificate);
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Helper extension method to copy certificate (preserves private key if present)
 | 
			
		||||
    private static X509Certificate2 CopyWithPrivateKeyIfAvailable(this X509Certificate2 certificate)
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user