From a1268175521329051370b9e412ea78fe1eed3635 Mon Sep 17 00:00:00 2001 From: Milan Panik <5015486+mpanik@users.noreply.github.com> Date: Thu, 22 Feb 2024 13:32:17 -0500 Subject: [PATCH] [#186993968] Update to JDK21 and Spring Boot 3 --- ci/e2e-tests/Dockerfile | 13 +- ci/impl/Dockerfile | 4 +- e2e-tests/pom.xml | 96 ++++----- pom.xml | 195 +++++++++--------- .../com/dnastack/wes/api/WesV1Controller.java | 2 +- .../wes/cromwell/CromwellWesMapper.java | 2 +- .../dnastack/wes/registry/Ga4ghService.java | 2 +- .../dnastack/wes/registry/Organization.java | 2 +- .../dnastack/wes/registry/ServiceType.java | 2 +- .../wes/security/BasicAuthSecurityConfig.java | 40 ++-- .../wes/security/NoAuthSecurityConfig.java | 19 +- .../wes/security/OAuthSecurityConfig.java | 45 ++-- .../PassportSecurityConfiguration.java | 6 +- .../dnastack/wes/security/XForwardUtil.java | 2 +- .../wes/storage/AzureBlobStorageClient.java | 12 +- .../wes/storage/BlobStorageClient.java | 2 +- .../workflow/ChecksumWorkflowAuthorizer.java | 2 +- src/main/resources/application.yaml | 6 +- 18 files changed, 220 insertions(+), 232 deletions(-) diff --git a/ci/e2e-tests/Dockerfile b/ci/e2e-tests/Dockerfile index dab4848..e3b99f6 100644 --- a/ci/e2e-tests/Dockerfile +++ b/ci/e2e-tests/Dockerfile @@ -6,7 +6,8 @@ # This stage depends on a JDK image and uses Maven Wrapper to pull in dependencies and build the project # from source. -FROM amazoncorretto:17-alpine AS build +FROM amazoncorretto:21-al2023 AS build + ARG APP_NAME ARG APP_VERSION @@ -47,10 +48,7 @@ RUN ./mvnw -P -dnastack -B -o process-test-classes # This stage uses a JRE rather than JDK because it doesn't have to build anything; it just runs the fat jar # produced by the previous stage. -FROM amazoncorretto:17-alpine - -ARG APP_NAME -ARG APP_VERSION +FROM amazoncorretto:21-alpine # Create a non-root user RUN adduser -D -h /home/testuser testuser @@ -71,9 +69,4 @@ WORKDIR /home/testuser ENV E2E_SCREENSHOT_DIR /target -# If the container has a memory limit, that limit (in bytes) is present in a file under /sys/fs/cgroup -# In Linux 5.10.76, the value comes from memory.max. -# If the container doesn't have a set memory limit, the file contains "max", hence we fall back to a default value of 2GiB -# In Linux 5.4.129, the value comes from memory/memory.limit_in_bytes -# If the container doesn't have a set memory limit, the file will be blank, hence we fall back to a default value of 2Gib ENTRYPOINT ["./mvnw", "-B", "-o", "-DreportsDirectory=/target/surefire-reports", "test"] \ No newline at end of file diff --git a/ci/impl/Dockerfile b/ci/impl/Dockerfile index f9e65b2..9187bf1 100644 --- a/ci/impl/Dockerfile +++ b/ci/impl/Dockerfile @@ -6,7 +6,7 @@ # This stage depends on a JDK image and uses Maven Wrapper to pull in dependencies and build the project # from source. -FROM azul/zulu-openjdk:17.0.3 AS build +FROM amazoncorretto:21-al2023 AS build ARG APP_NAME ARG APP_VERSION @@ -46,7 +46,7 @@ RUN ./mvnw -P -dnastack -B -o package # This stage uses a JRE rather than JDK because it doesn't have to build anything; it just runs the fat jar # produced by the previous stage. -FROM azul/zulu-openjdk:17.0.3-jre +FROM amazoncorretto:21-alpine ARG APP_NAME ARG APP_VERSION diff --git a/e2e-tests/pom.xml b/e2e-tests/pom.xml index d8e6537..2c89dc4 100644 --- a/e2e-tests/pom.xml +++ b/e2e-tests/pom.xml @@ -10,25 +10,27 @@ E2E tests for DNAstack WES Translator - 17 + 21 UTF-8 UTF-8 ${java.version} ${java.version} - 3.8.1 - 3.0.0-M5 - - 5.8.2 - 4.5.1 - 2.0.1 - 2.13.2 - 2.13.4 - 3.0.13 - 4.0.3 - 4.0.3 - 1.18.24 - 1.0.3 + 3.8.1 + 3.0.0-M7 + 1.2.8 + + 1.0.4 + + 1.18.30 + 5.10.1 + 5.6.3 + 4.16.1 + 5.4.0 + 2.0.10 + 4.2.0 + 2.16.1 0.5.9 + 1.3.2 @@ -54,22 +56,12 @@ com.dnastack actuator-e2e-test - ${actuator-e2e-test.version} + ${dnastack.actuator-e2e-test.version} - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - slf4j-simple - ${slf4j.version} - - - org.slf4j - jcl-over-slf4j - ${slf4j.version} + com.google.cloud + google-cloud-resourcemanager + ${gcloud.version} org.projectlombok @@ -85,7 +77,7 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-databind.version} + ${jackson.version} com.fasterxml.jackson.core @@ -108,27 +100,6 @@ - - io.rest-assured - json-path - - - io.rest-assured - xml-path - - - io.rest-assured - rest-assured-common - - - io.rest-assured - json-schema-validator - - - org.codehaus.groovy - groovy - ${groovy.version} - org.junit.jupiter junit-jupiter-api @@ -141,10 +112,21 @@ org.junit.jupiter junit-jupiter-params + - com.google.cloud - google-cloud-resourcemanager - 1.3.2 + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + slf4j-simple + ${slf4j.version} + + + org.slf4j + jcl-over-slf4j + ${slf4j.version} @@ -165,7 +147,7 @@ org.apache.maven.plugins maven-compiler-plugin - ${maven-compiler-plugin.version} + ${maven.compiler.plugin.version} ${java.version} @@ -177,7 +159,7 @@ org.apache.maven.plugins maven-surefire-plugin - ${maven-surefire-plugin.version} + ${maven.surefire.plugin.version} ${reportsDirectory} @@ -189,7 +171,7 @@ de.qaware.maven go-offline-maven-plugin - 1.2.8 + ${maven.go-offline.plugin.version} false false @@ -197,7 +179,7 @@ org.apache.maven.surefire surefire-junit-platform - 3.0.0-M5 + ${maven.surefire.plugin.version} PLUGIN diff --git a/pom.xml b/pom.xml index f308273..ebd3f30 100644 --- a/pom.xml +++ b/pom.xml @@ -7,55 +7,55 @@ org.springframework.boot spring-boot-starter-parent - 2.7.15 + 3.2.2 com.dnastack cromwell-wes-service - 1.1.0-SNAPSHOT + 1.2.0-SNAPSHOT jar cromwell-wes-service - Light weight shim that sits on top of cromwell converting the cromwell REST API into a powerful WES - api + + Light weight shim that sits on top of cromwell + converting the cromwell REST API into a powerful WES api - 17 + 21 UTF-8 UTF-8 ${java.version} ${java.version} - 3.0.0-M5 - 2021.0.8 - 1.2.10 - 1.0.0 - 0.1.5 - 1.6.13 - 1.0.9 - 1.0.15 - 4.9.3 - 0.11.2 - 3.8.0 + 3.0.0-M7 + 1.2.8 + + 7.4.1 + target/dependency-check-report.json + target/dependency-check-report.html + true + + 1.0.11 + 1.0.17 + 1.0.0 + 12.9.0 - target/dependency-check-report.json - target/dependency-check-report.html - true 1.2.8 2.20.1 1.16.0 + + 2023.0.0 + 2.3.0 + 1.4.5 + 0.1.5 + 0.12.3 + 4.12.0 + 3.8.0 - - org.springframework.boot - spring-boot-starter-parent - pom - import - 2.7.5 - org.springframework.cloud spring-cloud-dependencies @@ -98,6 +98,24 @@ + + + com.dnastack + dnastack-token-validator + ${dnastack.token-validator.version} + + + com.dnastack + logback-extensions + ${dnastack.logback-extensions.version} + + + com.dnastack + spring-boot-audit-event-logger + ${dnastack.spring-boot-audit-event-logger.version} + + + org.springframework.boot spring-boot-starter-web @@ -106,35 +124,47 @@ org.springframework.boot spring-boot-starter-actuator + + org.springframework.boot + spring-boot-actuator-autoconfigure + + + org.springframework.boot + spring-boot-configuration-processor + true + io.micrometer micrometer-registry-prometheus + + io.micrometer + micrometer-tracing-bridge-brave + - + - com.dnastack - dnastack-token-validator - ${dnastack-token-validator.version} + org.springdoc + springdoc-openapi-starter-webmvc-ui + ${springdoc-openapi.version} - com.dnastack - spring-boot-audit-event-logger - ${audit-event-logger.version} + org.springdoc + springdoc-openapi-starter-webmvc-api + ${springdoc-openapi.version} + + org.projectlombok lombok - - org.springframework.cloud - spring-cloud-starter-sleuth - com.squareup.okhttp3 okhttp + ${okhttp.version} com.fasterxml.jackson.datatype @@ -161,55 +191,46 @@ io.github.openfeign feign-jackson - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.security - spring-security-oauth2-jose - - - org.springframework.security - spring-security-oauth2-resource-server - - - org.springframework.security.oauth.boot - spring-security-oauth2-autoconfigure + org.apache.commons + commons-lang3 - + io.jsonwebtoken jjwt-impl - ${jwt.version} + ${jjwt.version} runtime io.jsonwebtoken jjwt-jackson - ${jwt.version} + ${jjwt.version} runtime org.springframework.boot - spring-boot-configuration-processor - true + spring-boot-starter-security - - - com.dnastack - logback-extensions - ${logback-extensions.version} + org.springframework.security + spring-security-oauth2-jose + + + org.springframework.security + spring-security-oauth2-resource-server + + + org.springframework.boot + spring-boot-starter-oauth2-client ch.qos.logback.contrib logback-jackson ${logback.contrib.version} + com.azure @@ -224,29 +245,17 @@ google-auth-library-oauth2-http - - org.apache.commons - commons-lang3 - - - - - org.springdoc - springdoc-openapi-ui - ${springdoc.version} - - - org.springdoc - springdoc-openapi-security - ${springdoc.version} - - - - + org.springframework.boot spring-boot-starter-test test + + + org.junit.vintage + junit-vintage-engine + + org.junit.jupiter @@ -254,27 +263,19 @@ test - org.junit.jupiter - junit-jupiter-api + org.junit.platform + junit-platform-launcher test - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - - org.owasp dependency-check-maven - 7.1.0 + ${sonar.dependency-check.plugin.version} ALL @@ -304,17 +305,17 @@ org.apache.maven.plugins maven-resources-plugin - 3.1.0 + ${maven-resources-plugin.version} org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M5 + ${maven.surefire.plugin.version} de.qaware.maven go-offline-maven-plugin - 1.2.8 + ${maven.go-offline.plugin.version} false false @@ -322,7 +323,7 @@ org.apache.maven.surefire surefire-junit-platform - 3.0.0-M5 + ${maven.surefire.plugin.version} PLUGIN diff --git a/src/main/java/com/dnastack/wes/api/WesV1Controller.java b/src/main/java/com/dnastack/wes/api/WesV1Controller.java index de472b8..f98ad8a 100644 --- a/src/main/java/com/dnastack/wes/api/WesV1Controller.java +++ b/src/main/java/com/dnastack/wes/api/WesV1Controller.java @@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.HashMap; import java.util.List; diff --git a/src/main/java/com/dnastack/wes/cromwell/CromwellWesMapper.java b/src/main/java/com/dnastack/wes/cromwell/CromwellWesMapper.java index 751c5d6..7f652f1 100644 --- a/src/main/java/com/dnastack/wes/cromwell/CromwellWesMapper.java +++ b/src/main/java/com/dnastack/wes/cromwell/CromwellWesMapper.java @@ -6,13 +6,13 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.servlet.http.HttpServletRequest; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.servlet.support.ServletUriComponentsBuilder; -import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.nio.file.Paths; import java.util.*; diff --git a/src/main/java/com/dnastack/wes/registry/Ga4ghService.java b/src/main/java/com/dnastack/wes/registry/Ga4ghService.java index be5c628..9d81653 100644 --- a/src/main/java/com/dnastack/wes/registry/Ga4ghService.java +++ b/src/main/java/com/dnastack/wes/registry/Ga4ghService.java @@ -32,7 +32,7 @@ public class Ga4ghService implements Cloneable { private List authentication; @Override - public Ga4ghService clone() { + public Ga4ghService clone() throws CloneNotSupportedException { Ga4ghService ga4ghService; try { ga4ghService = (Ga4ghService) super.clone(); diff --git a/src/main/java/com/dnastack/wes/registry/Organization.java b/src/main/java/com/dnastack/wes/registry/Organization.java index 62e3f39..cadba65 100644 --- a/src/main/java/com/dnastack/wes/registry/Organization.java +++ b/src/main/java/com/dnastack/wes/registry/Organization.java @@ -15,7 +15,7 @@ public class Organization implements Cloneable { private String url; @Override - protected Organization clone() { + protected Organization clone() throws CloneNotSupportedException { try { return (Organization) super.clone(); } catch (CloneNotSupportedException e) { diff --git a/src/main/java/com/dnastack/wes/registry/ServiceType.java b/src/main/java/com/dnastack/wes/registry/ServiceType.java index 2e5317e..9477f06 100644 --- a/src/main/java/com/dnastack/wes/registry/ServiceType.java +++ b/src/main/java/com/dnastack/wes/registry/ServiceType.java @@ -16,7 +16,7 @@ public class ServiceType implements Cloneable { private String version; @Override - protected ServiceType clone() { + protected ServiceType clone() throws CloneNotSupportedException { try { return (ServiceType) super.clone(); } catch (CloneNotSupportedException e) { diff --git a/src/main/java/com/dnastack/wes/security/BasicAuthSecurityConfig.java b/src/main/java/com/dnastack/wes/security/BasicAuthSecurityConfig.java index 38add38..af89c31 100644 --- a/src/main/java/com/dnastack/wes/security/BasicAuthSecurityConfig.java +++ b/src/main/java/com/dnastack/wes/security/BasicAuthSecurityConfig.java @@ -4,7 +4,9 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; @@ -14,6 +16,8 @@ import java.util.Objects; +import static org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMatcher; + @Configuration @ConditionalOnExpression("'${wes.auth.method}' == 'BASIC_AUTH'") public class BasicAuthSecurityConfig { @@ -45,24 +49,24 @@ public boolean matches(CharSequence rawPassword, String encodedPassword) { @Bean protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception { - http.sessionManagement() - .sessionCreationPolicy(SessionCreationPolicy.STATELESS) - .and() - .cors() - .disable() - .csrf() - .disable() - .authorizeRequests() - .antMatchers("/services", "/actuator/info**", "/actuator/health", "/actuator/health/**", "/service-info", "/docs/**") - .permitAll() - .antMatchers("/ga4gh/wes/v1/service-info") - .permitAll() - .antMatchers("/actuator/**") - .authenticated() - .antMatchers("/**") - .authenticated() - .and() - .httpBasic(); + http.sessionManagement(sessionConfig -> sessionConfig.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .cors(AbstractHttpConfigurer::disable) + .csrf(AbstractHttpConfigurer::disable) + .authorizeHttpRequests(requestConfig -> requestConfig.requestMatchers( + antMatcher("/services"), + antMatcher("/actuator/info**"), + antMatcher("/actuator/health"), + antMatcher("/actuator/health/**"), + antMatcher("/service-info"), + antMatcher("/docs/**"), + antMatcher("/ga4gh/wes/v1/service-info") + ).permitAll() + .requestMatchers( + antMatcher("/actuator/**"), + antMatcher("/**") + ).authenticated()) + .httpBasic(Customizer.withDefaults()); + return http.build(); } diff --git a/src/main/java/com/dnastack/wes/security/NoAuthSecurityConfig.java b/src/main/java/com/dnastack/wes/security/NoAuthSecurityConfig.java index 38c83d0..954fd1f 100644 --- a/src/main/java/com/dnastack/wes/security/NoAuthSecurityConfig.java +++ b/src/main/java/com/dnastack/wes/security/NoAuthSecurityConfig.java @@ -4,9 +4,12 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.web.SecurityFilterChain; +import static org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMatcher; + @Configuration @ConditionalOnExpression("'${wes.auth.method}' == 'NO_AUTH'") @@ -14,16 +17,14 @@ public class NoAuthSecurityConfig { @Bean protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception { - http.sessionManagement() - .sessionCreationPolicy(SessionCreationPolicy.STATELESS) - .and() - .cors().disable() - .csrf().disable() - .authorizeRequests() - .antMatchers("/**") - .permitAll(); + http.sessionManagement(sessionConfig -> sessionConfig.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .cors(AbstractHttpConfigurer::disable) + .csrf(AbstractHttpConfigurer::disable) + .authorizeHttpRequests(requestConfig -> requestConfig.requestMatchers( + antMatcher("/**") + ).permitAll()); + return http.build(); } - } diff --git a/src/main/java/com/dnastack/wes/security/OAuthSecurityConfig.java b/src/main/java/com/dnastack/wes/security/OAuthSecurityConfig.java index 803a147..bfeec2d 100644 --- a/src/main/java/com/dnastack/wes/security/OAuthSecurityConfig.java +++ b/src/main/java/com/dnastack/wes/security/OAuthSecurityConfig.java @@ -19,8 +19,10 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.oauth2.jwt.Jwt; import org.springframework.security.oauth2.jwt.JwtDecoder; @@ -30,6 +32,8 @@ import java.util.List; import java.util.concurrent.TimeUnit; +import static org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMatcher; + /** * Configure JWT Authentication for the WES server */ @@ -42,25 +46,24 @@ public class OAuthSecurityConfig { @Bean protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception { - http.sessionManagement() - .sessionCreationPolicy(SessionCreationPolicy.STATELESS) - .and() - .cors() - .disable() - .csrf() - .disable() - .authorizeRequests() - .antMatchers("/services", "/actuator/info**", "/actuator/health", "/actuator/health/**", "/service-info", "/docs/**") - .permitAll() - .antMatchers("/ga4gh/wes/v1/service-info") - .permitAll() - .antMatchers("/actuator/**") - .authenticated() - .antMatchers("/**") - .authenticated() - .and() - .oauth2ResourceServer() - .jwt(); + http.sessionManagement(sessionConfig -> sessionConfig.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .cors(AbstractHttpConfigurer::disable) + .csrf(AbstractHttpConfigurer::disable) + .authorizeHttpRequests(requestConfig -> requestConfig.requestMatchers( + antMatcher("/services"), + antMatcher("/actuator/info**"), + antMatcher("/actuator/health"), + antMatcher("/actuator/health/**"), + antMatcher("/service-info"), + antMatcher("/docs/**"), + antMatcher("/ga4gh/wes/v1/service-info") + ).permitAll() + .requestMatchers( + antMatcher("/actuator/**"), + antMatcher("/**") + ).authenticated()) + .oauth2ResourceServer(outhConfig -> outhConfig.jwt(Customizer.withDefaults())); + return http.build(); } @@ -111,8 +114,8 @@ public JwtDecoder jwtDecoder(JwtTokenParser jwtTokenParser) { return jwtToken -> { try { final Jws jws = jwtTokenParser.parseTokenClaims(jwtToken); - final JwsHeader headers = jws.getHeader(); - final Claims claims = jws.getBody(); + final JwsHeader headers = jws.getHeader(); + final Claims claims = jws.getPayload(); return new Jwt(jwtToken, claims.getIssuedAt().toInstant(), claims.getExpiration().toInstant(), headers, claims); } catch (JwtException e) { throw new org.springframework.security.oauth2.jwt.BadJwtException(e.getMessage(), e); diff --git a/src/main/java/com/dnastack/wes/security/PassportSecurityConfiguration.java b/src/main/java/com/dnastack/wes/security/PassportSecurityConfiguration.java index 1e9f3f1..b3d622f 100644 --- a/src/main/java/com/dnastack/wes/security/PassportSecurityConfiguration.java +++ b/src/main/java/com/dnastack/wes/security/PassportSecurityConfiguration.java @@ -19,9 +19,7 @@ import org.springframework.security.oauth2.jwt.Jwt; import org.springframework.security.oauth2.jwt.JwtDecoder; -import java.time.Duration; import java.util.List; -import java.util.concurrent.TimeUnit; /** * Configure API level Authorization enforcing the @PreAuthorize annotations for all controller methods. Permissions @@ -54,8 +52,8 @@ public JwtDecoder jwtDecoder(JwtTokenParser jwtTokenParser, PermissionChecker pe try { permissionChecker.checkPermissions(jwtToken); final Jws jws = jwtTokenParser.parseTokenClaims(jwtToken); - final JwsHeader headers = jws.getHeader(); - final Claims claims = jws.getBody(); + final JwsHeader headers = jws.getHeader(); + final Claims claims = jws.getPayload(); return new Jwt(jwtToken, claims.getIssuedAt().toInstant(), claims.getExpiration().toInstant(), headers, claims); } catch (JwtException e) { throw new org.springframework.security.oauth2.jwt.BadJwtException(e.getMessage(), e); diff --git a/src/main/java/com/dnastack/wes/security/XForwardUtil.java b/src/main/java/com/dnastack/wes/security/XForwardUtil.java index 549289f..3cd82b3 100644 --- a/src/main/java/com/dnastack/wes/security/XForwardUtil.java +++ b/src/main/java/com/dnastack/wes/security/XForwardUtil.java @@ -1,10 +1,10 @@ package com.dnastack.wes.security; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.http.HttpRequest; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.security.web.savedrequest.SavedRequest; -import javax.servlet.http.HttpServletRequest; import java.net.MalformedURLException; import java.net.URI; import java.net.URL; diff --git a/src/main/java/com/dnastack/wes/storage/AzureBlobStorageClient.java b/src/main/java/com/dnastack/wes/storage/AzureBlobStorageClient.java index bd29b08..83b40eb 100644 --- a/src/main/java/com/dnastack/wes/storage/AzureBlobStorageClient.java +++ b/src/main/java/com/dnastack/wes/storage/AzureBlobStorageClient.java @@ -115,8 +115,16 @@ public void readBytes(OutputStream outputStream, String blobUri, HttpRange httpR } BlobRange range = new BlobRange(rangeStart, rangeEnd - rangeStart); - blobClient.downloadWithResponse(outputStream, range, new DownloadRetryOptions() - .setMaxRetryRequests(3), null, false, null, null); + blobClient.downloadStreamWithResponse( + outputStream, + range, + new DownloadRetryOptions() + .setMaxRetryRequests(3), + null, + false, + null, + null + ); } @Override diff --git a/src/main/java/com/dnastack/wes/storage/BlobStorageClient.java b/src/main/java/com/dnastack/wes/storage/BlobStorageClient.java index 2ad51aa..ac5fe43 100644 --- a/src/main/java/com/dnastack/wes/storage/BlobStorageClient.java +++ b/src/main/java/com/dnastack/wes/storage/BlobStorageClient.java @@ -2,7 +2,7 @@ import org.springframework.http.HttpRange; -import javax.annotation.Nullable; +import jakarta.annotation.Nullable; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; diff --git a/src/main/java/com/dnastack/wes/workflow/ChecksumWorkflowAuthorizer.java b/src/main/java/com/dnastack/wes/workflow/ChecksumWorkflowAuthorizer.java index ffaae79..1b77c92 100644 --- a/src/main/java/com/dnastack/wes/workflow/ChecksumWorkflowAuthorizer.java +++ b/src/main/java/com/dnastack/wes/workflow/ChecksumWorkflowAuthorizer.java @@ -9,7 +9,7 @@ import org.springframework.stereotype.Component; import org.springframework.web.multipart.MultipartFile; -import javax.xml.bind.DatatypeConverter; +import jakarta.xml.bind.DatatypeConverter; import java.io.InputStream; import java.net.URI; import java.security.MessageDigest; diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index b8f6d26..487f266 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -4,6 +4,8 @@ server: include-message: always # To include "message" attribute include-binding-errors: always # To include "errors" attribute +build.version: @project.version@ + spring: application: name: cromwell-wes-service @@ -14,8 +16,6 @@ spring: servlet: multipart: enabled: true - zipkin: - enabled: false logging: level: @@ -47,8 +47,6 @@ info: url: ${wes.url} version: "${project.version}" -build.version: @project.version@ - wes: url: http://localhost:${server.port} service-info: