cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [2/2] cxf git commit: Updating AbstractOAuthProvider with some boilerplate code
Date Tue, 08 Dec 2015 16:22:25 GMT
Updating AbstractOAuthProvider with some boilerplate code


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

Branch: refs/heads/master
Commit: 8461ddd121a1ded290fa38524b3f2cd7aa667ca3
Parents: 8aebfa3 03f3fec
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Tue Dec 8 16:22:04 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Tue Dec 8 16:22:04 2015 +0000

----------------------------------------------------------------------
 .../provider/AbstractOAuthDataProvider.java     |   7 +-
 .../oauth2/provider/OAuthDataProvider.java      |   4 +-
 systests/rs-security/pom.xml                    |   9 -
 .../jaxrs/security/oauth2/JAXRSOAuth2Test.java  | 106 ++++-
 .../security/oauth2/OAuthDataProviderImpl.java  |   1 +
 .../security/oauth2/SamlCallbackHandler.java    |  53 ++-
 .../security/oauth2/SamlCallbackHandler2.java   | 158 -------
 .../oauth2/grants/AuthorizationGrantTest.java   | 447 +++++++++++++++++++
 .../security/oauth2/grants/BasicAuthFilter.java | 117 +++++
 .../oauth2/grants/BookServerOAuth2Grants.java   |  48 ++
 .../oauth2/grants/CallbackHandlerImpl.java      |  52 +++
 .../grants/CallbackHandlerLoginHandler.java     |  83 ++++
 .../oauth2/grants/OAuthDataProviderImpl.java    | 101 +++++
 .../jaxrs/security/oauth2/grants/client.xml     |  38 ++
 .../security/oauth2/grants/grants-server.xml    | 142 ++++++
 .../systest/jaxrs/security/oauth2/server.xml    |  29 ++
 16 files changed, 1209 insertions(+), 186 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/8461ddd1/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
----------------------------------------------------------------------
diff --cc rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
index a74aaf7,3c88608..149bff1
--- 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
@@@ -140,21 -133,12 +140,20 @@@ public abstract class AbstractOAuthData
          return currentRefreshToken;
      }
  
 -    
 -
      @Override
-     public List<OAuthPermission> convertScopeToPermissions(Client client, List<String>
requestedScope)
-             throws OAuthServiceException {
-         if (requestedScope.isEmpty()) {
+     public List<OAuthPermission> convertScopeToPermissions(Client client, List<String>
requestedScopes) {
+         if (requestedScopes.isEmpty()) {
              return Collections.emptyList();
 +        } else if (!permissionMap.isEmpty()) {
 +            List<OAuthPermission> list = new ArrayList<OAuthPermission>();
-             for (String scope : requestedScope) {
++            for (String scope : requestedScopes) {
 +                OAuthPermission permission = permissionMap.get(scope);
 +                if (permission == null) {
 +                    throw new OAuthServiceException("Unexpected scope: " + scope);
 +                }
 +                list.add(permission);
 +            }
 +            return list;
          } else {
              throw new OAuthServiceException("Requested scopes can not be mapped");
          }


Mime
View raw message