diff --git a/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiAddContextAppToPortalRequest.cs b/backend/src/Equinor.ProjectExecutionPortal.WebApi/ViewModels/PortalApp/ApiAddContextAppToPortalRequest.cs index c3a60238..9684ebe0 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 c28ad1c3..fdd7912f 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 33fb2949..a9986b3c 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 16abccf8..f1d510ec 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 683e7843..ee072dd3 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 d6d0cd0b..f5c775bc 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);