ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sneet...@apache.org
Subject git commit: ARGUS-29:Allow Kerberized Username during repo creation
Date Thu, 04 Sep 2014 04:36:14 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/master 6c3a74e2b -> d70c51929


ARGUS-29:Allow Kerberized Username during repo creation

Signed-off-by: sneethiraj <sneethir@apache.org>


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

Branch: refs/heads/master
Commit: d70c51929e7761f65dad459efdc3fd8963fd9148
Parents: 6c3a74e
Author: vperiasamy <vperiasamy@hortonworks.com>
Authored: Tue Sep 2 16:22:48 2014 -0400
Committer: sneethiraj <sneethir@apache.org>
Committed: Thu Sep 4 00:35:30 2014 -0400

----------------------------------------------------------------------
 .../src/main/java/com/xasecure/biz/AssetMgr.java         | 11 ++++++++---
 .../src/main/webapp/scripts/views/asset/AssetForm.js     |  4 ++--
 2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/d70c5192/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java b/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java
index e635b9d..e2aa45f 100644
--- a/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java
+++ b/security-admin/src/main/java/com/xasecure/biz/AssetMgr.java
@@ -1207,7 +1207,8 @@ public class AssetMgr extends AssetMgrBase {
 		int assetType = vXAsset.getAssetType();
 
 		Map<String, String> configMap = jsonUtil.jsonToMap(config);
-		String userName = configMap.get("username");
+		String userName = configMap.get("username").indexOf("/") < 0 ? configMap.get("username")

+				:  configMap.get("username").substring(0,configMap.get("username").indexOf("/"));
 
 		VXResource vXResource = new VXResource();
 		vXResource.setAssetId(vXAsset.getId());
@@ -1939,7 +1940,9 @@ public class AssetMgr extends AssetMgrBase {
 	public void updateDefaultPolicy(VXAsset vXAsset, String config) {
 		int assetType = vXAsset.getAssetType();
 		Map<String, String> configMap = jsonUtil.jsonToMap(config);
-		String userName = configMap.get("username");
+//		String userName = configMap.get("username");
+		String userName = configMap.get("username").indexOf("/") < 0 ? configMap.get("username")

+				:  configMap.get("username").substring(0,configMap.get("username").indexOf("/"));
 		VXResource vxResource = fetchDefaultPolicyForAsset(vXAsset.getId(),
 				assetType);
 		if (vxResource != null) {
@@ -2241,7 +2244,9 @@ public class AssetMgr extends AssetMgrBase {
 			return ;
 		}
 		Map<String, String> configMap = jsonUtil.jsonToMap(config);
-		String userName = configMap.get("username");
+		String userName = configMap.get("username").indexOf("/") < 0 ? configMap.get("username")

+				:  configMap.get("username").substring(0,configMap.get("username").indexOf("/"));
+		
 		VXResource vXResource = new VXResource();
 		vXResource.setAssetId(vXAsset.getId());
 		vXResource.setAssetName(vXAsset.getName());

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/d70c5192/security-admin/src/main/webapp/scripts/views/asset/AssetForm.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/asset/AssetForm.js b/security-admin/src/main/webapp/scripts/views/asset/AssetForm.js
index 08a0ae7..e5fff85 100644
--- a/security-admin/src/main/webapp/scripts/views/asset/AssetForm.js
+++ b/security-admin/src/main/webapp/scripts/views/asset/AssetForm.js
@@ -69,8 +69,8 @@ define(function(require){
 					type : 'Text',
 //					fieldClass : "hdfs hive knox",
 					title : this.model.propertiesNameMap.userName+" *",//'xalogin.username'
-					validators  : ['required',{type:'regexp',regexp:/^[a-z][a-z0-9,._'-]+$/i,message :'Please
enter valid username'}],
-					editorAttrs :{'class':'stretchTextInput','maxlength': 32}
+					validators  : ['required'],//{type:'regexp',regexp:/^[a-z][a-z0-9,._'-]+$/i,message
:'Please enter valid username'}],
+					editorAttrs :{'class':'stretchTextInput'}//,'maxlength': 48}
 				},
 				passwordKeytabfile : {
 					type : 'Password',


Mime
View raw message