Skip to content

Commit 408456c

Browse files
committed
Adding a trim around the credentials passed in since the endpoint, access id, and key cannot have any spaces
1 parent 18f8c45 commit 408456c

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3ClientBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private Ds3ClientBuilder(final String endpoint, final Credentials credentials) t
5858
if(credentials == null || !credentials.isValid()) {
5959
throw new IllegalArgumentException("Credentials must be filled out.");
6060
}
61-
this.endpoint = endpoint;
61+
this.endpoint = endpoint.trim();
6262
this.credentials = credentials;
6363
}
6464

ds3-sdk/src/main/java/com/spectralogic/ds3client/models/common/Credentials.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public class Credentials {
2424
private final String key;
2525

2626
public Credentials(final String clientId, final String key) {
27-
this.clientId = clientId;
28-
this.key = key;
27+
this.clientId = clientId == null ? null : clientId.trim();
28+
this.key = key == null ? null : key.trim();
2929
}
3030

3131
public String getClientId() {

ds3-sdk/src/test/java/com/spectralogic/ds3client/models/common/Credential_Test.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,11 @@
1616
package com.spectralogic.ds3client.models.common;
1717

1818

19-
import com.spectralogic.ds3client.models.common.Credentials;
2019
import org.junit.Test;
21-
import org.junit.runner.RunWith;
22-
import org.junit.runners.JUnit4;
2320

2421
import static org.hamcrest.CoreMatchers.is;
2522
import static org.hamcrest.MatcherAssert.assertThat;
2623

27-
@RunWith(JUnit4.class)
2824
public class Credential_Test {
2925

3026
@Test

0 commit comments

Comments
 (0)