diff --git a/pom.xml b/pom.xml index 922759c..ad59140 100644 --- a/pom.xml +++ b/pom.xml @@ -4,9 +4,16 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + + org.springframework.cloud + spring-cloud-starter-parent + 2022.0.1 + + + eu.europa.ec.dgc dgc-lib - latest + 2.0.0 jar dgc-lib @@ -17,15 +24,13 @@ - 11 - 11 + 17 + 17 UTF-8 UTF-8 7.3.0 - 2.7.5 - 3.1.4 11.10 1.70 1.18.24 @@ -74,7 +79,6 @@ org.springframework.boot spring-boot-starter-web - ${spring.boot.version} true @@ -96,13 +100,11 @@ org.springframework.boot spring-boot-configuration-processor - ${spring.boot.version} true org.springframework.cloud spring-cloud-starter-openfeign - ${spring.cloud.version} org.springframework @@ -162,7 +164,6 @@ org.springframework.boot spring-boot-starter-test test - ${spring.boot.version} com.squareup.okhttp3 @@ -293,7 +294,7 @@ org.springframework.boot spring-boot-configuration-processor - ${spring.boot.version} + ${project.parent.parent.version} diff --git a/src/main/java/eu/europa/ec/dgc/DgcLibAutoConfiguration.java b/src/main/java/eu/europa/ec/dgc/DgcLibAutoConfiguration.java index 14be84b..605ea32 100644 --- a/src/main/java/eu/europa/ec/dgc/DgcLibAutoConfiguration.java +++ b/src/main/java/eu/europa/ec/dgc/DgcLibAutoConfiguration.java @@ -20,11 +20,12 @@ package eu.europa.ec.dgc; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; -@Configuration +@AutoConfiguration @ComponentScan("eu.europa.ec.dgc") @EnableConfigurationProperties public class DgcLibAutoConfiguration { diff --git a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayConnectorUtils.java b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayConnectorUtils.java index 7da1edf..1dcb708 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayConnectorUtils.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayConnectorUtils.java @@ -33,6 +33,7 @@ import eu.europa.ec.dgc.signing.SignedStringMessageParser; import eu.europa.ec.dgc.utils.CertificateUtils; import feign.FeignException; +import jakarta.annotation.PostConstruct; import java.io.IOException; import java.io.Serializable; import java.nio.charset.StandardCharsets; @@ -48,7 +49,6 @@ import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; -import javax.annotation.PostConstruct; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; @@ -217,7 +217,7 @@ public List fetchCertificatesAndVerifyByTrustAnchor(Certi if (downloadedCertificates.getStatusCode() != HttpStatus.OK || downloadedCertificates.getBody() == null) { log.error("Failed to Download certificates from DGC Gateway, Type: {}, Status Code: {}", - type, downloadedCertificates.getStatusCodeValue()); + type, downloadedCertificates.getStatusCode()); return Collections.emptyList(); } @@ -249,7 +249,7 @@ public List fetchTrustedIssuersAndVerifyByTrustAnchor( if (responseEntity.getStatusCode() != HttpStatus.OK || downloadedTrustedIssuers == null) { throw new DgcGatewayConnectorUtils.DgcGatewayConnectorException( - responseEntity.getStatusCodeValue(), "Download of TrustedIssuers failed."); + responseEntity.getStatusCode().value(), "Download of TrustedIssuers failed."); } else { log.info("Got Response from DGCG, Downloaded TrustedIssuers: {}", downloadedTrustedIssuers.size()); diff --git a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayCountryListDownloadConnector.java b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayCountryListDownloadConnector.java index f88a288..b48ea0e 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayCountryListDownloadConnector.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayCountryListDownloadConnector.java @@ -23,13 +23,13 @@ import eu.europa.ec.dgc.gateway.connector.client.DgcGatewayConnectorRestClient; import eu.europa.ec.dgc.gateway.connector.config.DgcGatewayConnectorConfigProperties; import feign.FeignException; +import jakarta.annotation.PostConstruct; import java.security.Security; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import javax.annotation.PostConstruct; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayDownloadConnector.java b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayDownloadConnector.java index 801408e..fcfc6dc 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayDownloadConnector.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayDownloadConnector.java @@ -28,6 +28,7 @@ import eu.europa.ec.dgc.gateway.connector.model.TrustListItem; import eu.europa.ec.dgc.signing.SignedCertificateMessageParser; import feign.FeignException; +import jakarta.annotation.PostConstruct; import java.security.Security; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; @@ -37,7 +38,6 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import javax.annotation.PostConstruct; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayRevocationListUploadConnector.java b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayRevocationListUploadConnector.java index 4520162..75860fa 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayRevocationListUploadConnector.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayRevocationListUploadConnector.java @@ -31,6 +31,7 @@ import eu.europa.ec.dgc.signing.SignedStringMessageBuilder; import eu.europa.ec.dgc.utils.CertificateUtils; import feign.FeignException; +import jakarta.annotation.PostConstruct; import java.io.IOException; import java.security.KeyStore; import java.security.KeyStoreException; @@ -39,7 +40,6 @@ import java.security.UnrecoverableKeyException; import java.security.cert.CertificateEncodingException; import java.security.cert.X509Certificate; -import javax.annotation.PostConstruct; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayTrustedIssuerDownloadConnector.java b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayTrustedIssuerDownloadConnector.java index 2263dbb..01a5265 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayTrustedIssuerDownloadConnector.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayTrustedIssuerDownloadConnector.java @@ -23,6 +23,7 @@ import eu.europa.ec.dgc.gateway.connector.config.DgcGatewayConnectorConfigProperties; import eu.europa.ec.dgc.gateway.connector.model.QueryParameter; import eu.europa.ec.dgc.gateway.connector.model.TrustedIssuer; +import jakarta.annotation.PostConstruct; import java.io.Serializable; import java.security.Security; import java.time.LocalDateTime; @@ -31,7 +32,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; -import javax.annotation.PostConstruct; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayUploadConnector.java b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayUploadConnector.java index ed7f075..04883ba 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayUploadConnector.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayUploadConnector.java @@ -28,6 +28,7 @@ import eu.europa.ec.dgc.signing.SignedCertificateMessageBuilder; import eu.europa.ec.dgc.utils.CertificateUtils; import feign.FeignException; +import jakarta.annotation.PostConstruct; import java.io.IOException; import java.security.KeyStore; import java.security.KeyStoreException; @@ -36,7 +37,6 @@ import java.security.UnrecoverableKeyException; import java.security.cert.CertificateEncodingException; import java.security.cert.X509Certificate; -import javax.annotation.PostConstruct; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayValidationRuleUploadConnector.java b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayValidationRuleUploadConnector.java index 613afb7..5ba3eae 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayValidationRuleUploadConnector.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayValidationRuleUploadConnector.java @@ -28,6 +28,7 @@ import eu.europa.ec.dgc.signing.SignedStringMessageBuilder; import eu.europa.ec.dgc.utils.CertificateUtils; import feign.FeignException; +import jakarta.annotation.PostConstruct; import java.io.IOException; import java.security.KeyStore; import java.security.KeyStoreException; @@ -36,7 +37,6 @@ import java.security.UnrecoverableKeyException; import java.security.cert.CertificateEncodingException; import java.security.cert.X509Certificate; -import javax.annotation.PostConstruct; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/resources/META-INF/spring.factories b/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 2ac5bc2..0000000 --- a/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=eu.europa.ec.dgc.DgcLibAutoConfiguration diff --git a/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..bd2794c --- /dev/null +++ b/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +eu.europa.ec.dgc.DgcLibAutoConfiguration