Skip to content

Commit

Permalink
context file config (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-trzewik committed May 17, 2021
1 parent d28f1d7 commit b06f639
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM adoptopenjdk:11-jre-hotspot
COPY ./target/*.jar /app/app.jar
COPY ./certs/test.jks /app/certs/test.jks
COPY ./context/context.json /app/context/context.json
WORKDIR /app
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar ./app.jar" ]
27 changes: 27 additions & 0 deletions context/context.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"origin": "DE",
"versions": {
"default": {
"privacyUrl": "https://publications.europa.eu/en/web/about-us/legal-notices/eu-mobile-apps",
"context": {
"url": "https://dgca-issuance-web.cfapps.eu10.hana.ondemand.com/dgca-issuance-service/context",
"pubKeys": [
"lKdU1EbQubxyDDm2q3N8KclZ2C94Num3xXjG0pk+3eI=",
"r/mIkG3eEpVdm+u/ko/cwxzOMo1bk4TyHIlByibiA5E="
]
},
"endpoints": {
"claim": {
"url": "https://dgca-issuance-web.cfapps.eu10.hana.ondemand.com/dgca-issuance-service/dgci/wallet/claim",
"pubKeys": [
"lKdU1EbQubxyDDm2q3N8KclZ2C94Num3xXjG0pk+3eI=",
"r/mIkG3eEpVdm+u/ko/cwxzOMo1bk4TyHIlByibiA5E="
]
}
}
},
"0.1.0": {
"outdated": true
}
}
}
30 changes: 30 additions & 0 deletions context/context.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
// Origin in ISO alpha 2 code:
"origin": "DE",
"versions": {
"default": {
// catch-all for normal versions
"privacyUrl": "https://publications.europa.eu/en/web/about-us/legal-notices/eu-mobile-apps",
"context": {
"url": "https://dgca-issuance-web.cfapps.eu10.hana.ondemand.com/dgca-issuance-service/context",
"pubKeys": [
"lKdU1EbQubxyDDm2q3N8KclZ2C94Num3xXjG0pk+3eI=",
"r/mIkG3eEpVdm+u/ko/cwxzOMo1bk4TyHIlByibiA5E="
]
},
"endpoints": {
"claim": {
"url": "https://dgca-issuance-web.cfapps.eu10.hana.ondemand.com/dgca-issuance-service/dgci/wallet/claim",
"pubKeys": [
"lKdU1EbQubxyDDm2q3N8KclZ2C94Num3xXjG0pk+3eI=",
"r/mIkG3eEpVdm+u/ko/cwxzOMo1bk4TyHIlByibiA5E="
]
}
}
},
"0.1.0": {
// Example for a version that is insecure and shouldn't start.
"outdated": true
}
}
}
9 changes: 9 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ The default database is in-memory H2 database and is usable for development only
In the spring profile "cloud" see src/main/resources/application-cloud.yml there are example postgres database configured.
Consult [spring boot manuals](https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto-data-access)

# Context File
Context file is used by wallet app for url pinning. It will be server at /context endpoint without any other modification.
If the context file is not configured and empty context json will be returned.

```
issuance:
context: context.json
```

# Configuring Connection to EDGC Gateway
The connection to EDGC is optional.
The application uses DGC Gateway connector from dgc-lib to configure and use the dgc-gateway.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void loadContextFile() {
JsonNodeFactory jsonNodeFactory = JsonNodeFactory.instance;
ObjectNode contextObj = jsonNodeFactory.objectNode();
contextObj.set("Origin", jsonNodeFactory.textNode(issuanceConfigProperties.getCountryCode()));
contextObj.set("claimEndpoints", jsonNodeFactory.arrayNode());
contextObj.set("versions", jsonNodeFactory.objectNode());
contextDefinition = contextObj;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ issuance:
privateKeyPassword: dgca
countryCode: DE
tanExpirationHours: 2
contextFile: context/context.json
expiration:
vaccination: 365
recoverty: 365
Expand Down

0 comments on commit b06f639

Please sign in to comment.