-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'eu-digital-green-certificates:main' into main
- Loading branch information
Showing
50 changed files
with
2,618 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/eu/europa/ec/dgc/businessrule/DgcBusinessRuleServiceApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/eu/europa/ec/dgc/businessrule/config/ErrorHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/eu/europa/ec/dgc/businessrule/config/OpenApiConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/eu/europa/ec/dgc/businessrule/config/SchedulerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/eu/europa/ec/dgc/businessrule/config/ShedLockConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/main/java/eu/europa/ec/dgc/businessrule/config/btp/SapCredentialStoreCfEnvProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package eu.europa.ec.dgc.businessrule.config.btp; | ||
|
||
import io.pivotal.cfenv.core.CfCredentials; | ||
import io.pivotal.cfenv.core.CfService; | ||
import io.pivotal.cfenv.spring.boot.CfEnvProcessor; | ||
import io.pivotal.cfenv.spring.boot.CfEnvProcessorProperties; | ||
import java.util.Map; | ||
|
||
/** | ||
* Custom implementation of {@link CfEnvProcessor} for reading the SAP credential store parameters from the <code> | ||
* VCAP_SERVICES</code> environment variable and making them available as properties in the spring context. | ||
* <br/><br/> | ||
* The following properties are available in the context after the processor is done: | ||
* <code> | ||
* <ul> | ||
* <li>sap.btp.credstore.url</li> | ||
* <li>sap.btp.credstore.password</li> | ||
* <li>sap.btp.credstore.username</li> | ||
* <li>sap.btp.credstore.clientPrivateKey</li> | ||
* <li>sap.btp.credstore.serverPublicKey</li> | ||
* </ul> | ||
* </code> | ||
* | ||
* @see CfEnvProcessor | ||
*/ | ||
public class SapCredentialStoreCfEnvProcessor implements CfEnvProcessor { | ||
|
||
private static final String CRED_STORE_SCHEME = "credstore"; | ||
private static final String CRED_STORE_PROPERTY_PREFIX = "sap.btp.credstore"; | ||
|
||
@Override | ||
public boolean accept(CfService service) { | ||
return service.existsByTagIgnoreCase(CRED_STORE_SCHEME, "securestore", "keystore", "credentials") | ||
|| service.existsByLabelStartsWith(CRED_STORE_SCHEME) | ||
|| service.existsByUriSchemeStartsWith(CRED_STORE_SCHEME); | ||
} | ||
|
||
@Override | ||
public void process(CfCredentials cfCredentials, Map<String, Object> properties) { | ||
properties.put(CRED_STORE_PROPERTY_PREFIX + ".url", cfCredentials.getString("url")); | ||
properties.put(CRED_STORE_PROPERTY_PREFIX + ".password", cfCredentials.getString("password")); | ||
properties.put(CRED_STORE_PROPERTY_PREFIX + ".username", cfCredentials.getString("username")); | ||
|
||
@SuppressWarnings("unchecked") | ||
Map<String, Object> encryption = (Map<String, Object>) cfCredentials.getMap().get("encryption"); | ||
if (encryption == null) { | ||
// Encryption features have been disabled on this BTP instance. | ||
properties.put(CRED_STORE_PROPERTY_PREFIX + ".clientPrivateKey", "encryption-disabled"); | ||
properties.put(CRED_STORE_PROPERTY_PREFIX + ".serverPublicKey", "encryption-disabled"); | ||
return; | ||
} | ||
|
||
String clientPrivateKey = encryption.get("client_private_key").toString(); | ||
String serverPublicKey = encryption.get("server_public_key").toString(); | ||
|
||
properties.put(CRED_STORE_PROPERTY_PREFIX + ".clientPrivateKey", clientPrivateKey); | ||
properties.put(CRED_STORE_PROPERTY_PREFIX + ".serverPublicKey", serverPublicKey); | ||
} | ||
|
||
@Override | ||
public CfEnvProcessorProperties getProperties() { | ||
return CfEnvProcessorProperties.builder() | ||
.propertyPrefixes(CRED_STORE_PROPERTY_PREFIX) | ||
.serviceName("CredentialStore") | ||
.build(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/eu/europa/ec/dgc/businessrule/entity/CountryListEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/eu/europa/ec/dgc/businessrule/entity/ShedlockEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/eu/europa/ec/dgc/businessrule/entity/ValueSetEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...main/java/eu/europa/ec/dgc/businessrule/exception/DgcaBusinessRulesResponseException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/eu/europa/ec/dgc/businessrule/model/BusinessRuleItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package eu.europa.ec.dgc.businessrule.model; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class BusinessRuleItem { | ||
|
||
private String hash; | ||
|
||
private String identifier; | ||
|
||
private String version; | ||
|
||
private String country; | ||
|
||
private String rawData; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/eu/europa/ec/dgc/businessrule/model/ValueSetItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package eu.europa.ec.dgc.businessrule.model; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class ValueSetItem { | ||
|
||
private String hash; | ||
|
||
private String id; | ||
|
||
private String rawData; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/eu/europa/ec/dgc/businessrule/repository/CountryListRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.