Skip to content

Commit 8198c03

Browse files
authored
Merge pull request #13 from dchenbec/master
Fix newline handling on Windows
2 parents 772e02b + 30da7c7 commit 8198c03

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
## [4.0.3] - 2020-05-15
4+
5+
Updated the plugin to fix newlines used in the SigV4 signature on Windows. This resolves [Issue
6+
#12](https://github.com/aws/aws-sigv4-auth-cassandra-java-driver-plugin/issues/12).
7+
38
## [4.0.2] - 2020-03-31
49

510
Changed the plugin to use a `DateTimeFormatter` to ensure precisely 3 digits of millisecond precision for the SigV4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# IMPORTANT: Latest Version
22

3-
The current version is 4.0.2. The 4.0.0 version was built with JDK9, which includes a breaking API change in ByteBuffer, despite targetting Java 8 source and bytecode. The 4.0.1 version has a bug related to `Instant.toString()`, which causes signature mismatch errors on JDK9 and later.
3+
The current version is 4.0.3. Please see the [changelog](./CHANGELOG.md) for details on version history.
44

55
# What
66

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>software.aws.mcs</groupId>
55
<artifactId>aws-sigv4-auth-cassandra-java-driver-plugin</artifactId>
6-
<version>4.0.2</version>
6+
<version>4.0.3</version>
77
<name>AWS SigV4 Auth Java Driver 4.x Plugin</name>
88
<description>A Plugin to allow SigV4 authentication for Java Cassandra drivers with Amazon MCS</description>
99
<url>https://github.com/aws/aws-sigv4-auth-cassandra-java-driver-plugin</url>

src/main/java/software/aws/mcs/auth/SigV4AuthProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ private String generateSignature(byte[] nonce, Instant requestTimestamp, AWSCred
275275

276276
String canonicalRequest = canonicalizeRequest(credentials.getAWSAccessKeyId(), signingScope, requestTimestamp, nonceHash);
277277

278-
String stringToSign = String.format("%s%n%s%n%s%n%s",
278+
String stringToSign = String.format("%s\n%s\n%s\n%s",
279279
SignerConstants.AWS4_SIGNING_ALGORITHM,
280280
timestampFormatter.format(requestTimestamp),
281281
signingScope,
@@ -313,7 +313,7 @@ private static String canonicalizeRequest(String accessKey,
313313

314314
String queryString = String.join("&", queryStringHeaders);
315315

316-
return String.format("PUT%n/authenticate%n%s%nhost:%s%n%nhost%n%s",
316+
return String.format("PUT\n/authenticate\n%s\nhost:%s\n\nhost\n%s",
317317
queryString, CANONICAL_SERVICE, payloadHash);
318318
}
319319

0 commit comments

Comments
 (0)