cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Deprecating OAuthPermission.isDefault
Date Thu, 21 Apr 2016 16:29:32 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 3a1084d86 -> e92e57c1f


Deprecating OAuthPermission.isDefault


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

Branch: refs/heads/master
Commit: e92e57c1f14de911cd2315a907443c79e91a94de
Parents: 3a1084d
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Thu Apr 21 17:29:13 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Thu Apr 21 17:29:13 2016 +0100

----------------------------------------------------------------------
 .../security/oauth2/common/OAuthPermission.java | 22 +++++++++++++-------
 .../provider/AbstractOAuthDataProvider.java     |  2 +-
 .../utils/crypto/ModelEncryptionSupport.java    |  4 ++--
 3 files changed, 18 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e92e57c1/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
index ce60032..62a2e4c 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
@@ -25,6 +25,7 @@ import java.util.List;
 import javax.persistence.ElementCollection;
 import javax.persistence.Entity;
 import javax.persistence.Id;
+import javax.persistence.Transient;
 import javax.xml.bind.annotation.XmlRootElement;
 
 /**
@@ -42,7 +43,7 @@ public class OAuthPermission implements Serializable {
     private List<String> uris = new LinkedList<String>();
     private String permission;
     private String description;
-    private boolean isDefault;
+    private boolean isDefaultPermission;
     private boolean invisibleToClient;
     
     public OAuthPermission() {
@@ -136,14 +137,20 @@ public class OAuthPermission implements Serializable {
      * optionally select 'add' and/or 'update' scopes, in addition to the default 'read'
one. 
      * @param isDefault true if the permission has been allocated by default
      */
-    public void setDefault(boolean value) {
-        this.isDefault = value;
+    public void setDefaultPermission(boolean value) {
+        this.isDefaultPermission = value;
     }
 
+    public boolean isDefaultPermission() {
+        return isDefaultPermission;
+    }
+    
+    @Deprecated
+    @Transient
     public boolean isDefault() {
-        return isDefault;
+        return isDefaultPermission;
     }
-
+    
     public boolean isInvisibleToClient() {
         return invisibleToClient;
     }
@@ -183,7 +190,8 @@ public class OAuthPermission implements Serializable {
             || getDescription() != null && !getDescription().equals(that.getDescription()))
{
             return false;
         }
-        if (isInvisibleToClient() != that.isInvisibleToClient() || isDefault() != that.isDefault())
{ //NOPMD
+        if (isInvisibleToClient() != that.isInvisibleToClient() //NOPMD
+            || isDefaultPermission() != that.isDefaultPermission()) { //NOPMD
             return false;
         }
         
@@ -204,7 +212,7 @@ public class OAuthPermission implements Serializable {
             hashCode = 31 * hashCode + getDescription().hashCode();
         }
         hashCode = 31 * hashCode + Boolean.hashCode(isInvisibleToClient());
-        hashCode = 31 * hashCode + Boolean.hashCode(isDefault());
+        hashCode = 31 * hashCode + Boolean.hashCode(isDefaultPermission());
         
         return hashCode;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/e92e57c1/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 1a312f6..4169f4b 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
@@ -284,7 +284,7 @@ public abstract class AbstractOAuthDataProvider implements OAuthDataProvider,
Cl
     public void init() {
         for (OAuthPermission perm : permissionMap.values()) {
             if (defaultScopes != null && defaultScopes.contains(perm.getPermission()))
{
-                perm.setDefault(true);
+                perm.setDefaultPermission(true);
             }
             if (invisibleToClientScopes != null && invisibleToClientScopes.contains(perm.getPermission()))
{
                 perm.setInvisibleToClient(true);

http://git-wip-us.apache.org/repos/asf/cxf/blob/e92e57c1/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/crypto/ModelEncryptionSupport.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/crypto/ModelEncryptionSupport.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/crypto/ModelEncryptionSupport.java
index 9f5a929..3a72698 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/crypto/ModelEncryptionSupport.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/crypto/ModelEncryptionSupport.java
@@ -245,7 +245,7 @@ public final class ModelEncryptionSupport {
             String[] allPermParts = parts[9].split("\\.");
             for (int i = 0; i + 4 < allPermParts.length; i = i + 5) {
                 OAuthPermission perm = new OAuthPermission(allPermParts[i], allPermParts[i
+ 1]);
-                perm.setDefault(Boolean.valueOf(allPermParts[i + 2]));
+                perm.setDefaultPermission(Boolean.valueOf(allPermParts[i + 2]));
                 perm.setHttpVerbs(parseSimpleList(allPermParts[i + 3]));
                 perm.setUris(parseSimpleList(allPermParts[i + 4]));
                 perms.add(perm);
@@ -309,7 +309,7 @@ public final class ModelEncryptionSupport {
                 state.append(tokenizeString(p.getDescription()));
                 state.append(".");
                 // 9.3
-                state.append(p.isDefault());
+                state.append(p.isDefaultPermission());
                 state.append(".");
                 // 9.4
                 state.append(p.getHttpVerbs().toString());


Mime
View raw message