diff --git a/README.adoc b/README.adoc index d525e0f9..48ab1254 100644 --- a/README.adoc +++ b/README.adoc @@ -257,7 +257,7 @@ credentials and you already have those. The projects that require middleware generally include a `docker-compose.yml`, so consider using -https://compose.docker.io/[Docker Compose] to run the middeware servers +https://docs.docker.com/compose/[Docker Compose] to run the middeware servers in Docker containers. See the README in the https://github.com/spring-cloud-samples/scripts[scripts demo repository] for specific instructions about the common cases of mongo, diff --git a/docs/pom.xml b/docs/pom.xml index e38023e3..e59da90b 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-config - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE .. diff --git a/pom.xml b/pom.xml index f2374126..153b9f49 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE pom Spring Cloud Config Spring Cloud Config @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-build - 2.1.4.BUILD-SNAPSHOT + 2.1.3.RELEASE @@ -27,7 +27,7 @@ config - 2.1.2.BUILD-SNAPSHOT + 2.1.1.RELEASE true true diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index 39f2fd8f..483fa4c8 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index a35a07c3..533d17ba 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -6,11 +6,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 2.1.4.BUILD-SNAPSHOT + 2.1.3.RELEASE spring-cloud-config-dependencies - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index 60c70932..7909aeb2 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE .. spring-cloud-config-monitor @@ -14,7 +14,7 @@ Spring Cloud Config Monitor ${basedir}/../.. - 2.1.1.BUILD-SNAPSHOT + 2.1.1.RELEASE diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index a818f9cf..3cdaa2ca 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index a2a053f1..5de20aab 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE .. diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/resource/GenericResourceRepository.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/resource/GenericResourceRepository.java index e354554b..47c035ad 100644 --- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/resource/GenericResourceRepository.java +++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/resource/GenericResourceRepository.java @@ -64,7 +64,7 @@ public class GenericResourceRepository String[] locations = this.service.getLocations(application, profile, label) .getLocations(); try { - for (int i = locations.length; i-- > 0; ) { + for (int i = locations.length; i-- > 0;) { String location = locations[i]; for (String local : getProfilePaths(profile, path)) { if (!isInvalidPath(local) && !isInvalidEncodedPath(local)) { @@ -116,7 +116,8 @@ public class GenericResourceRepository private boolean isInvalidEncodedPath(String path) { if (path.contains("%")) { try { - // Use URLDecoder (vs UriUtils) to preserve potentially decoded UTF-8 chars + // Use URLDecoder (vs UriUtils) to preserve potentially decoded UTF-8 + // chars String decodedPath = URLDecoder.decode(path, "UTF-8"); if (isInvalidPath(decodedPath)) { return true; @@ -135,13 +136,13 @@ public class GenericResourceRepository /** * Process the given resource path. - *

The default implementation replaces: + *

+ * The default implementation replaces: *

    *
  • Backslash with forward slash. *
  • Duplicate occurrences of slash with a single slash. - *
  • Any combination of leading slash and control characters (00-1F and 7F) - * with a single "/" or "". For example {@code " / // foo/bar"} - * becomes {@code "/foo/bar"}. + *
  • Any combination of leading slash and control characters (00-1F and 7F) with a + * single "/" or "". For example {@code " / // foo/bar"} becomes {@code "/foo/bar"}. *
* @since 3.2.12 */ @@ -151,7 +152,6 @@ public class GenericResourceRepository return cleanLeadingSlash(path); } - private String cleanDuplicateSlashes(String path) { StringBuilder sb = null; char prev = 0; @@ -175,7 +175,6 @@ public class GenericResourceRepository return sb != null ? sb.toString() : path; } - private String cleanLeadingSlash(String path) { boolean slash = false; for (int i = 0; i < path.length(); i++) { @@ -192,7 +191,6 @@ public class GenericResourceRepository return (slash ? "/" : ""); } - /** * Identifies invalid resource paths. By default rejects: *
    @@ -202,9 +200,10 @@ public class GenericResourceRepository *
  • Paths that represent a {@link org.springframework.util.ResourceUtils#isUrl * valid URL} or would represent one after the leading slash is removed. *
- *

Note: this method assumes that leading, duplicate '/' - * or control characters (e.g. white space) have been trimmed so that the - * path starts predictably with a single '/' or does not have one. + *

+ * Note: this method assumes that leading, duplicate '/' or control + * characters (e.g. white space) have been trimmed so that the path starts predictably + * with a single '/' or does not have one. * @param path the path to validate * @return {@code true} if the path is invalid, {@code false} otherwise * @since 3.0.6 @@ -220,17 +219,20 @@ public class GenericResourceRepository String relativePath = (path.charAt(0) == '/' ? path.substring(1) : path); if (ResourceUtils.isUrl(relativePath) || relativePath.startsWith("url:")) { if (logger.isWarnEnabled()) { - logger.warn("Path represents URL or has \"url:\" prefix: [" + path + "]"); + logger.warn( + "Path represents URL or has \"url:\" prefix: [" + path + "]"); } return true; } } if (path.contains("..") && StringUtils.cleanPath(path).contains("../")) { if (logger.isWarnEnabled()) { - logger.warn("Path contains \"../\" after call to StringUtils#cleanPath: [" + path + "]"); + logger.warn("Path contains \"../\" after call to StringUtils#cleanPath: [" + + path + "]"); } return true; } return false; } + } diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/resource/GenericResourceRepositoryTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/resource/GenericResourceRepositoryTests.java index 51c4b0f8..a5594882 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/resource/GenericResourceRepositoryTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/resource/GenericResourceRepositoryTests.java @@ -98,9 +98,11 @@ public class GenericResourceRepositoryTests { @Test public void invalidPath() { this.exception.expect(NoSuchResourceException.class); - this.nativeRepository.setSearchLocations("file:./src/test/resources/test/{profile}"); + this.nativeRepository + .setSearchLocations("file:./src/test/resources/test/{profile}"); this.repository.findOne("blah", "local", "master", "..%2F..%2Fdata-jdbc.sql"); - this.output.expect(containsString("Path contains \"../\" after call to StringUtils#cleanPath")); + this.output.expect(containsString( + "Path contains \"../\" after call to StringUtils#cleanPath")); } } diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index d9667ae1..dd0ff43b 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -6,10 +6,10 @@ org.springframework.cloud spring-cloud-config - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE spring-cloud-starter-config - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud