cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Minor update to a client Hawk validator
Date Tue, 09 Dec 2014 10:43:57 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes e9b59cae1 -> 877c386dc


Minor update to a client Hawk validator


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

Branch: refs/heads/3.0.x-fixes
Commit: 877c386dce027d0302b90971f158d8df7b4c8966
Parents: e9b59ca
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Dec 9 10:42:05 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Dec 9 10:43:21 2014 +0000

----------------------------------------------------------------------
 .../oauth2/tokens/hawk/HawkAccessTokenValidatorClient.java  | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/877c386d/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/tokens/hawk/HawkAccessTokenValidatorClient.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/tokens/hawk/HawkAccessTokenValidatorClient.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/tokens/hawk/HawkAccessTokenValidatorClient.java
index 196e82b..8e615fb 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/tokens/hawk/HawkAccessTokenValidatorClient.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/tokens/hawk/HawkAccessTokenValidatorClient.java
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.rs.security.oauth2.tokens.hawk;
 
+import java.util.List;
 import java.util.Map;
 
 import org.apache.cxf.jaxrs.ext.MessageContext;
@@ -34,5 +35,13 @@ public class HawkAccessTokenValidatorClient extends AbstractHawkAccessTokenValid
         return validator.validateAccessToken(mc, OAuthConstants.HAWK_AUTHORIZATION_SCHEME,

                                              authSchemeData);
     }
+
+    public void setValidator(AccessTokenValidator validator) {
+        List<String> schemes = validator.getSupportedAuthorizationSchemes();
+        if (!schemes.contains("*") && !schemes.contains(OAuthConstants.HAWK_AUTHORIZATION_SCHEME))
{ 
+            throw new IllegalArgumentException();
+        }
+        this.validator = validator;
+    }
     
 }


Mime
View raw message