diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ed250d0..c0c63999 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ All notable changes to this project will be documented in this file. ### Patch Change: Infomodel Maintenance - Update infomodel artifacts: java (v5.0.0), serializer (v5.0.0), interaction (v5.0.0) ([PR 545](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/pull/545)) +### Patch Change: Other +- Added spring validation to ConfigProperties ([PR 533](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/pull/533)) + ### Patch Change: Dependency Maintenance - Upgrade: com.puppycrawl.tools:checkstyle 10.2 -> 10.3 ([PR 539](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/pull/539)) - Upgrade: org.springframework:spring-web 5.3.20 -> 5.3.21 ([PR 561](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/pull/561)) diff --git a/core/src/main/java/ids/messaging/core/config/ConfigProperties.java b/core/src/main/java/ids/messaging/core/config/ConfigProperties.java index 189bc31b..09240d27 100644 --- a/core/src/main/java/ids/messaging/core/config/ConfigProperties.java +++ b/core/src/main/java/ids/messaging/core/config/ConfigProperties.java @@ -15,24 +15,30 @@ * * Contributors: * sovity GmbH + * Fraunhofer Institute for Transportation and Infrastructure Systems * */ package ids.messaging.core.config; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.validation.annotation.Validated; + +import javax.validation.constraints.NotNull; /** * Set of Properties to configure the imported configuration at startup. * Properties should be added to the application.properties file. */ @Data +@Validated @ConfigurationProperties(prefix = "configuration") public class ConfigProperties { /** * Path to a configuration File (JsonLD representation of * a {@link de.fraunhofer.iais.eis.ConfigurationModel}. */ + @NotNull private String path; /** @@ -40,16 +46,19 @@ public class ConfigProperties { * {@link de.fraunhofer.iais.eis.ConfigurationModel} keyStore field. */ + @NotNull private String keyStorePassword; /** * Alias of the connectors private key (used for signing DAT Requests). */ + @NotNull private String keyAlias; /** * Password for the IDSTruststore configured in the * {@link de.fraunhofer.iais.eis.ConfigurationModel} trustStore field. */ + @NotNull private String trustStorePassword; }