Skip to content

Commit ec643d4

Browse files
Gematik-Entwicklungsbaulig
authored andcommitted
R2.0.0
1 parent 6e111e6 commit ec643d4

113 files changed

Lines changed: 4552 additions & 2821 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 93 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This project provides a sample implementation of the PoPP-Service and
66
PoPP-Client according to [gemSpec_PoPP_Service](https://gemspec.gematik.de/prereleases/Draft_PoPP_25_1/gemSpec_PoPP_Service_V1.0.0_CC2).
77
The [eGK-Hash-Datenbank](https://gemspec.gematik.de/prereleases/Draft_PoPP_25_1/gemSpec_PoPP_Service_V1.0.0_CC2/#6.2.1.9) is implemented as PostgresSQL database.
88

9-
You can run the components either locally or via Docker.
9+
You can run the components either locally or via Docker [Quick start](#quick-start-docker-full-profile--recommended-for-testing-with-the-virtual-card).
1010

1111
## Building and running the project locally
1212

@@ -23,7 +23,7 @@ You can run the components either locally or via Docker.
2323
*Notes*
2424

2525
- Ensure ports '8081' (PoPP-Client), `5432` (eGK-Hash-Datenbank) and `8443` (PoPP-Service) are free.
26-
- You can modify `docker-compose.yml` to fit your environment.
26+
- You can modify `compose.yaml` to fit your environment.
2727

2828
## Step-by-step guide
2929

@@ -39,6 +39,12 @@ Optionally without tests:
3939
./mvnw clean install -Dmaven.test.skip=true
4040
```
4141

42+
or
43+
44+
```bash
45+
./mvnw clean install -DskipTests=true
46+
```
47+
4248
### Configuration
4349

4450
All described configuration options must be implemented in the `application-dev.yaml` of the PoPP-Client.
@@ -57,6 +63,7 @@ cardreader:
5763
The name is case-sensitive but does not have to be complete, for example with "REINER SCT" the
5864
Standard-Kartenleser named "REINER SCT cyberJack RFID standard 1" will be found.
5965
66+
6067
#### b) Konnektor
6168
6269
**Optional: Certificates for TLS**
@@ -128,11 +135,6 @@ connector:
128135
clientSystemId: <ClientSystemId for Konnektor Context>
129136
workplaceId: <WorkplaceId for Konnektor Context>
130137
mandantId: <MandantId for Konnektor Context>
131-
soap-services:
132-
get-cards: <GetCards soap service endpoint>
133-
start-card-session: <StartCardSession soap service endpoint>
134-
stop-card-session: <StopCardSession soap service endpoint>
135-
secure-send-apdu: <SecureSendApdu soap service endpoint>
136138
```
137139
Example:
138140

@@ -153,11 +155,6 @@ connector:
153155
clientSystemId: "ClientID1"
154156
workplaceId: "Workplace1"
155157
mandantId: "Mandant1"
156-
soap-services:
157-
get-cards: "http://ws.gematik.de/conn/EventService/v7.2#GetCards"
158-
start-card-session: "http://ws.gematik.de/conn/CardService/v8.2#StartCardSession"
159-
stop-card-session: "http://ws.gematik.de/conn/CardService/v8.2#StopCardSession"
160-
secure-send-apdu: "http://ws.gematik.de/conn/CardService/v8.2#SecureSendAPDU"
161158
```
162159
163160
**Supported Konnektor functions**
@@ -168,11 +165,68 @@ connector:
168165
- `GetCards` - see [GetCards in gemSpec_Kon](https://gemspec.gematik.de/docs/gemSpec/gemSpec_Kon/latest/#4.1.6.5.2)
169166
-- If GetCards finds more than one eGK the first one is used.
170167

168+
#### c) Virtual Card
169+
170+
If you want to use a virtual card instead a card reader or Konnektor you can configure it as follows.
171+
This allows testing without any card-related hardware.
172+
The card data will be read from the XML image file specified.
173+
174+
```yaml
175+
virtual-card:
176+
image-file: <XML image file>
177+
```
178+
171179
## Execution
172180

181+
### Quick start (Docker, full profile – recommended for testing with the virtual card)
182+
183+
184+
For a quick **out-of-the-box setup** (including **PoPP-Client**, **PoPP-Service**, and the **eGK-Hash-Datenbank**),
185+
this project provides a Docker Compose **`full` profile**.
186+
187+
This mode is especially useful for:
188+
189+
- testing the **virtual card**
190+
- running the complete PoPP stack without card readers or a Konnektor
191+
192+
#### 1. Build Docker images via Maven
193+
194+
Docker images are built as part of the Maven build.
195+
Make sure Docker image creation is **enabled**:
196+
197+
```bash
198+
./mvnw clean install -Dskip.dockerbuild=false
199+
```
200+
This step builds the Docker images `local/popp/popp-server:<version>` and `local/popp/popp-client:<version>`.
201+
202+
#### 2. Start the full stack via Docker Compose
203+
204+
```bash
205+
docker compose -f docker/compose.yaml --profile full up
206+
```
207+
208+
This starts:
209+
210+
- PoPP-Server
211+
- eGK-Hash-Datenbank (PostgreSQL)
212+
- PoPP-Client (without card reader/Konnektor, using virtual card)
213+
214+
#### 3. Verify startup
215+
216+
Once all containers are running, the following endpoints are available:
217+
218+
- PoPP-Client Swagger UI: <http://localhost:8081/swagger-ui.html>
219+
220+
#### 4. Testing with a virtual card
221+
222+
The full Docker profile is intended to be used together with the virtual card configuration. You can test it via the
223+
Swagger-Ui with the `/token` endpoint as described below with the communication type `contact-virtual`.
224+
225+
This allows testing PoPP flows without any card-related hardware.
226+
173227
### Start the eGK-Hash-Datenbank
174228

175-
Before running the PoPP-Service, you need to start the eGK-Hash-Datenbank.
229+
If you want to run the PoPP-Service with out Docker, you need to start the eGK-Hash-Datenbank.
176230

177231
```bash
178232
cd popp-server/docker && docker compose --file postgres-dev.yaml up
@@ -244,9 +298,20 @@ To execute the tests for a specific module, use the `-pl` option to specify the
244298

245299
## Generate a PoPP-Token
246300

247-
The client provides the following endpoint to generate a PoPP-Token:
301+
The client provides the following POST endpoint to generate a PoPP-Token:
248302

249-
`http://localhost:8081/token/{communication-type}?clientsessionid={client-session-id} `
303+
```
304+
POST http://localhost:8081/token
305+
```
306+
307+
With Request Body:
308+
309+
```json
310+
{
311+
"communicationType": "<one of the supported types>",
312+
"clientSessionId": "<optional>"
313+
}
314+
```
250315

251316
The request parameter `clientsessionid` is optional. If set, the `clientsessionid` will overwrite the Konnektor `clientsessionid` from `StartCardSession`
252317

@@ -256,23 +321,29 @@ The communication type must be one of the following:
256321
- use contact-based interface from Standard-Kartenleser
257322
- `contactless-standard`
258323
- use contactless interface from Standard-Kartenleser
324+
- `contact-virtual`
325+
- use a virtual card from a card image file, no card reader needed
259326
- `contact-connector`
260327
- use contact-based interface from eHealth-Kartenterminal via Konnektor
261-
- *Note: if the client was started with mock configuration (see above) the scenario is simulated without any terminal and just with static APDUs*
262328
- `contactless-connector`
263329
- use contactless interface from eHealth-Kartenterminal via Konnektor
264330
- `contact-connector-via-standard-terminal`
265-
- generate sample messages for Konnektor via contact-based interface from Standard-Kartenleser
331+
- generate sample messages for Konnektor via contact-based interface from Standard-Kartenleser \
266332

267333
### Example usage
268334

269-
To generate a PoPP-Token with `contact-standard` option, open the following URL in your browser:
270-
[http://localhost:8081/token/contact-standard](http://localhost:8081/token/contact-standard)
335+
To generate a PoPP token, you can use the Swagger UI. Open the following URL in your browser:
336+
[http://localhost:8081/swagger-ui.html](http://localhost:8081/swagger-ui.html)
271337

272-
Alternatively, you can use this `curl` command in the terminal:
338+
Alternatively, you can use this `curl` command in the terminal, e.g.:
273339

274340
```bash
275-
curl http://localhost:8081/token/contact-standard
341+
curl -X POST http://localhost:8081/token \
342+
-H "Content-Type: application/json" \
343+
-d '{
344+
"communicationType": "contact-standard",
345+
"clientSessionId": "123456"
346+
}'
276347
```
277348

278349
To view the generated PoPP-Token, check the console output of the client.
@@ -291,7 +362,7 @@ For PoPP-Token claims see [api-popp](https://github.com/gematik/api-popp/blob/ma
291362

292363
## License
293364

294-
Copyright 2025-2025 gematik GmbH
365+
Copyright 2025-2026 gematik GmbH
295366

296367
Apache License, Version 2.0
297368

ReleaseNotes.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,24 @@
22

33
# Release Notes popp-sample-code
44

5-
### Known Issues
5+
## Release 2.0.0
6+
7+
### changed
8+
9+
- API change: The PoPP token is now returned in the REST response.
10+
- API break: To generate a PoPP token, use the following POST endpoint instead of GET:
11+
`POST http://localhost:8081/token`
12+
See `README.md` for the required request body.
13+
- You no longer need to specify the SOAP services in `application.yaml`; the versions are now read from `connector.sds`.
14+
- Virtual card images are now supported.
15+
See `README.md` for details.
16+
-
17+
18+
19+
### fixed
20+
21+
- it is now possible to skip tests with -DskipTests=true
22+
- Postgres service is starting via docker compose [Issue 13](https://github.com/gematik/popp-sample-code/issues/13)
623

724
## Release 1.0.3
825

docker/compose.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
services:
2+
popp-client:
3+
profiles: [ "full" ]
4+
image: local/popp/popp-client:1.0.4-SNAPSHOT
5+
container_name: popp-client
6+
environment:
7+
- POPP_SERVER_URL=wss://popp-server:8443/ws
8+
networks:
9+
- popp-network
10+
ports:
11+
- "8081:8081"
12+
depends_on:
13+
- popp-server
14+
15+
popp-server:
16+
image: local/popp/popp-server:2.0.0
17+
container_name: popp-server
18+
ports:
19+
- "8443:8443"
20+
environment:
21+
- IDENTITIES_LOCATION=classpath:identities
22+
- CERT_HASH_IMPORT_LOCATION=file:/app/import
23+
- SPRING_DATASOURCE_URL=jdbc:postgresql://popp-server-db:5432/egk_hash_db
24+
networks:
25+
- popp-network
26+
depends_on:
27+
- popp-server-db
28+
29+
popp-server-db:
30+
image: postgres:18-alpine
31+
container_name: popp-server-db
32+
environment:
33+
POSTGRES_USER: poppserver
34+
POSTGRES_PASSWORD: verysafe
35+
POSTGRES_DB: egk_hash_db
36+
ports:
37+
- "5432:5432"
38+
volumes:
39+
- popp-server-db-data:/var/lib/postgresql
40+
restart: on-failure
41+
networks:
42+
- popp-network
43+
44+
volumes:
45+
popp-server-db-data:
46+
47+
networks:
48+
popp-network:
49+
name: popp-network
50+
driver: bridge

docker/docker-compose.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

images/PoPP_Beispielnachrichten_Konnektor.drawio.svg

Lines changed: 1 addition & 1 deletion
Loading

images/PoPP_Token_Konnektor.drawio.svg

Lines changed: 1 addition & 1 deletion
Loading

images/PoPP_Token_Standard_Kartenleser.drawio.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)