diff --git a/.vs/AOLBackend/DesignTimeBuild/.dtbcache.v2 b/.vs/AOLBackend/DesignTimeBuild/.dtbcache.v2 index 07b7abf..fec5692 100644 Binary files a/.vs/AOLBackend/DesignTimeBuild/.dtbcache.v2 and b/.vs/AOLBackend/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/AOLBackend/v17/.futdcache.v1 b/.vs/AOLBackend/v17/.futdcache.v1 index e0fa6ec..c224f0a 100644 Binary files a/.vs/AOLBackend/v17/.futdcache.v1 and b/.vs/AOLBackend/v17/.futdcache.v1 differ diff --git a/.vs/AOLBackend/v17/.suo b/.vs/AOLBackend/v17/.suo index e525611..3837fc1 100644 Binary files a/.vs/AOLBackend/v17/.suo and b/.vs/AOLBackend/v17/.suo differ diff --git a/.vs/ProjectEvaluation/aolbackend.metadata.v2 b/.vs/ProjectEvaluation/aolbackend.metadata.v2 index 6b4e676..5a05f1c 100644 Binary files a/.vs/ProjectEvaluation/aolbackend.metadata.v2 and b/.vs/ProjectEvaluation/aolbackend.metadata.v2 differ diff --git a/.vs/ProjectEvaluation/aolbackend.projects.v2 b/.vs/ProjectEvaluation/aolbackend.projects.v2 index cd1e929..b1f8eda 100644 Binary files a/.vs/ProjectEvaluation/aolbackend.projects.v2 and b/.vs/ProjectEvaluation/aolbackend.projects.v2 differ diff --git a/AOLBackend.csproj.user b/AOLBackend.csproj.user index 6b9f46b..dbff490 100644 --- a/AOLBackend.csproj.user +++ b/AOLBackend.csproj.user @@ -3,5 +3,6 @@ ApiControllerWithActionsScaffolder root/Common/Api + C:\projects\staging\AOLBackend\Properties\PublishProfiles\FolderProfile.pubxml \ No newline at end of file diff --git a/Controllers/Catalogos/CatClientesController.cs b/Controllers/Catalogos/CatClientesController.cs index 6f7c40d..a40ddfc 100644 --- a/Controllers/Catalogos/CatClientesController.cs +++ b/Controllers/Catalogos/CatClientesController.cs @@ -1,9 +1,11 @@ using AOLBackend.Contracts.Catalogos; using AOLBackend.Models.Catalogos; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; namespace AOLBackend.Controllers.Catalogos { + [Authorize] [ApiController] [Route("api/Catalogos/[controller]")] public class CatClientesController : ControllerBase diff --git a/Controllers/Catalogos/CatProveedoresController.cs b/Controllers/Catalogos/CatProveedoresController.cs index ce17f6f..259662c 100644 --- a/Controllers/Catalogos/CatProveedoresController.cs +++ b/Controllers/Catalogos/CatProveedoresController.cs @@ -1,9 +1,11 @@ using AOLBackend.Contracts.Catalogos; using AOLBackend.Models.Catalogos; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; namespace AOLBackend.Controllers.Catalogos { + [Authorize] [ApiController] [Route("api/Catalogos/[controller]")] public class CatProveedoresController : ControllerBase diff --git a/Controllers/Catalogos/CatRutasController.cs b/Controllers/Catalogos/CatRutasController.cs index ccfa214..9cf4ecb 100644 --- a/Controllers/Catalogos/CatRutasController.cs +++ b/Controllers/Catalogos/CatRutasController.cs @@ -2,9 +2,11 @@ using AOLBackend.Contracts.Catalogos; using AOLBackend.Models.Catalogos; using AOLBackend.DTO.Catalogos; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; namespace AOLBackend.Controllers.Catalogos { + [Authorize] [ApiController] [Route("api/Catalogos/[controller]")] public class CatRutasController : ControllerBase diff --git a/Controllers/Catalogos/CatServiciosController.cs b/Controllers/Catalogos/CatServiciosController.cs index 22c658d..8d29a62 100644 --- a/Controllers/Catalogos/CatServiciosController.cs +++ b/Controllers/Catalogos/CatServiciosController.cs @@ -1,10 +1,11 @@ using AOLBackend.Contracts.Catalogos; using AOLBackend.Models.Catalogos; using Microsoft.AspNetCore.Mvc; - +using Microsoft.AspNetCore.Authorization; namespace AOLBackend.Controllers.Catalogos { + [Authorize] [ApiController] [Route("api/Catalogos/[controller]")] public class CatServiciosController : ControllerBase diff --git a/Controllers/Catalogos/CatTipoUnidadController.cs b/Controllers/Catalogos/CatTipoUnidadController.cs index 57c505a..a6ea117 100644 --- a/Controllers/Catalogos/CatTipoUnidadController.cs +++ b/Controllers/Catalogos/CatTipoUnidadController.cs @@ -1,9 +1,11 @@ using AOLBackend.Contracts.Catalogos; using AOLBackend.Models.Catalogos; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; namespace AOLBackend.Controllers.Catalogos { + [Authorize] [ApiController] [Route("api/Catalogos/[controller]")] public class CatTipoUnidadController : ControllerBase diff --git a/Controllers/Catalogos/CatUbicacionesController.cs b/Controllers/Catalogos/CatUbicacionesController.cs index 02df040..d3111db 100644 --- a/Controllers/Catalogos/CatUbicacionesController.cs +++ b/Controllers/Catalogos/CatUbicacionesController.cs @@ -1,10 +1,11 @@ using AOLBackend.Contracts.Catalogos; using AOLBackend.Models.Catalogos; using Microsoft.AspNetCore.Mvc; - +using Microsoft.AspNetCore.Authorization; namespace AOLBackend.Controllers.Catalogos { + [Authorize] [ApiController] [Route("api/Catalogos/[controller]")] public class CatUbicacionesController : ControllerBase diff --git a/Controllers/Operaciones/OpViajesController.cs b/Controllers/Operaciones/OpViajesController.cs index 2ee823e..44e7d39 100644 --- a/Controllers/Operaciones/OpViajesController.cs +++ b/Controllers/Operaciones/OpViajesController.cs @@ -1,9 +1,11 @@ using AOLBackend.Contracts.Operaciones; using AOLBackend.DTO.Operaciones; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; namespace AOLBackend.Controllers.Operaciones { + [Authorize] [ApiController] [Route("api/Operaciones/[controller]")] public class OpViajesController : ControllerBase diff --git a/Controllers/Usuarios/AuthController.cs b/Controllers/Usuarios/AuthController.cs index 40d4e34..6ea438c 100644 --- a/Controllers/Usuarios/AuthController.cs +++ b/Controllers/Usuarios/AuthController.cs @@ -50,7 +50,7 @@ namespace AOLBackend.Controllers.Usuarios claims.Add(new Claim("Usuario", user.Usuario)); claims.Add(new Claim("Departamento", (user.sDept ?? user.sDept ?? "No asignado"))); claims.Add(new Claim("UserType", (user != null) ? user.TipoUsuario.ToString() : "0")); - if (menu!=null) + if (menu != null) { foreach (IMenu item in menu) { claims.Add(new Claim(ClaimTypes.Role, item.Url)); } } @@ -60,8 +60,8 @@ namespace AOLBackend.Controllers.Usuarios _config["Jwt:Issuer"], _config["Jwt:Audience"], claims, - expires: DateTime.UtcNow.AddHours(Int32.Parse(_config["Jwt:ExpirationHours"])), - //expires: DateTime.UtcNow.AddMinutes(5), + expires: DateTime.UtcNow.AddHours(Int32.Parse(_config["Jwt:ExpirationHours"])), + //expires: DateTime.UtcNow.AddMinutes(2), signingCredentials: signIn); var _token = new JwtSecurityTokenHandler().WriteToken(token); diff --git a/DTO/Operaciones/DTOOpViajes.cs b/DTO/Operaciones/DTOOpViajes.cs index ab4aaa0..1258566 100644 --- a/DTO/Operaciones/DTOOpViajes.cs +++ b/DTO/Operaciones/DTOOpViajes.cs @@ -18,6 +18,7 @@ namespace AOLBackend.DTO.Operaciones public string? sDestino { get; set; } = null!; public byte Hazmat { get; set; } = 0; public byte TipoOperacion { get; set; } = 1; + public string sTipoOperacion { get; set; } = null!; public string Pedimento { get; set; } = null!; public int Status { get; set; } = 0; public int Activo { get; set; } = 0; diff --git a/Program.cs b/Program.cs index a24346e..751eac1 100644 --- a/Program.cs +++ b/Program.cs @@ -48,12 +48,15 @@ builder.Services.AddCors(p => p.AddPolicy("corsapp", builder => //builder.WithOrigins("*").AllowAnyMethod().AllowAnyHeader(); builder.WithOrigins("http://localhost:3000", + "http://localhost:7001", "http://localhost:5000", "https://localhost:5001", + "https://www.alphaomega.com.mx", + "https://74.208.165.122", + "https://www.alphaomega.com.mx:443", + "https://74.208.165.122:443", "http://localhost", - "http://192.168.100.242:3000", - "http://74.208.65.168", - "http://reportes.gemcousa.com").AllowAnyMethod().AllowAnyHeader(); + "http://74.208.165.122:5000").AllowAnyMethod().AllowAnyHeader(); })); var app = builder.Build(); diff --git a/appsettings.Development.json b/appsettings.Development.json index 125dfdc..a475d49 100644 --- a/appsettings.Development.json +++ b/appsettings.Development.json @@ -1,7 +1,7 @@ -{ - /* "ConnectionStrings": { - "SqlConnection": "server=127.0.0.1,14033; database=GEMCO; User Id=sa;Password=toor1234.;Encrypt=False;" - }, */ + { + "ConnectionStrings": { + "SqlConnection": "server=.; database=AOL; Integrated Security=true;TrustServerCertificate=True;" + }, "Logging": { "LogLevel": { "Default": "Information", diff --git a/appsettings.json b/appsettings.json index b68bcda..5072260 100644 --- a/appsettings.json +++ b/appsettings.json @@ -1,7 +1,6 @@ { "ConnectionStrings": { - "SqlConnection": "server=.; database=AOL; Integrated Security=true;TrustServerCertificate=True;" - // "SqlConnection": "server=127.0.0.1,14033; database=GEMCO; User Id=sa; Password=toor1234.; TrustServerCertificate=True;" + "SqlConnection": "server=localhost\\SQLEXPRESS; database=AOL; User Id=AOLadmin;Password=40La6m1n.22;Encrypt=False;" }, "DefaultUser": { "Password": "Bienvenido123!" @@ -18,7 +17,8 @@ "Issuer": "JWTAuthenticationServer", "Audience": "JWTServicePostmanClient", "Subject": "JWTServiceAccessToken", - "ExpirationHours": 4 + "ExpirationHours": 4, + "ExpirationMinutes": 1 }, "EmailServer": "146.20.161.11", "EmailPort": 587, diff --git a/bin/Debug/net6.0/AOLBackend.dll b/bin/Debug/net6.0/AOLBackend.dll index 2fc9be0..2cc4298 100644 Binary files a/bin/Debug/net6.0/AOLBackend.dll and b/bin/Debug/net6.0/AOLBackend.dll differ diff --git a/bin/Debug/net6.0/AOLBackend.pdb b/bin/Debug/net6.0/AOLBackend.pdb index 467e473..7d3df47 100644 Binary files a/bin/Debug/net6.0/AOLBackend.pdb and b/bin/Debug/net6.0/AOLBackend.pdb differ diff --git a/bin/Debug/net6.0/appsettings.Development.json b/bin/Debug/net6.0/appsettings.Development.json index 125dfdc..a475d49 100644 --- a/bin/Debug/net6.0/appsettings.Development.json +++ b/bin/Debug/net6.0/appsettings.Development.json @@ -1,7 +1,7 @@ -{ - /* "ConnectionStrings": { - "SqlConnection": "server=127.0.0.1,14033; database=GEMCO; User Id=sa;Password=toor1234.;Encrypt=False;" - }, */ + { + "ConnectionStrings": { + "SqlConnection": "server=.; database=AOL; Integrated Security=true;TrustServerCertificate=True;" + }, "Logging": { "LogLevel": { "Default": "Information", diff --git a/bin/Debug/net6.0/appsettings.json b/bin/Debug/net6.0/appsettings.json index b68bcda..5072260 100644 --- a/bin/Debug/net6.0/appsettings.json +++ b/bin/Debug/net6.0/appsettings.json @@ -1,7 +1,6 @@ { "ConnectionStrings": { - "SqlConnection": "server=.; database=AOL; Integrated Security=true;TrustServerCertificate=True;" - // "SqlConnection": "server=127.0.0.1,14033; database=GEMCO; User Id=sa; Password=toor1234.; TrustServerCertificate=True;" + "SqlConnection": "server=localhost\\SQLEXPRESS; database=AOL; User Id=AOLadmin;Password=40La6m1n.22;Encrypt=False;" }, "DefaultUser": { "Password": "Bienvenido123!" @@ -18,7 +17,8 @@ "Issuer": "JWTAuthenticationServer", "Audience": "JWTServicePostmanClient", "Subject": "JWTServiceAccessToken", - "ExpirationHours": 4 + "ExpirationHours": 4, + "ExpirationMinutes": 1 }, "EmailServer": "146.20.161.11", "EmailPort": 587, diff --git a/obj/Debug/net6.0/AOLBackend.GeneratedMSBuildEditorConfig.editorconfig b/obj/Debug/net6.0/AOLBackend.GeneratedMSBuildEditorConfig.editorconfig index aa0a97e..fc61964 100644 --- a/obj/Debug/net6.0/AOLBackend.GeneratedMSBuildEditorConfig.editorconfig +++ b/obj/Debug/net6.0/AOLBackend.GeneratedMSBuildEditorConfig.editorconfig @@ -8,9 +8,9 @@ build_property.PlatformNeutralAssembly = build_property._SupportedPlatformList = Linux,macOS,Windows build_property.RootNamespace = AOLBackend build_property.RootNamespace = AOLBackend -build_property.ProjectDir = C:\projects\staging\AOLBackend\ +build_property.ProjectDir = c:\projects\staging\AOLBackend\ build_property.RazorLangVersion = 6.0 build_property.SupportLocalizedComponentNames = build_property.GenerateRazorMetadataSourceChecksumAttributes = -build_property.MSBuildProjectDirectory = C:\projects\staging\AOLBackend +build_property.MSBuildProjectDirectory = c:\projects\staging\AOLBackend build_property._RazorSourceGeneratorDebug = diff --git a/obj/Debug/net6.0/AOLBackend.assets.cache b/obj/Debug/net6.0/AOLBackend.assets.cache index 20a4db6..1389778 100644 Binary files a/obj/Debug/net6.0/AOLBackend.assets.cache and b/obj/Debug/net6.0/AOLBackend.assets.cache differ diff --git a/obj/Debug/net6.0/AOLBackend.dll b/obj/Debug/net6.0/AOLBackend.dll index 2fc9be0..2cc4298 100644 Binary files a/obj/Debug/net6.0/AOLBackend.dll and b/obj/Debug/net6.0/AOLBackend.dll differ diff --git a/obj/Debug/net6.0/AOLBackend.pdb b/obj/Debug/net6.0/AOLBackend.pdb index 467e473..7d3df47 100644 Binary files a/obj/Debug/net6.0/AOLBackend.pdb and b/obj/Debug/net6.0/AOLBackend.pdb differ diff --git a/obj/Debug/net6.0/ref/AOLBackend.dll b/obj/Debug/net6.0/ref/AOLBackend.dll index a32324f..537b9bb 100644 Binary files a/obj/Debug/net6.0/ref/AOLBackend.dll and b/obj/Debug/net6.0/ref/AOLBackend.dll differ diff --git a/obj/Debug/net6.0/refint/AOLBackend.dll b/obj/Debug/net6.0/refint/AOLBackend.dll index a32324f..537b9bb 100644 Binary files a/obj/Debug/net6.0/refint/AOLBackend.dll and b/obj/Debug/net6.0/refint/AOLBackend.dll differ diff --git a/obj/staticwebassets.pack.sentinel b/obj/staticwebassets.pack.sentinel index dc5bd2e..2f43a0a 100644 --- a/obj/staticwebassets.pack.sentinel +++ b/obj/staticwebassets.pack.sentinel @@ -142,3 +142,101 @@ 2.0 2.0 2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0 +2.0