diff --git a/CHANGELOG.md b/CHANGELOG.md index 919e18e13895..3c5d57d4e034 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## __AWS SDK for Java v2__ + - ### Bugfixes + - The period, solidus, at-sign, and percent sign are now allowed in profile names and property names. + # __2.10.29__ __2019-12-03__ ## __AWS Lambda__ - ### Features diff --git a/core/profiles/src/main/java/software/amazon/awssdk/profiles/internal/ProfileFileReader.java b/core/profiles/src/main/java/software/amazon/awssdk/profiles/internal/ProfileFileReader.java index 99eda03eb688..48223386a9d3 100644 --- a/core/profiles/src/main/java/software/amazon/awssdk/profiles/internal/ProfileFileReader.java +++ b/core/profiles/src/main/java/software/amazon/awssdk/profiles/internal/ProfileFileReader.java @@ -42,7 +42,7 @@ public final class ProfileFileReader { private static final Pattern EMPTY_LINE = Pattern.compile("^[\t ]*$"); - private static final Pattern VALID_IDENTIFIER = Pattern.compile("^[A-Za-z0-9_\\-]*$"); + private static final Pattern VALID_IDENTIFIER = Pattern.compile("^[A-Za-z0-9_\\-/.%@]*$"); private ProfileFileReader() {} @@ -213,7 +213,7 @@ private static Optional parseProfileDefinition(ParserState state, String // If the profile name includes invalid characters, it should be ignored. if (!isValidIdentifier(profileName)) { log.warn(() -> "Ignoring profile '" + standardizedProfileName + "' on line " + state.currentLineNumber + " because " + - "it was not alphanumeric with dashes or underscores."); + "it was not alphanumeric with only these special characters: - / . % @ _"); return Optional.empty(); } @@ -256,7 +256,7 @@ private static Optional> parsePropertyDefinition(ParserStat // If the profile name includes invalid characters, it should be ignored. if (!isValidIdentifier(propertyKey)) { log.warn(() -> "Ignoring property '" + propertyKey + "' on line " + state.currentLineNumber + " because " + - "its name was not alphanumeric with dashes or underscores."); + "its name was not alphanumeric with only these special characters: - / . % @ _"); return Optional.empty(); } diff --git a/core/profiles/src/test/java/software/amazon/awssdk/profiles/ProfileFileTest.java b/core/profiles/src/test/java/software/amazon/awssdk/profiles/ProfileFileTest.java index d949eddc0ac6..ec9a2cf0aa61 100644 --- a/core/profiles/src/test/java/software/amazon/awssdk/profiles/ProfileFileTest.java +++ b/core/profiles/src/test/java/software/amazon/awssdk/profiles/ProfileFileTest.java @@ -326,14 +326,14 @@ public void invalidPropertyNamesAreIgnored() { @Test public void allValidProfileNameCharactersAreSupported() { - assertThat(configFileProfiles("[profile ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_]")) - .isEqualTo(profiles(profile("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"))); + assertThat(configFileProfiles("[profile ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_./%@]")) + .isEqualTo(profiles(profile("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_./%@"))); } @Test public void allValidPropertyNameCharactersAreSupported() { - assertThat(configFileProfiles("[profile foo]\nABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_ = value")) - .isEqualTo(profiles(profile("foo", property("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", + assertThat(configFileProfiles("[profile foo]\nABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_./%@ = value")) + .isEqualTo(profiles(profile("foo", property("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_./%@", "value")))); }