diff --git a/ApiGateway/CustomLogic.cs b/ApiGateway/CustomLogic.cs index c1d4149..210dd89 100644 --- a/ApiGateway/CustomLogic.cs +++ b/ApiGateway/CustomLogic.cs @@ -24,8 +24,8 @@ namespace ApiGateway //var route2 = ctx.Items.DownstreamRequest(); //Solo el path del request //var route3 = ctx.Items.DownstreamRoute(); //Datos full del request - //var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole().AddEventLog()); - //var logger = loggerFactory.CreateLogger("Auth"); + var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole().AddEventLog()); + var logger = loggerFactory.CreateLogger("Auth"); //TODO: ELIMINAR ESTAS RUTAS POR COMPLETO! // TknCambioClave @@ -165,7 +165,7 @@ namespace ApiGateway } catch (Exception e) { - //logger.LogError(71, e.Message); + logger.LogError(71, e.Message); ctx.Items.SetError(new UnauthenticatedError(e.Message)); return false; } diff --git a/ApiGateway/Program.cs b/ApiGateway/Program.cs index 5e36c7c..0271076 100644 --- a/ApiGateway/Program.cs +++ b/ApiGateway/Program.cs @@ -20,7 +20,7 @@ builder.Configuration.AddOcelotWithSwaggerSupport(options => var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole().AddEventLog()); -//var logger = loggerFactory.CreateLogger("Gateway"); +var logger = loggerFactory.CreateLogger("Gateway"); builder.Configuration.SetBasePath(builder.Environment.ContentRootPath) .AddJsonFile("ocelot.json", optional: false, reloadOnChange: true) @@ -61,7 +61,7 @@ var pipeConfig = new OcelotPipelineConfiguration .Append("Date: ").AppendLine(date) .Append("Errors: ") .AppendLine(downStreamContext.Items.Errors().ToString()); - //logger.LogWarning(27, sb2.ToString()); + logger.LogWarning(27, sb2.ToString()); //downStreamContext.Items.SetError(new UnauthenticatedError("Nel wey, no estas autorizado")); return; } diff --git a/ApiGateway/Routes/ocelot.historiaclinica.json b/ApiGateway/Routes/ocelot.historiaclinica.json index 5c8c95e..0423dc0 100644 --- a/ApiGateway/Routes/ocelot.historiaclinica.json +++ b/ApiGateway/Routes/ocelot.historiaclinica.json @@ -504,6 +504,60 @@ "POST" ] }, + { + "SwaggerKey": "MsHistoriaClinica", + "UpstreamPathTemplate": "/Incapacidades/Masivo", + "DownstreamPathTemplate": "/Incapacidades/Masivo", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 8154 + } + ], + "RouteClaimsRequirement": { + "permisos": "any" + }, + "UpstreamHttpMethod": [ + "POST" + ] + }, + { + "SwaggerKey": "MsHistoriaClinica", + "UpstreamPathTemplate": "/PagosLicencias", + "DownstreamPathTemplate": "/PagosLicencias", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 8154 + } + ], + "RouteClaimsRequirement": { + "permisos": "any" + }, + "UpstreamHttpMethod": [ + "GET" + ] + }, + { + "SwaggerKey": "MsHistoriaClinica", + "UpstreamPathTemplate": "/PagosLicencias/Masivo", + "DownstreamPathTemplate": "/PagosLicencias/Masivo", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 8154 + } + ], + "RouteClaimsRequirement": { + "permisos": "any" + }, + "UpstreamHttpMethod": [ + "POST" + ] + }, { "SwaggerKey": "MsHistoriaClinica", "UpstreamPathTemplate": "/Rias",