cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [03/23] cxf git commit: Letting AbstractOAuthProvider extensions add as many permissions as needed per a single scope
Date Mon, 05 Sep 2016 01:10:10 GMT
Letting AbstractOAuthProvider extensions add as many permissions as needed per a single scope


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

Branch: refs/heads/master-jaxrs-2.1
Commit: 457ad7c4e99269999073a358ac9ff9508b858f1b
Parents: 502db47
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Tue Aug 30 21:29:00 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Tue Aug 30 21:29:00 2016 +0100

----------------------------------------------------------------------
 .../security/oauth2/provider/AbstractOAuthDataProvider.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/457ad7c4/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 9a3631e..41acfef 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
@@ -249,7 +249,7 @@ public abstract class AbstractOAuthDataProvider implements OAuthDataProvider,
Cl
         } else {
             List<OAuthPermission> list = new ArrayList<OAuthPermission>();
             for (String scope : requestedScopes) {
-                list.add(convertSingleScopeToPermission(client, scope));
+                convertSingleScopeToPermission(client, scope, list);
             }
             if (!list.isEmpty()) {
                 return list;
@@ -259,12 +259,14 @@ public abstract class AbstractOAuthDataProvider implements OAuthDataProvider,
Cl
         
     }
 
-    protected OAuthPermission convertSingleScopeToPermission(Client client, String scope)
{
+    protected void convertSingleScopeToPermission(Client client, 
+                                                  String scope,
+                                                  List<OAuthPermission> perms) {
         OAuthPermission permission = permissionMap.get(scope);
         if (permission == null) {
             throw new OAuthServiceException("Unexpected scope: " + scope);
         }
-        return permission;
+        perms.add(permission);
     }
 
     @Override


Mime
View raw message