Skip to content

Commit 73c29f5

Browse files
committed
drop toString method from *Tokens to prevent leak of sensible data (token ans secrets) (thanks to https://github.com/rcaa)
1 parent 76f626e commit 73c29f5

File tree

59 files changed

+66
-163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+66
-163
lines changed

changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* add support for RFC 7009 OAuth 2.0 Token Revocation (thanks to https://github.com/vivin)
1010
* add OAuth2Service signRequest method accepting just String, not OAuth2 Access Token Object.
1111
Remove signRequest from abstract OAuthService. 2.0 and 1.0a will be a bit more different now.
12+
* drop toString method from *Tokens to prevent leak of sensible data (token ans secrets) (thanks to https://github.com/rcaa)
1213

1314
[4.2.0]
1415
* DELETE in JdkClient permits, but not requires payload (thanks to https://github.com/miguelD73)

scribejava-apis/src/main/java/com/github/scribejava/apis/openid/OpenIdOAuth2AccessToken.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,4 @@ public boolean equals(Object obj) {
5656

5757
return Objects.equals(openIdToken, ((OpenIdOAuth2AccessToken) obj).getOpenIdToken());
5858
}
59-
60-
@Override
61-
public String toString() {
62-
return "OpenIdOAuth2AccessToken{"
63-
+ "access_token=" + getAccessToken()
64-
+ ", token_type=" + getTokenType()
65-
+ ", expires_in=" + getExpiresIn()
66-
+ ", refresh_token=" + getRefreshToken()
67-
+ ", scope=" + getScope()
68-
+ ", open_id_token=" + openIdToken + '}';
69-
}
7059
}

scribejava-apis/src/main/java/com/github/scribejava/apis/salesforce/SalesforceToken.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,4 @@ public boolean equals(Object obj) {
5151
}
5252
return Objects.equals(instanceUrl, ((SalesforceToken) obj).getInstanceUrl());
5353
}
54-
55-
@Override
56-
public String toString() {
57-
return "SalesforceToken{"
58-
+ "access_token=" + getAccessToken()
59-
+ ", token_type=" + getTokenType()
60-
+ ", expires_in=" + getExpiresIn()
61-
+ ", refresh_token=" + getRefreshToken()
62-
+ ", scope=" + getScope()
63-
+ ", instance_url=" + instanceUrl + '}';
64-
}
6554
}

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/AWeberExample.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ public static void main(String... args) throws IOException, InterruptedException
5050
System.out.println("Trading the Request Token for an Access Token...");
5151
final OAuth1AccessToken accessToken = service.getAccessToken(requestToken, oauthVerifier);
5252
System.out.println("Got the Access Token!");
53-
System.out.println("(if your curious it looks like this: " + accessToken
54-
+ ", 'rawResponse'='" + accessToken.getRawResponse() + "')");
53+
System.out.println("(if your curious the raw answer looks like this: " + accessToken.getRawResponse() + "')");
5554
System.out.println();
5655

5756
// Now let's go and ask for a protected resource!

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/Box20Example.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ public static void main(String... args) throws IOException, InterruptedException
6969
System.out.println("Trading the Request Token for an Access Token...");
7070
final OAuth2AccessToken accessToken = service.getAccessToken(code);
7171
System.out.println("Got the Access Token!");
72-
System.out.println("(If you're curious, it looks like this: " + accessToken
73-
+ ", 'rawResponse'='" + accessToken.getRawResponse() + "')");
72+
System.out.println("(if your curious the raw answer looks like this: " + accessToken.getRawResponse() + "')");
7473

7574
System.out.println();
7675

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/DiggExample.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ public static void main(String... args) throws IOException, InterruptedException
5353
System.out.println("Trading the Request Token for an Access Token...");
5454
final OAuth1AccessToken accessToken = service.getAccessToken(requestToken, oauthVerifier);
5555
System.out.println("Got the Access Token!");
56-
System.out.println("(if your curious it looks like this: " + accessToken
57-
+ ", 'rawResponse'='" + accessToken.getRawResponse() + "')");
56+
System.out.println("(if your curious the raw answer looks like this: " + accessToken.getRawResponse() + "')");
5857
System.out.println();
5958

6059
// Now let's go and ask for a protected resource!

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/EtsyExample.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ public static void main(String[] args) throws InterruptedException, ExecutionExc
4747
System.out.println("Trading the Request Token for an Access Token...");
4848
final OAuth1AccessToken accessToken = service.getAccessToken(requestToken, oauthVerifier);
4949
System.out.println("Got the Access Token!");
50-
System.out.println("(if your curious it looks like this: " + accessToken
51-
+ ", 'rawResponse'='" + accessToken.getRawResponse() + "')");
50+
System.out.println("(if your curious the raw answer looks like this: " + accessToken.getRawResponse() + "')");
5251
System.out.println();
5352

5453
// Now let's go and ask for a protected resource!

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/FacebookAsyncNingExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public static void main(String... args) throws InterruptedException, ExecutionEx
7474
System.out.println("Trading the Request Token for an Access Token...");
7575
final OAuth2AccessToken accessToken = service.getAccessTokenAsync(code).get();
7676
System.out.println("Got the Access Token!");
77-
System.out.println("(if your curious it looks like this: " + accessToken
78-
+ ", 'rawResponse'='" + accessToken.getRawResponse() + "')");
77+
System.out.println("(if your curious the raw answer looks like this: " + accessToken.getRawResponse()
78+
+ "')");
7979
System.out.println();
8080

8181
// Now let's go and ask for a protected resource!

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/FacebookExample.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ public static void main(String... args) throws IOException, InterruptedException
6363
System.out.println("Trading the Request Token for an Access Token...");
6464
final OAuth2AccessToken accessToken = service.getAccessToken(code);
6565
System.out.println("Got the Access Token!");
66-
System.out.println("(if your curious it looks like this: " + accessToken
67-
+ ", 'rawResponse'='" + accessToken.getRawResponse() + "')");
66+
System.out.println("(if your curious the raw answer looks like this: " + accessToken.getRawResponse() + "')");
6867
System.out.println();
6968

7069
// Now let's go and ask for a protected resource!

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/FlickrExample.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ public static void main(String... args) throws IOException, InterruptedException
5151
System.out.println("Trading the Request Token for an Access Token...");
5252
final OAuth1AccessToken accessToken = service.getAccessToken(requestToken, oauthVerifier);
5353
System.out.println("Got the Access Token!");
54-
System.out.println("(if your curious it looks like this: " + accessToken
55-
+ ", 'rawResponse'='" + accessToken.getRawResponse() + "')");
54+
System.out.println("(if your curious the raw answer looks like this: " + accessToken.getRawResponse() + "')");
5655
System.out.println();
5756

5857
// Now let's go and ask for a protected resource!

0 commit comments

Comments
 (0)