@Test public void testToRangerPolicyForResourceTypeColumnFamily(){ RangerPolicy expectedRangerPolicy = new RangerPolicy(); expectedRangerPolicy.setId(1L); expectedRangerPolicy.setName("hive Policy"); expectedRangerPolicy.setService("hive"); expectedRangerPolicy.setDescription("hive policy description"); Map<String, RangerPolicyResource> expectedMap = new HashMap<String, RangerPolicyResource>(); List<String> valuesList = new ArrayList<String>(); valuesList.add("columnFamilies"); VXAuditMap vXAuditMap = new VXAuditMap(); vXAuditMap.setId(1L); vXAuditMap.setOwner("rangerAdmin"); List<VXAuditMap> vXAuditMapList = new ArrayList<VXAuditMap>(); vXAuditMapList.add(vXAuditMap); RangerPolicyResource rangerPolicyResource = new RangerPolicyResource(); rangerPolicyResource.setIsExcludes(false); rangerPolicyResource.setIsRecursive(false); rangerPolicyResource.setValue("columnFamilies"); rangerPolicyResource.setValues(valuesList); expectedMap.put("column-family", rangerPolicyResource); expectedRangerPolicy.setResources(expectedMap); RangerService rangerService = new RangerService(); rangerService.setName("hive"); VXResource resource = new VXResource(); resource.setId(1L); resource.setColumnFamilies("columnFamilies"); resource.setUpdateDate(new Date()); resource.setCreateDate(new Date()); resource.setOwner("rangerAdmin"); resource.setUpdatedBy("rangerAdmin"); resource.setPolicyName("hive Policy"); resource.setDescription("hive policy description"); resource.setResourceStatus(RangerCommonEnums.STATUS_ENABLED); resource.setIsRecursive(1); resource.setTableType(1); resource.setColumnType(1); RangerPolicy actualRangerPolicy = serviceUtil.toRangerPolicy(resource, rangerService); Assert.assertNotNull(actualRangerPolicy); Assert.assertEquals(expectedRangerPolicy.getId(), actualRangerPolicy.getId()); Assert.assertEquals(expectedRangerPolicy.getName(), actualRangerPolicy.getName()); Assert.assertEquals(expectedRangerPolicy.getService(), actualRangerPolicy.getService()); Assert.assertEquals(expectedRangerPolicy.getDescription(), actualRangerPolicy.getDescription()); Assert.assertEquals(expectedRangerPolicy.getResources(), actualRangerPolicy.getResources()); }
public RangerPolicy toRangerPolicy(VXResource resource, RangerService service) { if(resource == null) { return null; } RangerPolicy ret = new RangerPolicy(); dataObjectToRangerObject(resource, ret); if(service != null) { ret.setService(service.getName()); } else { ret.setService(resource.getAssetName()); } ret.setName(StringUtils.trim(resource.getPolicyName())); ret.setDescription(resource.getDescription()); ret.setIsEnabled(resource.getResourceStatus() == RangerCommonEnums.STATUS_ENABLED); ret.setIsAuditEnabled(resource.getAuditList() != null && !resource.getAuditList().isEmpty()); Boolean isPathRecursive = resource.getIsRecursive() == RangerCommonEnums.BOOL_TRUE; Boolean isTableExcludes = resource.getTableType() == RangerCommonEnums.POLICY_EXCLUSION; Boolean isColumnExcludes = resource.getColumnType() == RangerCommonEnums.POLICY_EXCLUSION; toRangerResourceList(resource.getName(), "path", Boolean.FALSE, isPathRecursive, ret.getResources()); toRangerResourceList(resource.getTables(), "table", isTableExcludes, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getColumnFamilies(), "column-family", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getColumns(), "column", isColumnExcludes, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getDatabases(), "database", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getUdfs(), "udf", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getTopologies(), "topology", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getServices(), "service", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getHiveServices(), "hiveservice", Boolean.FALSE, Boolean.FALSE, ret.getResources()); HashMap<String, List<VXPermMap>> sortedPermMap = new HashMap<String, List<VXPermMap>>(); if (resource.getPermMapList() != null) { for(VXPermMap permMap : resource.getPermMapList()) { String permGrp = permMap.getPermGroup(); List<VXPermMap> sortedList = sortedPermMap.get(permGrp); if(sortedList == null) { sortedList = new ArrayList<VXPermMap>(); sortedPermMap.put(permGrp, sortedList); } sortedList.add(permMap); } } Integer assetType = getAssetType(service,ret.getService()); for (Entry<String, List<VXPermMap>> entry : sortedPermMap.entrySet()) { List<String> userList = new ArrayList<String>(); List<String> groupList = new ArrayList<String>(); List<RangerPolicyItemAccess> accessList = new ArrayList<RangerPolicyItemAccess>(); String ipAddress = null; RangerPolicy.RangerPolicyItem policyItem = new RangerPolicy.RangerPolicyItem(); for(VXPermMap permMap : entry.getValue()) { if(permMap.getPermFor() == AppConstants.XA_PERM_FOR_USER) { String userName = getUserName(permMap); if (! userList.contains(userName)) { userList.add(userName); } } else if(permMap.getPermFor() == AppConstants.XA_PERM_FOR_GROUP) { String groupName = getGroupName(permMap); if (! groupList.contains(groupName)) { groupList.add(groupName); } } String accessType = toAccessType(permMap.getPermType()); if(StringUtils.equalsIgnoreCase(accessType, "Admin")) { policyItem.setDelegateAdmin(Boolean.TRUE); if ( assetType != null && assetType == RangerCommonEnums.ASSET_HBASE) { accessList.add(new RangerPolicyItemAccess(accessType)); } } else { accessList.add(new RangerPolicyItemAccess(accessType)); } ipAddress = permMap.getIpAddress(); } policyItem.setUsers(userList); policyItem.setGroups(groupList); policyItem.setAccesses(accessList); if(ipAddress != null && !ipAddress.isEmpty()) { RangerPolicy.RangerPolicyItemCondition ipCondition = new RangerPolicy.RangerPolicyItemCondition("ipaddress", Collections.singletonList(ipAddress)); policyItem.getConditions().add(ipCondition); } ret.getPolicyItems().add(policyItem); } return ret; }
ServiceUtil { public RangerPolicy toRangerPolicy(VXResource resource, RangerService service) { if(resource == null) { return null; } RangerPolicy ret = new RangerPolicy(); dataObjectToRangerObject(resource, ret); if(service != null) { ret.setService(service.getName()); } else { ret.setService(resource.getAssetName()); } ret.setName(StringUtils.trim(resource.getPolicyName())); ret.setDescription(resource.getDescription()); ret.setIsEnabled(resource.getResourceStatus() == RangerCommonEnums.STATUS_ENABLED); ret.setIsAuditEnabled(resource.getAuditList() != null && !resource.getAuditList().isEmpty()); Boolean isPathRecursive = resource.getIsRecursive() == RangerCommonEnums.BOOL_TRUE; Boolean isTableExcludes = resource.getTableType() == RangerCommonEnums.POLICY_EXCLUSION; Boolean isColumnExcludes = resource.getColumnType() == RangerCommonEnums.POLICY_EXCLUSION; toRangerResourceList(resource.getName(), "path", Boolean.FALSE, isPathRecursive, ret.getResources()); toRangerResourceList(resource.getTables(), "table", isTableExcludes, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getColumnFamilies(), "column-family", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getColumns(), "column", isColumnExcludes, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getDatabases(), "database", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getUdfs(), "udf", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getTopologies(), "topology", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getServices(), "service", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getHiveServices(), "hiveservice", Boolean.FALSE, Boolean.FALSE, ret.getResources()); HashMap<String, List<VXPermMap>> sortedPermMap = new HashMap<String, List<VXPermMap>>(); if (resource.getPermMapList() != null) { for(VXPermMap permMap : resource.getPermMapList()) { String permGrp = permMap.getPermGroup(); List<VXPermMap> sortedList = sortedPermMap.get(permGrp); if(sortedList == null) { sortedList = new ArrayList<VXPermMap>(); sortedPermMap.put(permGrp, sortedList); } sortedList.add(permMap); } } Integer assetType = getAssetType(service,ret.getService()); for (Entry<String, List<VXPermMap>> entry : sortedPermMap.entrySet()) { List<String> userList = new ArrayList<String>(); List<String> groupList = new ArrayList<String>(); List<RangerPolicyItemAccess> accessList = new ArrayList<RangerPolicyItemAccess>(); String ipAddress = null; RangerPolicy.RangerPolicyItem policyItem = new RangerPolicy.RangerPolicyItem(); for(VXPermMap permMap : entry.getValue()) { if(permMap.getPermFor() == AppConstants.XA_PERM_FOR_USER) { String userName = getUserName(permMap); if (! userList.contains(userName)) { userList.add(userName); } } else if(permMap.getPermFor() == AppConstants.XA_PERM_FOR_GROUP) { String groupName = getGroupName(permMap); if (! groupList.contains(groupName)) { groupList.add(groupName); } } String accessType = toAccessType(permMap.getPermType()); if(StringUtils.equalsIgnoreCase(accessType, "Admin")) { policyItem.setDelegateAdmin(Boolean.TRUE); if ( assetType != null && assetType == RangerCommonEnums.ASSET_HBASE) { accessList.add(new RangerPolicyItemAccess(accessType)); } } else { accessList.add(new RangerPolicyItemAccess(accessType)); } ipAddress = permMap.getIpAddress(); } policyItem.setUsers(userList); policyItem.setGroups(groupList); policyItem.setAccesses(accessList); if(ipAddress != null && !ipAddress.isEmpty()) { RangerPolicy.RangerPolicyItemCondition ipCondition = new RangerPolicy.RangerPolicyItemCondition("ipaddress", Collections.singletonList(ipAddress)); policyItem.getConditions().add(ipCondition); } ret.getPolicyItems().add(policyItem); } return ret; } }
ServiceUtil { public RangerPolicy toRangerPolicy(VXResource resource, RangerService service) { if(resource == null) { return null; } RangerPolicy ret = new RangerPolicy(); dataObjectToRangerObject(resource, ret); if(service != null) { ret.setService(service.getName()); } else { ret.setService(resource.getAssetName()); } ret.setName(StringUtils.trim(resource.getPolicyName())); ret.setDescription(resource.getDescription()); ret.setIsEnabled(resource.getResourceStatus() == RangerCommonEnums.STATUS_ENABLED); ret.setIsAuditEnabled(resource.getAuditList() != null && !resource.getAuditList().isEmpty()); Boolean isPathRecursive = resource.getIsRecursive() == RangerCommonEnums.BOOL_TRUE; Boolean isTableExcludes = resource.getTableType() == RangerCommonEnums.POLICY_EXCLUSION; Boolean isColumnExcludes = resource.getColumnType() == RangerCommonEnums.POLICY_EXCLUSION; toRangerResourceList(resource.getName(), "path", Boolean.FALSE, isPathRecursive, ret.getResources()); toRangerResourceList(resource.getTables(), "table", isTableExcludes, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getColumnFamilies(), "column-family", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getColumns(), "column", isColumnExcludes, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getDatabases(), "database", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getUdfs(), "udf", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getTopologies(), "topology", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getServices(), "service", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getHiveServices(), "hiveservice", Boolean.FALSE, Boolean.FALSE, ret.getResources()); HashMap<String, List<VXPermMap>> sortedPermMap = new HashMap<String, List<VXPermMap>>(); if (resource.getPermMapList() != null) { for(VXPermMap permMap : resource.getPermMapList()) { String permGrp = permMap.getPermGroup(); List<VXPermMap> sortedList = sortedPermMap.get(permGrp); if(sortedList == null) { sortedList = new ArrayList<VXPermMap>(); sortedPermMap.put(permGrp, sortedList); } sortedList.add(permMap); } } Integer assetType = getAssetType(service,ret.getService()); for (Entry<String, List<VXPermMap>> entry : sortedPermMap.entrySet()) { List<String> userList = new ArrayList<String>(); List<String> groupList = new ArrayList<String>(); List<RangerPolicyItemAccess> accessList = new ArrayList<RangerPolicyItemAccess>(); String ipAddress = null; RangerPolicy.RangerPolicyItem policyItem = new RangerPolicy.RangerPolicyItem(); for(VXPermMap permMap : entry.getValue()) { if(permMap.getPermFor() == AppConstants.XA_PERM_FOR_USER) { String userName = getUserName(permMap); if (! userList.contains(userName)) { userList.add(userName); } } else if(permMap.getPermFor() == AppConstants.XA_PERM_FOR_GROUP) { String groupName = getGroupName(permMap); if (! groupList.contains(groupName)) { groupList.add(groupName); } } String accessType = toAccessType(permMap.getPermType()); if(StringUtils.equalsIgnoreCase(accessType, "Admin")) { policyItem.setDelegateAdmin(Boolean.TRUE); if ( assetType != null && assetType == RangerCommonEnums.ASSET_HBASE) { accessList.add(new RangerPolicyItemAccess(accessType)); } } else { accessList.add(new RangerPolicyItemAccess(accessType)); } ipAddress = permMap.getIpAddress(); } policyItem.setUsers(userList); policyItem.setGroups(groupList); policyItem.setAccesses(accessList); if(ipAddress != null && !ipAddress.isEmpty()) { RangerPolicy.RangerPolicyItemCondition ipCondition = new RangerPolicy.RangerPolicyItemCondition("ipaddress", Collections.singletonList(ipAddress)); policyItem.getConditions().add(ipCondition); } ret.getPolicyItems().add(policyItem); } return ret; }  }
ServiceUtil { public RangerPolicy toRangerPolicy(VXResource resource, RangerService service) { if(resource == null) { return null; } RangerPolicy ret = new RangerPolicy(); dataObjectToRangerObject(resource, ret); if(service != null) { ret.setService(service.getName()); } else { ret.setService(resource.getAssetName()); } ret.setName(StringUtils.trim(resource.getPolicyName())); ret.setDescription(resource.getDescription()); ret.setIsEnabled(resource.getResourceStatus() == RangerCommonEnums.STATUS_ENABLED); ret.setIsAuditEnabled(resource.getAuditList() != null && !resource.getAuditList().isEmpty()); Boolean isPathRecursive = resource.getIsRecursive() == RangerCommonEnums.BOOL_TRUE; Boolean isTableExcludes = resource.getTableType() == RangerCommonEnums.POLICY_EXCLUSION; Boolean isColumnExcludes = resource.getColumnType() == RangerCommonEnums.POLICY_EXCLUSION; toRangerResourceList(resource.getName(), "path", Boolean.FALSE, isPathRecursive, ret.getResources()); toRangerResourceList(resource.getTables(), "table", isTableExcludes, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getColumnFamilies(), "column-family", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getColumns(), "column", isColumnExcludes, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getDatabases(), "database", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getUdfs(), "udf", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getTopologies(), "topology", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getServices(), "service", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getHiveServices(), "hiveservice", Boolean.FALSE, Boolean.FALSE, ret.getResources()); HashMap<String, List<VXPermMap>> sortedPermMap = new HashMap<String, List<VXPermMap>>(); if (resource.getPermMapList() != null) { for(VXPermMap permMap : resource.getPermMapList()) { String permGrp = permMap.getPermGroup(); List<VXPermMap> sortedList = sortedPermMap.get(permGrp); if(sortedList == null) { sortedList = new ArrayList<VXPermMap>(); sortedPermMap.put(permGrp, sortedList); } sortedList.add(permMap); } } Integer assetType = getAssetType(service,ret.getService()); for (Entry<String, List<VXPermMap>> entry : sortedPermMap.entrySet()) { List<String> userList = new ArrayList<String>(); List<String> groupList = new ArrayList<String>(); List<RangerPolicyItemAccess> accessList = new ArrayList<RangerPolicyItemAccess>(); String ipAddress = null; RangerPolicy.RangerPolicyItem policyItem = new RangerPolicy.RangerPolicyItem(); for(VXPermMap permMap : entry.getValue()) { if(permMap.getPermFor() == AppConstants.XA_PERM_FOR_USER) { String userName = getUserName(permMap); if (! userList.contains(userName)) { userList.add(userName); } } else if(permMap.getPermFor() == AppConstants.XA_PERM_FOR_GROUP) { String groupName = getGroupName(permMap); if (! groupList.contains(groupName)) { groupList.add(groupName); } } String accessType = toAccessType(permMap.getPermType()); if(StringUtils.equalsIgnoreCase(accessType, "Admin")) { policyItem.setDelegateAdmin(Boolean.TRUE); if ( assetType != null && assetType == RangerCommonEnums.ASSET_HBASE) { accessList.add(new RangerPolicyItemAccess(accessType)); } } else { accessList.add(new RangerPolicyItemAccess(accessType)); } ipAddress = permMap.getIpAddress(); } policyItem.setUsers(userList); policyItem.setGroups(groupList); policyItem.setAccesses(accessList); if(ipAddress != null && !ipAddress.isEmpty()) { RangerPolicy.RangerPolicyItemCondition ipCondition = new RangerPolicy.RangerPolicyItemCondition("ipaddress", Collections.singletonList(ipAddress)); policyItem.getConditions().add(ipCondition); } ret.getPolicyItems().add(policyItem); } return ret; }  RangerService getServiceByName(@PathParam("name") String name); RangerService toRangerService(VXAsset asset); VXAsset toVXAsset(RangerService service); VXRepository toVXRepository(RangerService service); RangerPolicy toRangerPolicy(VXResource resource, RangerService service); VXResource toVXResource(RangerPolicy policy, RangerService service); VXAsset publicObjecttoVXAsset(VXRepository vXRepository); VXRepository vXAssetToPublicObject(VXAsset asset); static String toAccessType(int permType); SearchCriteria getMappedSearchParams(HttpServletRequest request,
			SearchCriteria searchCriteria); VXRepositoryList rangerServiceListToPublicObjectList(List<RangerService> serviceList); VXPolicy toVXPolicy(RangerPolicy policy, RangerService service); List<VXPermMap> getVXPermMapList(RangerPolicy policy); List<VXPermObj> mapPermMapToPermObj(List<VXPermMap> permMapList); RangerPolicy toRangerPolicy(VXPolicy vXPolicy, RangerService service ); VXPolicyList rangerPolicyListToPublic(List<RangerPolicy> rangerPolicyList,SearchFilter filter); GrantRevokeRequest toGrantRevokeRequest(VXPolicy vXPolicy); boolean isValidateHttpsAuthentication( String serviceName, HttpServletRequest request); boolean isValidService(String serviceName, HttpServletRequest request); List<RangerPolicy> getMatchingPoliciesForResource(HttpServletRequest request,
			List<RangerPolicy> policyLists); }
