ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gau...@apache.org
Subject ranger git commit: RANGER-1560 : Code Improvement To Follow Best Practices
Date Fri, 05 May 2017 18:13:33 GMT
Repository: ranger
Updated Branches:
  refs/heads/master 58116e011 -> a5ab9a34d


RANGER-1560 : Code Improvement To Follow Best Practices

Signed-off-by: Gautam Borad <gautam@apache.org>


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

Branch: refs/heads/master
Commit: a5ab9a34d3c8a66d3119f9bd552bd35ce68b03ed
Parents: 58116e0
Author: Ankita Sinha <ankita@apache.org>
Authored: Fri May 5 16:58:26 2017 +0530
Committer: Gautam Borad <gautam@apache.org>
Committed: Fri May 5 23:42:58 2017 +0530

----------------------------------------------------------------------
 .../ranger/plugin/model/RangerPolicyResourceSignature.java       | 4 ++--
 .../ranger/plugin/store/RangerServiceResourceSignature.java      | 2 +-
 .../ranger/plugin/model/TestRangerPolicyResourceSignature.java   | 2 +-
 .../apache/ranger/authorization/hive/udf/RangerUdfMaskHash.java  | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/a5ab9a34/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicyResourceSignature.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicyResourceSignature.java
b/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicyResourceSignature.java
index 27d0e42..00e60e2 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicyResourceSignature.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicyResourceSignature.java
@@ -45,7 +45,7 @@ public class RangerPolicyResourceSignature {
 		_policy = policy;
 		PolicySerializer serializer = new PolicySerializer(_policy);
 		_string = serializer.toString();
-		_hash = DigestUtils.md5Hex(_string);
+                _hash = DigestUtils.sha256Hex(_string);
 	}
 
 	/**
@@ -59,7 +59,7 @@ public class RangerPolicyResourceSignature {
 		} else {
 			_string = string;
 		}
-		_hash = DigestUtils.md5Hex(_string);
+                _hash = DigestUtils.sha256Hex(_string);
 	}
 	
 	String asString() {

http://git-wip-us.apache.org/repos/asf/ranger/blob/a5ab9a34/agents-common/src/main/java/org/apache/ranger/plugin/store/RangerServiceResourceSignature.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/store/RangerServiceResourceSignature.java
b/agents-common/src/main/java/org/apache/ranger/plugin/store/RangerServiceResourceSignature.java
index d643034..eb9a9d2 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/store/RangerServiceResourceSignature.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/store/RangerServiceResourceSignature.java
@@ -31,7 +31,7 @@ public class RangerServiceResourceSignature {
 
 	public RangerServiceResourceSignature(RangerServiceResource serviceResource) {
 		_string = ServiceResourceSerializer.toString(serviceResource);
-		_hash   = DigestUtils.md5Hex(_string);
+                _hash   = DigestUtils.sha256Hex(_string);
 	}
 
 	String asString() {

http://git-wip-us.apache.org/repos/asf/ranger/blob/a5ab9a34/agents-common/src/test/java/org/apache/ranger/plugin/model/TestRangerPolicyResourceSignature.java
----------------------------------------------------------------------
diff --git a/agents-common/src/test/java/org/apache/ranger/plugin/model/TestRangerPolicyResourceSignature.java
b/agents-common/src/test/java/org/apache/ranger/plugin/model/TestRangerPolicyResourceSignature.java
index 345b260..38c425d 100644
--- a/agents-common/src/test/java/org/apache/ranger/plugin/model/TestRangerPolicyResourceSignature.java
+++ b/agents-common/src/test/java/org/apache/ranger/plugin/model/TestRangerPolicyResourceSignature.java
@@ -104,7 +104,7 @@ public class TestRangerPolicyResourceSignature {
 		// String rep of a null policy is an empty string! and its hash is sha of empty string!
 		RangerPolicyResourceSignature signature = new RangerPolicyResourceSignature((String)null);
 		Assert.assertEquals("", signature.asString());
-		Assert.assertEquals(DigestUtils.md5Hex(""), signature.getSignature());
+                Assert.assertEquals(DigestUtils.sha256Hex(""), signature.getSignature());
 	}
 
 	/*

http://git-wip-us.apache.org/repos/asf/ranger/blob/a5ab9a34/ranger-hive-utils/src/main/java/org/apache/ranger/authorization/hive/udf/RangerUdfMaskHash.java
----------------------------------------------------------------------
diff --git a/ranger-hive-utils/src/main/java/org/apache/ranger/authorization/hive/udf/RangerUdfMaskHash.java
b/ranger-hive-utils/src/main/java/org/apache/ranger/authorization/hive/udf/RangerUdfMaskHash.java
index 430212b..02ead75 100644
--- a/ranger-hive-utils/src/main/java/org/apache/ranger/authorization/hive/udf/RangerUdfMaskHash.java
+++ b/ranger-hive-utils/src/main/java/org/apache/ranger/authorization/hive/udf/RangerUdfMaskHash.java
@@ -47,7 +47,7 @@ class MaskHashTransformer extends AbstractTransformer {
 
   @Override
   String transform(final String value) {
-    return DigestUtils.md5Hex(value);
+    return DigestUtils.sha256Hex(value);
   }
 
   @Override


Mime
View raw message