Skip to content

Commit

Permalink
Merge branch 'dev' into 140-wahltag-kann-abgerufen-werden
Browse files Browse the repository at this point in the history
  • Loading branch information
Nic12345678 committed Jul 12, 2024
2 parents 2b26d3a + 5b0db8b commit 9a8f869
Show file tree
Hide file tree
Showing 186 changed files with 7,071 additions and 401 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
distribution: 'temurin'

- name: build jar without tests
run: mvn -B -ntp -DskipTests package -f ${{ inputs.service }}/pom.xml
run: mvn -B -ntp -DskipTests verify -f ${{ inputs.service }}/pom.xml

- name: Create GitHub Release
id: create_release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dispatch-microservice-mvn-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
with:
tag: ${{ github.event.inputs.service }}/${{ github.event.inputs.release-version }}
service: ${{ github.event.inputs.service }}
files: ${{ inputs.service }}/target/*.jar
files: "${{ github.event.inputs.service }}/target/*.jar\n${{ github.event.inputs.service }}/target/openapi.json"

build-github-container-image:
permissions:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ See the [open issues](https://github.com/it-at-m/Wahllokalsystem/issues) for a f

## Documentation

*comming soon during the development*
We use [VitePress](https://vitepress.dev/) for our documentation. The sources for the documentation is also part of
this repository. After building the documentation is accessible via https://it-at-m.github.io/Wahllokalsystem/.

## Contributing

Expand Down
9 changes: 8 additions & 1 deletion docs/src/features/basisdaten-service/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ Service zur Bereitstellung folgender Basisdaten:
- Wahlbezirke
- Wahlvorschläge
- Kopfdaten
- Handbuch

Wahlen, Wahlbezirke und Kopfdaten können in der Service-Datenbank gespeichert werden.

## Abhängigkeiten

Folgende Services werden zum Betrieb benötigt:
- EAI-Service
- Infomanagement-Service
- Infomanagement-Service

## Handbuch

In dem Service werden Handbücher verwaltet. Je Wahl und Wahlbezirkart kann ein Handbuch hinterlegt werden.

Bei dem Handbuch soll es sich um ein PDF-Dokument handeln.
14 changes: 13 additions & 1 deletion docs/src/features/eai-service/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,16 @@ Wahlbeteiligungen der Wahllokale kann mitgeteilt werden.

### Wahllokalstatus

Der Zustand in dem sich die Wahllokale befinden kann mitgeteilt werden.
Der Zustand in dem sich die Wahllokale befinden kann mitgeteilt werden.

## Zugriffsbeschränkungen

Übersicht über die Endpunkte und die dafür benötigten Rechte:

| Endpunkt | erforderliche Rechte |
| --- | --- |
| GET /wahldaten/wahlbezirke/{wahlbezirkID}/wahlberechtigte | aoueai_BUSINESSACTION_LoadWahlberechtigte
| GET /wahldaten/wahltage?includingSince | aoueai_BUSINESSACTION_LoadWahltage
| GET /wahldaten/wahlbezirk?forDate&withNummer | aoueai_BUSINESSACTION_LoadWahlbezirke
| GET /wahldaten/wahlen?forDate&withNummer | aoueai_BUSINESSACTION_LoadWahlen
| GET /wahldaten/basisdaten?forDate&withNummer | aoueai_BUSINESSACTION_LoadBasisdaten
10 changes: 9 additions & 1 deletion stack/.env
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ WLS_INFOMANAGEMENT_SERVICE_KEYCLOAK_URL=http://kubernetes.docker.internal:8100/a

WLS_BRIEFWAHL_SERVICE_PROFILE=local,db-oracle
WLS_BRIEFWAHL_SERVICE_DB_URL=jdbc:oracle:thin:@//wls-db-oracle:1521/XEPDB1
WLS_BRIEFWAHL_SERVICE_KEYCLOAK_URL=http://kubernetes.docker.internal:8100/auth/realms/${SSO_REALM}/protocol/openid-connect
WLS_BRIEFWAHL_SERVICE_KEYCLOAK_URL=http://kubernetes.docker.internal:8100/auth/realms/${SSO_REALM}/protocol/openid-connect

WLS_WAHLVORBEREITUNG_SERVICE_PROFILE=local,db-oracle,dummy.nobezirkid.check
WLS_WAHLVORBEREITUNG_SERVICE_DB_URL=jdbc:oracle:thin:@//wls-db-oracle:1521/XEPDB1
WLS_WAHLVORBEREITUNG_SERVICE_KEYCLOAK_URL=http://kubernetes.docker.internal:8100/auth/realms/${SSO_REALM}/protocol/openid-connect

WLS_EAI_SERVICE_PROFILE=local,db-oracle,db-dummydata
WLS_EAI_SERVICE_DB_URL=jdbc:oracle:thin:@//wls-db-oracle:1521/XEPDB1
WLS_EAI_SERVICE_KEYCLOAK_URL=http://kubernetes.docker.internal:8100/auth/realms/${SSO_REALM}/protocol/openid-connect
47 changes: 44 additions & 3 deletions stack/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ services:
- SPRING_DATASOURCE_URL=${WLS_BROADCAST_SERVICE_DB_URL}
- SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK-SET-URI=${WLS_BROADCAST_SERVICE_KEYCLOAK_URL}/certs
- SECURITY_OAUTH2_RESOURCE_USER-INFO-URI=${WLS_BROADCAST_SERVICE_KEYCLOAK_URL}/userinfo
- SERVER_PORT=8080
ports:
- 8200:39146
- 8200:8080
networks:
- services
- keycloak
Expand All @@ -32,8 +33,9 @@ services:
- SPRING_DATASOURCE_URL=${WLS_INFOMANAGEMENT_SERVICE_DB_URL}
- SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK-SET-URI=${WLS_INFOMANAGEMENT_SERVICE_KEYCLOAK_URL}/certs
- SECURITY_OAUTH2_RESOURCE_USER-INFO-URI=${WLS_INFOMANAGEMENT_SERVICE_KEYCLOAK_URL}/userinfo
- SERVER_PORT=8080
ports:
- 8201:39146
- 8201:8080
networks:
- services
- keycloak
Expand All @@ -50,8 +52,47 @@ services:
- SPRING_DATASOURCE_URL=${WLS_BRIEFWAHL_SERVICE_DB_URL}
- SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK-SET-URI=${WLS_BRIEFWAHL_SERVICE_KEYCLOAK_URL}/certs
- SECURITY_OAUTH2_RESOURCE_USER-INFO-URI=${WLS_BRIEFWAHL_SERVICE_KEYCLOAK_URL}/userinfo
- SERVER_PORT=8080
ports:
- 8202:39146
- 8202:8080
networks:
- services
- keycloak

wls-wahlvorbereitung-service:
container_name: wls-wahlvorbereitung-service
image: ghcr.io/it-at-m/wahllokalsystem-wls-wahlvorbereitung-service:latest
depends_on:
- wls-db-oracle
env_file:
- .env
environment:
- SPRING_PROFILES_ACTIVE=${WLS_WAHLVORBEREITUNG_SERVICE_PROFILE}
- SPRING_DATASOURCE_URL=${WLS_WAHLVORBEREITUNG_SERVICE_DB_URL}
- SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK-SET-URI=${WLS_WAHLVORBEREITUNG_SERVICE_KEYCLOAK_URL}/certs
- SECURITY_OAUTH2_RESOURCE_USER-INFO-URI=${WLS_WAHLVORBEREITUNG_SERVICE_KEYCLOAK_URL}/userinfo
- SERVER_PORT=8080
ports:
- 8203:8080
networks:
- services
- keycloak

wls-eai-service:
container_name: wls-eai-service
image: ghcr.io/it-at-m/wahllokalsystem-wls-eai-service:latest
depends_on:
- wls-db-oracle
env_file:
- .env
environment:
- SPRING_PROFILES_ACTIVE=${WLS_EAI_SERVICE_PROFILE}
- SPRING_DATASOURCE_URL=${WLS_EAI_SERVICE_DB_URL}
- SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK-SET-URI=${WLS_EAI_SERVICE_KEYCLOAK_URL}/certs
- SECURITY_OAUTH2_RESOURCE_USER-INFO-URI=${WLS_EAI_SERVICE_KEYCLOAK_URL}/userinfo
- SERVER_PORT=8080
ports:
- 8300:8080
networks:
- services
- keycloak
Expand Down
48 changes: 48 additions & 0 deletions stack/keycloak/migration/add-authorities-basisdaten-handbuch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
id: add authorities basisdaten handbuch
author: MrSebastian
realm: ${SSO_REALM}
changes:
- addRole:
name: Basisdaten_BUSINESSACTION_GetHandbuch
clientRole: true
clientId: ${SSO_CLIENT_ID}
- assignRoleToGroup:
group: allBasisdatenAuthorities
role: Basisdaten_BUSINESSACTION_GetHandbuch
clientId: ${SSO_CLIENT_ID}

- addRole:
name: Basisdaten_BUSINESSACTION_PostHandbuch
clientRole: true
clientId: ${SSO_CLIENT_ID}
- assignRoleToGroup:
group: allBasisdatenAuthorities
role: Basisdaten_BUSINESSACTION_PostHandbuch
clientId: ${SSO_CLIENT_ID}

- addRole:
name: Basisdaten_READ_Handbuch
clientRole: true
clientId: ${SSO_CLIENT_ID}
- assignRoleToGroup:
group: allBasisdatenAuthorities
role: Basisdaten_READ_Handbuch
clientId: ${SSO_CLIENT_ID}

- addRole:
name: Basisdaten_WRITE_Handbuch
clientRole: true
clientId: ${SSO_CLIENT_ID}
- assignRoleToGroup:
group: allBasisdatenAuthorities
role: Basisdaten_WRITE_Handbuch
clientId: ${SSO_CLIENT_ID}

- addRole:
name: Basisdaten_DELETE_Handbuch
clientRole: true
clientId: ${SSO_CLIENT_ID}
- assignRoleToGroup:
group: allBasisdatenAuthorities
role: Basisdaten_DELETE_Handbuch
clientId: ${SSO_CLIENT_ID}
48 changes: 48 additions & 0 deletions stack/keycloak/migration/add-authorities-eai-wahldaten.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
id: add authorities eai wahldaten
author: MrSebastian
realm: ${SSO_REALM}
changes:
- addRole:
name: aoueai_BUSINESSACTION_LoadWahltage
clientRole: true
clientId: ${SSO_CLIENT_ID}
- assignRoleToGroup:
group: allEaiAuthorities
role: aoueai_BUSINESSACTION_LoadWahltage
clientId: ${SSO_CLIENT_ID}

- addRole:
name: aoueai_BUSINESSACTION_LoadWahlen
clientRole: true
clientId: ${SSO_CLIENT_ID}
- assignRoleToGroup:
group: allEaiAuthorities
role: aoueai_BUSINESSACTION_LoadWahlen
clientId: ${SSO_CLIENT_ID}

- addRole:
name: aoueai_BUSINESSACTION_LoadWahlbezirke
clientRole: true
clientId: ${SSO_CLIENT_ID}
- assignRoleToGroup:
group: allEaiAuthorities
role: aoueai_BUSINESSACTION_LoadWahlbezirke
clientId: ${SSO_CLIENT_ID}

- addRole:
name: aoueai_BUSINESSACTION_LoadWahlberechtigte
clientRole: true
clientId: ${SSO_CLIENT_ID}
- assignRoleToGroup:
group: allEaiAuthorities
role: aoueai_BUSINESSACTION_LoadWahlberechtigte
clientId: ${SSO_CLIENT_ID}

- addRole:
name: aoueai_BUSINESSACTION_LoadBasisdaten
clientRole: true
clientId: ${SSO_CLIENT_ID}
- assignRoleToGroup:
group: allEaiAuthorities
role: aoueai_BUSINESSACTION_LoadBasisdaten
clientId: ${SSO_CLIENT_ID}
28 changes: 28 additions & 0 deletions stack/keycloak/migration/add-authorities-eai-wahlvorschlag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
id: add authorities eai wahlvorschlag
author: dragonfly28
realm: ${SSO_REALM}
changes:
- addRole:
name: aoueai_BUSINESSACTION_LoadWahlvorschlaege
clientRole: true
clientId: ${SSO_CLIENT_ID}
- assignRoleToGroup:
group: allEaiAuthorities
role: aoueai_BUSINESSACTION_LoadWahlvorschlaege
clientId: ${SSO_CLIENT_ID}
- addRole:
name: aoueai_BUSINESSACTION_LoadWahlvorschlaegeListe
clientRole: true
clientId: ${SSO_CLIENT_ID}
- assignRoleToGroup:
group: allEaiAuthorities
role: aoueai_BUSINESSACTION_LoadWahlvorschlaegeListe
clientId: ${SSO_CLIENT_ID}
- addRole:
name: aoueai_BUSINESSACTION_LoadReferendumvorlagen
clientRole: true
clientId: ${SSO_CLIENT_ID}
- assignRoleToGroup:
group: allEaiAuthorities
role: aoueai_BUSINESSACTION_LoadReferendumvorlagen
clientId: ${SSO_CLIENT_ID}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ changes:
role: Wahlvorbereitung_BUSINESSACTION_PostBriefwahlvorbereitung
clientId: ${SSO_CLIENT_ID}

- addRole:
name: Wahlvorbereitung_READ_Briefwahlvorbereitung
clientRole: true
clientId: ${SSO_CLIENT_ID}
- assignRoleToGroup:
group: allWahlvorbereitungAuthorities
role: Wahlvorbereitung_READ_Briefwahlvorbereitung
clientId: ${SSO_CLIENT_ID}

- addRole:
name: Wahlvorbereitung_WRITE_Briefwahlvorbereitung
clientRole: true
Expand Down
5 changes: 4 additions & 1 deletion stack/keycloak/migration/keycloak-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ includes:
- path: add-authorities-eai-wahlvorstand.yml
- path: add-authorities-wahlvorbereitung-briefwahlvorbereitung.yml
- path: create-group-all-basisdaten-authorities.yml
- path: add-authorities-basisdaten-wahlvorschlaege.yml
- path: add-authorities-basisdaten-wahlvorschlaege.yml
- path: add-authorities-eai-wahlvorschlag.yml
- path: add-authorities-eai-wahldaten.yml
- path: add-authorities-basisdaten-handbuch.yml
31 changes: 31 additions & 0 deletions wls-auth-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,18 @@
<goal>repackage</goal>
</goals>
</execution>
<execution>
<id>pre-integration-test</id>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>post-integration-test</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
Expand Down Expand Up @@ -429,6 +441,25 @@
</dependency>
</dependencies>
</plugin>
<!-- OpenApi -->
<plugin>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<apiDocsUrl>http://localhost:8080/v3/api-docs</apiDocsUrl>
<outputFileName>openapi.json</outputFileName>
<outputDir>${project.build.directory}</outputDir>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package de.muenchen.oss.wahllokalsystem.basisdatenservice.domain;

import jakarta.persistence.EmbeddedId;
import jakarta.persistence.Entity;
import jakarta.persistence.Lob;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

@Entity
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
@ToString(onlyExplicitlyIncluded = true)
public class Handbuch {

@EmbeddedId
@ToString.Include
private WahltagIdUndWahlbezirksart wahltagIdUndWahlbezirksart;

@NotNull
@Lob
private byte[] handbuch;
}
Loading

0 comments on commit 9a8f869

Please sign in to comment.