diff --git a/.github/workflows/main_dotnetcameroon.yml b/.github/workflows/main_dotnetcameroon.yml index 080395f..174c579 100644 --- a/.github/workflows/main_dotnetcameroon.yml +++ b/.github/workflows/main_dotnetcameroon.yml @@ -39,6 +39,10 @@ jobs: CookiesOptions.LogoutPath: ${{ secrets.COOKIES_LOGOUTPATH}} CookiesOptions.AccessDeniedPath: ${{ secrets.COOKIES_ACCESSDENIEDPATH}} CookiesOptions.ExpirationInDays: ${{ secrets.COOKIES_EXPIRATIONINDAYS}} + JwtOptions.Issuer: ${{ secrets.JWT_ISSUER}} + JwtOptions.Audience: ${{ secrets.JWT_AUDIENCE}} + JwtOptions.Secret: ${{ secrets.JWT_SECRET}} + JwtOptions.ExpirationInMinutes: ${{ secrets.JWT_EXPIRATION_IN_MINUTES}} ApplicationInsights.InstrumentationKey: ${{ secrets.AZURE_APPINSIGHTS_INSTRUMENTAL_KEY}} - name: Upload artifact for deployment job uses: actions/upload-artifact@v4 diff --git a/app/Api/Projects/ProjectsApi.cs b/app/Api/Projects/ProjectsApi.cs index fc46788..96efc05 100644 --- a/app/Api/Projects/ProjectsApi.cs +++ b/app/Api/Projects/ProjectsApi.cs @@ -31,9 +31,9 @@ public static IEndpointRouteBuilder MapProjectsApi(this IEndpointRouteBuilder en }) .RequireAuthorization(Policies.JwtAuthOnly); - endpoints.MapPost("/api/projects/json", async (string json, IProjectService projectService) => + endpoints.MapPost("/api/projects/json", async (PushDataRequest request, IProjectService projectService) => { - var projects = JsonSerializer.Deserialize(json) ?? throw new InvalidOperationException("Invalid JSON"); + var projects = JsonSerializer.Deserialize(request.Json) ?? throw new InvalidOperationException("Invalid JSON"); await projectService.RefreshAsync(projects.Select(p => new Project { Id = Guid.NewGuid(), @@ -59,3 +59,7 @@ public record struct ProjectDto( string Technologies, string? Github, string? Website); + +public record PushDataRequest( + string Json +); diff --git a/http/LoginExternal.http b/http/LoginExternal.http index d6de2f1..300c57b 100644 --- a/http/LoginExternal.http +++ b/http/LoginExternal.http @@ -10,14 +10,3 @@ Content-Type: application/json "ApplicationId": "{{ApplicationId}}", "ApplicationSecret": "{{ApplicationSecret}}" } - -### - -### Test external login endpoint -POST http://localhost:8000/api/login/external -Content-Type: application/json - -{ - "ApplicationId": "ee509c54-2445-4dc8-a7f5-ea88d5528daa", - "ApplicationSecret": "exampleToken" -}