cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [1/2] cxf git commit: Minor update to the abstract oauth2 provider
Date Tue, 07 Mar 2017 16:53:01 GMT
Repository: cxf
Updated Branches:
  refs/heads/master f17784b09 -> a776fbd6c


Minor update to the abstract oauth2 provider


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

Branch: refs/heads/master
Commit: c63096efa7eaab67b81ab6f6ca7d075642c95fb5
Parents: 41262ee
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Tue Mar 7 16:52:24 2017 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Tue Mar 7 16:52:24 2017 +0000

----------------------------------------------------------------------
 .../oauth2/provider/AbstractOAuthDataProvider.java        | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c63096ef/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
index 61d9361..339e07d 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
@@ -245,9 +245,7 @@ public abstract class AbstractOAuthDataProvider implements OAuthDataProvider,
Cl
 
     @Override
     public List<OAuthPermission> convertScopeToPermissions(Client client, List<String>
requestedScopes) {
-        if (requiredScopes != null && !requestedScopes.containsAll(requiredScopes))
{
-            throw new OAuthServiceException("Required scopes are missing");
-        }
+        checkRequestedScopes(client, requestedScopes);
         if (requestedScopes.isEmpty()) {
             return Collections.emptyList();
         } else {
@@ -262,6 +260,12 @@ public abstract class AbstractOAuthDataProvider implements OAuthDataProvider,
Cl
         throw new OAuthServiceException("Requested scopes can not be mapped");
 
     }
+    
+    protected void checkRequestedScopes(Client client, List<String> requestedScopes)
{
+        if (requiredScopes != null && !requestedScopes.containsAll(requiredScopes))
{
+            throw new OAuthServiceException("Required scopes are missing");
+        }
+    }
 
     protected void convertSingleScopeToPermission(Client client,
                                                   String scope,


Mime
View raw message