From 9c5b5d3522dcf79dc530d1d1cb4527f320523fa4 Mon Sep 17 00:00:00 2001 From: Vanderlan Gomes da Silva <=> Date: Fri, 6 Oct 2023 21:04:12 -0300 Subject: [PATCH] Setup Java version on sonarqube pipeline --- .github/workflows/sonar.yml | 6 +++--- Orion.Api/Middleware/OrionMiddleware.cs | 7 ++++--- Orion.Data/UnitOfWork/UnitOfWork.cs | 2 +- README.md | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 32f02ff..0045639 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -10,10 +10,10 @@ jobs: name: Sonar Analysis runs-on: windows-latest steps: - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - name: Set up JDK 17 + uses: actions/setup-java@v3 with: - java-version: 1.11 + java-version: '17' - uses: actions/checkout@v2 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis diff --git a/Orion.Api/Middleware/OrionMiddleware.cs b/Orion.Api/Middleware/OrionMiddleware.cs index 2b4a052..02503f5 100644 --- a/Orion.Api/Middleware/OrionMiddleware.cs +++ b/Orion.Api/Middleware/OrionMiddleware.cs @@ -71,9 +71,10 @@ private async Task ProccessResponseAsync(HttpContext context, HttpStatusCode sta { var errrorReturn = JsonConvert.SerializeObject(errorResponse); - if(statusCode == HttpStatusCode.InternalServerError) - _logger.LogError(exception, "Internal Server Error: {message}", errorResponse.Errors); - + if (statusCode == HttpStatusCode.InternalServerError) + foreach (var error in errorResponse.Errors) + _logger.LogError(exception, "Internal Server Error: {message}", error); + context.Response.StatusCode = (int)statusCode; context.Response.ContentType = "application/json"; diff --git a/Orion.Data/UnitOfWork/UnitOfWork.cs b/Orion.Data/UnitOfWork/UnitOfWork.cs index a1539b1..d467196 100644 --- a/Orion.Data/UnitOfWork/UnitOfWork.cs +++ b/Orion.Data/UnitOfWork/UnitOfWork.cs @@ -10,7 +10,7 @@ namespace Orion.Data.UnitOfWork { - public class UnitOfWork : IUnitOfWork, IDisposable + public class UnitOfWork : IUnitOfWork { private DataContext DbContext { get; } diff --git a/README.md b/README.md index cf42658..8f3456a 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ The main objective is to start projects with a clean and simple architecture, wi + Unmapped members Configuration. + Swagger + Fluent Validation -+ Microsoft Identity Authentication ++ Authentication and Authorization + JWT Token; + Claims and profiles configuration; + Personalized decorators;