From 4b7cd5405dea9003f31af1aa9cd584d8ccf2141f Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Wed, 23 Aug 2023 09:54:43 +0200 Subject: Consistently use the preferences and history names in the bff code base - rename openapi clients (client-portal-prefs -> client-preferences, client-portal-history -> client-history, client-portal-keycloak -> client-keycloak) - rename related spring configurations (portal-prefs -> preferences, portal-history -> history) - rename related environment variables (PORTAL_PREFS_URL -> PREFERENCES_URL, PORTAL_HISTORY_URL -> HISTORY_URL) Note that the changes to the configurations and variables affect external services using it and the bff chart Issue-ID: PORTALNG-49 Change-Id: I434abdf130a5a81534c2387143b296122408d452 Signed-off-by: Fiete Ostkamp --- app/build.gradle | 10 +- .../main/resources/application-access-control.yml | 2 - app/src/main/resources/application-development.yml | 5 +- app/src/main/resources/application-local.yml | 5 +- app/src/main/resources/application.yml | 5 +- .../onap/portalng/bff/actions/ActionFixtures.java | 26 +- .../onap/portalng/bff/actions/ActionsMocks.java | 39 +- .../bff/actions/CreateActionsIntegrationTest.java | 22 +- .../bff/actions/GetActionsIntegrationTest.java | 20 +- .../bff/actions/ListActionsIntegrationTest.java | 23 +- .../portalng/bff/headers/XRequestIdHeaderTest.java | 10 +- .../CreatePreferencesIntegrationTest.java | 30 +- .../preferences/GetPreferencesIntegrationTest.java | 14 +- .../portalng/bff/preferences/PreferencesMocks.java | 38 +- .../UpdatePreferencesIntegrationTest.java | 28 +- .../bff/roles/ListRealmRolesIntegrationTest.java | 4 +- .../org/onap/portalng/bff/roles/RolesMocks.java | 2 +- .../bff/users/CreateUserIntegrationTest.java | 8 +- .../bff/users/DeleteUserIntegrationTest.java | 2 +- .../bff/users/GetUserDetailIntegrationTest.java | 6 +- .../users/ListAssignedRolesIntegrationTest.java | 4 +- .../users/ListAvailableRolesIntegrationTest.java | 4 +- .../bff/users/ListUsersIntegrationTest.java | 6 +- .../users/UpdateAssignedRolesIntegrationTest.java | 4 +- .../bff/users/UpdateUserIntegrationTest.java | 6 +- .../users/UpdateUserPasswordIntegrationTest.java | 4 +- .../test/resources/application-access-control.yml | 2 - app/src/test/resources/application-development.yml | 5 +- app/src/test/resources/application.yml | 5 +- development/.env | 16 +- development/docker-compose.yml | 16 +- lib/build.gradle | 24 +- .../org/onap/portalng/bff/config/BffConfig.java | 5 +- .../portalng/bff/config/clients/HistoryConfig.java | 95 +++ .../bff/config/clients/KeycloakConfig.java | 6 +- .../bff/config/clients/PortalHistoryConfig.java | 97 --- .../bff/config/clients/PortalPrefsConfig.java | 96 --- .../bff/config/clients/PreferencesConfig.java | 96 +++ .../onap/portalng/bff/mappers/ActionsMapper.java | 6 +- .../portalng/bff/mappers/CredentialMapper.java | 2 +- .../portalng/bff/mappers/PreferencesMapper.java | 6 +- .../org/onap/portalng/bff/mappers/RolesMapper.java | 2 +- .../org/onap/portalng/bff/mappers/UsersMapper.java | 4 +- .../onap/portalng/bff/services/ActionService.java | 16 +- .../portalng/bff/services/KeycloakService.java | 4 +- .../portalng/bff/services/PreferencesService.java | 18 +- .../java/org/onap/portalng/bff/utils/Logger.java | 4 +- openapi/build.gradle | 12 +- openapi/client-history/LICENSE | 201 +++++++ openapi/client-history/build.gradle | 62 ++ openapi/client-history/src/api.yaml | 457 +++++++++++++++ openapi/client-keycloak/LICENSE | 201 +++++++ openapi/client-keycloak/build.gradle | 62 ++ openapi/client-keycloak/src/api.yaml | 651 +++++++++++++++++++++ openapi/client-portal-history/LICENSE | 201 ------- openapi/client-portal-history/build.gradle | 62 -- .../src/portal_history_openapi.yaml | 457 --------------- openapi/client-portal-keycloak/LICENSE | 201 ------- openapi/client-portal-keycloak/build.gradle | 62 -- .../src/portal_keycloak_openapi.yaml | 651 --------------------- openapi/client-portal-prefs/LICENSE | 201 ------- openapi/client-portal-prefs/build.gradle | 62 -- .../src/portal_prefs_openapi.yaml | 341 ----------- openapi/client-preferences/LICENSE | 201 +++++++ openapi/client-preferences/build.gradle | 66 +++ openapi/client-preferences/src/api.yaml | 341 +++++++++++ openapi/server/build.gradle | 2 +- openapi/server/src/main/resources/static/api.yaml | 2 +- settings.gradle | 6 +- 69 files changed, 2660 insertions(+), 2694 deletions(-) create mode 100644 lib/src/main/java/org/onap/portalng/bff/config/clients/HistoryConfig.java delete mode 100644 lib/src/main/java/org/onap/portalng/bff/config/clients/PortalHistoryConfig.java delete mode 100644 lib/src/main/java/org/onap/portalng/bff/config/clients/PortalPrefsConfig.java create mode 100644 lib/src/main/java/org/onap/portalng/bff/config/clients/PreferencesConfig.java create mode 100644 openapi/client-history/LICENSE create mode 100644 openapi/client-history/build.gradle create mode 100644 openapi/client-history/src/api.yaml create mode 100644 openapi/client-keycloak/LICENSE create mode 100644 openapi/client-keycloak/build.gradle create mode 100644 openapi/client-keycloak/src/api.yaml delete mode 100644 openapi/client-portal-history/LICENSE delete mode 100644 openapi/client-portal-history/build.gradle delete mode 100644 openapi/client-portal-history/src/portal_history_openapi.yaml delete mode 100644 openapi/client-portal-keycloak/LICENSE delete mode 100644 openapi/client-portal-keycloak/build.gradle delete mode 100644 openapi/client-portal-keycloak/src/portal_keycloak_openapi.yaml delete mode 100644 openapi/client-portal-prefs/LICENSE delete mode 100644 openapi/client-portal-prefs/build.gradle delete mode 100644 openapi/client-portal-prefs/src/portal_prefs_openapi.yaml create mode 100644 openapi/client-preferences/LICENSE create mode 100644 openapi/client-preferences/build.gradle create mode 100644 openapi/client-preferences/src/api.yaml diff --git a/app/build.gradle b/app/build.gradle index 7ad65cd..4305de0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,15 +19,11 @@ configurations { } } -// repositories { -// mavenCentral() -// } - dependencies { implementation project(':openapi:server') - implementation project(':openapi:client-portal-history') - implementation project(':openapi:client-portal-prefs') - implementation project(':openapi:client-portal-keycloak') + implementation project(':openapi:client-history') + implementation project(':openapi:client-preferences') + implementation project(':openapi:client-keycloak') implementation project(':lib') implementation 'org.springframework.boot:spring-boot-starter-webflux' diff --git a/app/src/main/resources/application-access-control.yml b/app/src/main/resources/application-access-control.yml index 450ab8a..ac83409 100644 --- a/app/src/main/resources/application-access-control.yml +++ b/app/src/main/resources/application-access-control.yml @@ -9,8 +9,6 @@ bff.access-control: PREFERENCES_GET: [onap_admin, onap_designer, onap_operator] PREFERENCES_UPDATE: [onap_admin, onap_designer, onap_operator] ROLE_LIST: ["*"] - TILE_GET: [onap_admin, onap_designer, onap_operator] - TILE_LIST: [onap_admin, onap_designer, onap_operator] USER_CREATE: [onap_admin, onap_designer, onap_operator] USER_DELETE: [onap_admin, onap_designer, onap_operator] USER_GET: [onap_admin, onap_designer, onap_operator] diff --git a/app/src/main/resources/application-development.yml b/app/src/main/resources/application-development.yml index c7e869f..e5de9be 100644 --- a/app/src/main/resources/application-development.yml +++ b/app/src/main/resources/application-development.yml @@ -24,7 +24,6 @@ management: bff: realm: ONAP - portal-prefs-url: ${PORTAL_PREFS_URL} - portal-history-url: ${PORTAL_HISTORY_URL} + preferences-url: ${PREFERENCES_URL} + history-url: ${PORTAL_HISTORY_URL} keycloak-url: ${KEYCLOAK_URL} - instance-id: PORTAL diff --git a/app/src/main/resources/application-local.yml b/app/src/main/resources/application-local.yml index 0cb6e6b..2eb3278 100644 --- a/app/src/main/resources/application-local.yml +++ b/app/src/main/resources/application-local.yml @@ -24,10 +24,9 @@ management: bff: realm: ONAP - portal-prefs-url: http://localhost:9001 - portal-history-url: http://localhost:9002 + preferences-url: http://localhost:9001 + history-url: http://localhost:9002 keycloak-url: http://localhost:8080/ - instance-id: PORTAL logging: level: diff --git a/app/src/main/resources/application.yml b/app/src/main/resources/application.yml index 6e74453..2d09bbb 100644 --- a/app/src/main/resources/application.yml +++ b/app/src/main/resources/application.yml @@ -42,8 +42,7 @@ spring: bff: realm: ${KEYCLOAK_REALM} - portal-prefs-url: ${PORTAL_PREFS_URL} - portal-history-url: ${PORTAL_HISTORY_URL} + preferences-url: ${PREFERENCES_URL} + history-url: ${PORTAL_HISTORY_URL} keycloak-url: ${KEYCLOAK_URL} - instance-id: PORTAL diff --git a/app/src/test/java/org/onap/portalng/bff/actions/ActionFixtures.java b/app/src/test/java/org/onap/portalng/bff/actions/ActionFixtures.java index 0acd0eb..0ca28bf 100644 --- a/app/src/test/java/org/onap/portalng/bff/actions/ActionFixtures.java +++ b/app/src/test/java/org/onap/portalng/bff/actions/ActionFixtures.java @@ -23,27 +23,27 @@ package org.onap.portalng.bff.actions; import java.time.OffsetDateTime; import java.time.temporal.ChronoUnit; -import org.onap.portalng.bff.openapi.client_portal_history.model.ActionResponsePortalHistoryDto; -import org.onap.portalng.bff.openapi.client_portal_history.model.ActionsListResponsePortalHistoryDto; -import org.onap.portalng.bff.openapi.client_portal_history.model.CreateActionRequestPortalHistoryDto; +import org.onap.portalng.bff.openapi.client_history.model.ActionResponseHistoryDto; +import org.onap.portalng.bff.openapi.client_history.model.ActionsListResponseHistoryDto; +import org.onap.portalng.bff.openapi.client_history.model.CreateActionRequestHistoryDto; import org.onap.portalng.bff.openapi.server.model.CreateActionRequestApiDto; public class ActionFixtures { - public static ActionsListResponsePortalHistoryDto generateActionsListResponse( + public static ActionsListResponseHistoryDto generateActionsListResponse( Integer numberOfActions, Integer totalCount, OffsetDateTime createdAt) { - ActionsListResponsePortalHistoryDto actionsListResponsePortalHistoryDto = - new ActionsListResponsePortalHistoryDto(); + ActionsListResponseHistoryDto actionsListResponseHistoryDto = + new ActionsListResponseHistoryDto(); for (Integer i = 0; i < numberOfActions; i++) { - actionsListResponsePortalHistoryDto.addActionsListItem( + actionsListResponseHistoryDto.addActionsListItem( generateActionResponse( "Instantiation", "create", null, i.toString(), "SO", i, createdAt)); } - actionsListResponsePortalHistoryDto.setTotalCount(totalCount); - return actionsListResponsePortalHistoryDto; + actionsListResponseHistoryDto.setTotalCount(totalCount); + return actionsListResponseHistoryDto; } - public static ActionResponsePortalHistoryDto generateActionResponse( + public static ActionResponseHistoryDto generateActionResponse( String type, String action, String message, @@ -58,12 +58,12 @@ public class ActionFixtures { actionDto.setDownStreamSystem(downStreamSystem); actionDto.setDownStreamId(id); - return new ActionResponsePortalHistoryDto() + return new ActionResponseHistoryDto() .action(actionDto) .actionCreatedAt(createdAt.minus(deltaHours, ChronoUnit.HOURS)); } - public static CreateActionRequestPortalHistoryDto generateActionRequestPortalHistoryDto( + public static CreateActionRequestHistoryDto generateActionRequestHistoryDto( String type, String action, String message, @@ -77,7 +77,7 @@ public class ActionFixtures { actionDto.setMessage(message); actionDto.setDownStreamSystem(downStreamSystem); actionDto.setDownStreamId(id); - return new CreateActionRequestPortalHistoryDto() + return new CreateActionRequestHistoryDto() .action(actionDto) .actionCreatedAt(createdAt) .userId(userId); diff --git a/app/src/test/java/org/onap/portalng/bff/actions/ActionsMocks.java b/app/src/test/java/org/onap/portalng/bff/actions/ActionsMocks.java index aa9e2f3..39fc3dc 100644 --- a/app/src/test/java/org/onap/portalng/bff/actions/ActionsMocks.java +++ b/app/src/test/java/org/onap/portalng/bff/actions/ActionsMocks.java @@ -27,9 +27,9 @@ import com.github.tomakehurst.wiremock.matching.EqualToPattern; import io.restassured.http.Header; import org.apache.http.HttpHeaders; import org.onap.portalng.bff.BaseIntegrationTest; -import org.onap.portalng.bff.openapi.client_portal_history.model.ActionResponsePortalHistoryDto; -import org.onap.portalng.bff.openapi.client_portal_history.model.ActionsListResponsePortalHistoryDto; -import org.onap.portalng.bff.openapi.client_portal_history.model.ProblemPortalHistoryDto; +import org.onap.portalng.bff.openapi.client_history.model.ActionResponseHistoryDto; +import org.onap.portalng.bff.openapi.client_history.model.ActionsListResponseHistoryDto; +import org.onap.portalng.bff.openapi.client_history.model.ProblemHistoryDto; import org.onap.portalng.bff.openapi.server.model.ActionsListResponseApiDto; import org.onap.portalng.bff.openapi.server.model.ActionsResponseApiDto; import org.onap.portalng.bff.openapi.server.model.CreateActionRequestApiDto; @@ -56,16 +56,15 @@ public class ActionsMocks extends BaseIntegrationTest { } // used for test thatActionsListCanBeRetrieved - protected void mockListActions( - ActionsListResponsePortalHistoryDto actionsListResponsePortalHistoryDto) throws Exception { + protected void mockListActions(ActionsListResponseHistoryDto actionsListResponseHistoryDto) + throws Exception { WireMock.stubFor( WireMock.get(WireMock.urlEqualTo("/v1/actions?page=1&pageSize=10")) .withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID)) .willReturn( WireMock.aResponse() .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) - .withBody( - objectMapper.writeValueAsString(actionsListResponsePortalHistoryDto)))); + .withBody(objectMapper.writeValueAsString(actionsListResponseHistoryDto)))); } // used for test thatActionsListCanNotBeRetrieved @@ -84,8 +83,7 @@ public class ActionsMocks extends BaseIntegrationTest { } // used for test thatActionsListCanNotBeRetrieved - protected void mockListActionsProblem(ProblemPortalHistoryDto problemPortalHistoryDto) - throws Exception { + protected void mockListActionsProblem(ProblemHistoryDto problemHistoryDto) throws Exception { WireMock.stubFor( WireMock.get(WireMock.urlEqualTo("/v1/actions?page=1&pageSize=10")) .withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID)) @@ -93,12 +91,12 @@ public class ActionsMocks extends BaseIntegrationTest { WireMock.aResponse() .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_PROBLEM_JSON_VALUE) .withStatus(HttpStatus.INTERNAL_SERVER_ERROR.value()) - .withBody(objectMapper.writeValueAsString(problemPortalHistoryDto)))); + .withBody(objectMapper.writeValueAsString(problemHistoryDto)))); } // used for test thatActionCanBeRetrieved protected void mockGetActions( - ActionsListResponsePortalHistoryDto actionsListResponsePortalHistoryDto, + ActionsListResponseHistoryDto actionsListResponseHistoryDto, String userId, Integer showLastHours) throws Exception { @@ -114,8 +112,7 @@ public class ActionsMocks extends BaseIntegrationTest { .willReturn( WireMock.aResponse() .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) - .withBody( - objectMapper.writeValueAsString(actionsListResponsePortalHistoryDto)))); + .withBody(objectMapper.writeValueAsString(actionsListResponseHistoryDto)))); } // used for test thatActionCanBeRetrieved protected ActionsListResponseApiDto getActions(String userId) { @@ -134,16 +131,14 @@ public class ActionsMocks extends BaseIntegrationTest { // used for test thatActionCanBeRetrievedWithoutParameterShowLastHours protected void mockGetActionsWithoutParameterShowLastHours( - ActionsListResponsePortalHistoryDto actionsListResponsePortalHistoryDto, String userId) - throws Exception { + ActionsListResponseHistoryDto actionsListResponseHistoryDto, String userId) throws Exception { WireMock.stubFor( WireMock.get(WireMock.urlEqualTo("/v1/actions/" + userId + "?page=1&pageSize=10")) .withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID)) .willReturn( WireMock.aResponse() .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) - .withBody( - objectMapper.writeValueAsString(actionsListResponsePortalHistoryDto)))); + .withBody(objectMapper.writeValueAsString(actionsListResponseHistoryDto)))); } // used for test thatActionCanBeRetrievedWithoutParameterShowLastHours protected ActionsListResponseApiDto getActionsWithoutParameterShowLastHours(String userId) { @@ -161,8 +156,7 @@ public class ActionsMocks extends BaseIntegrationTest { } // Used for thatActionCanBeCreated - protected void mockCreateActions( - String userId, ActionResponsePortalHistoryDto actionResponsePortalHistoryDto) + protected void mockCreateActions(String userId, ActionResponseHistoryDto actionResponseHistoryDto) throws Exception { WireMock.stubFor( WireMock.post(WireMock.urlEqualTo("/v1/actions/" + userId)) @@ -172,7 +166,7 @@ public class ActionsMocks extends BaseIntegrationTest { WireMock.aResponse() .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) .withStatus(200) - .withBody(objectMapper.writeValueAsString(actionResponsePortalHistoryDto)))); + .withBody(objectMapper.writeValueAsString(actionResponseHistoryDto)))); } // Used for thatActionCanBeCreated @@ -194,8 +188,7 @@ public class ActionsMocks extends BaseIntegrationTest { } // Used for thatActionCanNotBeCreated - protected void mockCreateActionsProblem( - String userId, ProblemPortalHistoryDto problemPortalHistoryDto) + protected void mockCreateActionsProblem(String userId, ProblemHistoryDto problemHistoryDto) throws JsonProcessingException { WireMock.stubFor( WireMock.post(WireMock.urlEqualTo("/v1/actions/" + userId)) @@ -205,7 +198,7 @@ public class ActionsMocks extends BaseIntegrationTest { WireMock.aResponse() .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_PROBLEM_JSON_VALUE) .withStatus(500) - .withBody(objectMapper.writeValueAsString(problemPortalHistoryDto)))); + .withBody(objectMapper.writeValueAsString(problemHistoryDto)))); } // Used for thatActionCanNotBeCreated protected ProblemApiDto createActionProblem( diff --git a/app/src/test/java/org/onap/portalng/bff/actions/CreateActionsIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/actions/CreateActionsIntegrationTest.java index 3508f19..748d568 100644 --- a/app/src/test/java/org/onap/portalng/bff/actions/CreateActionsIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/actions/CreateActionsIntegrationTest.java @@ -26,8 +26,8 @@ import static org.assertj.core.api.Assertions.assertThat; import java.time.OffsetDateTime; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; -import org.onap.portalng.bff.openapi.client_portal_history.model.ActionResponsePortalHistoryDto; -import org.onap.portalng.bff.openapi.client_portal_history.model.ProblemPortalHistoryDto; +import org.onap.portalng.bff.openapi.client_history.model.ActionResponseHistoryDto; +import org.onap.portalng.bff.openapi.client_history.model.ProblemHistoryDto; import org.onap.portalng.bff.openapi.server.model.ActionsResponseApiDto; import org.onap.portalng.bff.openapi.server.model.CreateActionRequestApiDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; @@ -39,21 +39,21 @@ class CreateActionsIntegrationTest extends ActionsMocks { void thatActionCanBeCreated() throws Exception { String userId = "22-33-44-55"; OffsetDateTime createdAt = OffsetDateTime.now(); - ActionResponsePortalHistoryDto actionResponsePortalHistoryDto = + ActionResponseHistoryDto actionResponseHistoryDto = ActionFixtures.generateActionResponse( "Instantiation", "create", "no detail message", "223344", "SO", 0, createdAt); CreateActionRequestApiDto createActionDto = ActionFixtures.generateCreateActionRequestApiDto( "Instantiation", "create", "no detail message", "223344", "SO", userId, createdAt); - mockCreateActions(userId, actionResponsePortalHistoryDto); + mockCreateActions(userId, actionResponseHistoryDto); final ActionsResponseApiDto response = createAction(createActionDto, userId); assertThat(response.getActionCreatedAt()) - .isEqualTo(actionResponsePortalHistoryDto.getActionCreatedAt()); + .isEqualTo(actionResponseHistoryDto.getActionCreatedAt()); Assertions.assertThat(objectMapper.writeValueAsString(response.getAction())) - .isEqualTo(objectMapper.writeValueAsString(actionResponsePortalHistoryDto.getAction())); + .isEqualTo(objectMapper.writeValueAsString(actionResponseHistoryDto.getAction())); } @Test @@ -61,18 +61,18 @@ class CreateActionsIntegrationTest extends ActionsMocks { String userId = "22-33-44-55"; OffsetDateTime createdAt = OffsetDateTime.now(); - ProblemPortalHistoryDto problemPortalHistoryDto = - new ProblemPortalHistoryDto() + ProblemHistoryDto problemHistoryDto = + new ProblemHistoryDto() .status(HttpStatus.INTERNAL_SERVER_ERROR.value()) .detail("Internal database error") .title("Internal Server Error") - .instance("portal-history"); + .instance("history"); CreateActionRequestApiDto createActionDto = ActionFixtures.generateCreateActionRequestApiDto( "Instantiation", "create", "no detail message", "223344", "SO", userId, createdAt); - mockCreateActionsProblem(userId, problemPortalHistoryDto); + mockCreateActionsProblem(userId, problemHistoryDto); final ProblemApiDto response = createActionProblem(createActionDto, userId); @@ -80,6 +80,6 @@ class CreateActionsIntegrationTest extends ActionsMocks { .isEqualTo(ProblemApiDto.DownstreamSystemEnum.PORTAL_HISTORY); assertThat(response.getDownstreamStatus()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value()); - assertThat(response.getDetail()).isEqualTo(problemPortalHistoryDto.getDetail()); + assertThat(response.getDetail()).isEqualTo(problemHistoryDto.getDetail()); } } diff --git a/app/src/test/java/org/onap/portalng/bff/actions/GetActionsIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/actions/GetActionsIntegrationTest.java index 489a8d3..90c065e 100644 --- a/app/src/test/java/org/onap/portalng/bff/actions/GetActionsIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/actions/GetActionsIntegrationTest.java @@ -25,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.onap.portalng.bff.openapi.client_portal_history.model.ActionsListResponsePortalHistoryDto; +import org.onap.portalng.bff.openapi.client_history.model.ActionsListResponseHistoryDto; import org.onap.portalng.bff.openapi.server.model.ActionsListResponseApiDto; class GetActionsIntegrationTest extends ActionsMocks { @@ -36,22 +36,21 @@ class GetActionsIntegrationTest extends ActionsMocks { Integer showLastHours = 2; String userId = "22-33-44-55"; OffsetDateTime createdAt = OffsetDateTime.now(); - ActionsListResponsePortalHistoryDto actionsListResponsePortalHistoryDto = + ActionsListResponseHistoryDto actionsListResponseHistoryDto = ActionFixtures.generateActionsListResponse(numberOfActions, 30, createdAt); - mockGetActions(actionsListResponsePortalHistoryDto, userId, showLastHours); + mockGetActions(actionsListResponseHistoryDto, userId, showLastHours); final ActionsListResponseApiDto response = getActions(userId); assertThat(response.getTotalCount()).isEqualTo(30); assertThat(response.getItems()).hasSize(numberOfActions); assertThat(response.getItems().get(0).getActionCreatedAt()) - .isEqualTo( - actionsListResponsePortalHistoryDto.getActionsList().get(0).getActionCreatedAt()); + .isEqualTo(actionsListResponseHistoryDto.getActionsList().get(0).getActionCreatedAt()); assertThat(objectMapper.writeValueAsString(response.getItems().get(0).getAction())) .isEqualTo( objectMapper.writeValueAsString( - actionsListResponsePortalHistoryDto.getActionsList().get(0).getAction())); + actionsListResponseHistoryDto.getActionsList().get(0).getAction())); } @Test @@ -59,21 +58,20 @@ class GetActionsIntegrationTest extends ActionsMocks { int numberOfActions = 10; String userId = "22-33-44-55"; OffsetDateTime createdAt = OffsetDateTime.now(); - ActionsListResponsePortalHistoryDto actionsListResponsePortalHistoryDto = + ActionsListResponseHistoryDto actionsListResponseHistoryDto = ActionFixtures.generateActionsListResponse(numberOfActions, 30, createdAt); - mockGetActionsWithoutParameterShowLastHours(actionsListResponsePortalHistoryDto, userId); + mockGetActionsWithoutParameterShowLastHours(actionsListResponseHistoryDto, userId); final ActionsListResponseApiDto response = getActionsWithoutParameterShowLastHours(userId); assertThat(response.getTotalCount()).isEqualTo(30); assertThat(response.getItems()).hasSize(numberOfActions); assertThat(response.getItems().get(0).getActionCreatedAt()) - .isEqualTo( - actionsListResponsePortalHistoryDto.getActionsList().get(0).getActionCreatedAt()); + .isEqualTo(actionsListResponseHistoryDto.getActionsList().get(0).getActionCreatedAt()); assertThat(objectMapper.writeValueAsString(response.getItems().get(0).getAction())) .isEqualTo( objectMapper.writeValueAsString( - actionsListResponsePortalHistoryDto.getActionsList().get(0).getAction())); + actionsListResponseHistoryDto.getActionsList().get(0).getAction())); } } diff --git a/app/src/test/java/org/onap/portalng/bff/actions/ListActionsIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/actions/ListActionsIntegrationTest.java index 8451641..5acc4f4 100644 --- a/app/src/test/java/org/onap/portalng/bff/actions/ListActionsIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/actions/ListActionsIntegrationTest.java @@ -26,8 +26,8 @@ import static org.assertj.core.api.Assertions.assertThat; import java.time.OffsetDateTime; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; -import org.onap.portalng.bff.openapi.client_portal_history.model.ActionsListResponsePortalHistoryDto; -import org.onap.portalng.bff.openapi.client_portal_history.model.ProblemPortalHistoryDto; +import org.onap.portalng.bff.openapi.client_history.model.ActionsListResponseHistoryDto; +import org.onap.portalng.bff.openapi.client_history.model.ProblemHistoryDto; import org.onap.portalng.bff.openapi.server.model.ActionsListResponseApiDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; import org.springframework.http.HttpStatus; @@ -38,41 +38,40 @@ class ListActionsIntegrationTest extends ActionsMocks { void thatActionsListCanBeRetrieved() throws Exception { int numberOfActions = 10; OffsetDateTime createdAt = OffsetDateTime.now(); - ActionsListResponsePortalHistoryDto actionsListResponsePortalHistoryDto = + ActionsListResponseHistoryDto actionsListResponseHistoryDto = ActionFixtures.generateActionsListResponse(numberOfActions, 1000, createdAt); - mockListActions(actionsListResponsePortalHistoryDto); + mockListActions(actionsListResponseHistoryDto); final ActionsListResponseApiDto response = listActions(); assertThat(response.getTotalCount()).isEqualTo(1000); assertThat(response.getItems()).hasSize(numberOfActions); assertThat(response.getItems().get(0).getActionCreatedAt()) - .isEqualTo( - actionsListResponsePortalHistoryDto.getActionsList().get(0).getActionCreatedAt()); + .isEqualTo(actionsListResponseHistoryDto.getActionsList().get(0).getActionCreatedAt()); Assertions.assertThat(objectMapper.writeValueAsString(response.getItems().get(0).getAction())) .isEqualTo( objectMapper.writeValueAsString( - actionsListResponsePortalHistoryDto.getActionsList().get(0).getAction())); + actionsListResponseHistoryDto.getActionsList().get(0).getAction())); } @Test void thatActionsListCanNotBeRetrieved() throws Exception { - ProblemPortalHistoryDto problemPortalHistoryDto = - new ProblemPortalHistoryDto() + ProblemHistoryDto problemHistoryDto = + new ProblemHistoryDto() .status(HttpStatus.INTERNAL_SERVER_ERROR.value()) .detail("Internal database error") .title("Internal Server Error") - .instance("portal-history"); + .instance("history"); - mockListActionsProblem(problemPortalHistoryDto); + mockListActionsProblem(problemHistoryDto); final ProblemApiDto response = listActionsProblem(); assertThat(response.getDownstreamSystem()) .isEqualTo(ProblemApiDto.DownstreamSystemEnum.PORTAL_HISTORY); assertThat(response.getDownstreamStatus()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value()); - assertThat(response.getDetail()).isEqualTo(problemPortalHistoryDto.getDetail()); + assertThat(response.getDetail()).isEqualTo(problemHistoryDto.getDetail()); } } diff --git a/app/src/test/java/org/onap/portalng/bff/headers/XRequestIdHeaderTest.java b/app/src/test/java/org/onap/portalng/bff/headers/XRequestIdHeaderTest.java index 6f82308..b79537c 100644 --- a/app/src/test/java/org/onap/portalng/bff/headers/XRequestIdHeaderTest.java +++ b/app/src/test/java/org/onap/portalng/bff/headers/XRequestIdHeaderTest.java @@ -28,7 +28,7 @@ import com.github.tomakehurst.wiremock.matching.EqualToPattern; import io.restassured.http.Header; import org.junit.jupiter.api.Test; import org.onap.portalng.bff.BaseIntegrationTest; -import org.onap.portalng.bff.openapi.client_portal_prefs.model.PreferencesPortalPrefsDto; +import org.onap.portalng.bff.openapi.client_preferences.model.PreferencesPreferencesDto; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -39,17 +39,17 @@ class XRequestIdHeaderTest extends BaseIntegrationTest { @Test void xRequestIdHeaderIsCorrectlySetInResponse() throws Exception { // use preferences endpoint for testing the header - final PreferencesPortalPrefsDto preferencesPortalPrefsDto = new PreferencesPortalPrefsDto(); + final PreferencesPreferencesDto preferencesPreferencesDto = new PreferencesPreferencesDto(); // mockGetTile(tileDetailResponsePortalServiceDto, X_REQUEST_ID); - mockGetPreferences(preferencesPortalPrefsDto, X_REQUEST_ID); + mockGetPreferences(preferencesPreferencesDto, X_REQUEST_ID); final String response = getPreferencesExtractHeader(X_REQUEST_ID); assertThat(response).isEqualTo(X_REQUEST_ID); } protected void mockGetPreferences( - PreferencesPortalPrefsDto preferencesPortalPrefsDto, String xRequestId) throws Exception { + PreferencesPreferencesDto preferencesPreferencesDto, String xRequestId) throws Exception { WireMock.stubFor( WireMock.get(WireMock.urlEqualTo("/v1/preferences")) .withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID)) @@ -57,7 +57,7 @@ class XRequestIdHeaderTest extends BaseIntegrationTest { WireMock.aResponse() .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) .withHeader("X-Request-Id", xRequestId) - .withBody(objectMapper.writeValueAsString(preferencesPortalPrefsDto)))); + .withBody(objectMapper.writeValueAsString(preferencesPreferencesDto)))); } protected String getPreferencesExtractHeader(String xRequestId) { diff --git a/app/src/test/java/org/onap/portalng/bff/preferences/CreatePreferencesIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/preferences/CreatePreferencesIntegrationTest.java index 65a6f19..3b16664 100644 --- a/app/src/test/java/org/onap/portalng/bff/preferences/CreatePreferencesIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/preferences/CreatePreferencesIntegrationTest.java @@ -25,8 +25,8 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import io.restassured.http.Header; import org.junit.jupiter.api.Test; -import org.onap.portalng.bff.openapi.client_portal_prefs.model.PreferencesPortalPrefsDto; -import org.onap.portalng.bff.openapi.client_portal_prefs.model.ProblemPortalPrefsDto; +import org.onap.portalng.bff.openapi.client_preferences.model.PreferencesPreferencesDto; +import org.onap.portalng.bff.openapi.client_preferences.model.ProblemPreferencesDto; import org.onap.portalng.bff.openapi.server.model.CreatePreferencesRequestApiDto; import org.onap.portalng.bff.openapi.server.model.PreferencesResponseApiDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; @@ -36,8 +36,8 @@ import org.springframework.http.MediaType; class CreatePreferencesIntegrationTest extends PreferencesMocks { @Test void thatPreferencesCanBeCreated() throws Exception { - PreferencesPortalPrefsDto preferencesPortalPrefsDto = new PreferencesPortalPrefsDto(); - preferencesPortalPrefsDto.setProperties( + PreferencesPreferencesDto preferencesPreferencesDto = new PreferencesPreferencesDto(); + preferencesPreferencesDto.setProperties( "{\n" + "\"properties\": {\n" + "\"appStarter\": \"value1\",\n" @@ -45,7 +45,7 @@ class CreatePreferencesIntegrationTest extends PreferencesMocks { + "}\n" + "\n" + "}"); - mockCreatePreferences(preferencesPortalPrefsDto); + mockCreatePreferences(preferencesPreferencesDto); final CreatePreferencesRequestApiDto request = new CreatePreferencesRequestApiDto() @@ -59,18 +59,18 @@ class CreatePreferencesIntegrationTest extends PreferencesMocks { + "}"); final PreferencesResponseApiDto response = createPreferences(request); assertThat(response).isNotNull(); - assertThat(response.getProperties()).isEqualTo(preferencesPortalPrefsDto.getProperties()); + assertThat(response.getProperties()).isEqualTo(preferencesPreferencesDto.getProperties()); } @Test void thatPreferencesCanNotBeCreated() throws Exception { - final var problemPortalPrefsDto = new ProblemPortalPrefsDto(); - problemPortalPrefsDto.setStatus(HttpStatus.BAD_REQUEST.value()); - problemPortalPrefsDto.setTitle(HttpStatus.BAD_REQUEST.toString()); - problemPortalPrefsDto.setDetail("Some details"); + final var problemPreferencesDto = new ProblemPreferencesDto(); + problemPreferencesDto.setStatus(HttpStatus.BAD_REQUEST.value()); + problemPreferencesDto.setTitle(HttpStatus.BAD_REQUEST.toString()); + problemPreferencesDto.setDetail("Some details"); - final PreferencesPortalPrefsDto preferencesPortalPrefsDto = - new PreferencesPortalPrefsDto() + final PreferencesPreferencesDto preferencesPreferencesDto = + new PreferencesPreferencesDto() .properties( "{\n" + "\"properties\": {\n" @@ -79,7 +79,7 @@ class CreatePreferencesIntegrationTest extends PreferencesMocks { + "}\n" + "\n" + "}"); - mockCreatePreferencesError(preferencesPortalPrefsDto, problemPortalPrefsDto); + mockCreatePreferencesError(preferencesPreferencesDto, problemPreferencesDto); CreatePreferencesRequestApiDto responseBody = new CreatePreferencesRequestApiDto() @@ -107,9 +107,9 @@ class CreatePreferencesIntegrationTest extends PreferencesMocks { .as(ProblemApiDto.class); assertThat(response.getStatus()).isEqualTo(HttpStatus.BAD_GATEWAY.value()); - assertThat(response.getDetail()).isEqualTo(problemPortalPrefsDto.getDetail()); + assertThat(response.getDetail()).isEqualTo(problemPreferencesDto.getDetail()); assertThat(response.getDownstreamSystem()) - .isEqualTo(ProblemApiDto.DownstreamSystemEnum.PORTAL_PREFS); + .isEqualTo(ProblemApiDto.DownstreamSystemEnum.PREFERENCES); assertThat(response.getDownstreamStatus()).isEqualTo(HttpStatus.BAD_REQUEST.value()); } } diff --git a/app/src/test/java/org/onap/portalng/bff/preferences/GetPreferencesIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/preferences/GetPreferencesIntegrationTest.java index 06329d4..a88a0cd 100644 --- a/app/src/test/java/org/onap/portalng/bff/preferences/GetPreferencesIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/preferences/GetPreferencesIntegrationTest.java @@ -25,8 +25,8 @@ import static org.assertj.core.api.Assertions.assertThat; import io.restassured.http.Header; import org.junit.jupiter.api.Test; -import org.onap.portalng.bff.openapi.client_portal_prefs.model.PreferencesPortalPrefsDto; -import org.onap.portalng.bff.openapi.client_portal_prefs.model.ProblemPortalPrefsDto; +import org.onap.portalng.bff.openapi.client_preferences.model.PreferencesPreferencesDto; +import org.onap.portalng.bff.openapi.client_preferences.model.ProblemPreferencesDto; import org.onap.portalng.bff.openapi.server.model.PreferencesResponseApiDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; import org.springframework.http.HttpStatus; @@ -36,9 +36,9 @@ class GetPreferencesIntegrationTest extends PreferencesMocks { @Test void thatPreferencesCanBeRetrieved() throws Exception { - PreferencesPortalPrefsDto preferencesPortalPrefsDto = new PreferencesPortalPrefsDto(); - preferencesPortalPrefsDto.setProperties(getFixture(PREF_PROPERTIES_FILE, Object.class)); - mockGetPreferences(preferencesPortalPrefsDto); + PreferencesPreferencesDto preferencesPreferencesDto = new PreferencesPreferencesDto(); + preferencesPreferencesDto.setProperties(getFixture(PREF_PROPERTIES_FILE, Object.class)); + mockGetPreferences(preferencesPreferencesDto); final PreferencesResponseApiDto response = getPreferences(); assertThat(response).isNotNull(); @@ -46,8 +46,8 @@ class GetPreferencesIntegrationTest extends PreferencesMocks { @Test void thatPreferencesCanNotBeRetrieved() throws Exception { - final ProblemPortalPrefsDto problemResponse = - new ProblemPortalPrefsDto() + final ProblemPreferencesDto problemResponse = + new ProblemPreferencesDto() .title("Unauthorized") .status(HttpStatus.UNAUTHORIZED.value()) .detail("Unauthorized error detail") diff --git a/app/src/test/java/org/onap/portalng/bff/preferences/PreferencesMocks.java b/app/src/test/java/org/onap/portalng/bff/preferences/PreferencesMocks.java index 0d5b69a..9c5be75 100644 --- a/app/src/test/java/org/onap/portalng/bff/preferences/PreferencesMocks.java +++ b/app/src/test/java/org/onap/portalng/bff/preferences/PreferencesMocks.java @@ -30,8 +30,8 @@ import java.io.File; import java.io.IOException; import org.apache.http.HttpHeaders; import org.onap.portalng.bff.BaseIntegrationTest; -import org.onap.portalng.bff.openapi.client_portal_prefs.model.PreferencesPortalPrefsDto; -import org.onap.portalng.bff.openapi.client_portal_prefs.model.ProblemPortalPrefsDto; +import org.onap.portalng.bff.openapi.client_preferences.model.PreferencesPreferencesDto; +import org.onap.portalng.bff.openapi.client_preferences.model.ProblemPreferencesDto; import org.onap.portalng.bff.openapi.server.model.CreatePreferencesRequestApiDto; import org.onap.portalng.bff.openapi.server.model.PreferencesResponseApiDto; import org.springframework.http.HttpStatus; @@ -65,7 +65,7 @@ public class PreferencesMocks extends BaseIntegrationTest { .as(PreferencesResponseApiDto.class); } - protected void mockGetPreferences(PreferencesPortalPrefsDto preferencesPortalPrefsDto) + protected void mockGetPreferences(PreferencesPreferencesDto preferencesPreferencesDto) throws Exception { WireMock.stubFor( WireMock.get(WireMock.urlEqualTo("/v1/preferences")) @@ -73,10 +73,10 @@ public class PreferencesMocks extends BaseIntegrationTest { .willReturn( WireMock.aResponse() .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) - .withBody(objectMapper.writeValueAsString(preferencesPortalPrefsDto)))); + .withBody(objectMapper.writeValueAsString(preferencesPreferencesDto)))); } - protected void mockGetPreferencesError(ProblemPortalPrefsDto problem) throws Exception { + protected void mockGetPreferencesError(ProblemPreferencesDto problem) throws Exception { WireMock.stubFor( WireMock.get(WireMock.urlEqualTo("/v1/preferences")) .withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID)) @@ -104,35 +104,35 @@ public class PreferencesMocks extends BaseIntegrationTest { .as(PreferencesResponseApiDto.class); } - protected void mockCreatePreferences(PreferencesPortalPrefsDto preferencesPortalPrefsDto) + protected void mockCreatePreferences(PreferencesPreferencesDto preferencesPreferencesDto) throws Exception { WireMock.stubFor( WireMock.post(WireMock.urlEqualTo("/v1/preferences")) .withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID)) .withRequestBody( WireMock.equalToJson( - objectMapper.writeValueAsString(preferencesPortalPrefsDto), true, false)) + objectMapper.writeValueAsString(preferencesPreferencesDto), true, false)) .willReturn( WireMock.aResponse() .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) - .withBody(objectMapper.writeValueAsString(preferencesPortalPrefsDto)))); + .withBody(objectMapper.writeValueAsString(preferencesPreferencesDto)))); } protected void mockCreatePreferencesError( - PreferencesPortalPrefsDto preferencesPortalPrefsDto, - ProblemPortalPrefsDto problemPortalPrefsDto) + PreferencesPreferencesDto preferencesPreferencesDto, + ProblemPreferencesDto problemPreferencesDto) throws Exception { WireMock.stubFor( WireMock.post(WireMock.urlEqualTo("/v1/preferences")) .withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID)) .withRequestBody( WireMock.equalToJson( - objectMapper.writeValueAsString(preferencesPortalPrefsDto), true, false)) + objectMapper.writeValueAsString(preferencesPreferencesDto), true, false)) .willReturn( WireMock.aResponse() .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) .withStatus(HttpStatus.BAD_REQUEST.value()) - .withBody(objectMapper.writeValueAsString(problemPortalPrefsDto)))); + .withBody(objectMapper.writeValueAsString(problemPreferencesDto)))); } protected PreferencesResponseApiDto updatePreferences(CreatePreferencesRequestApiDto request) { @@ -150,33 +150,33 @@ public class PreferencesMocks extends BaseIntegrationTest { .as(PreferencesResponseApiDto.class); } - protected void mockUpdatePreferences(PreferencesPortalPrefsDto preferencesPortalPrefsDto) + protected void mockUpdatePreferences(PreferencesPreferencesDto preferencesPreferencesDto) throws Exception { WireMock.stubFor( WireMock.put(WireMock.urlEqualTo("/v1/preferences")) .withHeader("X-Request-Id", new EqualToPattern(X_REQUEST_ID)) .withRequestBody( WireMock.equalToJson( - objectMapper.writeValueAsString(preferencesPortalPrefsDto), true, false)) + objectMapper.writeValueAsString(preferencesPreferencesDto), true, false)) .willReturn( WireMock.aResponse() .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) - .withBody(objectMapper.writeValueAsString(preferencesPortalPrefsDto)))); + .withBody(objectMapper.writeValueAsString(preferencesPreferencesDto)))); } protected void mockUpdatePreferencesError( - PreferencesPortalPrefsDto preferencesPortalPrefsDto, - ProblemPortalPrefsDto problemPortalPrefsDto) + PreferencesPreferencesDto preferencesPreferencesDto, + ProblemPreferencesDto problemPreferencesDto) throws Exception { WireMock.stubFor( WireMock.put(WireMock.urlEqualTo("/v1/preferences")) .withRequestBody( WireMock.equalToJson( - objectMapper.writeValueAsString(preferencesPortalPrefsDto), true, false)) + objectMapper.writeValueAsString(preferencesPreferencesDto), true, false)) .willReturn( WireMock.aResponse() .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) .withStatus(HttpStatus.BAD_REQUEST.value()) - .withBody(objectMapper.writeValueAsString(problemPortalPrefsDto)))); + .withBody(objectMapper.writeValueAsString(problemPreferencesDto)))); } } diff --git a/app/src/test/java/org/onap/portalng/bff/preferences/UpdatePreferencesIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/preferences/UpdatePreferencesIntegrationTest.java index 031726e..1cd9a70 100644 --- a/app/src/test/java/org/onap/portalng/bff/preferences/UpdatePreferencesIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/preferences/UpdatePreferencesIntegrationTest.java @@ -25,8 +25,8 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import io.restassured.http.Header; import org.junit.jupiter.api.Test; -import org.onap.portalng.bff.openapi.client_portal_prefs.model.PreferencesPortalPrefsDto; -import org.onap.portalng.bff.openapi.client_portal_prefs.model.ProblemPortalPrefsDto; +import org.onap.portalng.bff.openapi.client_preferences.model.PreferencesPreferencesDto; +import org.onap.portalng.bff.openapi.client_preferences.model.ProblemPreferencesDto; import org.onap.portalng.bff.openapi.server.model.CreatePreferencesRequestApiDto; import org.onap.portalng.bff.openapi.server.model.PreferencesResponseApiDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; @@ -36,8 +36,8 @@ import org.springframework.http.MediaType; class UpdatePreferencesIntegrationTest extends PreferencesMocks { @Test void thatPreferencesCanBeUpdated() throws Exception { - PreferencesPortalPrefsDto preferencesPortalPrefsDto = new PreferencesPortalPrefsDto(); - preferencesPortalPrefsDto.setProperties( + PreferencesPreferencesDto preferencesPreferencesDto = new PreferencesPreferencesDto(); + preferencesPreferencesDto.setProperties( "{\n" + "\"properties\": {\n" + "\"appStarter\": \"value1\",\n" @@ -45,7 +45,7 @@ class UpdatePreferencesIntegrationTest extends PreferencesMocks { + "}\n" + "\n" + "}"); - mockUpdatePreferences(preferencesPortalPrefsDto); + mockUpdatePreferences(preferencesPreferencesDto); final CreatePreferencesRequestApiDto requestApiDto = new CreatePreferencesRequestApiDto() @@ -59,18 +59,18 @@ class UpdatePreferencesIntegrationTest extends PreferencesMocks { + "}"); final PreferencesResponseApiDto response = updatePreferences(requestApiDto); assertThat(response).isNotNull(); - assertThat(response.getProperties()).isEqualTo(preferencesPortalPrefsDto.getProperties()); + assertThat(response.getProperties()).isEqualTo(preferencesPreferencesDto.getProperties()); } @Test void thatPreferencesCanNotBeUpdated() throws Exception { - final var problemPortalPrefsDto = new ProblemPortalPrefsDto(); - problemPortalPrefsDto.setStatus(HttpStatus.BAD_REQUEST.value()); - problemPortalPrefsDto.setTitle(HttpStatus.BAD_REQUEST.toString()); - problemPortalPrefsDto.setDetail("Some details"); + final var problemPreferencesDto = new ProblemPreferencesDto(); + problemPreferencesDto.setStatus(HttpStatus.BAD_REQUEST.value()); + problemPreferencesDto.setTitle(HttpStatus.BAD_REQUEST.toString()); + problemPreferencesDto.setDetail("Some details"); - final PreferencesPortalPrefsDto preferencesPortalPrefsDto = - new PreferencesPortalPrefsDto() + final PreferencesPreferencesDto preferencesPreferencesDto = + new PreferencesPreferencesDto() .properties( "{\n" + "\"properties\": {\n" @@ -79,7 +79,7 @@ class UpdatePreferencesIntegrationTest extends PreferencesMocks { + "}\n" + "\n" + "}"); - mockUpdatePreferencesError(preferencesPortalPrefsDto, problemPortalPrefsDto); + mockUpdatePreferencesError(preferencesPreferencesDto, problemPreferencesDto); CreatePreferencesRequestApiDto requestApiDto = new CreatePreferencesRequestApiDto() @@ -108,7 +108,7 @@ class UpdatePreferencesIntegrationTest extends PreferencesMocks { assertThat(response.getStatus()).isEqualTo(HttpStatus.BAD_GATEWAY.value()); assertThat(response.getDownstreamSystem()) - .isEqualTo(ProblemApiDto.DownstreamSystemEnum.PORTAL_PREFS); + .isEqualTo(ProblemApiDto.DownstreamSystemEnum.PREFERENCES); assertThat(response.getDownstreamStatus()).isEqualTo(HttpStatus.BAD_REQUEST.value()); } } diff --git a/app/src/test/java/org/onap/portalng/bff/roles/ListRealmRolesIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/roles/ListRealmRolesIntegrationTest.java index df95e2c..d9a69f1 100644 --- a/app/src/test/java/org/onap/portalng/bff/roles/ListRealmRolesIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/roles/ListRealmRolesIntegrationTest.java @@ -27,8 +27,8 @@ import com.github.tomakehurst.wiremock.client.WireMock; import io.restassured.http.Header; import java.util.List; import org.junit.jupiter.api.Test; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; import org.onap.portalng.bff.openapi.server.model.RoleApiDto; import org.onap.portalng.bff.openapi.server.model.RoleListResponseApiDto; diff --git a/app/src/test/java/org/onap/portalng/bff/roles/RolesMocks.java b/app/src/test/java/org/onap/portalng/bff/roles/RolesMocks.java index fe065a7..b29ad7c 100644 --- a/app/src/test/java/org/onap/portalng/bff/roles/RolesMocks.java +++ b/app/src/test/java/org/onap/portalng/bff/roles/RolesMocks.java @@ -25,7 +25,7 @@ import com.github.tomakehurst.wiremock.client.WireMock; import io.restassured.http.Header; import java.util.List; import org.onap.portalng.bff.BaseIntegrationTest; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto; import org.onap.portalng.bff.openapi.server.model.RoleListResponseApiDto; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/app/src/test/java/org/onap/portalng/bff/users/CreateUserIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/CreateUserIntegrationTest.java index aa67631..5aab69d 100644 --- a/app/src/test/java/org/onap/portalng/bff/users/CreateUserIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/users/CreateUserIntegrationTest.java @@ -30,10 +30,10 @@ import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; import org.onap.portalng.bff.BaseIntegrationTest; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RequiredActionsKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.UserKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.RequiredActionsKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.UserKeycloakDto; import org.onap.portalng.bff.openapi.server.model.CreateUserRequestApiDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; import org.onap.portalng.bff.openapi.server.model.RoleApiDto; diff --git a/app/src/test/java/org/onap/portalng/bff/users/DeleteUserIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/DeleteUserIntegrationTest.java index 639e5d3..11076d4 100644 --- a/app/src/test/java/org/onap/portalng/bff/users/DeleteUserIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/users/DeleteUserIntegrationTest.java @@ -27,7 +27,7 @@ import com.github.tomakehurst.wiremock.client.WireMock; import io.restassured.http.Header; import org.junit.jupiter.api.Test; import org.onap.portalng.bff.BaseIntegrationTest; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/app/src/test/java/org/onap/portalng/bff/users/GetUserDetailIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/GetUserDetailIntegrationTest.java index 6704cbc..e334953 100644 --- a/app/src/test/java/org/onap/portalng/bff/users/GetUserDetailIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/users/GetUserDetailIntegrationTest.java @@ -29,9 +29,9 @@ import io.restassured.http.Header; import java.util.List; import org.junit.jupiter.api.Test; import org.onap.portalng.bff.BaseIntegrationTest; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.UserKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.UserKeycloakDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; import org.onap.portalng.bff.openapi.server.model.UserResponseApiDto; import org.springframework.http.HttpHeaders; diff --git a/app/src/test/java/org/onap/portalng/bff/users/ListAssignedRolesIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/ListAssignedRolesIntegrationTest.java index 7d05c67..7ab1130 100644 --- a/app/src/test/java/org/onap/portalng/bff/users/ListAssignedRolesIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/users/ListAssignedRolesIntegrationTest.java @@ -28,8 +28,8 @@ import io.restassured.http.Header; import java.util.List; import org.junit.jupiter.api.Test; import org.onap.portalng.bff.BaseIntegrationTest; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; import org.onap.portalng.bff.openapi.server.model.RoleApiDto; import org.onap.portalng.bff.openapi.server.model.RoleListResponseApiDto; diff --git a/app/src/test/java/org/onap/portalng/bff/users/ListAvailableRolesIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/ListAvailableRolesIntegrationTest.java index 86f9ed8..45290da 100644 --- a/app/src/test/java/org/onap/portalng/bff/users/ListAvailableRolesIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/users/ListAvailableRolesIntegrationTest.java @@ -28,8 +28,8 @@ import io.restassured.http.Header; import java.util.List; import org.junit.jupiter.api.Test; import org.onap.portalng.bff.BaseIntegrationTest; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; import org.onap.portalng.bff.openapi.server.model.RoleApiDto; import org.onap.portalng.bff.openapi.server.model.RoleListResponseApiDto; diff --git a/app/src/test/java/org/onap/portalng/bff/users/ListUsersIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/ListUsersIntegrationTest.java index 27a8ecd..8e675ca 100644 --- a/app/src/test/java/org/onap/portalng/bff/users/ListUsersIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/users/ListUsersIntegrationTest.java @@ -30,9 +30,9 @@ import java.util.List; import java.util.Optional; import org.junit.jupiter.api.Test; import org.onap.portalng.bff.BaseIntegrationTest; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.UserKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.UserKeycloakDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; import org.onap.portalng.bff.openapi.server.model.UserListResponseApiDto; import org.onap.portalng.bff.openapi.server.model.UserResponseApiDto; diff --git a/app/src/test/java/org/onap/portalng/bff/users/UpdateAssignedRolesIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/UpdateAssignedRolesIntegrationTest.java index a1a5ee3..8f7b350 100644 --- a/app/src/test/java/org/onap/portalng/bff/users/UpdateAssignedRolesIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/users/UpdateAssignedRolesIntegrationTest.java @@ -30,8 +30,8 @@ import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; import org.onap.portalng.bff.BaseIntegrationTest; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; import org.onap.portalng.bff.openapi.server.model.RoleApiDto; import org.onap.portalng.bff.openapi.server.model.RoleListResponseApiDto; diff --git a/app/src/test/java/org/onap/portalng/bff/users/UpdateUserIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/UpdateUserIntegrationTest.java index f181c5e..0cce10a 100644 --- a/app/src/test/java/org/onap/portalng/bff/users/UpdateUserIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/users/UpdateUserIntegrationTest.java @@ -29,9 +29,9 @@ import io.restassured.http.Header; import java.util.List; import org.junit.jupiter.api.Test; import org.onap.portalng.bff.BaseIntegrationTest; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.UserKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.UserKeycloakDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; import org.onap.portalng.bff.openapi.server.model.UpdateUserRequestApiDto; import org.springframework.http.HttpStatus; diff --git a/app/src/test/java/org/onap/portalng/bff/users/UpdateUserPasswordIntegrationTest.java b/app/src/test/java/org/onap/portalng/bff/users/UpdateUserPasswordIntegrationTest.java index 0bdaaa9..cd38aeb 100644 --- a/app/src/test/java/org/onap/portalng/bff/users/UpdateUserPasswordIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/bff/users/UpdateUserPasswordIntegrationTest.java @@ -27,8 +27,8 @@ import com.github.tomakehurst.wiremock.client.WireMock; import io.restassured.http.Header; import org.junit.jupiter.api.Test; import org.onap.portalng.bff.BaseIntegrationTest; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.CredentialKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.CredentialKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; import org.onap.portalng.bff.openapi.server.model.UpdateUserPasswordRequestApiDto; import org.springframework.http.HttpStatus; diff --git a/app/src/test/resources/application-access-control.yml b/app/src/test/resources/application-access-control.yml index 1eb37b8..0506066 100644 --- a/app/src/test/resources/application-access-control.yml +++ b/app/src/test/resources/application-access-control.yml @@ -9,8 +9,6 @@ bff.access-control: PREFERENCES_GET: [onap_admin, onap_designer, onap_operator] PREFERENCES_UPDATE: [onap_admin, onap_designer, onap_operator] ROLE_LIST: ["*"] - TILE_GET: [onap_admin, onap_designer, onap_operator] - TILE_LIST: [onap_admin, onap_designer, onap_operator] USER_CREATE: [onap_admin, onap_designer, onap_operator] USER_DELETE: [onap_admin, onap_designer, onap_operator] USER_GET: [onap_admin, onap_designer, onap_operator] diff --git a/app/src/test/resources/application-development.yml b/app/src/test/resources/application-development.yml index 2f408fe..2d53583 100644 --- a/app/src/test/resources/application-development.yml +++ b/app/src/test/resources/application-development.yml @@ -27,7 +27,6 @@ spring: bff: realm: ONAP - portal-prefs-url: http://localhost:${wiremock.server.port} - portal-history-url: http://localhost:${wiremock.server.port} + preferences-url: http://localhost:${wiremock.server.port} + history-url: http://localhost:${wiremock.server.port} keycloak-url: http://localhost:${wiremock.server.port} - instance-id: PORTAL diff --git a/app/src/test/resources/application.yml b/app/src/test/resources/application.yml index b26e5d4..789e870 100644 --- a/app/src/test/resources/application.yml +++ b/app/src/test/resources/application.yml @@ -28,7 +28,6 @@ spring: bff: realm: ONAP - portal-prefs-url: http://localhost:${wiremock.server.port} - portal-history-url: http://localhost:${wiremock.server.port} + preferences-url: http://localhost:${wiremock.server.port} + history-url: http://localhost:${wiremock.server.port} keycloak-url: http://localhost:${wiremock.server.port} - instance-id: PORTAL diff --git a/development/.env b/development/.env index 9bb9dd3..f8e9c18 100644 --- a/development/.env +++ b/development/.env @@ -20,21 +20,21 @@ POSTGRES_VERSION=15rc1 MONGO_IMAGE=mongo MONGO_VERSION=latest -# portal-prefs -PORTAL_PREFS_IMAGE_NAME=portal-prefs -PORTAL_PREFS_IMAGE_TAG=0.1.0-master-faef0c0e +# preferences +PREFERENCES_IMAGE_NAME=preferences +PREFERENCES_IMAGE_TAG=0.1.0-master-faef0c0e PORTALPREFS_USERNAME:root PORTALPREFS_PASSWORD:password -PORTALPREFS_DATABASE:Portalprefs -PORTALPREFS_HOST:mongo-prefs +PORTALPREFS_DATABASE:Preferences +PORTALPREFS_HOST:mongo-preferences PORTALPREFS_PORT:27017 -# portal-history -PORTAL_HISTORY_IMAGE_NAME=portal-history +# history +PORTAL_HISTORY_IMAGE_NAME=history PORTAL_HISTORY_IMAGE_TAG=0.1.1-de369ace PORTALHISTORY_USERNAME:root PORTALHISTORY_PASSWORD:password -PORTALHISTORY_DATABASE:Portalhist +PORTALHISTORY_DATABASE:History PORTALHISTORY_HOST:mongo-history PORTALHISTORY_PORT:27017 diff --git a/development/docker-compose.yml b/development/docker-compose.yml index 4794ff3..9cca867 100644 --- a/development/docker-compose.yml +++ b/development/docker-compose.yml @@ -39,8 +39,8 @@ services: environment: MONGO_INITDB_ROOT_USERNAME: ${PORTALHISTORY_USERNAME} MONGO_INITDB_ROOT_PASSWORD: ${PORTALHISTORY_PASSWORD} - portal-history: - container_name: portal-history + history: + container_name: history image: "${IMAGE_REPOSITORY}/${PORTAL_HISTORY_IMAGE_NAME}:${PORTAL_HISTORY_IMAGE_TAG}" ports: - 9002:9002 @@ -54,15 +54,15 @@ services: PORTALHISTORY_PORT: ${PORTALHISTORY_PORT} depends_on: - mongo-history - mongo-prefs: - container_name: mongo-prefs + mongo-preferences: + container_name: mongo-preferences image: "${MONGO_IMAGE}:${MONGO_VERSION}" environment: MONGO_INITDB_ROOT_USERNAME: ${PORTALPREFS_USERNAME} MONGO_INITDB_ROOT_PASSWORD: ${PORTALPREFS_PASSWORD} - portal-prefs: - container_name: portal-prefs - image: "${IMAGE_REPOSITORY}/${PORTAL_PREFS_IMAGE_NAME}:${PORTAL_PREFS_IMAGE_TAG}" + preferences: + container_name: preferences + image: "${IMAGE_REPOSITORY}/${PREFERENCES_IMAGE_NAME}:${PREFERENCES_IMAGE_TAG}" ports: - 9001:9001 environment: @@ -74,4 +74,4 @@ services: PORTALPREFS_HOST: ${PORTALPREFS_HOST} PORTALPREFS_PORT: ${PORTALPREFS_PORT} depends_on: - - mongo-prefs \ No newline at end of file + - mongo-preferences \ No newline at end of file diff --git a/lib/build.gradle b/lib/build.gradle index 76b1d42..e72062d 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java' id 'org.springframework.boot' id 'io.spring.dependency-management' - id 'com.github.johnrengelman.shadow' // + id 'com.github.johnrengelman.shadow' id 'maven-publish' // publish lib jar to artifact repository id 'com.diffplug.spotless' // code formatting id 'com.github.spotbugs' // bug linting that can be picked up by IDE @@ -13,9 +13,9 @@ version rootProject.file('version').text.trim() dependencies { implementation project(':openapi:server') - implementation project(':openapi:client-portal-prefs') - implementation project(':openapi:client-portal-history') - implementation project(':openapi:client-portal-keycloak') + implementation project(':openapi:client-preferences') + implementation project(':openapi:client-history') + implementation project(':openapi:client-keycloak') implementation 'org.springframework.boot:spring-boot-starter-webflux' implementation 'org.springframework.boot:spring-boot-starter-actuator' @@ -50,9 +50,9 @@ shadowJar { archiveBaseName.set('bff') dependencies { include(project(':openapi:server')) - include(project(':openapi:client-portal-history')) - include(project(':openapi:client-portal-prefs')) - include(project(':openapi:client-portal-keycloak')) + include(project(':openapi:client-history')) + include(project(':openapi:client-preferences')) + include(project(':openapi:client-keycloak')) } } @@ -69,17 +69,9 @@ publishing { } } } - // https://gitlab.devops.telekom.de/tnap/development/tesla-team/portal-community/bff/-/blob/pipeline/lib/build.gradle#L60 + repositories{ mavenCentral() - // maven { - // url "${maven_central_url}" - // credentials { - // username = "${artifactory_user}" - // password = "${artifactory_password}" - // } - // } - } } diff --git a/lib/src/main/java/org/onap/portalng/bff/config/BffConfig.java b/lib/src/main/java/org/onap/portalng/bff/config/BffConfig.java index 7e773ed..5bc618c 100644 --- a/lib/src/main/java/org/onap/portalng/bff/config/BffConfig.java +++ b/lib/src/main/java/org/onap/portalng/bff/config/BffConfig.java @@ -42,9 +42,8 @@ import reactor.core.publisher.Mono; public class BffConfig { @NotBlank private final String realm; - @NotBlank private final String portalServiceUrl; - @NotBlank private final String portalPrefsUrl; - @NotBlank private final String portalHistoryUrl; + @NotBlank private final String preferencesUrl; + @NotBlank private final String historyUrl; @NotBlank private final String keycloakUrl; @NotNull private final Map> accessControl; diff --git a/lib/src/main/java/org/onap/portalng/bff/config/clients/HistoryConfig.java b/lib/src/main/java/org/onap/portalng/bff/config/clients/HistoryConfig.java new file mode 100644 index 0000000..c7f8709 --- /dev/null +++ b/lib/src/main/java/org/onap/portalng/bff/config/clients/HistoryConfig.java @@ -0,0 +1,95 @@ +/* + * + * Copyright (c) 2022. Deutsche Telekom AG + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * + * + */ + +package org.onap.portalng.bff.config.clients; + +import com.fasterxml.jackson.databind.ObjectMapper; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.List; +import java.util.function.Function; +import lombok.extern.slf4j.Slf4j; +import org.onap.portalng.bff.config.BeansConfig; +import org.onap.portalng.bff.config.BffConfig; +import org.onap.portalng.bff.exceptions.DownstreamApiProblemException; +import org.onap.portalng.bff.openapi.client_history.ApiClient; +import org.onap.portalng.bff.openapi.client_history.api.ActionsApi; +import org.onap.portalng.bff.openapi.client_history.model.ProblemHistoryDto; +import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpStatusCode; +import org.springframework.web.reactive.function.client.ExchangeFilterFunction; +import org.springframework.web.reactive.function.client.WebClient; + +@Slf4j +@Configuration +public class HistoryConfig extends AbstractClientConfig { + private final ObjectMapper objectMapper; + private final BffConfig bffConfig; + private final ExchangeFilterFunction oauth2ExchangeFilterFunction; + + public HistoryConfig( + @Qualifier(BeansConfig.OAUTH2_EXCHANGE_FILTER_FUNCTION) + ExchangeFilterFunction oauth2ExchangeFilterFunction, + ObjectMapper objectMapper, + BffConfig bffConfig) { + super(ProblemHistoryDto.class); + this.objectMapper = objectMapper; + this.bffConfig = bffConfig; + this.oauth2ExchangeFilterFunction = oauth2ExchangeFilterFunction; + } + + @Bean + public ActionsApi portalHistoryActionApi(WebClient.Builder webClientBuilder) { + return constructApiClient(webClientBuilder, ActionsApi::new); + } + + private T constructApiClient( + WebClient.Builder webClientBuilder, Function apiConstructor) { + final ApiClient apiClient = + new ApiClient( + getWebClient(webClientBuilder, List.of(oauth2ExchangeFilterFunction)), + objectMapper, + objectMapper.getDateFormat()); + final String generatedBasePath = apiClient.getBasePath(); + String basePath = ""; + try { + basePath = bffConfig.getHistoryUrl() + new URL(generatedBasePath).getPath(); + } catch (MalformedURLException e) { + log.error(e.getLocalizedMessage()); + } + return apiConstructor.apply(apiClient.setBasePath(basePath)); + } + + @Override + protected DownstreamApiProblemException mapException( + ProblemHistoryDto errorResponse, HttpStatusCode httpStatusCode) { + return DownstreamApiProblemException.builder() + .title(httpStatusCode.toString()) + .detail(errorResponse.getDetail()) + .downstreamMessageId(errorResponse.getType()) + .downstreamSystem(ProblemApiDto.DownstreamSystemEnum.PORTAL_HISTORY.toString()) + .downstreamStatus(httpStatusCode.value()) + .build(); + } +} diff --git a/lib/src/main/java/org/onap/portalng/bff/config/clients/KeycloakConfig.java b/lib/src/main/java/org/onap/portalng/bff/config/clients/KeycloakConfig.java index 9880ef7..2ff3974 100644 --- a/lib/src/main/java/org/onap/portalng/bff/config/clients/KeycloakConfig.java +++ b/lib/src/main/java/org/onap/portalng/bff/config/clients/KeycloakConfig.java @@ -27,9 +27,9 @@ import java.util.function.Function; import org.onap.portalng.bff.config.BeansConfig; import org.onap.portalng.bff.config.BffConfig; import org.onap.portalng.bff.exceptions.DownstreamApiProblemException; -import org.onap.portalng.bff.openapi.client_portal_keycloak.ApiClient; -import org.onap.portalng.bff.openapi.client_portal_keycloak.api.KeycloakApi; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.ErrorResponseKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.ApiClient; +import org.onap.portalng.bff.openapi.client_keycloak.api.KeycloakApi; +import org.onap.portalng.bff.openapi.client_keycloak.model.ErrorResponseKeycloakDto; import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; diff --git a/lib/src/main/java/org/onap/portalng/bff/config/clients/PortalHistoryConfig.java b/lib/src/main/java/org/onap/portalng/bff/config/clients/PortalHistoryConfig.java deleted file mode 100644 index e6904b1..0000000 --- a/lib/src/main/java/org/onap/portalng/bff/config/clients/PortalHistoryConfig.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * - * Copyright (c) 2022. Deutsche Telekom AG - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * - * - */ - -package org.onap.portalng.bff.config.clients; - -import com.fasterxml.jackson.databind.ObjectMapper; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.List; -import java.util.function.Function; -import lombok.extern.slf4j.Slf4j; -import org.onap.portalng.bff.config.BeansConfig; -import org.onap.portalng.bff.config.BffConfig; -import org.onap.portalng.bff.exceptions.DownstreamApiProblemException; -import org.onap.portalng.bff.openapi.client_portal_history.ApiClient; -import org.onap.portalng.bff.openapi.client_portal_history.api.ActionsApi; -import org.onap.portalng.bff.openapi.client_portal_history.model.ProblemPortalHistoryDto; -import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.HttpStatusCode; -import org.springframework.web.reactive.function.client.ExchangeFilterFunction; -import org.springframework.web.reactive.function.client.WebClient; - -@Slf4j -@Configuration -public class PortalHistoryConfig extends AbstractClientConfig { - private final ObjectMapper objectMapper; - private final BffConfig bffConfig; - private final ExchangeFilterFunction oauth2ExchangeFilterFunction; - - @Autowired - public PortalHistoryConfig( - @Qualifier(BeansConfig.OAUTH2_EXCHANGE_FILTER_FUNCTION) - ExchangeFilterFunction oauth2ExchangeFilterFunction, - ObjectMapper objectMapper, - BffConfig bffConfig) { - super(ProblemPortalHistoryDto.class); - this.objectMapper = objectMapper; - this.bffConfig = bffConfig; - this.oauth2ExchangeFilterFunction = oauth2ExchangeFilterFunction; - } - - @Bean - public ActionsApi portalHistoryActionApi(WebClient.Builder webClientBuilder) { - return constructApiClient(webClientBuilder, ActionsApi::new); - } - - private T constructApiClient( - WebClient.Builder webClientBuilder, Function apiConstructor) { - final ApiClient apiClient = - new ApiClient( - getWebClient(webClientBuilder, List.of(oauth2ExchangeFilterFunction)), - objectMapper, - objectMapper.getDateFormat()); - final String generatedBasePath = apiClient.getBasePath(); - String basePath = ""; - try { - basePath = bffConfig.getPortalHistoryUrl() + new URL(generatedBasePath).getPath(); - } catch (MalformedURLException e) { - log.error(e.getLocalizedMessage()); - } - return apiConstructor.apply(apiClient.setBasePath(basePath)); - } - - @Override - protected DownstreamApiProblemException mapException( - ProblemPortalHistoryDto errorResponse, HttpStatusCode httpStatusCode) { - return DownstreamApiProblemException.builder() - .title(httpStatusCode.toString()) - .detail(errorResponse.getDetail()) - .downstreamMessageId(errorResponse.getType()) - .downstreamSystem(ProblemApiDto.DownstreamSystemEnum.PORTAL_HISTORY.toString()) - .downstreamStatus(httpStatusCode.value()) - .build(); - } -} diff --git a/lib/src/main/java/org/onap/portalng/bff/config/clients/PortalPrefsConfig.java b/lib/src/main/java/org/onap/portalng/bff/config/clients/PortalPrefsConfig.java deleted file mode 100644 index 8c2eba4..0000000 --- a/lib/src/main/java/org/onap/portalng/bff/config/clients/PortalPrefsConfig.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * - * Copyright (c) 2022. Deutsche Telekom AG - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * - * - */ - -package org.onap.portalng.bff.config.clients; - -import com.fasterxml.jackson.databind.ObjectMapper; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.List; -import java.util.function.Function; -import lombok.extern.slf4j.Slf4j; -import org.onap.portalng.bff.config.BeansConfig; -import org.onap.portalng.bff.config.BffConfig; -import org.onap.portalng.bff.exceptions.DownstreamApiProblemException; -import org.onap.portalng.bff.openapi.client_portal_prefs.ApiClient; -import org.onap.portalng.bff.openapi.client_portal_prefs.api.PreferencesApi; -import org.onap.portalng.bff.openapi.client_portal_prefs.model.ProblemPortalPrefsDto; -import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.HttpStatusCode; -import org.springframework.web.reactive.function.client.ExchangeFilterFunction; -import org.springframework.web.reactive.function.client.WebClient; - -@Slf4j -@Configuration -public class PortalPrefsConfig extends AbstractClientConfig { - private final ObjectMapper objectMapper; - private final BffConfig bffConfig; - private final ExchangeFilterFunction oauth2ExchangeFilterFunction; - - public PortalPrefsConfig( - @Qualifier(BeansConfig.OAUTH2_EXCHANGE_FILTER_FUNCTION) - ExchangeFilterFunction oauth2ExchangeFilterFunction, - ObjectMapper objectMapper, - BffConfig bffConfig) { - super(ProblemPortalPrefsDto.class); - this.objectMapper = objectMapper; - this.bffConfig = bffConfig; - this.oauth2ExchangeFilterFunction = oauth2ExchangeFilterFunction; - } - - @Bean - public PreferencesApi portalPrefsApi(WebClient.Builder webClientBuilder) { - return constructApiClient(webClientBuilder, PreferencesApi::new); - } - - private T constructApiClient( - WebClient.Builder webClientBuilder, Function apiConstructor) { - final ApiClient apiClient = - new ApiClient( - getWebClient(webClientBuilder, List.of(oauth2ExchangeFilterFunction)), - objectMapper, - objectMapper.getDateFormat()); - - final String generatedBasePath = apiClient.getBasePath(); - String basePath = ""; - try { - basePath = bffConfig.getPortalPrefsUrl() + new URL(generatedBasePath).getPath(); - } catch (MalformedURLException e) { - log.error(e.getLocalizedMessage()); - } - return apiConstructor.apply(apiClient.setBasePath(basePath)); - } - - @Override - protected DownstreamApiProblemException mapException( - ProblemPortalPrefsDto errorResponse, HttpStatusCode httpStatusCode) { - return DownstreamApiProblemException.builder() - .title(httpStatusCode.toString()) - .detail(errorResponse.getDetail()) - .downstreamMessageId(errorResponse.getType()) - .downstreamSystem(ProblemApiDto.DownstreamSystemEnum.PORTAL_PREFS.toString()) - .downstreamStatus(httpStatusCode.value()) - .build(); - } -} diff --git a/lib/src/main/java/org/onap/portalng/bff/config/clients/PreferencesConfig.java b/lib/src/main/java/org/onap/portalng/bff/config/clients/PreferencesConfig.java new file mode 100644 index 0000000..d94eae2 --- /dev/null +++ b/lib/src/main/java/org/onap/portalng/bff/config/clients/PreferencesConfig.java @@ -0,0 +1,96 @@ +/* + * + * Copyright (c) 2022. Deutsche Telekom AG + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * + * + */ + +package org.onap.portalng.bff.config.clients; + +import com.fasterxml.jackson.databind.ObjectMapper; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.List; +import java.util.function.Function; +import lombok.extern.slf4j.Slf4j; +import org.onap.portalng.bff.config.BeansConfig; +import org.onap.portalng.bff.config.BffConfig; +import org.onap.portalng.bff.exceptions.DownstreamApiProblemException; +import org.onap.portalng.bff.openapi.client_preferences.ApiClient; +import org.onap.portalng.bff.openapi.client_preferences.api.PreferencesApi; +import org.onap.portalng.bff.openapi.client_preferences.model.ProblemPreferencesDto; +import org.onap.portalng.bff.openapi.server.model.ProblemApiDto; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpStatusCode; +import org.springframework.web.reactive.function.client.ExchangeFilterFunction; +import org.springframework.web.reactive.function.client.WebClient; + +@Slf4j +@Configuration +public class PreferencesConfig extends AbstractClientConfig { + private final ObjectMapper objectMapper; + private final BffConfig bffConfig; + private final ExchangeFilterFunction oauth2ExchangeFilterFunction; + + public PreferencesConfig( + @Qualifier(BeansConfig.OAUTH2_EXCHANGE_FILTER_FUNCTION) + ExchangeFilterFunction oauth2ExchangeFilterFunction, + ObjectMapper objectMapper, + BffConfig bffConfig) { + super(ProblemPreferencesDto.class); + this.objectMapper = objectMapper; + this.bffConfig = bffConfig; + this.oauth2ExchangeFilterFunction = oauth2ExchangeFilterFunction; + } + + @Bean + public PreferencesApi portalPrefsApi(WebClient.Builder webClientBuilder) { + return constructApiClient(webClientBuilder, PreferencesApi::new); + } + + private T constructApiClient( + WebClient.Builder webClientBuilder, Function apiConstructor) { + final ApiClient apiClient = + new ApiClient( + getWebClient(webClientBuilder, List.of(oauth2ExchangeFilterFunction)), + objectMapper, + objectMapper.getDateFormat()); + + final String generatedBasePath = apiClient.getBasePath(); + String basePath = ""; + try { + basePath = bffConfig.getPreferencesUrl() + new URL(generatedBasePath).getPath(); + } catch (MalformedURLException e) { + log.error(e.getLocalizedMessage()); + } + return apiConstructor.apply(apiClient.setBasePath(basePath)); + } + + @Override + protected DownstreamApiProblemException mapException( + ProblemPreferencesDto errorResponse, HttpStatusCode httpStatusCode) { + return DownstreamApiProblemException.builder() + .title(httpStatusCode.toString()) + .detail(errorResponse.getDetail()) + .downstreamMessageId(errorResponse.getType()) + .downstreamSystem(ProblemApiDto.DownstreamSystemEnum.PREFERENCES.toString()) + .downstreamStatus(httpStatusCode.value()) + .build(); + } +} diff --git a/lib/src/main/java/org/onap/portalng/bff/mappers/ActionsMapper.java b/lib/src/main/java/org/onap/portalng/bff/mappers/ActionsMapper.java index 3f0ebdf..bc4f550 100644 --- a/lib/src/main/java/org/onap/portalng/bff/mappers/ActionsMapper.java +++ b/lib/src/main/java/org/onap/portalng/bff/mappers/ActionsMapper.java @@ -24,14 +24,14 @@ package org.onap.portalng.bff.mappers; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.onap.portalng.bff.config.MapperSpringConfig; -import org.onap.portalng.bff.openapi.client_portal_history.model.ActionsListResponsePortalHistoryDto; +import org.onap.portalng.bff.openapi.client_history.model.ActionsListResponseHistoryDto; import org.onap.portalng.bff.openapi.server.model.ActionsListResponseApiDto; import org.springframework.core.convert.converter.Converter; @Mapper(config = MapperSpringConfig.class) public interface ActionsMapper - extends Converter { + extends Converter { @Mapping(source = "actionsList", target = "items") - ActionsListResponseApiDto convert(ActionsListResponsePortalHistoryDto source); + ActionsListResponseApiDto convert(ActionsListResponseHistoryDto source); } diff --git a/lib/src/main/java/org/onap/portalng/bff/mappers/CredentialMapper.java b/lib/src/main/java/org/onap/portalng/bff/mappers/CredentialMapper.java index b3c7f05..6b05ae3 100644 --- a/lib/src/main/java/org/onap/portalng/bff/mappers/CredentialMapper.java +++ b/lib/src/main/java/org/onap/portalng/bff/mappers/CredentialMapper.java @@ -24,7 +24,7 @@ package org.onap.portalng.bff.mappers; import org.mapstruct.Mapper; import org.mapstruct.ReportingPolicy; import org.onap.portalng.bff.config.MapperSpringConfig; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.CredentialKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.CredentialKeycloakDto; import org.onap.portalng.bff.openapi.server.model.UpdateUserPasswordRequestApiDto; @Mapper(config = MapperSpringConfig.class, unmappedTargetPolicy = ReportingPolicy.IGNORE) diff --git a/lib/src/main/java/org/onap/portalng/bff/mappers/PreferencesMapper.java b/lib/src/main/java/org/onap/portalng/bff/mappers/PreferencesMapper.java index 6e615c3..13f9e3f 100644 --- a/lib/src/main/java/org/onap/portalng/bff/mappers/PreferencesMapper.java +++ b/lib/src/main/java/org/onap/portalng/bff/mappers/PreferencesMapper.java @@ -24,14 +24,14 @@ package org.onap.portalng.bff.mappers; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.onap.portalng.bff.config.MapperSpringConfig; -import org.onap.portalng.bff.openapi.client_portal_prefs.model.PreferencesPortalPrefsDto; +import org.onap.portalng.bff.openapi.client_preferences.model.PreferencesPreferencesDto; import org.onap.portalng.bff.openapi.server.model.PreferencesResponseApiDto; import org.springframework.core.convert.converter.Converter; @Mapper(config = MapperSpringConfig.class) public interface PreferencesMapper - extends Converter { + extends Converter { @Mapping(source = "properties", target = "properties") - PreferencesResponseApiDto convert(PreferencesPortalPrefsDto source); + PreferencesResponseApiDto convert(PreferencesPreferencesDto source); } diff --git a/lib/src/main/java/org/onap/portalng/bff/mappers/RolesMapper.java b/lib/src/main/java/org/onap/portalng/bff/mappers/RolesMapper.java index 6e14d7e..ca3ee4c 100644 --- a/lib/src/main/java/org/onap/portalng/bff/mappers/RolesMapper.java +++ b/lib/src/main/java/org/onap/portalng/bff/mappers/RolesMapper.java @@ -24,7 +24,7 @@ package org.onap.portalng.bff.mappers; import org.mapstruct.Mapper; import org.mapstruct.ReportingPolicy; import org.onap.portalng.bff.config.MapperSpringConfig; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RoleKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.RoleKeycloakDto; import org.onap.portalng.bff.openapi.server.model.RoleApiDto; import org.springframework.core.convert.converter.Converter; diff --git a/lib/src/main/java/org/onap/portalng/bff/mappers/UsersMapper.java b/lib/src/main/java/org/onap/portalng/bff/mappers/UsersMapper.java index f494c5d..78ba804 100644 --- a/lib/src/main/java/org/onap/portalng/bff/mappers/UsersMapper.java +++ b/lib/src/main/java/org/onap/portalng/bff/mappers/UsersMapper.java @@ -26,8 +26,8 @@ import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.ReportingPolicy; import org.onap.portalng.bff.config.MapperSpringConfig; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RequiredActionsKeycloakDto; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.UserKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.RequiredActionsKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.model.UserKeycloakDto; import org.onap.portalng.bff.openapi.server.model.CreateUserRequestApiDto; import org.onap.portalng.bff.openapi.server.model.UpdateUserRequestApiDto; import org.onap.portalng.bff.openapi.server.model.UserResponseApiDto; diff --git a/lib/src/main/java/org/onap/portalng/bff/services/ActionService.java b/lib/src/main/java/org/onap/portalng/bff/services/ActionService.java index 17afa39..cb7b6b4 100644 --- a/lib/src/main/java/org/onap/portalng/bff/services/ActionService.java +++ b/lib/src/main/java/org/onap/portalng/bff/services/ActionService.java @@ -23,8 +23,8 @@ package org.onap.portalng.bff.services; import lombok.RequiredArgsConstructor; import org.onap.portalng.bff.exceptions.DownstreamApiProblemException; -import org.onap.portalng.bff.openapi.client_portal_history.api.ActionsApi; -import org.onap.portalng.bff.openapi.client_portal_history.model.CreateActionRequestPortalHistoryDto; +import org.onap.portalng.bff.openapi.client_history.api.ActionsApi; +import org.onap.portalng.bff.openapi.client_history.model.CreateActionRequestHistoryDto; import org.onap.portalng.bff.openapi.server.model.ActionsListResponseApiDto; import org.onap.portalng.bff.openapi.server.model.ActionsResponseApiDto; import org.onap.portalng.bff.openapi.server.model.CreateActionRequestApiDto; @@ -43,15 +43,15 @@ public class ActionService { public Mono createAction( String userId, String xRequestId, CreateActionRequestApiDto createActionRequestApiDto) { // First map from server API model to client API model - CreateActionRequestPortalHistoryDto createActionRequestPortalHistoryDto = - new CreateActionRequestPortalHistoryDto(); - createActionRequestPortalHistoryDto.setUserId(createActionRequestApiDto.getUserId()); - createActionRequestPortalHistoryDto.setAction(createActionRequestApiDto.getAction()); - createActionRequestPortalHistoryDto.setActionCreatedAt( + CreateActionRequestHistoryDto createActionRequestHistoryDto = + new CreateActionRequestHistoryDto(); + createActionRequestHistoryDto.setUserId(createActionRequestApiDto.getUserId()); + createActionRequestHistoryDto.setAction(createActionRequestApiDto.getAction()); + createActionRequestHistoryDto.setActionCreatedAt( createActionRequestApiDto.getActionCreatedAt()); return actionsApi - .createAction(userId, xRequestId, createActionRequestPortalHistoryDto) + .createAction(userId, xRequestId, createActionRequestHistoryDto) .map( action -> new ActionsResponseApiDto() diff --git a/lib/src/main/java/org/onap/portalng/bff/services/KeycloakService.java b/lib/src/main/java/org/onap/portalng/bff/services/KeycloakService.java index b902128..5780ad0 100644 --- a/lib/src/main/java/org/onap/portalng/bff/services/KeycloakService.java +++ b/lib/src/main/java/org/onap/portalng/bff/services/KeycloakService.java @@ -33,8 +33,8 @@ import org.onap.portalng.bff.exceptions.DownstreamApiProblemException; import org.onap.portalng.bff.mappers.CredentialMapper; import org.onap.portalng.bff.mappers.RolesMapper; import org.onap.portalng.bff.mappers.UsersMapper; -import org.onap.portalng.bff.openapi.client_portal_keycloak.api.KeycloakApi; -import org.onap.portalng.bff.openapi.client_portal_keycloak.model.RequiredActionsKeycloakDto; +import org.onap.portalng.bff.openapi.client_keycloak.api.KeycloakApi; +import org.onap.portalng.bff.openapi.client_keycloak.model.RequiredActionsKeycloakDto; import org.onap.portalng.bff.openapi.server.model.*; import org.onap.portalng.bff.utils.Logger; import org.springframework.core.convert.support.ConfigurableConversionService; diff --git a/lib/src/main/java/org/onap/portalng/bff/services/PreferencesService.java b/lib/src/main/java/org/onap/portalng/bff/services/PreferencesService.java index af62d28..53bceee 100644 --- a/lib/src/main/java/org/onap/portalng/bff/services/PreferencesService.java +++ b/lib/src/main/java/org/onap/portalng/bff/services/PreferencesService.java @@ -23,8 +23,8 @@ package org.onap.portalng.bff.services; import lombok.RequiredArgsConstructor; import org.onap.portalng.bff.exceptions.DownstreamApiProblemException; -import org.onap.portalng.bff.openapi.client_portal_prefs.api.PreferencesApi; -import org.onap.portalng.bff.openapi.client_portal_prefs.model.PreferencesPortalPrefsDto; +import org.onap.portalng.bff.openapi.client_preferences.api.PreferencesApi; +import org.onap.portalng.bff.openapi.client_preferences.model.PreferencesPreferencesDto; import org.onap.portalng.bff.openapi.server.model.CreatePreferencesRequestApiDto; import org.onap.portalng.bff.openapi.server.model.PreferencesResponseApiDto; import org.onap.portalng.bff.utils.Logger; @@ -36,17 +36,17 @@ import reactor.core.publisher.Mono; @Service public class PreferencesService { - private static final String PREFERENCES_APPLICATION_NAME = "PORTAL_PREFS"; + private static final String PREFERENCES_APPLICATION_NAME = "PREFERENCES"; private final PreferencesApi preferencesApi; private final ConfigurableConversionService conversionService; public Mono createPreferences( String xRequestId, CreatePreferencesRequestApiDto request) { - PreferencesPortalPrefsDto preferencesPortalPrefsDto = new PreferencesPortalPrefsDto(); - preferencesPortalPrefsDto.setProperties(request.getProperties()); + PreferencesPreferencesDto preferencesPreferencesDto = new PreferencesPreferencesDto(); + preferencesPreferencesDto.setProperties(request.getProperties()); return preferencesApi - .savePreferences(xRequestId, preferencesPortalPrefsDto) + .savePreferences(xRequestId, preferencesPreferencesDto) .map(resp -> conversionService.convert(resp, PreferencesResponseApiDto.class)) .onErrorResume( DownstreamApiProblemException.class, @@ -59,10 +59,10 @@ public class PreferencesService { public Mono updatePreferences( String xRequestId, CreatePreferencesRequestApiDto request) { - PreferencesPortalPrefsDto preferencesPortalPrefsDto = new PreferencesPortalPrefsDto(); - preferencesPortalPrefsDto.setProperties(request.getProperties()); + PreferencesPreferencesDto preferencesPreferencesDto = new PreferencesPreferencesDto(); + preferencesPreferencesDto.setProperties(request.getProperties()); return preferencesApi - .updatePreferences(xRequestId, preferencesPortalPrefsDto) + .updatePreferences(xRequestId, preferencesPreferencesDto) .map(resp -> conversionService.convert(resp, PreferencesResponseApiDto.class)) .onErrorResume( DownstreamApiProblemException.class, diff --git a/lib/src/main/java/org/onap/portalng/bff/utils/Logger.java b/lib/src/main/java/org/onap/portalng/bff/utils/Logger.java index c20cd49..10d4833 100644 --- a/lib/src/main/java/org/onap/portalng/bff/utils/Logger.java +++ b/lib/src/main/java/org/onap/portalng/bff/utils/Logger.java @@ -35,8 +35,8 @@ public class Logger { */ private Logger() {} - public static void requestLog(String xRequestId, HttpMethod methode, URI path) { - log.info("bff - request - X-Request-Id {} {} {}", xRequestId, methode, path); + public static void requestLog(String xRequestId, HttpMethod method, URI path) { + log.info("bff - request - X-Request-Id {} {} {}", xRequestId, method, path); } public static void responseLog(String xRequestId, HttpStatusCode httpStatusCode) { diff --git a/openapi/build.gradle b/openapi/build.gradle index 0b3e556..34d949b 100644 --- a/openapi/build.gradle +++ b/openapi/build.gradle @@ -5,15 +5,11 @@ plugins { dependencies { implementation project('server') - implementation project('client-portal-history') - implementation project('client-portal-keycloak') - implementation project('client-portal-prefs') + implementation project('client-history') + implementation project('client-keycloak') + implementation project('client-preferences') } + ext { openapiVersion = '7.0.0-beta' -} -subprojects { - repositories { - mavenCentral() - } } \ No newline at end of file diff --git a/openapi/client-history/LICENSE b/openapi/client-history/LICENSE new file mode 100644 index 0000000..abe3069 --- /dev/null +++ b/openapi/client-history/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2021 TNAP / development / system-team + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/openapi/client-history/build.gradle b/openapi/client-history/build.gradle new file mode 100644 index 0000000..20b5258 --- /dev/null +++ b/openapi/client-history/build.gradle @@ -0,0 +1,62 @@ +plugins { + id 'java' + id 'idea' + id 'org.springframework.boot' + id 'io.spring.dependency-management' + id 'org.openapi.generator' +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-webflux' + implementation "org.openapitools:openapi-generator:$openapiVersion" +} + +openApiGenerate { + generatorName = "java" + library = "webclient" + inputSpec = "${project.projectDir}/src/api.yaml" + outputDir = "${project.buildDir}/openapi" + configOptions = [ + openApiNullable : "false", + dateLibrary : "java8", + serializationLibrary: "jackson", + useJakartaEe : "true", + ] + typeMappings = [ + "File": "org.springframework.core.io.buffer.DataBuffer" + ] + generateApiTests = false + generateApiDocumentation = false + generateModelTests = false + generateModelDocumentation = false + invokerPackage = "org.onap.portalng.bff.openapi.client_history" + apiPackage = "org.onap.portalng.bff.openapi.client_history.api" + modelPackage = "org.onap.portalng.bff.openapi.client_history.model" + modelNameSuffix = "HistoryDto" +} + +compileJava { + dependsOn tasks.openApiGenerate +} + +sourceSets { + main { + java { + srcDirs += file("$buildDir/openapi/src/main/java") + } + } +} + +idea { + module { + generatedSourceDirs += file("$buildDir/openapi/src/main/java") + } +} + +bootJar { + enabled = false +} + +jar { + enabled = true +} \ No newline at end of file diff --git a/openapi/client-history/src/api.yaml b/openapi/client-history/src/api.yaml new file mode 100644 index 0000000..22c6ae5 --- /dev/null +++ b/openapi/client-history/src/api.yaml @@ -0,0 +1,457 @@ +openapi: 3.0.2 +info: + title: Config API + version: '1.0' + description: API to provide actions for history + contact: + name: TNAP Team Tesla + url: 'https://www.telekom.de' + email: info@telekom.de +servers: + - url: 'http://localhost:9002' +tags: + - name: actions +paths: + '/v1/actions/{userId}': + parameters: + - $ref: '#/components/parameters/userIdPathParam' + - $ref: '#/components/parameters/xRequestIdHeader' + get: + summary: Retrieve all actions for a specific user + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ActionsListResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + operationId: getActions + parameters: + - $ref: '#/components/parameters/pageQueryParam' + - $ref: '#/components/parameters/pageSizeQueryParam' + - schema: + type: integer + format: int32 + in: query + name: showLastHours + description: Get all actions within the last X hours. + description: Get actions for the given userId + tags: + - actions + post: + summary: Create an action for a given user + operationId: createAction + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ActionResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateActionRequest' + description: Only one action in each POST request + description: Create a user action + tags: + - actions + delete: + summary: Delete user actions after given time + operationId: deleteActions + parameters: + - schema: + type: integer + format: int32 + in: query + name: deleteAfterHours + description: If parameter is given actions older than value will be deleted for the user + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + tags: + - actions + description: Delete user actions after given time + '/v1/actions': + get: + summary: Retrieve all actions from the portal with an optional timeframe + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ActionsListResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + operationId: listActions + parameters: + - $ref: '#/components/parameters/xRequestIdHeader' + - $ref: '#/components/parameters/pageQueryParam' + - $ref: '#/components/parameters/pageSizeQueryParam' + - schema: + type: integer + format: int32 + in: query + name: showLastHours + description: Get all actions within the last X hours. + description: Get portal actions from all users + tags: + - actions + '/actuator/info': + get: + tags: + - actions + summary: Retrieve actuator information + description: Proxy for actuator info endpoint + operationId: getActuatorInfo + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ActuatorInfoResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + +components: + parameters: + xRequestIdHeader: + name: X-Request-Id + in: header + description: The unique identifier of the request + required: true + schema: + type: string + pageQueryParam: + name: page + in: query + description: Page index (1..N) + required: false + schema: + type: integer + format: int32 + minimum: 1 + default: 1 + pageSizeQueryParam: + name: pageSize + in: query + description: The size of the page to be returned + required: false + schema: + type: integer + format: int32 + minimum: 1 + maximum: 5000 + default: 10 + userIdPathParam: + name: userId + in: path + description: User ID + required: true + schema: + $ref: '#/components/schemas/ValidString' + schemas: + ActionResponse: + title: ActionResponse + type: object + properties: + actionCreatedAt: + type: string + format: date-time + action: + type: object + saveInterval: + type: integer + format: int32 + required: + - action + - actionCreatedAt + CreateActionRequest: + title: CreateActionRequest + type: object + properties: + userId: + type: string + actionCreatedAt: + type: string + format: date-time + action: + type: object + required: + - userId + - actionCreatedAt + - action + ActionsListResponse: + title: ActionsListResponse + type: object + properties: + actionsList: + type: array + items: + $ref: '#/components/schemas/ActionResponse' + totalCount: + type: integer + format: int32 + description: Total number of items matching criteria + required: + - actionsList + - totalCount + ActuatorInfoResponse: + title: ActuatorInfoResponse + type: object + properties: + git: + $ref: '#/components/schemas/ActuatorGitInfo' + build: + $ref: '#/components/schemas/ActuatorBuildInfo' + java: + $ref: '#/components/schemas/ActuatorJavaInfo' + ActuatorGitInfo: + title: ActuatorGitInfo + type: object + properties: + branch: + type: string + commit: + $ref: '#/components/schemas/GitCommitInfo' + ActuatorBuildInfo: + title: ActuatorBuildInfo + type: object + properties: + artifact: + type: string + name: + type: string + time: + type: string + version: + type: string + group: + type: string + GitCommitInfo: + title: GitCommitInfo + type: object + properties: + id: + type: string + time: + type: string + ActuatorJavaInfo: + title: ActuatorJavaInfo + type: object + properties: + version: + type: string + vendor: + $ref: '#/components/schemas/JavaVendorInfo' + runtime: + $ref: '#/components/schemas/JavaRuntimeInfo' + jvm: + $ref: '#/components/schemas/JavaJvmInfo' + JavaVendorInfo: + title: JavaVendorInfo + type: object + properties: + name: + type: string + version: + type: string + JavaRuntimeInfo: + title: JavaRuntimeInfo + type: object + properties: + name: + type: string + version: + type: string + JavaJvmInfo: + title: JavaJvmInfo + type: object + properties: + name: + type: string + vendor: + type: string + version: + type: string + Problem: + type: object + properties: + type: + type: string + format: uri-reference + description: | + A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferencable and point to a human-readable documentation nor globally unique for the problem type. + default: 'about:blank' + example: /problem/connection-error + title: + type: string + description: | + A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. + example: Service Unavailable + status: + type: integer + format: int32 + description: | + The HTTP status code generated by the origin server for this occurrence of the problem. + minimum: 100 + maximum: 600 + exclusiveMaximum: true + example: 503 + detail: + type: string + description: | + A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. + example: Connection to database timed out + instance: + type: string + format: uri-reference + description: | + A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code. + example: /problem/connection-error#token-info-read-timed-out + ValidString: + type: string + pattern: '[\w,/!=§#@€:µ.*+?'' \-\u00C0-\u017F]*' + responses: + BadRequest: + description: '400: Bad Request' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + Unauthorized: + description: '401: Unauthorized' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + Forbidden: + description: '403: Forbidden' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + NotFound: + description: '404: Not Found' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + NotAllowed: + description: '405: Method Not Allowed' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + Conflict: + description: '409: Conflict' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + InternalServerError: + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + BadGateway: + description: Bad Gateway + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response diff --git a/openapi/client-keycloak/LICENSE b/openapi/client-keycloak/LICENSE new file mode 100644 index 0000000..abe3069 --- /dev/null +++ b/openapi/client-keycloak/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2021 TNAP / development / system-team + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/openapi/client-keycloak/build.gradle b/openapi/client-keycloak/build.gradle new file mode 100644 index 0000000..46c842d --- /dev/null +++ b/openapi/client-keycloak/build.gradle @@ -0,0 +1,62 @@ +plugins { + id 'java' + id 'idea' + id 'org.springframework.boot' + id 'io.spring.dependency-management' + id 'org.openapi.generator' +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-webflux' + implementation "org.openapitools:openapi-generator:$openapiVersion" +} + +openApiGenerate { + generatorName = "java" + library = "webclient" + inputSpec = "${project.projectDir}/src/api.yaml" + outputDir = "${project.buildDir}/openapi" + configOptions = [ + openApiNullable : "false", + dateLibrary : "java8", + serializationLibrary: "jackson", + useJakartaEe : "true", + ] + typeMappings = [ + "File": "org.springframework.core.io.buffer.DataBuffer" + ] + generateApiTests = false + generateApiDocumentation = false + generateModelTests = false + generateModelDocumentation = false + invokerPackage = "org.onap.portalng.bff.openapi.client_keycloak" + apiPackage = "org.onap.portalng.bff.openapi.client_keycloak.api" + modelPackage = "org.onap.portalng.bff.openapi.client_keycloak.model" + modelNameSuffix = "KeycloakDto" +} + +compileJava { + dependsOn tasks.openApiGenerate +} + +sourceSets { + main { + java { + srcDirs += file("$buildDir/openapi/src/main/java") + } + } +} + +idea { + module { + generatedSourceDirs += file("$buildDir/openapi/src/main/java") + } +} + +bootJar { + enabled = false +} + +jar { + enabled = true +} \ No newline at end of file diff --git a/openapi/client-keycloak/src/api.yaml b/openapi/client-keycloak/src/api.yaml new file mode 100644 index 0000000..a09f0f4 --- /dev/null +++ b/openapi/client-keycloak/src/api.yaml @@ -0,0 +1,651 @@ +openapi: 3.0.2 +info: + title: Keycloak API + version: '1.0' + description: API to provide Keycloak actions + contact: + name: TNAP Team Tesla + url: 'https://www.telekom.de' + email: info@telekom.de +servers: + - url: 'http://localhost:9003/{base}/{version}' + variables: + base: + default: 'portal-keycloak' + description: Basepath + version: + default: 'v1' + description: Version +paths: + '/roles': + get: + tags: + - keycloak + summary: Get all roles + description: Retrieves all keycloak roles for the realm or client + operationId: getRoles + parameters: + - name: search + in: query + schema: + type: string + - name: first + in: query + schema: + type: integer + format: int32 + - name: max + in: query + schema: + type: integer + format: int32 + - name: briefRepresentation + in: query + schema: + type: boolean + responses: + 2XX: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Role' + post: + tags: + - keycloak + summary: Create a new role + description: Creates a new role for the realm or client + operationId: createRole + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + required: true + responses: + 2XX: + description: OK + '/roles/{roleName}/users': + get: + tags: + - keycloak + summary: Get all users for the role + description: Returns a stream of users that have the specified role name + operationId: getUsersByRole + parameters: + - name: first + in: query + description: 'First result to return. Ignored if negative or {@code null}' + schema: + type: integer + format: int32 + - name: max + in: query + description: 'Maximum number of results to return. Ignored if negative or {@code null}' + schema: + type: integer + format: int32 + responses: + 2XX: + description: Success + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + parameters: + - name: roleName + in: path + description: The role name + required: true + schema: + type: string + '/users': + post: + tags: + - keycloak + summary: Create a new keycloak user + description: Creates a new user in keycloak. Username must be unique + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + responses: + 2XX: + description: Success + get: + tags: + - keycloak + summary: Get keycloak users + description: Returns a stream of users, filtered according to query. + operationId: getUsers + parameters: + - name: search + in: query + schema: + type: string + - name: lastName + in: query + schema: + type: string + - name: firstName + in: query + schema: + type: string + - name: email + in: query + schema: + type: string + - name: username + in: query + schema: + type: string + - name: emailVerified + in: query + schema: + type: boolean + - name: idpAlias + in: query + schema: + type: string + - name: idpUserId + in: query + schema: + type: string + - name: first + in: query + schema: + type: integer + format: int32 + - name: max + in: query + schema: + type: integer + format: int32 + - name: enabled + in: query + schema: + type: boolean + - name: briefRepresentation + in: query + schema: + type: boolean + - name: exact + in: query + schema: + type: boolean + - name: q + in: query + schema: + type: string + responses: + 2XX: + description: Success + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + '/users/count': + get: + tags: + - keycloak + summary: Get users count + description: Returns the number of users that match the given criteria + operationId: getUsersCount + parameters: + - name: search + in: query + schema: + type: string + - name: lastName + in: query + schema: + type: string + - name: firstName + in: query + schema: + type: string + - name: email + in: query + schema: + type: string + - name: emailVerified + in: query + schema: + type: boolean + - name: username + in: query + schema: + type: string + - name: enabled + in: query + schema: + type: boolean + responses: + 2XX: + description: Success + content: + application/json: + schema: + type: integer + format: int32 + '/users/{id}': + put: + tags: + - keycloak + summary: Update user + description: Updates the user + operationId: updateUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + responses: + 2XX: + description: Success + get: + tags: + - keycloak + summary: Get user + description: Returns representation of the user + operationId: getUser + responses: + 2XX: + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/User' + delete: + tags: + - keycloak + summary: Delete the user + description: Deletes the user + operationId: deleteUser + responses: + 2XX: + description: Success + parameters: + - name: id + in: path + required: true + schema: + type: string + '/users/{id}/reset-password': + put: + tags: + - keycloak + summary: Reset user password + description: Sets up a new password for the user + operationId: resetUserPassword + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + responses: + 2XX: + description: Success + parameters: + - name: id + in: path + required: true + schema: + type: string + '/users/{id}/role-mappings/realm': + get: + tags: + - keycloak + summary: Get realm role mappings + description: Returns realm-level role mappings + operationId: getRealmRoleMappingsByUserId + responses: + 2XX: + description: Success + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Role' + post: + tags: + - keycloak + summary: Add realm role mappings + description: Adds realm-level role mappings to the user + operationId: addRealmRoleMappingsToUser + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Role' + responses: + 2XX: + description: Success + delete: + tags: + - keycloak + summary: Delete realm role mappings + description: Deletes realm-level role mappings + operationId: deleteRealmRoleMappingsByUserId + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Role' + responses: + 2XX: + description: Success + parameters: + - name: id + in: path + required: true + schema: + type: string + '/users/{id}/role-mappings/realm/available': + get: + tags: + - keycloak + summary: Get available realm roles + description: Returns realm-level roles that can be mapped + operationId: getAvailableRealmRoleMappingsByUserId + responses: + 2XX: + description: Success + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Role' + parameters: + - name: id + in: path + required: true + schema: + type: string + '/users/{id}/execute-actions-email': + put: + tags: + - keycloak + summary: Execute actions email + description: Send an update account email to the user. An email contains a link the user can click to perform a set of required actions. The redirectUri and clientId parameters are optional. If no redirect is given, then there will be no link back to click after actions have completed. Redirect uri must be a valid uri for the particular clientId + operationId: executeActionsEmail + parameters: + - name: OIDCLoginProtocol.REDIRECT_URI_PARAM + in: query + description: Redirect uri + schema: + type: string + - name: OIDCLoginProtocol.CLIENT_ID_PARAM + in: query + description: Client id + schema: + type: string + - name: lifespan + in: query + description: Number of seconds after which the generated token expires + schema: + type: integer + format: int32 + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RequiredActions' + responses: + 2XX: + description: Success + parameters: + - name: id + in: path + required: true + schema: + type: string +components: + schemas: + Role: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + scopeParamRequired: + type: boolean + composites: + $ref: '#/components/schemas/Composites' + composite: + type: boolean + clientRole: + type: boolean + containerId: + type: string + attributes: + type: object + additionalProperties: + type: array + items: + type: string + Composites: + type: object + properties: + realm: + type: array + items: + type: string + client: + type: object + additionalProperties: + type: array + items: + type: string + application: + type: object + additionalProperties: + type: array + items: + type: string + User: + type: object + properties: + self: + type: string + id: + type: string + createdTimestamp: + type: integer + format: int64 + firstName: + type: string + lastName: + type: string + email: + type: string + username: + type: string + enabled: + type: boolean + totp: + type: boolean + emailVerified: + type: boolean + attributes: + type: object + additionalProperties: + type: array + items: + type: string + credentials: + type: array + items: + $ref: '#/components/schemas/Credential' + requiredActions: + type: array + items: + $ref: '#/components/schemas/RequiredActions' + federatedIdentities: + type: array + items: + $ref: '#/components/schemas/FederatedIdentity' + socialLinks: + type: array + items: + $ref: '#/components/schemas/SocialLink' + realmRoles: + type: array + items: + type: string + clientRoles: + type: object + additionalProperties: + type: array + items: + type: string + clientConsents: + type: array + items: + $ref: '#/components/schemas/UserConsent' + notBefore: + type: integer + format: int32 + applicationRoles: + type: object + additionalProperties: + type: array + items: + type: string + federationLink: + type: string + serviceAccountClientId: + type: string + groups: + type: array + items: + type: string + origin: + type: string + disableableCredentialTypes: + type: array + items: + type: string + access: + type: object + additionalProperties: + type: boolean + Credential: + type: object + properties: + id: + type: string + type: + type: string + userLabel: + type: string + secretData: + type: string + credentialData: + type: string + priority: + type: integer + format: int32 + createdDate: + type: integer + format: int64 + value: + type: string + temporary: + type: boolean + device: + type: string + hashedSaltedValue: + type: string + salt: + type: string + hashIterations: + type: integer + format: int32 + counter: + type: integer + format: int32 + algorithm: + type: string + digits: + type: integer + format: int32 + period: + type: integer + format: int32 + config: + type: object + additionalProperties: + type: string + FederatedIdentity: + type: object + properties: + identityProvider: + type: string + userId: + type: string + userName: + type: string + SocialLink: + type: object + properties: + socialProvider: + type: string + socialUserId: + type: string + socialUsername: + type: string + UserConsent: + type: object + properties: + clientId: + type: string + grantedClientScopes: + type: array + items: + type: string + createdDate: + type: integer + format: int64 + lastUpdatedDate: + type: integer + format: int64 + grantedRealmRoles: + type: array + items: + type: string + RequiredActions: + type: string + enum: + - CONFIGURE_TOTP + - TERMS_AND_CONDITIONS + - UPDATE_PASSWORD + - UPDATE_PROFILE + - VERIFY_EMAIL + ErrorResponse: + type: object + properties: + error: + type: string + errorMessage: + type: string + diff --git a/openapi/client-portal-history/LICENSE b/openapi/client-portal-history/LICENSE deleted file mode 100644 index abe3069..0000000 --- a/openapi/client-portal-history/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2021 TNAP / development / system-team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/openapi/client-portal-history/build.gradle b/openapi/client-portal-history/build.gradle deleted file mode 100644 index a087be9..0000000 --- a/openapi/client-portal-history/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -plugins { - id 'java' - id 'idea' - id 'org.springframework.boot' - id 'io.spring.dependency-management' - id 'org.openapi.generator' -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-webflux' - implementation "org.openapitools:openapi-generator:$openapiVersion" -} - -openApiGenerate { - generatorName = "java" - library = "webclient" - inputSpec = "${project.projectDir}/src/portal_history_openapi.yaml" - outputDir = "${project.buildDir}/openapi" - configOptions = [ - openApiNullable : "false", - dateLibrary : "java8", - serializationLibrary: "jackson", - useJakartaEe : "true", - ] - typeMappings = [ - "File": "org.springframework.core.io.buffer.DataBuffer" - ] - generateApiTests = false - generateApiDocumentation = false - generateModelTests = false - generateModelDocumentation = false - invokerPackage = "org.onap.portalng.bff.openapi.client_portal_history" - apiPackage = "org.onap.portalng.bff.openapi.client_portal_history.api" - modelPackage = "org.onap.portalng.bff.openapi.client_portal_history.model" - modelNameSuffix = "PortalHistoryDto" -} - -compileJava { - dependsOn tasks.openApiGenerate -} - -sourceSets { - main { - java { - srcDirs += file("$buildDir/openapi/src/main/java") - } - } -} - -idea { - module { - generatedSourceDirs += file("$buildDir/openapi/src/main/java") - } -} - -bootJar { - enabled = false -} - -jar { - enabled = true -} \ No newline at end of file diff --git a/openapi/client-portal-history/src/portal_history_openapi.yaml b/openapi/client-portal-history/src/portal_history_openapi.yaml deleted file mode 100644 index 5057592..0000000 --- a/openapi/client-portal-history/src/portal_history_openapi.yaml +++ /dev/null @@ -1,457 +0,0 @@ -openapi: 3.0.2 -info: - title: Config API - version: '1.0' - description: API to provide actions for portal-history - contact: - name: TNAP Team Tesla - url: 'https://www.telekom.de' - email: info@telekom.de -servers: - - url: 'http://localhost:9002' -tags: - - name: actions -paths: - '/v1/actions/{userId}': - parameters: - - $ref: '#/components/parameters/userIdPathParam' - - $ref: '#/components/parameters/xRequestIdHeader' - get: - summary: Retrieve all actions for a specific user - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ActionsListResponse' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - operationId: getActions - parameters: - - $ref: '#/components/parameters/pageQueryParam' - - $ref: '#/components/parameters/pageSizeQueryParam' - - schema: - type: integer - format: int32 - in: query - name: showLastHours - description: Get all actions within the last X hours. - description: Get actions for the given userId - tags: - - actions - post: - summary: Create an action for a given user - operationId: createAction - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ActionResponse' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateActionRequest' - description: Only one action in each POST request - description: Create a user action - tags: - - actions - delete: - summary: Delete user actions after given time - operationId: deleteActions - parameters: - - schema: - type: integer - format: int32 - in: query - name: deleteAfterHours - description: If parameter is given actions older than value will be deleted for the user - required: true - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - tags: - - actions - description: Delete user actions after given time - '/v1/actions': - get: - summary: Retrieve all actions from the portal with an optional timeframe - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ActionsListResponse' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - operationId: listActions - parameters: - - $ref: '#/components/parameters/xRequestIdHeader' - - $ref: '#/components/parameters/pageQueryParam' - - $ref: '#/components/parameters/pageSizeQueryParam' - - schema: - type: integer - format: int32 - in: query - name: showLastHours - description: Get all actions within the last X hours. - description: Get portal actions from all users - tags: - - actions - '/actuator/info': - get: - tags: - - actions - summary: Retrieve actuator information - description: Proxy for actuator info endpoint - operationId: getActuatorInfo - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ActuatorInfoResponse' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - -components: - parameters: - xRequestIdHeader: - name: X-Request-Id - in: header - description: The unique identifier of the request - required: true - schema: - type: string - pageQueryParam: - name: page - in: query - description: Page index (1..N) - required: false - schema: - type: integer - format: int32 - minimum: 1 - default: 1 - pageSizeQueryParam: - name: pageSize - in: query - description: The size of the page to be returned - required: false - schema: - type: integer - format: int32 - minimum: 1 - maximum: 5000 - default: 10 - userIdPathParam: - name: userId - in: path - description: User ID - required: true - schema: - $ref: '#/components/schemas/ValidString' - schemas: - ActionResponse: - title: ActionResponse - type: object - properties: - actionCreatedAt: - type: string - format: date-time - action: - type: object - saveInterval: - type: integer - format: int32 - required: - - action - - actionCreatedAt - CreateActionRequest: - title: CreateActionRequest - type: object - properties: - userId: - type: string - actionCreatedAt: - type: string - format: date-time - action: - type: object - required: - - userId - - actionCreatedAt - - action - ActionsListResponse: - title: ActionsListResponse - type: object - properties: - actionsList: - type: array - items: - $ref: '#/components/schemas/ActionResponse' - totalCount: - type: integer - format: int32 - description: Total number of items matching criteria - required: - - actionsList - - totalCount - ActuatorInfoResponse: - title: ActuatorInfoResponse - type: object - properties: - git: - $ref: '#/components/schemas/ActuatorGitInfo' - build: - $ref: '#/components/schemas/ActuatorBuildInfo' - java: - $ref: '#/components/schemas/ActuatorJavaInfo' - ActuatorGitInfo: - title: ActuatorGitInfo - type: object - properties: - branch: - type: string - commit: - $ref: '#/components/schemas/GitCommitInfo' - ActuatorBuildInfo: - title: ActuatorBuildInfo - type: object - properties: - artifact: - type: string - name: - type: string - time: - type: string - version: - type: string - group: - type: string - GitCommitInfo: - title: GitCommitInfo - type: object - properties: - id: - type: string - time: - type: string - ActuatorJavaInfo: - title: ActuatorJavaInfo - type: object - properties: - version: - type: string - vendor: - $ref: '#/components/schemas/JavaVendorInfo' - runtime: - $ref: '#/components/schemas/JavaRuntimeInfo' - jvm: - $ref: '#/components/schemas/JavaJvmInfo' - JavaVendorInfo: - title: JavaVendorInfo - type: object - properties: - name: - type: string - version: - type: string - JavaRuntimeInfo: - title: JavaRuntimeInfo - type: object - properties: - name: - type: string - version: - type: string - JavaJvmInfo: - title: JavaJvmInfo - type: object - properties: - name: - type: string - vendor: - type: string - version: - type: string - Problem: - type: object - properties: - type: - type: string - format: uri-reference - description: | - A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferencable and point to a human-readable documentation nor globally unique for the problem type. - default: 'about:blank' - example: /problem/connection-error - title: - type: string - description: | - A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. - example: Service Unavailable - status: - type: integer - format: int32 - description: | - The HTTP status code generated by the origin server for this occurrence of the problem. - minimum: 100 - maximum: 600 - exclusiveMaximum: true - example: 503 - detail: - type: string - description: | - A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. - example: Connection to database timed out - instance: - type: string - format: uri-reference - description: | - A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code. - example: /problem/connection-error#token-info-read-timed-out - ValidString: - type: string - pattern: '[\w,/!=§#@€:µ.*+?'' \-\u00C0-\u017F]*' - responses: - BadRequest: - description: '400: Bad Request' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - Unauthorized: - description: '401: Unauthorized' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - Forbidden: - description: '403: Forbidden' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - NotFound: - description: '404: Not Found' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - NotAllowed: - description: '405: Method Not Allowed' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - Conflict: - description: '409: Conflict' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - InternalServerError: - description: Internal Server Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - BadGateway: - description: Bad Gateway - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response diff --git a/openapi/client-portal-keycloak/LICENSE b/openapi/client-portal-keycloak/LICENSE deleted file mode 100644 index abe3069..0000000 --- a/openapi/client-portal-keycloak/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2021 TNAP / development / system-team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/openapi/client-portal-keycloak/build.gradle b/openapi/client-portal-keycloak/build.gradle deleted file mode 100644 index 22da1f2..0000000 --- a/openapi/client-portal-keycloak/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -plugins { - id 'java' - id 'idea' - id 'org.springframework.boot' - id 'io.spring.dependency-management' - id 'org.openapi.generator' -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-webflux' - implementation "org.openapitools:openapi-generator:$openapiVersion" -} - -openApiGenerate { - generatorName = "java" - library = "webclient" - inputSpec = "${project.projectDir}/src/portal_keycloak_openapi.yaml" - outputDir = "${project.buildDir}/openapi" - configOptions = [ - openApiNullable : "false", - dateLibrary : "java8", - serializationLibrary: "jackson", - useJakartaEe : "true", - ] - typeMappings = [ - "File": "org.springframework.core.io.buffer.DataBuffer" - ] - generateApiTests = false - generateApiDocumentation = false - generateModelTests = false - generateModelDocumentation = false - invokerPackage = "org.onap.portalng.bff.openapi.client_portal_keycloak" - apiPackage = "org.onap.portalng.bff.openapi.client_portal_keycloak.api" - modelPackage = "org.onap.portalng.bff.openapi.client_portal_keycloak.model" - modelNameSuffix = "KeycloakDto" -} - -compileJava { - dependsOn tasks.openApiGenerate -} - -sourceSets { - main { - java { - srcDirs += file("$buildDir/openapi/src/main/java") - } - } -} - -idea { - module { - generatedSourceDirs += file("$buildDir/openapi/src/main/java") - } -} - -bootJar { - enabled = false -} - -jar { - enabled = true -} \ No newline at end of file diff --git a/openapi/client-portal-keycloak/src/portal_keycloak_openapi.yaml b/openapi/client-portal-keycloak/src/portal_keycloak_openapi.yaml deleted file mode 100644 index a09f0f4..0000000 --- a/openapi/client-portal-keycloak/src/portal_keycloak_openapi.yaml +++ /dev/null @@ -1,651 +0,0 @@ -openapi: 3.0.2 -info: - title: Keycloak API - version: '1.0' - description: API to provide Keycloak actions - contact: - name: TNAP Team Tesla - url: 'https://www.telekom.de' - email: info@telekom.de -servers: - - url: 'http://localhost:9003/{base}/{version}' - variables: - base: - default: 'portal-keycloak' - description: Basepath - version: - default: 'v1' - description: Version -paths: - '/roles': - get: - tags: - - keycloak - summary: Get all roles - description: Retrieves all keycloak roles for the realm or client - operationId: getRoles - parameters: - - name: search - in: query - schema: - type: string - - name: first - in: query - schema: - type: integer - format: int32 - - name: max - in: query - schema: - type: integer - format: int32 - - name: briefRepresentation - in: query - schema: - type: boolean - responses: - 2XX: - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Role' - post: - tags: - - keycloak - summary: Create a new role - description: Creates a new role for the realm or client - operationId: createRole - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Role' - required: true - responses: - 2XX: - description: OK - '/roles/{roleName}/users': - get: - tags: - - keycloak - summary: Get all users for the role - description: Returns a stream of users that have the specified role name - operationId: getUsersByRole - parameters: - - name: first - in: query - description: 'First result to return. Ignored if negative or {@code null}' - schema: - type: integer - format: int32 - - name: max - in: query - description: 'Maximum number of results to return. Ignored if negative or {@code null}' - schema: - type: integer - format: int32 - responses: - 2XX: - description: Success - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/User' - parameters: - - name: roleName - in: path - description: The role name - required: true - schema: - type: string - '/users': - post: - tags: - - keycloak - summary: Create a new keycloak user - description: Creates a new user in keycloak. Username must be unique - operationId: createUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - responses: - 2XX: - description: Success - get: - tags: - - keycloak - summary: Get keycloak users - description: Returns a stream of users, filtered according to query. - operationId: getUsers - parameters: - - name: search - in: query - schema: - type: string - - name: lastName - in: query - schema: - type: string - - name: firstName - in: query - schema: - type: string - - name: email - in: query - schema: - type: string - - name: username - in: query - schema: - type: string - - name: emailVerified - in: query - schema: - type: boolean - - name: idpAlias - in: query - schema: - type: string - - name: idpUserId - in: query - schema: - type: string - - name: first - in: query - schema: - type: integer - format: int32 - - name: max - in: query - schema: - type: integer - format: int32 - - name: enabled - in: query - schema: - type: boolean - - name: briefRepresentation - in: query - schema: - type: boolean - - name: exact - in: query - schema: - type: boolean - - name: q - in: query - schema: - type: string - responses: - 2XX: - description: Success - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/User' - '/users/count': - get: - tags: - - keycloak - summary: Get users count - description: Returns the number of users that match the given criteria - operationId: getUsersCount - parameters: - - name: search - in: query - schema: - type: string - - name: lastName - in: query - schema: - type: string - - name: firstName - in: query - schema: - type: string - - name: email - in: query - schema: - type: string - - name: emailVerified - in: query - schema: - type: boolean - - name: username - in: query - schema: - type: string - - name: enabled - in: query - schema: - type: boolean - responses: - 2XX: - description: Success - content: - application/json: - schema: - type: integer - format: int32 - '/users/{id}': - put: - tags: - - keycloak - summary: Update user - description: Updates the user - operationId: updateUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - responses: - 2XX: - description: Success - get: - tags: - - keycloak - summary: Get user - description: Returns representation of the user - operationId: getUser - responses: - 2XX: - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/User' - delete: - tags: - - keycloak - summary: Delete the user - description: Deletes the user - operationId: deleteUser - responses: - 2XX: - description: Success - parameters: - - name: id - in: path - required: true - schema: - type: string - '/users/{id}/reset-password': - put: - tags: - - keycloak - summary: Reset user password - description: Sets up a new password for the user - operationId: resetUserPassword - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Credential' - responses: - 2XX: - description: Success - parameters: - - name: id - in: path - required: true - schema: - type: string - '/users/{id}/role-mappings/realm': - get: - tags: - - keycloak - summary: Get realm role mappings - description: Returns realm-level role mappings - operationId: getRealmRoleMappingsByUserId - responses: - 2XX: - description: Success - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Role' - post: - tags: - - keycloak - summary: Add realm role mappings - description: Adds realm-level role mappings to the user - operationId: addRealmRoleMappingsToUser - requestBody: - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Role' - responses: - 2XX: - description: Success - delete: - tags: - - keycloak - summary: Delete realm role mappings - description: Deletes realm-level role mappings - operationId: deleteRealmRoleMappingsByUserId - requestBody: - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Role' - responses: - 2XX: - description: Success - parameters: - - name: id - in: path - required: true - schema: - type: string - '/users/{id}/role-mappings/realm/available': - get: - tags: - - keycloak - summary: Get available realm roles - description: Returns realm-level roles that can be mapped - operationId: getAvailableRealmRoleMappingsByUserId - responses: - 2XX: - description: Success - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Role' - parameters: - - name: id - in: path - required: true - schema: - type: string - '/users/{id}/execute-actions-email': - put: - tags: - - keycloak - summary: Execute actions email - description: Send an update account email to the user. An email contains a link the user can click to perform a set of required actions. The redirectUri and clientId parameters are optional. If no redirect is given, then there will be no link back to click after actions have completed. Redirect uri must be a valid uri for the particular clientId - operationId: executeActionsEmail - parameters: - - name: OIDCLoginProtocol.REDIRECT_URI_PARAM - in: query - description: Redirect uri - schema: - type: string - - name: OIDCLoginProtocol.CLIENT_ID_PARAM - in: query - description: Client id - schema: - type: string - - name: lifespan - in: query - description: Number of seconds after which the generated token expires - schema: - type: integer - format: int32 - requestBody: - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/RequiredActions' - responses: - 2XX: - description: Success - parameters: - - name: id - in: path - required: true - schema: - type: string -components: - schemas: - Role: - type: object - properties: - id: - type: string - name: - type: string - description: - type: string - scopeParamRequired: - type: boolean - composites: - $ref: '#/components/schemas/Composites' - composite: - type: boolean - clientRole: - type: boolean - containerId: - type: string - attributes: - type: object - additionalProperties: - type: array - items: - type: string - Composites: - type: object - properties: - realm: - type: array - items: - type: string - client: - type: object - additionalProperties: - type: array - items: - type: string - application: - type: object - additionalProperties: - type: array - items: - type: string - User: - type: object - properties: - self: - type: string - id: - type: string - createdTimestamp: - type: integer - format: int64 - firstName: - type: string - lastName: - type: string - email: - type: string - username: - type: string - enabled: - type: boolean - totp: - type: boolean - emailVerified: - type: boolean - attributes: - type: object - additionalProperties: - type: array - items: - type: string - credentials: - type: array - items: - $ref: '#/components/schemas/Credential' - requiredActions: - type: array - items: - $ref: '#/components/schemas/RequiredActions' - federatedIdentities: - type: array - items: - $ref: '#/components/schemas/FederatedIdentity' - socialLinks: - type: array - items: - $ref: '#/components/schemas/SocialLink' - realmRoles: - type: array - items: - type: string - clientRoles: - type: object - additionalProperties: - type: array - items: - type: string - clientConsents: - type: array - items: - $ref: '#/components/schemas/UserConsent' - notBefore: - type: integer - format: int32 - applicationRoles: - type: object - additionalProperties: - type: array - items: - type: string - federationLink: - type: string - serviceAccountClientId: - type: string - groups: - type: array - items: - type: string - origin: - type: string - disableableCredentialTypes: - type: array - items: - type: string - access: - type: object - additionalProperties: - type: boolean - Credential: - type: object - properties: - id: - type: string - type: - type: string - userLabel: - type: string - secretData: - type: string - credentialData: - type: string - priority: - type: integer - format: int32 - createdDate: - type: integer - format: int64 - value: - type: string - temporary: - type: boolean - device: - type: string - hashedSaltedValue: - type: string - salt: - type: string - hashIterations: - type: integer - format: int32 - counter: - type: integer - format: int32 - algorithm: - type: string - digits: - type: integer - format: int32 - period: - type: integer - format: int32 - config: - type: object - additionalProperties: - type: string - FederatedIdentity: - type: object - properties: - identityProvider: - type: string - userId: - type: string - userName: - type: string - SocialLink: - type: object - properties: - socialProvider: - type: string - socialUserId: - type: string - socialUsername: - type: string - UserConsent: - type: object - properties: - clientId: - type: string - grantedClientScopes: - type: array - items: - type: string - createdDate: - type: integer - format: int64 - lastUpdatedDate: - type: integer - format: int64 - grantedRealmRoles: - type: array - items: - type: string - RequiredActions: - type: string - enum: - - CONFIGURE_TOTP - - TERMS_AND_CONDITIONS - - UPDATE_PASSWORD - - UPDATE_PROFILE - - VERIFY_EMAIL - ErrorResponse: - type: object - properties: - error: - type: string - errorMessage: - type: string - diff --git a/openapi/client-portal-prefs/LICENSE b/openapi/client-portal-prefs/LICENSE deleted file mode 100644 index abe3069..0000000 --- a/openapi/client-portal-prefs/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2021 TNAP / development / system-team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/openapi/client-portal-prefs/build.gradle b/openapi/client-portal-prefs/build.gradle deleted file mode 100644 index 9eaa4b0..0000000 --- a/openapi/client-portal-prefs/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -plugins { - id 'java' - id 'idea' - id 'org.springframework.boot' - id 'io.spring.dependency-management' - id 'org.openapi.generator' -} - -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-webflux' - implementation "org.openapitools:openapi-generator:$openapiVersion" -} - -openApiGenerate { - generatorName = "java" - library = "webclient" - inputSpec = "${project.projectDir}/src/portal_prefs_openapi.yaml" - outputDir = "${project.buildDir}/openapi" - configOptions = [ - openApiNullable : "false", - dateLibrary : "java8", - serializationLibrary: "jackson", - useJakartaEe : "true", - ] - typeMappings = [ - "File": "org.springframework.core.io.buffer.DataBuffer" - ] - generateApiTests = false - generateApiDocumentation = false - generateModelTests = false - generateModelDocumentation = false - invokerPackage = "org.onap.portalng.bff.openapi.client_portal_prefs" - apiPackage = "org.onap.portalng.bff.openapi.client_portal_prefs.api" - modelPackage = "org.onap.portalng.bff.openapi.client_portal_prefs.model" - modelNameSuffix = "PortalPrefsDto" -} - -compileJava { - dependsOn tasks.openApiGenerate -} - -sourceSets { - main { - java { - srcDirs += file("$buildDir/openapi/src/main/java") - } - } -} - -idea { - module { - generatedSourceDirs += file("$buildDir/openapi/src/main/java") - } -} - -bootJar { - enabled = false -} - -jar { - enabled = true -} \ No newline at end of file diff --git a/openapi/client-portal-prefs/src/portal_prefs_openapi.yaml b/openapi/client-portal-prefs/src/portal_prefs_openapi.yaml deleted file mode 100644 index 86d9e2b..0000000 --- a/openapi/client-portal-prefs/src/portal_prefs_openapi.yaml +++ /dev/null @@ -1,341 +0,0 @@ -openapi: 3.0.2 -info: - title: Config API - version: '1.0' -servers: - - url: 'http://localhost:9001' -tags: - - name: preferences -paths: - '/v1/preferences': - get: - description: Returns user preferences - summary: Get user preferences - operationId: getPreferences - parameters: - - $ref: '#/components/parameters/XRequestIdHeader' - tags: - - preferences - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Preferences' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - put: - description: Updates user preferences - summary: Update user preferences - operationId: updatePreferences - parameters: - - $ref: '#/components/parameters/XRequestIdHeader' - tags: - - preferences - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Preferences' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Preferences' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - post: - description: Save user preferences - summary: Save user preferences - operationId: savePreferences - parameters: - - $ref: '#/components/parameters/XRequestIdHeader' - tags: - - preferences - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/Preferences' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/Preferences' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' - '/actuator/info': - get: - tags: - - preferences - summary: Retrieve actuator information - description: Proxy for actuator info endpoint - operationId: getActuatorInfo - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ActuatorInfoResponse' - '400': - $ref: '#/components/responses/BadRequest' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - '500': - $ref: '#/components/responses/InternalServerError' - '502': - $ref: '#/components/responses/BadGateway' -components: - parameters: - XRequestIdHeader: - name: X-Request-Id - in: header - description: The unique identifier of the request - required: true - schema: - type: string - schemas: - Preferences: - type: object - x-extension-1: null - properties: - properties: - type: object - required: - - properties - ActuatorInfoResponse: - title: ActuatorInfoResponse - type: object - properties: - git: - $ref: '#/components/schemas/ActuatorGitInfo' - build: - $ref: '#/components/schemas/ActuatorBuildInfo' - java: - $ref: '#/components/schemas/ActuatorJavaInfo' - ActuatorGitInfo: - title: ActuatorGitInfo - type: object - properties: - branch: - type: string - commit: - $ref: '#/components/schemas/GitCommitInfo' - ActuatorBuildInfo: - title: ActuatorBuildInfo - type: object - properties: - artifact: - type: string - name: - type: string - time: - type: string - version: - type: string - group: - type: string - GitCommitInfo: - title: GitCommitInfo - type: object - properties: - id: - type: string - time: - type: string - ActuatorJavaInfo: - title: ActuatorJavaInfo - type: object - properties: - version: - type: string - vendor: - $ref: '#/components/schemas/JavaVendorInfo' - runtime: - $ref: '#/components/schemas/JavaRuntimeInfo' - jvm: - $ref: '#/components/schemas/JavaJvmInfo' - JavaVendorInfo: - title: JavaVendorInfo - type: object - properties: - name: - type: string - version: - type: string - JavaRuntimeInfo: - title: JavaRuntimeInfo - type: object - properties: - name: - type: string - version: - type: string - JavaJvmInfo: - title: JavaJvmInfo - type: object - properties: - name: - type: string - vendor: - type: string - version: - type: string - Problem: - type: object - properties: - type: - type: string - format: uri-reference - description: | - A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferencable and point to a human-readable documentation nor globally unique for the problem type. - default: 'about:blank' - example: /problem/connection-error - title: - type: string - description: | - A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. - example: Service Unavailable - status: - type: integer - format: int32 - description: | - The HTTP status code generated by the origin server for this occurrence of the problem. - minimum: 100 - maximum: 600 - exclusiveMaximum: true - example: 503 - detail: - type: string - description: | - A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. - example: Connection to database timed out - instance: - type: string - format: uri-reference - description: | - A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code. - example: /problem/connection-error#token-info-read-timed-out - responses: - BadRequest: - description: '400: Bad Request' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - Unauthorized: - description: '401: Unauthorized' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - Forbidden: - description: '403: Forbidden' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - NotFound: - description: '404: Not Found' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - NotAllowed: - description: '405: Method Not Allowed' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - Conflict: - description: '409: Conflict' - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - InternalServerError: - description: Internal Server Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response - BadGateway: - description: Bad Gateway - content: - application/problem+json: - schema: - $ref: '#/components/schemas/Problem' - headers: - X-Request-Id: - schema: - type: string - description: A in each response diff --git a/openapi/client-preferences/LICENSE b/openapi/client-preferences/LICENSE new file mode 100644 index 0000000..abe3069 --- /dev/null +++ b/openapi/client-preferences/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2021 TNAP / development / system-team + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/openapi/client-preferences/build.gradle b/openapi/client-preferences/build.gradle new file mode 100644 index 0000000..208b20d --- /dev/null +++ b/openapi/client-preferences/build.gradle @@ -0,0 +1,66 @@ +plugins { + id 'java' + id 'idea' + id 'org.springframework.boot' + id 'io.spring.dependency-management' + id 'org.openapi.generator' +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-webflux' + implementation "org.openapitools:openapi-generator:$openapiVersion" +} + +openApiGenerate { + generatorName = "java" + library = "webclient" + inputSpec = "${project.projectDir}/src/api.yaml" + outputDir = "${project.buildDir}/openapi" + configOptions = [ + openApiNullable : "false", + dateLibrary : "java8", + serializationLibrary: "jackson", + useJakartaEe : "true", + ] + typeMappings = [ + "File": "org.springframework.core.io.buffer.DataBuffer", + "mapOfObjects": "Map" + ] + importMappings = [ + "Map": "java.util.Map" + ] + generateApiTests = false + generateApiDocumentation = false + generateModelTests = false + generateModelDocumentation = false + invokerPackage = "org.onap.portalng.bff.openapi.client_preferences" + apiPackage = "org.onap.portalng.bff.openapi.client_preferences.api" + modelPackage = "org.onap.portalng.bff.openapi.client_preferences.model" + modelNameSuffix = "PreferencesDto" +} + +compileJava { + dependsOn tasks.openApiGenerate +} + +sourceSets { + main { + java { + srcDirs += file("$buildDir/openapi/src/main/java") + } + } +} + +idea { + module { + generatedSourceDirs += file("$buildDir/openapi/src/main/java") + } +} + +bootJar { + enabled = false +} + +jar { + enabled = true +} \ No newline at end of file diff --git a/openapi/client-preferences/src/api.yaml b/openapi/client-preferences/src/api.yaml new file mode 100644 index 0000000..86d9e2b --- /dev/null +++ b/openapi/client-preferences/src/api.yaml @@ -0,0 +1,341 @@ +openapi: 3.0.2 +info: + title: Config API + version: '1.0' +servers: + - url: 'http://localhost:9001' +tags: + - name: preferences +paths: + '/v1/preferences': + get: + description: Returns user preferences + summary: Get user preferences + operationId: getPreferences + parameters: + - $ref: '#/components/parameters/XRequestIdHeader' + tags: + - preferences + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Preferences' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + put: + description: Updates user preferences + summary: Update user preferences + operationId: updatePreferences + parameters: + - $ref: '#/components/parameters/XRequestIdHeader' + tags: + - preferences + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Preferences' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Preferences' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + post: + description: Save user preferences + summary: Save user preferences + operationId: savePreferences + parameters: + - $ref: '#/components/parameters/XRequestIdHeader' + tags: + - preferences + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Preferences' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Preferences' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' + '/actuator/info': + get: + tags: + - preferences + summary: Retrieve actuator information + description: Proxy for actuator info endpoint + operationId: getActuatorInfo + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ActuatorInfoResponse' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '500': + $ref: '#/components/responses/InternalServerError' + '502': + $ref: '#/components/responses/BadGateway' +components: + parameters: + XRequestIdHeader: + name: X-Request-Id + in: header + description: The unique identifier of the request + required: true + schema: + type: string + schemas: + Preferences: + type: object + x-extension-1: null + properties: + properties: + type: object + required: + - properties + ActuatorInfoResponse: + title: ActuatorInfoResponse + type: object + properties: + git: + $ref: '#/components/schemas/ActuatorGitInfo' + build: + $ref: '#/components/schemas/ActuatorBuildInfo' + java: + $ref: '#/components/schemas/ActuatorJavaInfo' + ActuatorGitInfo: + title: ActuatorGitInfo + type: object + properties: + branch: + type: string + commit: + $ref: '#/components/schemas/GitCommitInfo' + ActuatorBuildInfo: + title: ActuatorBuildInfo + type: object + properties: + artifact: + type: string + name: + type: string + time: + type: string + version: + type: string + group: + type: string + GitCommitInfo: + title: GitCommitInfo + type: object + properties: + id: + type: string + time: + type: string + ActuatorJavaInfo: + title: ActuatorJavaInfo + type: object + properties: + version: + type: string + vendor: + $ref: '#/components/schemas/JavaVendorInfo' + runtime: + $ref: '#/components/schemas/JavaRuntimeInfo' + jvm: + $ref: '#/components/schemas/JavaJvmInfo' + JavaVendorInfo: + title: JavaVendorInfo + type: object + properties: + name: + type: string + version: + type: string + JavaRuntimeInfo: + title: JavaRuntimeInfo + type: object + properties: + name: + type: string + version: + type: string + JavaJvmInfo: + title: JavaJvmInfo + type: object + properties: + name: + type: string + vendor: + type: string + version: + type: string + Problem: + type: object + properties: + type: + type: string + format: uri-reference + description: | + A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferencable and point to a human-readable documentation nor globally unique for the problem type. + default: 'about:blank' + example: /problem/connection-error + title: + type: string + description: | + A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. + example: Service Unavailable + status: + type: integer + format: int32 + description: | + The HTTP status code generated by the origin server for this occurrence of the problem. + minimum: 100 + maximum: 600 + exclusiveMaximum: true + example: 503 + detail: + type: string + description: | + A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized. + example: Connection to database timed out + instance: + type: string + format: uri-reference + description: | + A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code. + example: /problem/connection-error#token-info-read-timed-out + responses: + BadRequest: + description: '400: Bad Request' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + Unauthorized: + description: '401: Unauthorized' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + Forbidden: + description: '403: Forbidden' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + NotFound: + description: '404: Not Found' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + NotAllowed: + description: '405: Method Not Allowed' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + Conflict: + description: '409: Conflict' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + InternalServerError: + description: Internal Server Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response + BadGateway: + description: Bad Gateway + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + headers: + X-Request-Id: + schema: + type: string + description: A in each response diff --git a/openapi/server/build.gradle b/openapi/server/build.gradle index 99e401b..78c5103 100644 --- a/openapi/server/build.gradle +++ b/openapi/server/build.gradle @@ -24,7 +24,7 @@ openApiGenerate { inputSpec = "$projectDir/src/main/resources/static/api.yaml" outputDir = "$buildDir/openapi" configOptions = [ - hideGenerationTimestamps: "true", + hideGenerationTimestamp: "true", openApiNullable: "false", skipDefaultInterface: "true", dateLibrary: "java8", diff --git a/openapi/server/src/main/resources/static/api.yaml b/openapi/server/src/main/resources/static/api.yaml index be5ae0a..f601785 100644 --- a/openapi/server/src/main/resources/static/api.yaml +++ b/openapi/server/src/main/resources/static/api.yaml @@ -734,7 +734,7 @@ components: enum: - KEYCLOAK - PORTAL_SERVICE - - PORTAL_PREFS + - PREFERENCES - PORTAL_HISTORY downstreamStatus: type: integer diff --git a/settings.gradle b/settings.gradle index 6044422..200c1cc 100644 --- a/settings.gradle +++ b/settings.gradle @@ -20,9 +20,9 @@ pluginManagement { rootProject.name = 'bff' include 'openapi:server' -include 'openapi:client-portal-prefs' -include 'openapi:client-portal-history' -include 'openapi:client-portal-keycloak' +include 'openapi:client-preferences' +include 'openapi:client-history' +include 'openapi:client-keycloak' include 'lib' include 'app' -- cgit 1.2.3-korg