Skip to content

Commit a9078ce

Browse files
authored
Fixes #48. Dependencies upgraded. (#49)
1 parent 5c3d0f1 commit a9078ce

File tree

9 files changed

+38
-39
lines changed

9 files changed

+38
-39
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [4.0.7] - ?
6+
7+
### Fixed
8+
- [jaxrs-client-signature integration tests fail to work in Java 9](https://github.com/joyent/java-http-signature/issues/48)
9+
### Changed
10+
- Upgraded dependency versions.
11+
512
## [4.0.6] - 2017-12-18
613

714
### Fixed

apache-http-client/src/main/java/com/joyent/http/signature/apache/httpclient/HttpSignatureAuthenticationStrategy.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import org.apache.http.impl.client.BasicAuthCache;
2929
import org.apache.http.protocol.HttpContext;
3030

31+
import java.util.ArrayDeque;
3132
import java.util.Collections;
32-
import java.util.LinkedList;
3333
import java.util.Map;
3434
import java.util.Objects;
3535
import java.util.Queue;
@@ -140,11 +140,10 @@ public Map<String, Header> getChallenges(final HttpHost authhost,
140140
public Queue<AuthOption> select(final Map<String, Header> challengeHeaders,
141141
final HttpHost authhost,
142142
final HttpResponse response,
143-
final HttpContext context)
144-
throws MalformedChallengeException {
143+
final HttpContext context) {
145144
final HttpClientContext httpClientContext = HttpClientContext.adapt(context);
146145
final AuthState state = httpClientContext.getTargetAuthState();
147-
final Queue<AuthOption> queue = new LinkedList<>();
146+
final Queue<AuthOption> queue = new ArrayDeque<>();
148147

149148
if (state == null || !state.getState().equals(AuthProtocolState.CHALLENGED)) {
150149
queue.add(authOption);

apache-http-client/src/test/java/com/joyent/http/signature/apache/httpclient/HttpSignatureAuthIT.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public class HttpSignatureAuthIT {
3636
private static final String SDC_ACCOUNT_ENV_KEY = "SDC_ACCOUNT";
3737
private static final String SDC_KEY_PATH_ENV_KEY = "SDC_KEY_PATH";
3838

39+
private static final ThreadLocalSigner SIGNER = new ThreadLocalSigner();
40+
3941
// @Test
4042
public void canAuthenticate() throws IOException {
4143
final KeyPair keyPair = createKeyPair();
@@ -60,15 +62,6 @@ public void canAuthenticate() throws IOException {
6062

6163
HttpHead head = new HttpHead(uri);
6264
HttpClientContext context = new HttpClientContext();
63-
64-
// AuthCache authCache = new BasicAuthCache();
65-
// context.setAuthCache(authCache);
66-
// AuthState authState = new AuthState();
67-
// authState.update(configurator.getAuthScheme(), credentials);
68-
//
69-
// context.setAttribute(HttpClientContext.TARGET_AUTH_STATE,
70-
// authState);
71-
// context.getTargetAuthState().setState(AuthProtocolState.UNCHALLENGED);
7265
HttpResponse response = conn.execute(head, context);
7366

7467
assertEquals(response.getStatusLine().getStatusCode(),
@@ -113,10 +106,9 @@ private KeyPair createKeyPair() {
113106
final KeyPair keyPair;
114107
final String keyPath = System.getenv(SDC_KEY_PATH_ENV_KEY);
115108
Objects.requireNonNull(keyPath, SDC_KEY_PATH_ENV_KEY + " must be set");
116-
final ThreadLocalSigner signer = new ThreadLocalSigner();
117109

118110
try {
119-
keyPair = signer.get().getKeyPair(new File(keyPath).toPath());
111+
keyPair = SIGNER.get().getKeyPair(new File(keyPath).toPath());
120112
} catch (IOException e) {
121113
String msg = String.format("Unable to read key files from path: %s",
122114
keyPath);

common/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
<properties>
2222
<!-- Dependency versions -->
23-
<dependency.bouncycastle.version>1.58</dependency.bouncycastle.version>
24-
<dependency.jnagmp.version>2.0.0</dependency.jnagmp.version>
25-
<dependency.commons-codec.version>1.10</dependency.commons-codec.version>
23+
<dependency.bouncycastle.version>1.59</dependency.bouncycastle.version>
24+
<dependency.jnagmp.version>2.1.0</dependency.jnagmp.version>
25+
<dependency.commons-codec.version>1.11</dependency.commons-codec.version>
2626
</properties>
2727

2828
<dependencies>

common/src/main/java/com/joyent/http/signature/Signer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public class Signer {
4848
* defined in the standard library using modern classes.
4949
*/
5050
@Deprecated
51+
@SuppressWarnings("DateFormatConstant")
5152
public static final DateFormat DATE_FORMAT = new SimpleDateFormat(
5253
"EEE MMM d HH:mm:ss yyyy zzz", Locale.ENGLISH);
5354

common/src/main/java/com/joyent/http/signature/crypto/NativeRSAProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class NativeRSAProvider extends Provider {
2121
* Creates an instance of a JCE provider that supports native RSA via jnagmp.
2222
*/
2323
public NativeRSAProvider() {
24+
// This constructor signature will need to be upgraded in the future
2425
super("native-rsa", 1.0, "SHA Digest with RSA Native implementation");
2526
put("Signature.SHA1withNativeRSA", NativeRSAWithSHA.SHA1.class.getName());
2627
put("Signature.SHA256withNativeRSA", NativeRSAWithSHA.SHA256.class.getName());

common/src/test/java/com/joyent/http/signature/KeyFingerprinterIntegrationCycle.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
import java.io.File;
1414
import java.io.IOException;
1515
import java.io.InputStreamReader;
16+
import java.io.UncheckedIOException;
1617
import java.nio.charset.StandardCharsets;
1718
import java.nio.file.Files;
1819
import java.nio.file.Path;
1920
import java.nio.file.Paths;
21+
import java.util.stream.Stream;
2022

2123
/**
2224
* Utility stress test class for comparing generated fingerprints to
@@ -87,13 +89,12 @@ public void run() {
8789
throw new RuntimeException(e);
8890
}
8991
}
90-
try {
91-
Files.walk(tmpDir)
92-
.map(Path::toFile)
92+
try (Stream<Path> paths = Files.walk(tmpDir)){
93+
paths.map(Path::toFile)
9394
.sorted((o1, o2) -> -o1.compareTo(o2))
9495
.forEach(File::delete);
9596
} catch (IOException e) {
96-
throw new RuntimeException(e);
97+
throw new UncheckedIOException(e);
9798
}
9899
}
99100

jaxrs-client/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
<properties>
2222
<!-- Dependency versions -->
23-
<dependency.arquillian.version>1.1.13.Final</dependency.arquillian.version>
24-
<dependency.arquillian-glassfish-embedded-3.1.version>1.0.1</dependency.arquillian-glassfish-embedded-3.1.version>
23+
<dependency.arquillian.version>1.4.0.Final</dependency.arquillian.version>
24+
<dependency.arquillian-glassfish-embedded-3.1.version>1.0.2</dependency.arquillian-glassfish-embedded-3.1.version>
2525
<dependency.http-signature-common.version>4.0.6-SNAPSHOT</dependency.http-signature-common.version>
2626
<dependency.javaee.version>8.0</dependency.javaee.version>
2727
<dependency.jax-rs-api.version>2.1</dependency.jax-rs-api.version>
2828
<dependency.jersey-client.version>2.26</dependency.jersey-client.version>
29-
<dependency.payara-embedded-web.version>4.1.2.173.0.1</dependency.payara-embedded-web.version>
30-
<dependency.arquillian-testng-container>1.1.13.Final</dependency.arquillian-testng-container>
29+
<dependency.payara-embedded-web.version>5.181</dependency.payara-embedded-web.version>
30+
<dependency.arquillian-testng-container>1.4.0.Final</dependency.arquillian-testng-container>
3131
</properties>
3232

3333
<dependencyManagement>

pom.xml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,36 +89,36 @@
8989
<surefire.forkCount>1</surefire.forkCount>
9090
<surefire.useSystemClassLoader>true</surefire.useSystemClassLoader>
9191
<!-- Dependency versions -->
92-
<dependency.checkstyle.version>8.2</dependency.checkstyle.version>
93-
<dependency.apache-httpclient.version>4.5.3</dependency.apache-httpclient.version>
94-
<dependency.testng.version>6.11</dependency.testng.version>
92+
<dependency.checkstyle.version>8.8</dependency.checkstyle.version>
93+
<dependency.apache-httpclient.version>4.5.5</dependency.apache-httpclient.version>
94+
<dependency.testng.version>6.14.2</dependency.testng.version>
9595
<dependency.slfj.version>1.7.25</dependency.slfj.version>
9696
<dependency.logback.version>1.2.3</dependency.logback.version>
9797
<!-- Plugin versions -->
98-
<maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
98+
<maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
9999
<maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>
100100
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
101101
<maven-dependency-plugin.version>3.0.2</maven-dependency-plugin.version>
102102
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
103103
<maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version>
104-
<maven-failsafe-plugin.version>2.20.1</maven-failsafe-plugin.version>
104+
<maven-failsafe-plugin.version>2.21.0</maven-failsafe-plugin.version>
105105
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
106106
<maven-install-plugin.version>2.5.2</maven-install-plugin.version>
107107
<maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
108108
<maven-jarsigner-plugin.version>1.4</maven-jarsigner-plugin.version>
109-
<maven-javadoc-plugin.version>2.10.4</maven-javadoc-plugin.version>
109+
<maven-javadoc-plugin.version>3.0.0</maven-javadoc-plugin.version>
110110
<maven-jxr-plugin.version>2.5</maven-jxr-plugin.version>
111111
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
112112
<maven-resources-plugin.version>3.0.2</maven-resources-plugin.version>
113113
<maven-shade-plugin.version>2.4.2</maven-shade-plugin.version>
114114
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
115-
<maven-surefire-plugin.version>2.20.1</maven-surefire-plugin.version>
116-
<maven-jacoco-plugin.version>0.7.9</maven-jacoco-plugin.version>
115+
<maven-surefire-plugin.version>2.21.0</maven-surefire-plugin.version>
116+
<maven-jacoco-plugin.version>0.8.1</maven-jacoco-plugin.version>
117117
<maven-project-info-reports-plugin.version>2.9</maven-project-info-reports-plugin.version>
118118

119119
<!-- Maven plugin dependency versions -->
120-
<maven-plexus-compiler-javac-errorprone.version>2.8.2</maven-plexus-compiler-javac-errorprone.version>
121-
<maven-error-prone-core.version>2.1.1</maven-error-prone-core.version>
120+
<maven-plexus-compiler-javac-errorprone.version>2.8.3</maven-plexus-compiler-javac-errorprone.version>
121+
<maven-error-prone-core.version>2.2.0</maven-error-prone-core.version>
122122
</properties>
123123

124124
<dependencies>
@@ -233,9 +233,7 @@
233233
<version>${maven-failsafe-plugin.version}</version>
234234
<configuration>
235235
<forkCount>${surefire.forkCount}</forkCount>
236-
<systemPropertyVariables>
237-
<exampleSystemPropertyName>exampleSystemPropertyValue</exampleSystemPropertyName>
238-
</systemPropertyVariables>
236+
<trimStackTrace>false</trimStackTrace>
239237
<useSystemClassLoader>${surefire.useSystemClassLoader}</useSystemClassLoader>
240238
<trimStackTrace>false</trimStackTrace>
241239
</configuration>

0 commit comments

Comments
 (0)