You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ve...@apache.org on 2018/10/16 20:51:42 UTC

ranger git commit: RANGER-2209: Added Ranger service definition for ABFS

Repository: ranger
Updated Branches:
  refs/heads/master 6fc9a823d -> db7e26144


RANGER-2209: Added Ranger service definition for ABFS

Signed-off-by: Velmurugan Periasamy <ve...@apache.org>


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

Branch: refs/heads/master
Commit: db7e261448411eabe233bf34631ea209ab6a42bb
Parents: 6fc9a82
Author: Yuan Gao <ga...@microsoft.com>
Authored: Tue Oct 9 16:34:52 2018 -0700
Committer: Velmurugan Periasamy <ve...@apache.org>
Committed: Tue Oct 16 16:43:50 2018 -0400

----------------------------------------------------------------------
 .../plugin/store/EmbeddedServiceDefsUtil.java   |   5 +
 .../service-defs/ranger-servicedef-abfs.json    | 123 +++++++++++++++++++
 2 files changed, 128 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/db7e2614/agents-common/src/main/java/org/apache/ranger/plugin/store/EmbeddedServiceDefsUtil.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/store/EmbeddedServiceDefsUtil.java b/agents-common/src/main/java/org/apache/ranger/plugin/store/EmbeddedServiceDefsUtil.java
index 75dc128..118af1f 100755
--- a/agents-common/src/main/java/org/apache/ranger/plugin/store/EmbeddedServiceDefsUtil.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/store/EmbeddedServiceDefsUtil.java
@@ -67,6 +67,7 @@ public class EmbeddedServiceDefsUtil {
 	public static final String EMBEDDED_SERVICEDEF_WASB_NAME  = "wasb";
 	public static final String EMBEDDED_SERVICEDEF_SQOOP_NAME = "sqoop";
 	public static final String EMBEDDED_SERVICEDEF_KYLIN_NAME  = "kylin";
+	public static final String EMBEDDED_SERVICEDEF_ABFS_NAME  = "abfs";
 
 	public static final String PROPERTY_CREATE_EMBEDDED_SERVICE_DEFS = "ranger.service.store.create.embedded.service-defs";
 
@@ -100,6 +101,7 @@ public class EmbeddedServiceDefsUtil {
 	private RangerServiceDef wasbServiceDef;
 	private RangerServiceDef sqoopServiceDef;
 	private RangerServiceDef kylinServiceDef;
+	private RangerServiceDef abfsServiceDef;
 
 	private RangerServiceDef tagServiceDef;
 
@@ -142,6 +144,7 @@ public class EmbeddedServiceDefsUtil {
 			wasbServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_WASB_NAME);
 			sqoopServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_SQOOP_NAME);
 			kylinServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_KYLIN_NAME);
+			abfsServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_ABFS_NAME);
 
 			// Ensure that tag service def is updated with access types of all service defs
 			store.updateTagServiceDefForAccessTypes();
@@ -212,6 +215,8 @@ public class EmbeddedServiceDefsUtil {
 
 	public long getWasbServiceDefId() { return getId(wasbServiceDef); }
 
+	public long getAbfsServiceDefId() { return getId(abfsServiceDef); }
+
 	public RangerServiceDef getEmbeddedServiceDef(String defType) throws Exception {
 		RangerServiceDef serviceDef=null;
 		if(StringUtils.isNotEmpty(defType)){

http://git-wip-us.apache.org/repos/asf/ranger/blob/db7e2614/agents-common/src/main/resources/service-defs/ranger-servicedef-abfs.json
----------------------------------------------------------------------
diff --git a/agents-common/src/main/resources/service-defs/ranger-servicedef-abfs.json b/agents-common/src/main/resources/service-defs/ranger-servicedef-abfs.json
new file mode 100644
index 0000000..18454de
--- /dev/null
+++ b/agents-common/src/main/resources/service-defs/ranger-servicedef-abfs.json
@@ -0,0 +1,123 @@
+{
+  "id":103,
+  "name": "abfs",
+  "implClass": "",
+  "label": "Azure Blob File System",
+  "description": "Ranger plugin for ABFS",
+  "guid":"",
+  "options": { "enableDenyAndExceptionsInPolicies": "true" },
+  "resources": [
+    {
+      "itemId": 1,
+      "name": "storageaccount",
+      "type": "string",
+      "parent": "",
+      "level": 10,
+      "mandatory": true,
+      "lookupSupported": false,
+      "excludesSupported": false,
+      "matcher": "org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher",
+      "matcherOptions": {"wildCard":true, "ignoreCase":false},
+      "validationRegEx": "",
+      "validationMessage": "",
+      "uiHint": "",
+      "label": "Storage Account",
+      "description": "Storage Account for the Path"
+    },
+    {
+      "itemId":2,
+      "name": "container",
+      "type": "string",
+      "parent": "storageaccount",
+      "level":20,
+      "mandatory": true,
+      "lookupSupported": false,
+      "excludesSupported": false,
+      "matcher": "org.apache.ranger.plugin.resourcematcher.RangerDefaultResourceMatcher",
+      "matcherOptions": {"wildCard":true, "ignoreCase":false},
+      "validationRegEx":"",
+      "validationMessage": "",
+      "uiHint":"",
+      "label": "Storage Account Container",
+      "description": "Storage Account Container for the Path"
+    },
+    {
+      "itemId":3,
+      "name": "relativepath",
+      "type": "path",
+      "parent": "container",
+      "level":30,
+      "mandatory": true,
+      "lookupSupported": true,
+      "recursiveSupported": true,
+      "excludesSupported": false,
+      "matcher": "org.apache.ranger.plugin.resourcematcher.RangerPathResourceMatcher",
+      "matcherOptions": {"wildCard":true, "ignoreCase":false},
+      "validationRegEx":"^[/*]$|^\/.*?[^\/]$",
+      "validationMessage": "Relative Path must not end with a slash",
+      "uiHint":"",
+      "label": "Relative Path",
+      "description": "Relative Path inside Storage Account Container"
+    }
+  ],
+  "accessTypes":
+  [
+    {
+      "itemId": 1,
+      "name": "read",
+      "label": "Read"
+    },
+    {
+      "itemId": 2,
+      "name": "write",
+      "label": "Write"
+    }
+  ],
+  "configs":
+  [
+    {
+      "itemId": 1,
+      "name": "username",
+      "type": "string",
+      "subType": "",
+      "mandatory": false,
+      "validationRegEx":"",
+      "validationMessage": "",
+      "uiHint":"",
+      "label": "Username"
+    },
+    {
+      "itemId": 2,
+      "name": "password",
+      "type": "string",
+      "subType": "",
+      "mandatory": false,
+      "validationRegEx":"",
+      "validationMessage": "",
+      "uiHint":"",
+      "label": "Password"
+    },
+    {
+      "itemId":3,
+      "name": "commonNameForCertificate",
+      "type": "string",
+      "subType": "",
+      "mandatory": false,
+      "validationRegEx":"",
+      "validationMessage": "",
+      "uiHint":"",
+      "label": "Common Name for Certificate"
+    }
+  ],
+  "contextEnrichers": [],
+  "policyConditions":
+  [
+    {
+      "itemId": 1,
+      "name": "ip-range",
+      "evaluator": "org.apache.ranger.plugin.conditionevaluator.RangerIpMatcher",
+      "label": "IP Address Range",
+      "description": "IP Address Range"
+    }
+  ]
+}
\ No newline at end of file