From a5dbe336dc9ed00072da4353fc376a8811c0acc9 Mon Sep 17 00:00:00 2001 From: Kjetil Haugland Date: Wed, 30 Oct 2024 13:50:19 +0100 Subject: [PATCH] Rename key to appKey --- .../PortalApp/ApiAddContextAppToPortalRequest.cs | 2 +- .../PortalApp/ApiAddGlobalAppToPortalRequest.cs | 2 +- .../ViewModels/PortalApp/ApiPortalApp.cs | 4 ++-- .../ViewModels/PortalApp/ApiPortalOnboardedApp.cs | 4 ++-- .../IntegrationTests/AssertHelpers.cs | 2 +- .../IntegrationTests/PortalControllerTests.cs | 8 ++++---- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiAddContextAppToPortalRequest.cs b/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiAddContextAppToPortalRequest.cs index c3a60238f..9684ebe03 100644 --- a/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiAddContextAppToPortalRequest.cs +++ b/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiAddContextAppToPortalRequest.cs @@ -19,7 +19,7 @@ public ApiAddContextAppToPortalRequestValidator() RuleFor(x => x.AppKey) .NotEmpty() .NotContainScriptTag() - .WithMessage("App Key required"); + .WithMessage("AppKey required"); } } } diff --git a/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiAddGlobalAppToPortalRequest.cs b/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiAddGlobalAppToPortalRequest.cs index c28ad1c3b..fdd7912f1 100644 --- a/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiAddGlobalAppToPortalRequest.cs +++ b/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiAddGlobalAppToPortalRequest.cs @@ -27,7 +27,7 @@ public ApiAddGlobalAppToPortalRequestValidator() RuleFor(x => x.AppKey) .NotEmpty() .NotContainScriptTag() - .WithMessage("App Key required"); + .WithMessage("AppKey required"); } } } diff --git a/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiPortalApp.cs b/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiPortalApp.cs index 33fb29494..a9986b3c0 100644 --- a/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiPortalApp.cs +++ b/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiPortalApp.cs @@ -12,12 +12,12 @@ public ApiPortalApp() } public ApiPortalApp(PortalAppDto portalAppDto) { - Key = portalAppDto.OnboardedApp.AppKey; + AppKey = portalAppDto.OnboardedApp.AppKey; ContextTypes = portalAppDto.OnboardedApp.ContextTypes.Select(x => new ApiContextType(x)).ToList(); AppManifest = portalAppDto.OnboardedApp.AppInformation != null ? new ApiFusionApp(portalAppDto.OnboardedApp.AppInformation) : null; } - public string Key { get; set; } + public string AppKey { get; set; } public IList ContextTypes { get; set; } public ApiFusionApp? AppManifest { get; set; } } diff --git a/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiPortalOnboardedApp.cs b/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiPortalOnboardedApp.cs index 16abccf8a..f1d510ec6 100644 --- a/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiPortalOnboardedApp.cs +++ b/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiPortalOnboardedApp.cs @@ -10,7 +10,7 @@ public ApiPortalOnboardedApp() public ApiPortalOnboardedApp(PortalOnboardedAppDto portalOnboardedAppDto) { - Key = portalOnboardedAppDto.OnboardedApp.AppKey; + AppKey = portalOnboardedAppDto.OnboardedApp.AppKey; ContextTypes = portalOnboardedAppDto.OnboardedApp.ContextTypes.Select(x => x.ContextTypeKey).ToList(); ContextIds = portalOnboardedAppDto.ContextIds; IsActive = portalOnboardedAppDto.IsActive; @@ -19,7 +19,7 @@ public ApiPortalOnboardedApp(PortalOnboardedAppDto portalOnboardedAppDto) AppManifest = portalOnboardedAppDto.OnboardedApp.AppInformation != null ? new ApiFusionApp(portalOnboardedAppDto.OnboardedApp.AppInformation) : null; } - public string Key { get; set; } + public string AppKey { get; set; } public IList ContextTypes { get; set; } public IList ContextIds { get; set; } public bool IsActive { get; set; } diff --git a/backend/src/tests/Equinor.ProjectExecutionPortal.Tests.WebApi/IntegrationTests/AssertHelpers.cs b/backend/src/tests/Equinor.ProjectExecutionPortal.Tests.WebApi/IntegrationTests/AssertHelpers.cs index 683e78430..ee072dd3e 100644 --- a/backend/src/tests/Equinor.ProjectExecutionPortal.Tests.WebApi/IntegrationTests/AssertHelpers.cs +++ b/backend/src/tests/Equinor.ProjectExecutionPortal.Tests.WebApi/IntegrationTests/AssertHelpers.cs @@ -47,7 +47,7 @@ public static void AssertPortalAppValues(ApiPortalApp? portalAll) Assert.Fail(); } - Assert.IsNotNull(portalAll.Key); + Assert.IsNotNull(portalAll.AppKey); } public static void AssertOnboardedAppValues(ApiOnboardedApp? onboardedApp) diff --git a/backend/src/tests/Equinor.ProjectExecutionPortal.Tests.WebApi/IntegrationTests/PortalControllerTests.cs b/backend/src/tests/Equinor.ProjectExecutionPortal.Tests.WebApi/IntegrationTests/PortalControllerTests.cs index d6d0cd0b5..f5c775bc5 100644 --- a/backend/src/tests/Equinor.ProjectExecutionPortal.Tests.WebApi/IntegrationTests/PortalControllerTests.cs +++ b/backend/src/tests/Equinor.ProjectExecutionPortal.Tests.WebApi/IntegrationTests/PortalControllerTests.cs @@ -500,13 +500,13 @@ public async Task Delete_PortalApp_AsAdministrator_ShouldReturnOk() var appToDelete = apps.First(); // Act - var response = await DeletePortalApp(portalToTest.Id, appToDelete.Key, UserType.Administrator); + var response = await DeletePortalApp(portalToTest.Id, appToDelete.AppKey, UserType.Administrator); // Assert Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); // Verify the app is actually deleted - var deletedApp = await AssertGetPortalApp(portalToTest.Id, appToDelete.Key, UserType.Authenticated, HttpStatusCode.NotFound); + var deletedApp = await AssertGetPortalApp(portalToTest.Id, appToDelete.AppKey, UserType.Authenticated, HttpStatusCode.NotFound); Assert.IsNull(deletedApp); } @@ -526,7 +526,7 @@ public async Task Delete_PortalApp_AsAuthenticatedUser_ShouldReturnForbidden() var appToDelete = apps.First(); // Act - var response = await DeletePortalApp(portalToTest.Id, appToDelete.Key, UserType.Authenticated); + var response = await DeletePortalApp(portalToTest.Id, appToDelete.AppKey, UserType.Authenticated); // Assert Assert.AreEqual(HttpStatusCode.Forbidden, response.StatusCode); @@ -548,7 +548,7 @@ public async Task Delete_PortalApp_AsAnonymousUser_ShouldReturnUnauthorized() var appToDelete = apps.First(); // Act - var response = await DeletePortalApp(portalToTest.Id, appToDelete.Key, UserType.Anonymous); + var response = await DeletePortalApp(portalToTest.Id, appToDelete.AppKey, UserType.Anonymous); // Assert Assert.AreEqual(HttpStatusCode.Unauthorized, response.StatusCode);