diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml
index 23af7abd..303dc77f 100644
--- a/.github/workflows/sonar.yml
+++ b/.github/workflows/sonar.yml
@@ -13,10 +13,10 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- - name: Set up JDK 11
+ - name: Set up JDK 17
uses: actions/setup-java@v1
with:
- java-version: 11
+ java-version: 17
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
@@ -33,4 +33,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- run: mvn -s maven/cnaf-mirror-settings.xml -B -U install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=italiangrid_storm-webdav
\ No newline at end of file
+ run: mvn -s maven/cnaf-mirror-settings.xml -B -U install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=italiangrid_storm-webdav
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4fb6334e..435384f4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,36 +1,65 @@
# Changelog
+## 1.4.2 (2023-06-27)
+
+## Description
+
+This release:
+
+* upgrades significant dependencies (spring-boot, canl, bouncycastle, jQuery)
+* removes the support for TRACE method
+* tunes some default values (default TPC timeout, default heap size, etc.)
+* and fixes other minor bugs/issues.
+
+### fixes
+
+* [[STOR-1396](https://issues.infn.it/jira/browse/STOR-1396)] - Ensure adler32 checksums are always 8 chars long
+* [[STOR-1450](https://issues.infn.it/jira/browse/STOR-1450)] - Increase default timeout for TPC to 30 seconds
+* [[STOR-1500](https://issues.infn.it/jira/browse/STOR-1500)] - When redis is disabled the health indicator for redis should be disabled
+* [[STOR-1574](https://issues.infn.it/jira/browse/STOR-1574)] - Old java/canl creates problems with encoding of subject/issuer names in self-signed certificates
+* [[STOR-1440](https://issues.infn.it/jira/browse/STOR-1440)] - StoRM WebDAV should configure a bigger heap by default
+* [[STOR-1497](https://issues.infn.it/jira/browse/STOR-1497)] - Upgrade canl-java to v2.6.0
+* [[STOR-1515](https://issues.infn.it/jira/browse/STOR-1515)] - StoRM WebDAV metrics on TPC.pull/push.throughput
+* [[STOR-1555](https://issues.infn.it/jira/browse/STOR-1555)] - Upgrade jQuery version
+* [[STOR-1556](https://issues.infn.it/jira/browse/STOR-1556)] - Remove TRACE from allowed methods
+* [[STOR-1557](https://issues.infn.it/jira/browse/STOR-1557)] - Upgrade Spring Boot version to the latest
+* [[STOR-1558](https://issues.infn.it/jira/browse/STOR-1558)] - Update bouncycastle version to 1.67
+* [[STOR-1576](https://issues.infn.it/jira/browse/STOR-1576)] - Add .well-known endpoint for StoRM WebDAV to point to the Tape REST endpoint
+
+
+## 1.4.1 (2021-05-12)
+
+This release fixes the failed state shown on stop/restart of the service due to a misunderstood exit code meaning.
+
+### Fixed
+
+- [[STOR-1400](https://issues.infn.it/jira/browse/STOR-1400)] - StoRM WebDAV service enters failed state when stopped
+
## 1.4.0 (2021-04-01)
### Added
-- [Add support for externalized session management](https://issues.infn.it/jira/browse/STOR-1336)
+- [[STOR-1336](https://issues.infn.it/jira/browse/STOR-1336)] - Add support for externalized session management
### Fixed
-- [Login with OIDC button not shown for error
- pages](https://issues.infn.it/jira/browse/STOR-1335)
-- [StoRM WebDAV: Login with OIDC button displayed only on storage area index
- page]( https://issues.infn.it/jira/browse/STOR-1332)
-- [StoRM WebDAV rpm doesn't set the proper ownership on
- /var/log/storm](https://issues.infn.it/jira/browse/STOR-1298)
-- [StoRM WebDAV package should install Java
- 11](https://issues.infn.it/jira/browse/STOR-1358)
+- [[STOR-1335](https://issues.infn.it/jira/browse/STOR-1335)] - Login with OIDC button not shown for error
+ pages
+- [[STOR-1332](https://issues.infn.it/jira/browse/STOR-1332)] - Login with OIDC button displayed only on storage area index page
+- [[STOR-1298](https://issues.infn.it/jira/browse/STOR-1298)] - StoRM WebDAV RPM doesn't set the proper ownership on `/var/log/storm`
+- [[STOR-1358](https://issues.infn.it/jira/browse/STOR-1358)] - StoRM WebDAV package should install Java 11
## 1.2.0 (2019-08-??)
### Added
-- [Spring boot updated to 2.1.4.RELEASE][STOR-1098]
-- [Introduced support for Conscrypt JSSE provider to improve TLS
- performace][STOR-1097]
+- [[STOR-1098](https://issues.infn.it/jira/browse/STOR-1098)] - Spring boot updated to 2.1.4.RELEASE
+- [[STOR-1097](https://issues.infn.it/jira/browse/STOR-1097)] - Introduced support for Conscrypt JSSE provider to improve TLS performance
### Fixed
-- [StoRM WebDAV default configuration does not depend anymore on
- iam-test.indigo-datacloud.eu][STOR-1095]
-- [Unreachable OpenID Connect provider causes StoRM WebDAV startup
- failure][STOR-1096]
+- [[STOR-1095](https://issues.infn.it/jira/browse/STOR-1095)] - StoRM WebDAV default configuration does not depend anymore on `iam-test.indigo-datacloud.eu`
+- [[STOR-1096](https://issues.infn.it/jira/browse/STOR-1096)] - Unreachable OpenID Connect provider causes StoRM WebDAV startup failure
## 1.1.0 (2019-02-28)
@@ -46,8 +75,3 @@
- POST handled as GET fixed
-
-[STOR-1095]: https://issues.infn.it/jira/browse/STOR-1095
-[STOR-1096]: https://issues.infn.it/jira/browse/STOR-1096
-[STOR-1097]: https://issues.infn.it/jira/browse/STOR-1097
-[STOR-1098]: https://issues.infn.it/jira/browse/STOR-1098
diff --git a/etc/storm-webdav/logback-access.xml b/etc/storm-webdav/logback-access.xml
index a5f130c0..629060cc 100644
--- a/etc/storm-webdav/logback-access.xml
+++ b/etc/storm-webdav/logback-access.xml
@@ -11,7 +11,7 @@
- %a %localPort "%reqAttribute{storm.remoteUser}" %date{"yyyy-MM-dd'T'HH:mm:ss.SSSXXX", UTC} "%reqAttribute{storm.requestId}" "%m %U %H" %s %b %D
+ %replace(%a){'^$','-'} %localPort "%reqAttribute{storm.remoteUser}" %date{"yyyy-MM-dd'T'HH:mm:ss.SSSXXX", UTC} "%reqAttribute{storm.requestId}" "%m %U %H" %s %b %D
diff --git a/etc/systemd/system/storm-webdav.service.d/storm-webdav.conf b/etc/systemd/system/storm-webdav.service.d/storm-webdav.conf
index f173bd26..5ecdd990 100644
--- a/etc/systemd/system/storm-webdav.service.d/storm-webdav.conf
+++ b/etc/systemd/system/storm-webdav.service.d/storm-webdav.conf
@@ -127,3 +127,36 @@ Environment="STORM_WEBDAV_TPC_MAX_CONNECTIONS_PER_ROUTE=25"
# Source file for the tape REST API well-known endpoint
# Default: '/etc/storm/webdav/wlcg-tape-rest-api.json'
# Environment="STORM_WEBDAV_TAPE_WELLKNOWN_SOURCE=/etc/storm/webdav/wlcg-tape-rest-api.json"
+
+# Buffer size for both internal and third-party copy requests.
+# This adds more efficiency than to write the whole data. Valid values are numbers >= 4096.
+# Default: 1048576
+# Environment="STORM_WEBDAV_BUFFER_FILE_BUFFER_SIZE_BYTES=1048576"
+
+# Enable checksum filter which adds checksum as an header following RFC 3230.
+# Default: true
+# Environment="STORM_WEBDAV_CHECKSUM_FILTER_ENABLED=true"
+
+# Enable Macaroon filter to process Macaroon tokens. Requires authz server enabled.
+# Default: true
+# Environment="STORM_WEBDAV_MACAROON_FILTER_ENABLED=true"
+
+# TLS protocol for non-TPC requests
+# Default: TLS
+# Environment="STORM_WEBDAV_TLS_PROTOCOL=TLS"
+
+# VOMS Trust Store directory
+# Default: /etc/grid-security/vomsdir
+# Environment="STORM_WEBDAV_VOMS_TRUST_STORE_DIR=/etc/grid-security/vomsdir"
+
+# VOMS Trust Store refresh interval
+# Default: 43200
+# Environment="STORM_WEBDAV_VOMS_TRUST_STORE_REFRESH_INTERVAL_SEC=43200"
+
+# Enable caching for VOMS certificate validation
+# Default: true
+# Environment="STORM_WEBDAV_VOMS_CACHE_ENABLE=true"
+
+# Cache entries lifetime, used if caching for VOMS certificate validation is enabled
+# Default: 300
+# Environment="STORM_WEBDAV_VOMS_CACHE_ENTRY_LIFETIME_SEC=300"
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 92ee39e4..98940045 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.7.10
+ 2.7.18
@@ -20,8 +20,7 @@
UTF-8
UTF-8
- 3.6.0
- 11
+ 3.8.0
2.4
2.4
@@ -32,14 +31,14 @@
11
- 2.7.10
+ 2.7.18
italiangrid_storm-webdav
italiangrid
https://sonarcloud.io
- 0.4.6.v20220506
+ 3.3.3
2.7.1.7
2.3
@@ -50,14 +49,13 @@
4.2.2
4.2.1
- 31.1-jre
+ 32.0.0-jre
1.0.5.1
2.3.3.RELEASE
6.0.2
5.5.1
- 1.72
@@ -65,16 +63,6 @@
${project.name}
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
-
- 11
-
-
-
org.springframework.boot
spring-boot-maven-plugin
@@ -99,7 +87,6 @@
src/assembly/tarball.xml
- storm-webdav
@@ -107,6 +94,9 @@
single
+
+ false
+
@@ -190,13 +180,6 @@
org.springframework.boot
spring-boot-starter-actuator
-
-
-
- org.apache.logging.log4j
- log4j-api
-
-
@@ -256,6 +239,12 @@
org.springframework.boot
spring-boot-starter-test
test
+
+
+ com.vaadin.external.google
+ android-json
+
+
@@ -326,11 +315,6 @@
metrics-core
-
- io.dropwizard.metrics
- metrics-jvm
-
-
io.dropwizard.metrics
metrics-jetty9
@@ -348,45 +332,30 @@
- org.italiangrid
- jetty-utils
- ${jetty-utils.version}
-
-
- javax.activation
- activation
-
-
- javax.mail
- mail
-
-
- org.eclipse.jetty.aggregate
- jetty-all
-
-
- ch.qos.logback
- logback-core
-
-
- ch.qos.logback
- logback-classic
-
-
+ org.eclipse.jetty.http2
+ http2-server
+
+
+
+ org.eclipse.jetty
+ jetty-alpn-conscrypt-server
- org.bouncycastle
- bcpkix-jdk18on
- ${bouncycastle.version}
+ org.slf4j
+ slf4j-api
- org.bouncycastle
- bcprov-jdk18on
- ${bouncycastle.version}
+ org.slf4j
+ log4j-over-slf4j
+
+ org.italiangrid
+ voms-api-java
+ ${voms-api-java.version}
+
ch.qos.logback
diff --git a/src/main/java/org/italiangrid/storm/webdav/config/OAuthProperties.java b/src/main/java/org/italiangrid/storm/webdav/config/OAuthProperties.java
index bd833381..aab8d1f6 100644
--- a/src/main/java/org/italiangrid/storm/webdav/config/OAuthProperties.java
+++ b/src/main/java/org/italiangrid/storm/webdav/config/OAuthProperties.java
@@ -96,6 +96,9 @@ public boolean isEnforceAudienceChecks() {
@Min(value = 1, message = "The refresh period must be a positive integer")
int refreshPeriodMinutes = 60;
+ @Min(value = 1, message = "The refresh timeout must be a positive integer")
+ int refreshTimeoutSeconds = 30;
+
public List getIssuers() {
return issuers;
}
@@ -112,6 +115,14 @@ public void setRefreshPeriodMinutes(int refreshPeriodMinutes) {
this.refreshPeriodMinutes = refreshPeriodMinutes;
}
+ public int getRefreshTimeoutSeconds() {
+ return refreshTimeoutSeconds;
+ }
+
+ public void setRefreshTimeoutSeconds(int refreshTimeoutSeconds) {
+ this.refreshTimeoutSeconds = refreshTimeoutSeconds;
+ }
+
public void setEnableOidc(boolean enableOidc) {
this.enableOidc = enableOidc;
}
diff --git a/src/main/java/org/italiangrid/storm/webdav/config/ServiceConfiguration.java b/src/main/java/org/italiangrid/storm/webdav/config/ServiceConfiguration.java
index 9b3a0e03..c5fc69a0 100644
--- a/src/main/java/org/italiangrid/storm/webdav/config/ServiceConfiguration.java
+++ b/src/main/java/org/italiangrid/storm/webdav/config/ServiceConfiguration.java
@@ -33,10 +33,14 @@ public interface ServiceConfiguration {
public long getTrustAnchorsRefreshIntervalInSeconds();
+ public int getMinConnections();
+
public int getMaxConnections();
public int getMaxQueueSize();
+ public int getThreadPoolMaxIdleTimeInMsec();
+
public int getConnectorMaxIdleTimeInMsec();
public String getSAConfigDir();
diff --git a/src/main/java/org/italiangrid/storm/webdav/config/ServiceConfigurationProperties.java b/src/main/java/org/italiangrid/storm/webdav/config/ServiceConfigurationProperties.java
index b6e09321..dbacabad 100644
--- a/src/main/java/org/italiangrid/storm/webdav/config/ServiceConfigurationProperties.java
+++ b/src/main/java/org/italiangrid/storm/webdav/config/ServiceConfigurationProperties.java
@@ -249,6 +249,20 @@ public void setPolicies(List policies) {
}
}
+ public static class ServerProperties {
+
+ @Positive
+ int maxIdleTimeMsec = 3600000;
+
+ public int getMaxIdleTimeMsec() {
+ return maxIdleTimeMsec;
+ }
+
+ public void setMaxIdleTimeMsec(int maxIdleTimeMsec) {
+ this.maxIdleTimeMsec = maxIdleTimeMsec;
+ }
+ }
+
public static class ConnectorProperties {
@Positive
@@ -260,10 +274,13 @@ public static class ConnectorProperties {
int securePort = 8443;
@Positive
- int maxConnections = 200;
+ int minConnections = 50;
+
+ @Positive
+ int maxConnections = 300;
@Positive
- int maxQueueSize = 512;
+ int maxQueueSize = 900;
@Positive
int maxIdleTimeMsec = 30000;
@@ -292,6 +309,14 @@ public void setSecurePort(int securePort) {
this.securePort = securePort;
}
+ public int getMinConnections() {
+ return minConnections;
+ }
+
+ public void setMinConnections(int minConnections) {
+ this.minConnections = minConnections;
+ }
+
public int getMaxConnections() {
return maxConnections;
}
@@ -597,6 +622,8 @@ public void setTrustStore(VOMSTrustStoreProperties trustStore) {
private MacaroonFilterProperties macaroonFilter;
+ private ServerProperties server;
+
private ConnectorProperties connector;
private TLSProperties tls;
@@ -643,12 +670,18 @@ public void setTls(TLSProperties tls) {
this.tls = tls;
}
+ public ServerProperties getServer() {
+ return server;
+ }
+
+ public void setServer(ServerProperties server) {
+ this.server = server;
+ }
public ConnectorProperties getConnector() {
return connector;
}
-
public void setConnector(ConnectorProperties connector) {
this.connector = connector;
}
@@ -732,55 +765,56 @@ public long getTrustAnchorsRefreshIntervalInSeconds() {
return getTls().getTrustAnchorsRefreshIntervalSecs();
}
+ @Override
+ public int getMinConnections() {
+ return getConnector().getMinConnections();
+ }
@Override
public int getMaxConnections() {
return getConnector().getMaxConnections();
}
-
@Override
public int getMaxQueueSize() {
return getConnector().getMaxQueueSize();
}
+ @Override
+ public int getThreadPoolMaxIdleTimeInMsec() {
+ return getServer().getMaxIdleTimeMsec();
+ }
@Override
public int getConnectorMaxIdleTimeInMsec() {
return getConnector().getMaxIdleTimeMsec();
}
-
@Override
public String getSAConfigDir() {
return getSa().getConfigDir();
}
-
@Override
public boolean enableVOMapFiles() {
return getVoMapFiles().isEnabled();
}
-
@Override
public String getVOMapFilesConfigDir() {
return getVoMapFiles().getConfigDir();
}
-
@Override
public long getVOMapFilesRefreshIntervalInSeconds() {
return getVoMapFiles().getRefreshIntervalSec();
}
-
@Override
public boolean isAuthorizationDisabled() {
return getAuthz().isDisabled();
}
-
@Override
public boolean requireClientCertificateAuthentication() {
return getTls().isRequireClientCert();
@@ -887,4 +921,5 @@ public TapeProperties getTape() {
public void setTape(TapeProperties tape) {
this.tape = tape;
}
+
}
diff --git a/src/main/java/org/italiangrid/storm/webdav/oauth/utils/DefaultOidcConfigurationFetcher.java b/src/main/java/org/italiangrid/storm/webdav/oauth/utils/DefaultOidcConfigurationFetcher.java
index 090ee2db..4515bf3c 100644
--- a/src/main/java/org/italiangrid/storm/webdav/oauth/utils/DefaultOidcConfigurationFetcher.java
+++ b/src/main/java/org/italiangrid/storm/webdav/oauth/utils/DefaultOidcConfigurationFetcher.java
@@ -18,34 +18,47 @@
import static java.lang.String.format;
import java.net.URI;
+import java.time.Duration;
+import java.util.Arrays;
import java.util.Map;
+import java.util.Objects;
+import org.italiangrid.storm.webdav.config.OAuthProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
import org.springframework.http.RequestEntity;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
+import com.nimbusds.jose.KeySourceException;
+import com.nimbusds.jose.RemoteKeySourceException;
+
@Service
public class DefaultOidcConfigurationFetcher implements OidcConfigurationFetcher {
public static final String WELL_KNOWN_FRAGMENT = "/.well-known/openid-configuration";
public static final String ISSUER_MISMATCH_ERROR_TEMPLATE =
"Issuer in metadata '%s' does not match with requested issuer '%s'";
- public static final String NO_JWKS_URI_ERROR_TEMPLATE =
+ public static final String NO_JWKS_URI_ERROR_TEMPLATE =
"No jwks_uri found in metadata for issuer '%s'";
+ private static final MediaType APPLICATION_JWK_SET_JSON =
+ new MediaType("application", "jwk-set+json");
+
public static final Logger LOG = LoggerFactory.getLogger(DefaultOidcConfigurationFetcher.class);
- final RestTemplateBuilder restBuilder;
+ final RestTemplate restTemplate;
- @Autowired
- public DefaultOidcConfigurationFetcher(RestTemplateBuilder restBuilder) {
- this.restBuilder = restBuilder;
+ public DefaultOidcConfigurationFetcher(RestTemplateBuilder restBuilder,
+ OAuthProperties oAuthProperties) {
+ final Duration timeout = Duration.ofSeconds(oAuthProperties.getRefreshTimeoutSeconds());
+ this.restTemplate = restBuilder.setConnectTimeout(timeout).setReadTimeout(timeout).build();
}
private void metadataChecks(String issuer, Map oidcConfiguration) {
@@ -59,40 +72,63 @@ private void metadataChecks(String issuer, Map oidcConfiguration
throw new OidcConfigurationResolutionError(
format(ISSUER_MISMATCH_ERROR_TEMPLATE, metadataIssuer, issuer));
}
-
+
if (!oidcConfiguration.containsKey("jwks_uri")) {
- throw new OidcConfigurationResolutionError(format(NO_JWKS_URI_ERROR_TEMPLATE,issuer));
+ throw new OidcConfigurationResolutionError(format(NO_JWKS_URI_ERROR_TEMPLATE, issuer));
}
}
@Override
public Map loadConfigurationForIssuer(String issuer) {
LOG.debug("Fetching OpenID configuration for {}", issuer);
-
+
ParameterizedTypeReference