Update SNAPSHOT to 2.1.2.RELEASE

This commit is contained in:
buildmaster
2019-04-16 20:05:07 +00:00
parent a9be17e113
commit 2fcda6e1cb
11 changed files with 34 additions and 30 deletions

View File

@@ -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,

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config</artifactId>
<version>2.1.2.BUILD-SNAPSHOT</version>
<version>2.1.2.RELEASE</version>
<relativePath>..</relativePath>
</parent>

View File

@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config</artifactId>
<version>2.1.2.BUILD-SNAPSHOT</version>
<version>2.1.2.RELEASE</version>
<packaging>pom</packaging>
<name>Spring Cloud Config</name>
<description>Spring Cloud Config</description>
@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>2.1.4.BUILD-SNAPSHOT</version>
<version>2.1.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<scm>
@@ -27,7 +27,7 @@
</scm>
<properties>
<bintray.package>config</bintray.package>
<spring-cloud-commons.version>2.1.2.BUILD-SNAPSHOT</spring-cloud-commons.version>
<spring-cloud-commons.version>2.1.1.RELEASE</spring-cloud-commons.version>
<maven-checkstyle-plugin.failsOnError>true</maven-checkstyle-plugin.failsOnError>
<maven-checkstyle-plugin.failsOnViolation>true

View File

@@ -10,7 +10,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config</artifactId>
<version>2.1.2.BUILD-SNAPSHOT</version>
<version>2.1.2.RELEASE</version>
<relativePath>..</relativePath>
</parent>

View File

@@ -6,11 +6,11 @@
<parent>
<artifactId>spring-cloud-dependencies-parent</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>2.1.4.BUILD-SNAPSHOT</version>
<version>2.1.3.RELEASE</version>
<relativePath/>
</parent>
<artifactId>spring-cloud-config-dependencies</artifactId>
<version>2.1.2.BUILD-SNAPSHOT</version>
<version>2.1.2.RELEASE</version>
<packaging>pom</packaging>
<name>spring-cloud-config-dependencies</name>
<description>Spring Cloud Config Dependencies</description>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config</artifactId>
<version>2.1.2.BUILD-SNAPSHOT</version>
<version>2.1.2.RELEASE</version>
<relativePath>..</relativePath>
</parent>
<artifactId>spring-cloud-config-monitor</artifactId>
@@ -14,7 +14,7 @@
<description>Spring Cloud Config Monitor</description>
<properties>
<main.basedir>${basedir}/../..</main.basedir>
<spring-cloud-bus.version>2.1.1.BUILD-SNAPSHOT</spring-cloud-bus.version>
<spring-cloud-bus.version>2.1.1.RELEASE</spring-cloud-bus.version>
</properties>
<dependencyManagement>
<dependencies>

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config</artifactId>
<version>2.1.2.BUILD-SNAPSHOT</version>
<version>2.1.2.RELEASE</version>
<relativePath>..</relativePath>
</parent>

View File

@@ -13,7 +13,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config</artifactId>
<version>2.1.2.BUILD-SNAPSHOT</version>
<version>2.1.2.RELEASE</version>
<relativePath>..</relativePath>
</parent>

View File

@@ -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.
* <p>The default implementation replaces:
* <p>
* The default implementation replaces:
* <ul>
* <li>Backslash with forward slash.
* <li>Duplicate occurrences of slash with a single slash.
* <li>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"}.
* <li>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"}.
* </ul>
* @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:
* <ul>
@@ -202,9 +200,10 @@ public class GenericResourceRepository
* <li>Paths that represent a {@link org.springframework.util.ResourceUtils#isUrl
* valid URL} or would represent one after the leading slash is removed.
* </ul>
* <p><strong>Note:</strong> 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.
* <p>
* <strong>Note:</strong> 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;
}
}

View File

@@ -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"));
}
}

View File

@@ -6,10 +6,10 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config</artifactId>
<version>2.1.2.BUILD-SNAPSHOT</version>
<version>2.1.2.RELEASE</version>
</parent>
<artifactId>spring-cloud-starter-config</artifactId>
<version>2.1.2.BUILD-SNAPSHOT</version>
<version>2.1.2.RELEASE</version>
<name>spring-cloud-starter-config</name>
<description>Spring Cloud Starter</description>
<url>https://projects.spring.io/spring-cloud</url>