cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6723] Removing OAuthDataProvider removeAccessToken
Date Mon, 28 Dec 2015 16:47:22 GMT
Repository: cxf
Updated Branches:
  refs/heads/master f8befff00 -> efb1f0830


[CXF-6723] Removing OAuthDataProvider removeAccessToken


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

Branch: refs/heads/master
Commit: efb1f0830f5441777198737fb26e9305ab969f66
Parents: f8befff
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon Dec 28 16:47:06 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon Dec 28 16:47:06 2015 +0000

----------------------------------------------------------------------
 .../security/oauth2/provider/AbstractOAuthDataProvider.java | 5 -----
 .../cxf/rs/security/oauth2/provider/OAuthDataProvider.java  | 9 ---------
 .../oauth2/services/AbstractAccessTokenValidator.java       | 7 ++++---
 .../rs/security/oauth2/grants/OAuthDataProviderImpl.java    | 6 ------
 .../oauth2/utils/crypto/EncryptingDataProvider.java         | 5 -----
 .../jaxrs/security/oauth2/OAuthDataProviderImpl.java        | 6 ------
 6 files changed, 4 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/efb1f083/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 edfabb6..5bec101 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
@@ -72,11 +72,6 @@ public abstract class AbstractOAuthDataProvider implements OAuthDataProvider,
Cl
     }
     
     @Override
-    public void removeAccessToken(ServerAccessToken token) throws OAuthServiceException {
-        revokeAccessToken(token.getTokenKey());
-    }
-    
-    @Override
     public ServerAccessToken refreshAccessToken(Client client, String refreshTokenKey,
                                                 List<String> restrictedScopes) throws
OAuthServiceException {
         RefreshToken currentRefreshToken = recycleRefreshTokens 

http://git-wip-us.apache.org/repos/asf/cxf/blob/efb1f083/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthDataProvider.java
index d46e6da..b7ae576 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/OAuthDataProvider.java
@@ -87,15 +87,6 @@ public interface OAuthDataProvider {
         throws OAuthServiceException;
 
     /**
-     * Removes the access token
-     * The runtime will call this method if it finds that a token has expired
-     * @param accessToken the token
-     * @throws OAuthServiceException
-     */
-    @Deprecated
-    void removeAccessToken(ServerAccessToken accessToken) throws OAuthServiceException;
-    
-    /**
      * Return all access tokens associated with a given client
      * @param client the client
      * @return list of access tokens

http://git-wip-us.apache.org/repos/asf/cxf/blob/efb1f083/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java
index 666e7e4..95257d4 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractAccessTokenValidator.java
@@ -144,9 +144,10 @@ public abstract class AbstractAccessTokenValidator {
         return accessTokenV;
     }
 
-    @SuppressWarnings("deprecation")
-    protected void removeAccessToken(ServerAccessToken localAccessToken) {
-        dataProvider.removeAccessToken(localAccessToken);
+    protected void removeAccessToken(ServerAccessToken at) {
+        dataProvider.revokeToken(at.getClient(), 
+                                 at.getTokenKey(), 
+                                 OAuthConstants.ACCESS_TOKEN);
     }
 
     protected boolean validateAudience(String audience) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/efb1f083/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/grants/OAuthDataProviderImpl.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/grants/OAuthDataProviderImpl.java
b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/grants/OAuthDataProviderImpl.java
index 99143c0..3be5549 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/grants/OAuthDataProviderImpl.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/grants/OAuthDataProviderImpl.java
@@ -66,12 +66,6 @@ public class OAuthDataProviderImpl implements OAuthDataProvider {
     }
 
     @Override
-    public void removeAccessToken(ServerAccessToken accessToken) throws OAuthServiceException
{
-        // TODO Auto-generated method stub
-        
-    }
-
-    @Override
     public List<OAuthPermission> convertScopeToPermissions(Client client, List<String>
requestedScope) {
         // TODO Auto-generated method stub
         return null;

http://git-wip-us.apache.org/repos/asf/cxf/blob/efb1f083/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/utils/crypto/EncryptingDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/utils/crypto/EncryptingDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/utils/crypto/EncryptingDataProvider.java
index e2e7b3e..55c9332 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/utils/crypto/EncryptingDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/utils/crypto/EncryptingDataProvider.java
@@ -88,11 +88,6 @@ public class EncryptingDataProvider implements OAuthDataProvider {
     }
 
     @Override
-    public void removeAccessToken(ServerAccessToken accessToken) throws OAuthServiceException
{
-        tokens.remove(accessToken.getTokenKey());
-    }
-
-    @Override
     public void revokeToken(Client client, String token, String tokenTypeHint)
         throws OAuthServiceException {
         // the fast way: if it is the refresh token then there will be a matching value for
it

http://git-wip-us.apache.org/repos/asf/cxf/blob/efb1f083/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/OAuthDataProviderImpl.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/OAuthDataProviderImpl.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/OAuthDataProviderImpl.java
index 47b2fce..cd3da5d 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/OAuthDataProviderImpl.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/OAuthDataProviderImpl.java
@@ -102,12 +102,6 @@ public class OAuthDataProviderImpl implements OAuthDataProvider {
     }
 
     @Override
-    public void removeAccessToken(ServerAccessToken accessToken) throws OAuthServiceException
{
-        // TODO Auto-generated method stub
-        
-    }
-
-    @Override
     public List<OAuthPermission> convertScopeToPermissions(Client client, List<String>
requestedScope) {
         // TODO Auto-generated method stub
         return null;


Mime
View raw message