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:42:43 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 99653ffc5 -> 1f123776f


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/1f123776
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1f123776
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1f123776

Branch: refs/heads/master
Commit: 1f123776f1e56e5b42c20550d10eb150789e60a2
Parents: 99653ff
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:42:05 2014 +0000

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


http://git-wip-us.apache.org/repos/asf/cxf/blob/1f123776/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