cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Letting AbstractOAuthProvider extensions add as many permissions as needed per a single scope
Date Tue, 30 Aug 2016 20:32:11 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes e6dd9a71f -> d7bbaae0b


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

Branch: refs/heads/3.1.x-fixes
Commit: d7bbaae0b5a0be123a83ab032b3e51a539fed088
Parents: e6dd9a7
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:31:54 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/d7bbaae0/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 9fb2c53..a2fb184 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
@@ -254,7 +254,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;
@@ -264,12 +264,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