You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by rm...@apache.org on 2017/01/21 02:07:03 UTC
incubator-ranger git commit: RANGER-1295: Add-ons to support WASB in
Ranger Authorization Model
Repository: incubator-ranger
Updated Branches:
refs/heads/master 1a68c9586 -> 51c340ec1
RANGER-1295: Add-ons to support WASB in Ranger Authorization Model
Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/51c340ec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/51c340ec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/51c340ec
Branch: refs/heads/master
Commit: 51c340ec1d2cd7b0995215c89c5de1939e0ebe13
Parents: 1a68c95
Author: rmani <rm...@hortonworks.com>
Authored: Fri Jan 20 18:06:57 2017 -0800
Committer: rmani <rm...@hortonworks.com>
Committed: Fri Jan 20 18:06:57 2017 -0800
----------------------------------------------------------------------
.../plugin/store/EmbeddedServiceDefsUtil.java | 6 +
.../service-defs/ranger-servicedef-wasb.json | 110 +++++++++++++++++++
2 files changed, 116 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/51c340ec/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 3753a70..b13983f 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
@@ -62,6 +62,7 @@ public class EmbeddedServiceDefsUtil {
public static final String EMBEDDED_SERVICEDEF_SOLR_NAME = "solr";
public static final String EMBEDDED_SERVICEDEF_NIFI_NAME = "nifi";
public static final String EMBEDDED_SERVICEDEF_ATLAS_NAME = "atlas";
+ public static final String EMBEDDED_SERVICEDEF_WASB_NAME = "wasb";
public static final String PROPERTY_CREATE_EMBEDDED_SERVICE_DEFS = "ranger.service.store.create.embedded.service-defs";
@@ -91,6 +92,7 @@ public class EmbeddedServiceDefsUtil {
private RangerServiceDef solrServiceDef = null;
private RangerServiceDef nifiServiceDef = null;
private RangerServiceDef atlasServiceDef = null;
+ private RangerServiceDef wasbServiceDef = null;
private RangerServiceDef tagServiceDef = null;
@@ -131,6 +133,8 @@ public class EmbeddedServiceDefsUtil {
atlasServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_ATLAS_NAME);
tagServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_TAG_NAME);
+ wasbServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_WASB_NAME);
+
// Ensure that tag service def is updated with access types of all service defs
store.updateTagServiceDefForAccessTypes();
@@ -187,6 +191,8 @@ public class EmbeddedServiceDefsUtil {
public long getTagServiceDefId() { return getId(tagServiceDef); }
+ public long getWasbServiceDefId() { return getId(wasbServiceDef); }
+
public RangerServiceDef getEmbeddedServiceDef(String defType) throws Exception {
RangerServiceDef serviceDef=null;
if(StringUtils.isNotEmpty(defType)){
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/51c340ec/agents-common/src/main/resources/service-defs/ranger-servicedef-wasb.json
----------------------------------------------------------------------
diff --git a/agents-common/src/main/resources/service-defs/ranger-servicedef-wasb.json b/agents-common/src/main/resources/service-defs/ranger-servicedef-wasb.json
new file mode 100644
index 0000000..b6f600c
--- /dev/null
+++ b/agents-common/src/main/resources/service-defs/ranger-servicedef-wasb.json
@@ -0,0 +1,110 @@
+{
+ "id":101,
+ "name": "wasb",
+ "implClass": "",
+ "label": "WASB File System",
+ "description": "Ranger plugin for WASB File System",
+ "guid":"",
+ "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": false,
+ "excludesSupported": false,
+ "matcher": "org.apache.ranger.plugin.resourcematcher.RangerPathResourceMatcher",
+ "matcherOptions": {"wildCard":true, "ignoreCase":false},
+ "validationRegEx":"",
+ "validationMessage": "",
+ "uiHint":"",
+ "label": "Relative Path",
+ "description": "Relative Path inside Storage Account Container"
+ }
+ ],
+
+ "accessTypes":
+ [
+ {
+ "itemId": 1,
+ "name": "read",
+ "label": "Read"
+ },
+
+ {
+ "itemId": 2,
+ "name": "write",
+ "label": "Write"
+ },
+
+ {
+ "itemId": 3,
+ "name": "execute",
+ "label": "Execute"
+ }
+ ],
+
+ "configs":
+ [
+ {
+ "itemId": 1,
+ "name": "username",
+ "type": "string",
+ "subType": "",
+ "mandatory": false,
+ "validationRegEx":"",
+ "validationMessage": "",
+ "uiHint":"",
+ "label": "Username"
+ },
+ {
+ "itemId":2,
+ "name": "commonNameForCertificate",
+ "type": "string",
+ "subType": "",
+ "mandatory": false,
+ "validationRegEx":"",
+ "validationMessage": "",
+ "uiHint":"",
+ "label": "Common Name for Certificate"
+ }
+ ],
+ "contextEnrichers": [],
+ "policyConditions": []
+}