From 1074f1c4d6b2f5fd7aa9fb462732d61b43b72664 Mon Sep 17 00:00:00 2001 From: Nic12345678 <162564162+Nic12345678@users.noreply.github.com> Date: Fri, 27 Sep 2024 13:59:19 +0200 Subject: [PATCH 1/2] Demo and TheEntity Elemente entfernt --- .../rest/ClientDemoRestController.java | 19 ---------------- .../basisdatenservice/rest/DemoClient.java | 20 ----------------- .../basisdatenservice/rest/DemoDTO.java | 4 ---- .../security/AuthoritiesEnum.java | 19 ---------------- .../h2/V0_1__createTableTheEntity.sql | 5 ----- .../h2/V9_0__dropTableTheEntity.sql | 1 - .../oracle/V0_1__createTableTheEntity.sql | 5 ----- .../oracle/V9_0__dropTableTheEntity.sql | 1 - .../basisdatenservice/TestConstants.java | 16 -------------- .../src/test/resources/demo.http | 22 ------------------- 10 files changed, 112 deletions(-) delete mode 100644 wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/ClientDemoRestController.java delete mode 100644 wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/DemoClient.java delete mode 100644 wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/DemoDTO.java delete mode 100644 wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/security/AuthoritiesEnum.java delete mode 100644 wls-basisdaten-service/src/main/resources/db/migrations/h2/V0_1__createTableTheEntity.sql delete mode 100644 wls-basisdaten-service/src/main/resources/db/migrations/h2/V9_0__dropTableTheEntity.sql delete mode 100644 wls-basisdaten-service/src/main/resources/db/migrations/oracle/V0_1__createTableTheEntity.sql delete mode 100644 wls-basisdaten-service/src/main/resources/db/migrations/oracle/V9_0__dropTableTheEntity.sql delete mode 100644 wls-basisdaten-service/src/test/resources/demo.http diff --git a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/ClientDemoRestController.java b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/ClientDemoRestController.java deleted file mode 100644 index fd6f784e8..000000000 --- a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/ClientDemoRestController.java +++ /dev/null @@ -1,19 +0,0 @@ -package de.muenchen.oss.wahllokalsystem.basisdatenservice.rest; - -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/demo") -@RequiredArgsConstructor -public class ClientDemoRestController { - - private final DemoClient demoClient; - - @GetMapping - public DemoDTO getDemo() { - return demoClient.getDemo(); - } -} diff --git a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/DemoClient.java b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/DemoClient.java deleted file mode 100644 index 2a10352b4..000000000 --- a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/DemoClient.java +++ /dev/null @@ -1,20 +0,0 @@ -package de.muenchen.oss.wahllokalsystem.basisdatenservice.rest; - -import de.muenchen.oss.wahllokalsystem.basisdatenservice.eai.aou.client.WahlvorschlagControllerApi; -import lombok.RequiredArgsConstructor; -import lombok.val; -import org.springframework.stereotype.Component; - -@Component -@RequiredArgsConstructor -public class DemoClient { - - private final WahlvorschlagControllerApi wahlvorschlagControllerApi; - - public DemoDTO getDemo() { - val wahlvorschlaege = wahlvorschlagControllerApi.loadWahlvorschlaege("wahlID", "wahlbezirkID"); - - return new DemoDTO(wahlvorschlaege.getStimmzettelgebietID(), "" + wahlvorschlaege.getWahlvorschlaege().size()); - } - -} diff --git a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/DemoDTO.java b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/DemoDTO.java deleted file mode 100644 index 8504b0a8d..000000000 --- a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/rest/DemoDTO.java +++ /dev/null @@ -1,4 +0,0 @@ -package de.muenchen.oss.wahllokalsystem.basisdatenservice.rest; - -public record DemoDTO(String demoString1, String demoString) { -} diff --git a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/security/AuthoritiesEnum.java b/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/security/AuthoritiesEnum.java deleted file mode 100644 index 0202f7bc6..000000000 --- a/wls-basisdaten-service/src/main/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/security/AuthoritiesEnum.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c): it@M - Dienstleister für Informations- und Telekommunikationstechnik - * der Landeshauptstadt München, 2024 - */ -package de.muenchen.oss.wahllokalsystem.basisdatenservice.security; - -import org.springframework.data.repository.PagingAndSortingRepository; -import org.springframework.security.access.prepost.PreAuthorize; - -/** - * Each possible authority in this project is represented by an enum. The enums are used within the - * {@link PagingAndSortingRepository} in the annotation e.g. - * {@link PreAuthorize}. - */ -public enum AuthoritiesEnum { - WLS_BASISDATEN_SERVICE_READ_THEENTITY, WLS_BASISDATEN_SERVICE_WRITE_THEENTITY, WLS_BASISDATEN_SERVICE_DELETE_THEENTITY, - // add your authorities here and also add these new authorities to sso-authorisation.json. - -} diff --git a/wls-basisdaten-service/src/main/resources/db/migrations/h2/V0_1__createTableTheEntity.sql b/wls-basisdaten-service/src/main/resources/db/migrations/h2/V0_1__createTableTheEntity.sql deleted file mode 100644 index 1f2b83f72..000000000 --- a/wls-basisdaten-service/src/main/resources/db/migrations/h2/V0_1__createTableTheEntity.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLE theEntity -( - id varchar2(36) NOT NULL primary key, - textAttribute varchar2(8) NOT NULL -) \ No newline at end of file diff --git a/wls-basisdaten-service/src/main/resources/db/migrations/h2/V9_0__dropTableTheEntity.sql b/wls-basisdaten-service/src/main/resources/db/migrations/h2/V9_0__dropTableTheEntity.sql deleted file mode 100644 index 25bcba5ac..000000000 --- a/wls-basisdaten-service/src/main/resources/db/migrations/h2/V9_0__dropTableTheEntity.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE theEntity \ No newline at end of file diff --git a/wls-basisdaten-service/src/main/resources/db/migrations/oracle/V0_1__createTableTheEntity.sql b/wls-basisdaten-service/src/main/resources/db/migrations/oracle/V0_1__createTableTheEntity.sql deleted file mode 100644 index 1f2b83f72..000000000 --- a/wls-basisdaten-service/src/main/resources/db/migrations/oracle/V0_1__createTableTheEntity.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLE theEntity -( - id varchar2(36) NOT NULL primary key, - textAttribute varchar2(8) NOT NULL -) \ No newline at end of file diff --git a/wls-basisdaten-service/src/main/resources/db/migrations/oracle/V9_0__dropTableTheEntity.sql b/wls-basisdaten-service/src/main/resources/db/migrations/oracle/V9_0__dropTableTheEntity.sql deleted file mode 100644 index 25bcba5ac..000000000 --- a/wls-basisdaten-service/src/main/resources/db/migrations/oracle/V9_0__dropTableTheEntity.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE theEntity \ No newline at end of file diff --git a/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/TestConstants.java b/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/TestConstants.java index be39858e8..6e97356b1 100644 --- a/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/TestConstants.java +++ b/wls-basisdaten-service/src/test/java/de/muenchen/oss/wahllokalsystem/basisdatenservice/TestConstants.java @@ -5,12 +5,7 @@ package de.muenchen.oss.wahllokalsystem.basisdatenservice; import lombok.AccessLevel; -import lombok.EqualsAndHashCode; -import lombok.Getter; import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -import org.springframework.hateoas.RepresentationModel; @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class TestConstants { @@ -19,15 +14,4 @@ public final class TestConstants { public static final String SPRING_NO_SECURITY_PROFILE = "no-security"; - @NoArgsConstructor - @Getter - @Setter - @EqualsAndHashCode(callSuper = true) - @ToString(callSuper = true) - public static class TheEntityDto extends RepresentationModel { - - private String textAttribute; - - } - } diff --git a/wls-basisdaten-service/src/test/resources/demo.http b/wls-basisdaten-service/src/test/resources/demo.http deleted file mode 100644 index ebca281b3..000000000 --- a/wls-basisdaten-service/src/test/resources/demo.http +++ /dev/null @@ -1,22 +0,0 @@ -### get token for wls_all -POST http://kubernetes.docker.internal:8100/auth/realms/wls_realm/protocol/openid-connect/token -Content-Type: application/x-www-form-urlencoded - -password = test & -grant_type = password & -client_secret = top-secret & -client_id = wls & -username = wls_all - -> {% - client.global.set("auth_token", response.body.access_token); - client.global.set("token_type", response.body.token_type); -%} - -### get userinfo with auth_token -GET http://kubernetes.docker.internal:8100/auth/realms/wls_realm/protocol/openid-connect/userinfo -Authorization: {{ token_type }} {{ auth_token }} - -### Demo für client zu EAI - will result in 500 als long as eai is not implemented (not implemented yet) -GET http://localhost:39151/demo -Authorization: {{ token_type }} {{ auth_token }} \ No newline at end of file From 97f2a17d733c61d429d802ea471083a76d2b2d4c Mon Sep 17 00:00:00 2001 From: Nic12345678 <162564162+Nic12345678@users.noreply.github.com> Date: Fri, 4 Oct 2024 15:35:51 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Flyway=20Skripte=20f=C3=BCr=20TheEntity=20f?= =?UTF-8?q?=C3=BCr=20die=20Kompatibilt=C3=A4t=20wieder=20da?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migrations/h2/V0_1__createTableTheEntity.sql | 5 +++++ .../resources/db/migrations/h2/V9_0__dropTableTheEntity.sql | 1 + .../db/migrations/oracle/V0_1__createTableTheEntity.sql | 5 +++++ .../db/migrations/oracle/V9_0__dropTableTheEntity.sql | 1 + 4 files changed, 12 insertions(+) create mode 100644 wls-basisdaten-service/src/main/resources/db/migrations/h2/V0_1__createTableTheEntity.sql create mode 100644 wls-basisdaten-service/src/main/resources/db/migrations/h2/V9_0__dropTableTheEntity.sql create mode 100644 wls-basisdaten-service/src/main/resources/db/migrations/oracle/V0_1__createTableTheEntity.sql create mode 100644 wls-basisdaten-service/src/main/resources/db/migrations/oracle/V9_0__dropTableTheEntity.sql diff --git a/wls-basisdaten-service/src/main/resources/db/migrations/h2/V0_1__createTableTheEntity.sql b/wls-basisdaten-service/src/main/resources/db/migrations/h2/V0_1__createTableTheEntity.sql new file mode 100644 index 000000000..1f2b83f72 --- /dev/null +++ b/wls-basisdaten-service/src/main/resources/db/migrations/h2/V0_1__createTableTheEntity.sql @@ -0,0 +1,5 @@ +CREATE TABLE theEntity +( + id varchar2(36) NOT NULL primary key, + textAttribute varchar2(8) NOT NULL +) \ No newline at end of file diff --git a/wls-basisdaten-service/src/main/resources/db/migrations/h2/V9_0__dropTableTheEntity.sql b/wls-basisdaten-service/src/main/resources/db/migrations/h2/V9_0__dropTableTheEntity.sql new file mode 100644 index 000000000..25bcba5ac --- /dev/null +++ b/wls-basisdaten-service/src/main/resources/db/migrations/h2/V9_0__dropTableTheEntity.sql @@ -0,0 +1 @@ +DROP TABLE theEntity \ No newline at end of file diff --git a/wls-basisdaten-service/src/main/resources/db/migrations/oracle/V0_1__createTableTheEntity.sql b/wls-basisdaten-service/src/main/resources/db/migrations/oracle/V0_1__createTableTheEntity.sql new file mode 100644 index 000000000..1f2b83f72 --- /dev/null +++ b/wls-basisdaten-service/src/main/resources/db/migrations/oracle/V0_1__createTableTheEntity.sql @@ -0,0 +1,5 @@ +CREATE TABLE theEntity +( + id varchar2(36) NOT NULL primary key, + textAttribute varchar2(8) NOT NULL +) \ No newline at end of file diff --git a/wls-basisdaten-service/src/main/resources/db/migrations/oracle/V9_0__dropTableTheEntity.sql b/wls-basisdaten-service/src/main/resources/db/migrations/oracle/V9_0__dropTableTheEntity.sql new file mode 100644 index 000000000..25bcba5ac --- /dev/null +++ b/wls-basisdaten-service/src/main/resources/db/migrations/oracle/V9_0__dropTableTheEntity.sql @@ -0,0 +1 @@ +DROP TABLE theEntity \ No newline at end of file