ServiceUtil { public RangerPolicy toRangerPolicy(VXResource resource, RangerService service) { if(resource == null) { return null; } RangerPolicy ret = new RangerPolicy(); dataObjectToRangerObject(resource, ret); if(service != null) { ret.setService(service.getName()); } else { ret.setService(resource.getAssetName()); } ret.setName(StringUtils.trim(resource.getPolicyName())); ret.setDescription(resource.getDescription()); ret.setIsEnabled(resource.getResourceStatus() == RangerCommonEnums.STATUS_ENABLED); ret.setIsAuditEnabled(resource.getAuditList() != null && !resource.getAuditList().isEmpty()); Boolean isPathRecursive = resource.getIsRecursive() == RangerCommonEnums.BOOL_TRUE; Boolean isTableExcludes = resource.getTableType() == RangerCommonEnums.POLICY_EXCLUSION; Boolean isColumnExcludes = resource.getColumnType() == RangerCommonEnums.POLICY_EXCLUSION; toRangerResourceList(resource.getName(), "path", Boolean.FALSE, isPathRecursive, ret.getResources()); toRangerResourceList(resource.getTables(), "table", isTableExcludes, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getColumnFamilies(), "column-family", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getColumns(), "column", isColumnExcludes, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getDatabases(), "database", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getUdfs(), "udf", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getTopologies(), "topology", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getServices(), "service", Boolean.FALSE, Boolean.FALSE, ret.getResources()); toRangerResourceList(resource.getHiveServices(), "hiveservice", Boolean.FALSE, Boolean.FALSE, ret.getResources()); HashMap<String, List<VXPermMap>> sortedPermMap = new HashMap<String, List<VXPermMap>>(); if (resource.getPermMapList() != null) { for(VXPermMap permMap : resource.getPermMapList()) { String permGrp = permMap.getPermGroup(); List<VXPermMap> sortedList = sortedPermMap.get(permGrp); if(sortedList == null) { sortedList = new ArrayList<VXPermMap>(); sortedPermMap.put(permGrp, sortedList); } sortedList.add(permMap); } } Integer assetType = getAssetType(service,ret.getService()); for (Entry<String, List<VXPermMap>> entry : sortedPermMap.entrySet()) { List<String> userList = new ArrayList<String>(); List<String> groupList = new ArrayList<String>(); List<RangerPolicyItemAccess> accessList = new ArrayList<RangerPolicyItemAccess>(); String ipAddress = null; RangerPolicy.RangerPolicyItem policyItem = new RangerPolicy.RangerPolicyItem(); for(VXPermMap permMap : entry.getValue()) { if(permMap.getPermFor() == AppConstants.XA_PERM_FOR_USER) { String userName = getUserName(permMap); if (! userList.contains(userName)) { userList.add(userName); } } else if(permMap.getPermFor() == AppConstants.XA_PERM_FOR_GROUP) { String groupName = getGroupName(permMap); if (! groupList.contains(groupName)) { groupList.add(groupName); } } String accessType = toAccessType(permMap.getPermType()); if(StringUtils.equalsIgnoreCase(accessType, "Admin")) { policyItem.setDelegateAdmin(Boolean.TRUE); if ( assetType != null && assetType == RangerCommonEnums.ASSET_HBASE) { accessList.add(new RangerPolicyItemAccess(accessType)); } } else { accessList.add(new RangerPolicyItemAccess(accessType)); } ipAddress = permMap.getIpAddress(); } policyItem.setUsers(userList); policyItem.setGroups(groupList); policyItem.setAccesses(accessList); if(ipAddress != null && !ipAddress.isEmpty()) { RangerPolicy.RangerPolicyItemCondition ipCondition = new RangerPolicy.RangerPolicyItemCondition("ipaddress", Collections.singletonList(ipAddress)); policyItem.getConditions().add(ipCondition); } ret.getPolicyItems().add(policyItem); } return ret; }  RangerService getServiceByName(@PathParam("name") String name); RangerService toRangerService(VXAsset asset); VXAsset toVXAsset(RangerService service); VXRepository toVXRepository(RangerService service); RangerPolicy toRangerPolicy(VXResource resource, RangerService service); VXResource toVXResource(RangerPolicy policy, RangerService service); VXAsset publicObjecttoVXAsset(VXRepository vXRepository); VXRepository vXAssetToPublicObject(VXAsset asset); static String toAccessType(int permType); SearchCriteria getMappedSearchParams(HttpServletRequest request,
			SearchCriteria searchCriteria); VXRepositoryList rangerServiceListToPublicObjectList(List<RangerService> serviceList); VXPolicy toVXPolicy(RangerPolicy policy, RangerService service); List<VXPermMap> getVXPermMapList(RangerPolicy policy); List<VXPermObj> mapPermMapToPermObj(List<VXPermMap> permMapList); RangerPolicy toRangerPolicy(VXPolicy vXPolicy, RangerService service ); VXPolicyList rangerPolicyListToPublic(List<RangerPolicy> rangerPolicyList,SearchFilter filter); GrantRevokeRequest toGrantRevokeRequest(VXPolicy vXPolicy); boolean isValidateHttpsAuthentication( String serviceName, HttpServletRequest request); boolean isValidService(String serviceName, HttpServletRequest request); List<RangerPolicy> getMatchingPoliciesForResource(HttpServletRequest request,
			List<RangerPolicy> policyLists);  }