cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Bearer token type must be upper-case (was lower case in early drafts), as well spotted by Jan
Date Fri, 04 Dec 2015 15:39:40 GMT
Repository: cxf
Updated Branches:
  refs/heads/master f94e1dd9b -> 0b9ce1c16


Bearer token type must be upper-case (was lower case in early drafts), as well spotted by
Jan


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0b9ce1c1
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0b9ce1c1
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0b9ce1c1

Branch: refs/heads/master
Commit: 0b9ce1c16e77a43aaa188553a601105545e59b0b
Parents: f94e1dd
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Fri Dec 4 15:39:23 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Fri Dec 4 15:39:23 2015 +0000

----------------------------------------------------------------------
 .../apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java   | 4 ++--
 .../org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java  | 2 +-
 .../cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/0b9ce1c1/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
index 9d19af9..e00ce0b 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
@@ -409,11 +409,11 @@ public final class OAuthClientUtils {
         throws OAuthServiceException {
         // this should all be handled by token specific serializers
         String tokenType = token.getTokenType().toLowerCase();
-        if (OAuthConstants.BEARER_TOKEN_TYPE.equals(tokenType)) {
+        if (OAuthConstants.BEARER_TOKEN_TYPE.equalsIgnoreCase(tokenType)) {
             sb.append(OAuthConstants.BEARER_AUTHORIZATION_SCHEME);
             sb.append(" ");
             sb.append(token.getTokenKey());
-        } else if (OAuthConstants.HAWK_TOKEN_TYPE.equals(tokenType)) {
+        } else if (OAuthConstants.HAWK_TOKEN_TYPE.equalsIgnoreCase(tokenType)) {
             if (httpProps == null) {
                 throw new IllegalArgumentException("MAC scheme requires HTTP Request properties");
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/0b9ce1c1/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java
index 8a5d457..8a98eff 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/OAuthConstants.java
@@ -55,7 +55,7 @@ public final class OAuthConstants {
     public static final String DIRECT_TOKEN_GRANT = "urn:ietf:params:oauth:grant-type:direct-token-grant";
     
     // Well-known token types
-    public static final String BEARER_TOKEN_TYPE = "bearer";
+    public static final String BEARER_TOKEN_TYPE = "Bearer";
     public static final String HAWK_TOKEN_TYPE = "hawk";
     
     // https://tools.ietf.org/html/rfc7636

http://git-wip-us.apache.org/repos/asf/cxf/blob/0b9ce1c1/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java
b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java
index 988d329..7d04c7d 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/OAuthJSONProviderTest.java
@@ -86,7 +86,7 @@ public class OAuthJSONProviderTest extends Assert {
                           new MetadataMap<String, String>(), 
                           new ByteArrayInputStream(response.getBytes()));
         assertEquals("1234", token.getTokenKey());
-        assertEquals(expectedTokenType, token.getTokenType());
+        assertTrue(expectedTokenType.equalsIgnoreCase(token.getTokenType()));
         assertEquals("5678", token.getRefreshToken());
         assertEquals(12345, token.getExpiresIn());
         assertEquals("read", token.getApprovedScope());


Mime
View raw message