remove cerberos by thalos

This commit is contained in:
Sergio Matias Urquin
2025-05-18 19:23:42 -06:00
parent 46ebccf797
commit 82ebe4408b
88 changed files with 301 additions and 301 deletions

View File

@@ -0,0 +1,19 @@
using Core.Blueprint.External;
namespace Core.Thalos.External.GatewayConfigurations
{
public record GatewayConfiguration
{
public GatewayConfiguration()
{
ThalosService = new ThalosServiceAPI();
}
public ThalosServiceAPI ThalosService { get; set; }
}
public record ThalosServiceAPI
{
public string Channel { get; set; }
public BaseEndpoint Endpoint { get; set; }
}
}

View File

@@ -0,0 +1,48 @@
using Core.Blueprint.External;
using Microsoft.Extensions.Configuration;
namespace Core.Thalos.External.GatewayConfigurations
{
public class GatewaySettingsConfigurations
{
private static GatewayConfiguration GatewayConfigurations { get; set; } = new GatewayConfiguration();
private readonly IConfiguration _configuration;
public GatewaySettingsConfigurations(IConfiguration configuration)
{
_configuration = configuration;
this.SetThalosServiceAPIEndpoint();
}
public static ThalosServiceAPI GetThalosServiceAPIEndpoint()
{
return GatewayConfigurations.ThalosService;
}
private GatewayConfiguration SetThalosServiceAPIEndpoint()
{
IConfigurationSection source;
var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? string.Empty;
if (environment == "Local")
source = _configuration.GetSection("LocalGateways");
else
source = _configuration.GetSection("Gateways");
var endpoint = source["ThalosDAL"] ?? string.Empty;
if (string.IsNullOrEmpty(endpoint)) throw new Exception("Thalos DAL endpoint is empty or null");
GatewayConfigurations.ThalosService = new ThalosServiceAPI()
{
Endpoint = new BaseEndpoint()
{
Uri = new Uri(endpoint),
Url = endpoint,
Token = string.Empty,
APIName = "Thalos Service"
}
};
return GatewayConfigurations;
}
}
}