+ rutas HC para graficos (formulario)

This commit is contained in:
Luis Martinez 2023-09-01 09:19:18 -05:00
parent 2c997c8712
commit e7bb41e42a
4 changed files with 73 additions and 19 deletions

View File

@ -15,6 +15,7 @@
<ItemGroup>
<Content Remove="Routes\ocelot.apitest.json" />
<Content Remove="Routes\ocelot.comitetc.json" />
</ItemGroup>
<ItemGroup>

View File

@ -1,4 +1,5 @@
using Microsoft.IdentityModel.Tokens;
using Microsoft.Extensions.FileSystemGlobbing.Internal;
using Microsoft.IdentityModel.Tokens;
using Ocelot.Configuration;
using Ocelot.Middleware;
using Security;
@ -23,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
@ -33,6 +34,7 @@ namespace ApiGateway
string calledUrl = ctx.Items.DownstreamRoute().UpstreamPathTemplate.OriginalValue;
logger.LogError(71, $"DownstreamRoute: {calledUrl}");
// Excepcion para login, no requiere token
if (
String.Equals(calledUrl, "/ldap/Conectar") ||
@ -41,9 +43,25 @@ namespace ApiGateway
String.Equals(calledUrl, "/Auth/CambiarClave") ||
String.Equals(calledUrl, "/Auth/TknCambioClave") ||
String.Equals(calledUrl, "/Auth/Proveedor") ||
String.Equals(calledUrl, "/Email")
String.Equals(calledUrl, "/Email") ||
String.Equals(calledUrl, "/Formularios/Graficas/{rutaGrafica}")
)
{
return true;
}
// Define the regular expression pattern
//string patternGraficosHc = @"^\/Formularios\/Graficas\/[A-Za-z0-9]+\.[A-Za-z]+$";
//Regex regex = new Regex(patternGraficosHc);
//bool isMatch = regex.IsMatch(calledUrl);
//logger.LogError(71, $"isMatch: {isMatch}");
//if (isMatch)
//{
// return true;
//}
try

View File

@ -198,6 +198,42 @@
"POST"
]
},
{
"SwaggerKey": "MsHistoriaClinica",
"UpstreamPathTemplate": "/Formularios/Graficas",
"DownstreamPathTemplate": "/Formularios/Graficas",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 8154
}
],
"RouteClaimsRequirement": {
"permisos": "any"
},
"UpstreamHttpMethod": [
"GET"
]
},
{
"SwaggerKey": "MsHistoriaClinica",
"UpstreamPathTemplate": "/Formularios/Graficas/{rutaGrafica}",
"DownstreamPathTemplate": "/Formularios/Graficas/{rutaGrafica}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 8154
}
],
"RouteClaimsRequirement": {
"permisos": "any"
},
"UpstreamHttpMethod": [
"GET"
]
},
{
"SwaggerKey": "MsHistoriaClinica",
"UpstreamPathTemplate": "/GrupoEtPorRia",

View File

@ -1,24 +1,14 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:18821",
"sslPort": 44327
}
},
{
"profiles": {
"IntegradorBE": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7082;http://localhost:5082",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"MySecretKey": "_ll@v3Segur1d4d!123"
}
},
"dotnetRunMessages": true,
"applicationUrl": "https://localhost:7082;http://localhost:5082"
},
"IIS Express": {
"commandName": "IISExpress",
@ -28,5 +18,14 @@
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
},
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:61372/",
"sslPort": 44333
}
}
}
}