[ranger] branch master updated: RANGER-4378: Expand implied grants in the policy-items for being able to compare policy-cache dumps from server and client

2023-09-25 Thread abhay
This is an automated email from the ASF dual-hosted git repository.

abhay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
 new 696d4340b RANGER-4378: Expand implied grants in the policy-items for 
being able to compare policy-cache dumps from server and client
696d4340b is described below

commit 696d4340bfdf6c38f7cb4f53fc31b14e1ffaa0e7
Author: Abhay Kulkarni 
AuthorDate: Mon Sep 25 09:01:33 2023 -0700

RANGER-4378: Expand implied grants in the policy-items for being able to 
compare policy-cache dumps from server and client
---
 .../apache/ranger/plugin/model/RangerPolicy.java   |   4 +
 .../ranger/plugin/policyengine/PolicyEngine.java   |  44 +
 .../RangerAbstractPolicyItemEvaluator.java |  59 
 .../RangerAuditPolicyEvaluator.java|   2 +-
 .../RangerDefaultPolicyEvaluator.java  |  51 --
 .../RangerDefaultPolicyItemEvaluator.java  | 107 -
 .../RangerOptimizedPolicyEvaluator.java| 106 ++--
 .../policyevaluator/RangerPolicyEvaluator.java |  43 +++--
 .../policyevaluator/RangerPolicyItemEvaluator.java |   1 +
 9 files changed, 298 insertions(+), 119 deletions(-)

diff --git 
a/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicy.java 
b/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicy.java
index 9e5a94b1a..ec0618421 100644
--- 
a/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicy.java
+++ 
b/agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicy.java
@@ -959,6 +959,10 @@ public class RangerPolicy extends RangerBaseModelObject 
implements java.io.Seria
this(null, null, null, null, null, null);
}
 
+public RangerPolicyItem(RangerPolicyItem other) {
+this(other.accesses, other.users, other.groups, 
other.roles, other.conditions, other.delegateAdmin);
+}
+
public RangerPolicyItem(List 
accessTypes, List users, List groups, List roles, 
List conditions, Boolean delegateAdmin) {
setAccesses(accessTypes);
setUsers(users);
diff --git 
a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/PolicyEngine.java
 
b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/PolicyEngine.java
index 1e99b5824..4a5406301 100644
--- 
a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/PolicyEngine.java
+++ 
b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/PolicyEngine.java
@@ -71,6 +71,13 @@ public class PolicyEngine {
 
 private final RangerReadWriteLock lock;
 
+static private Map>> 
impliedAccessGrants = null;
+
+static public Map> 
getImpliedAccessGrants(RangerServiceDef serviceDef) {
+return impliedAccessGrants == null ? null : 
impliedAccessGrants.get(serviceDef.getName());
+}
+
+
 public RangerReadWriteLock.RangerLock getReadLock() {
 return lock.getReadLock();
 }
@@ -197,6 +204,8 @@ public class PolicyEngine {
 PERF_POLICYENGINE_INIT_LOG.debug("In-Use memory: " + (totalMemory 
- freeMemory) + ", Free memory:" + freeMemory);
 }
 
+buildImpliedAccessGrants(servicePolicies);
+
 this.pluginContext = pluginContext;
 this.lock  = new RangerReadWriteLock(isUseReadWriteLock);
 
@@ -471,6 +480,41 @@ public class PolicyEngine {
 }
 }
 
+synchronized static private void buildImpliedAccessGrants(ServicePolicies 
servicePolicies) {
+buildImpliedAccessGrants(servicePolicies.getServiceDef());
+if (servicePolicies.getTagPolicies() != null) {
+
buildImpliedAccessGrants(servicePolicies.getTagPolicies().getServiceDef());
+}
+}
+
+static private void buildImpliedAccessGrants(RangerServiceDef serviceDef) {
+Map> ret = null;
+
+if (serviceDef != null && 
!CollectionUtils.isEmpty(serviceDef.getAccessTypes())) {
+for (RangerServiceDef.RangerAccessTypeDef accessTypeDef : 
serviceDef.getAccessTypes()) {
+if 
(!CollectionUtils.isEmpty(accessTypeDef.getImpliedGrants())) {
+if (ret == null) {
+ret = new HashMap<>();
+}
+
+Collection impliedGrants = 
ret.get(accessTypeDef.getName());
+
+if (impliedGrants == null) {
+impliedGrants = new HashSet<>();
+
+ret.put(accessTypeDef.getName(), impliedGrants);
+}
+
+impliedGrants.addAll(accessTypeDef.getImpliedGrants());
+}
+}
+
+if (impliedAccessGrants == null) {
+impliedAccessGrants = 

[ranger] branch master updated: RANGER-4379: Assorted debugging help : save policy-cache at Ranger-admin and policy-cache as well as downloaded policy-deltas on plugin side

2023-09-25 Thread abhay
This is an automated email from the ASF dual-hosted git repository.

abhay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
 new e76101d28 RANGER-4379: Assorted debugging help : save policy-cache at 
Ranger-admin and policy-cache as well as downloaded policy-deltas on plugin side
e76101d28 is described below

commit e76101d28b001217f81ffcbd0647714a07fe68c3
Author: Abhay Kulkarni 
AuthorDate: Mon Sep 25 07:59:44 2023 -0700

RANGER-4379: Assorted debugging help : save policy-cache at Ranger-admin 
and policy-cache as well as downloaded policy-deltas on plugin side
---
 .../plugin/policyengine/RangerResourceTrie.java| 12 ++--
 .../ranger/plugin/service/RangerBasePlugin.java|  7 ++-
 .../apache/ranger/plugin/util/PolicyRefresher.java | 66 +++---
 .../ranger/common/RangerServicePoliciesCache.java  | 44 +++
 4 files changed, 116 insertions(+), 13 deletions(-)

diff --git 
a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerResourceTrie.java
 
b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerResourceTrie.java
index 647059203..2f725036d 100644
--- 
a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerResourceTrie.java
+++ 
b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerResourceTrie.java
@@ -1305,14 +1305,14 @@ public class RangerResourceTrie {
 void toString(StringBuilder sb) {
 String nodeValue = this.str;
 
-sb.append("nodeValue=").append(nodeValue);
+sb.append("nodeValue=").append(nodeValue == null ? "ROOT" : 
nodeValue);
 sb.append("; isSetup=").append(isSetup);
 sb.append("; 
isSharingParentWildcardEvaluators=").append(isSharingParentWildcardEvaluators);
 sb.append("; childCount=").append(children.size());
-sb.append("; evaluators=[ ");
+sb.append("; evaluators=[");
 if (evaluators != null) {
 for (U evaluator : evaluators) {
-sb.append(evaluator.getId()).append(" ");
+sb.append(evaluator.getId()).append(",");
 }
 }
 sb.append("]");
@@ -1320,7 +1320,7 @@ public class RangerResourceTrie {
 sb.append("; wildcardEvaluators=[ ");
 if (wildcardEvaluators != null) {
 for (U evaluator : wildcardEvaluators) {
-sb.append(evaluator.getId()).append(" ");
+sb.append(evaluator.getId()).append(",");
 }
 }
 sb.append("]");
@@ -1329,6 +1329,10 @@ public class RangerResourceTrie {
 void toString(String prefix, StringBuilder sb) {
 String nodeValue = prefix + (str != null ? str : "");
 
+if (!nodeValue.equals(prefix)) {
+prefix = prefix + "|";
+}
+
 sb.append(prefix);
 toString(sb);
 sb.append("]\n");
diff --git 
a/agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java
 
b/agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java
index f1eb08e4e..2f4af9763 100644
--- 
a/agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java
+++ 
b/agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBasePlugin.java
@@ -410,7 +410,9 @@ public class RangerBasePlugin {

newPolicyEngine.setTrustedProxyAddresses(pluginConfig.getTrustedProxyAddresses());
}
 
+   LOG.info("Switching policy engine from 
[" + getPolicyVersion() + "]");
this.policyEngine   = 
newPolicyEngine;
+   LOG.info("Switched policy engine to [" 
+ getPolicyVersion() + "]");
this.currentAuthContext = 
pluginContext.getAuthContext();
 

pluginContext.notifyAuthContextChanged();
@@ -516,7 +518,6 @@ public class RangerBasePlugin {
if (resultProcessor != null) {
resultProcessor.processResult(ret);
}
-
return ret;
}
 
@@ -1327,4 +1328,8 @@ public class RangerBasePlugin {
 
return ret;
}
+
+   public Long getPolicyVersion() {
+   return this.policyEngine == null ? -1L : 
this.policyEngine.getPolicyVersion();
+   }
 }
diff --git 
a/agents-common/src/main/java/org/apache/ranger/plugin/util/PolicyRefresher.java
 
b/agents-common/src/main/java/org/apache/ranger/plugin/util/PolicyRefresher.java
index c130309ea..aa0c80119 100644
--- 
a/agents-common/src/main/java/org/apache/ranger/plugin/util/PolicyRefresher.java
+++ 

[ranger] 02/04: RANGER-4381 : Difference in user lookup API request in permissions module page between React UI and BackBone UI

2023-09-25 Thread dhavalshah9131
This is an automated email from the ASF dual-hosted git repository.

dhavalshah9131 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git

commit 6b3bd1c85ccb5ed2c13e398e118c65484f92be58
Author: Brijesh Bhalala 
AuthorDate: Fri Sep 15 11:09:43 2023 +0530

RANGER-4381 : Difference in user lookup API request in permissions module 
page between React UI and BackBone UI
---
 .../main/webapp/react-webapp/src/styles/style.css  |  3 +-
 .../src/views/PermissionsModule/EditPermission.jsx | 61 +++--
 .../views/PolicyListing/AddUpdatePolicyForm.jsx|  2 +-
 .../src/views/SecurityZone/SecurityZoneForm.jsx| 74 +++-
 .../src/views/ServiceManager/ServiceForm.jsx   | 79 +++---
 .../groups_details/GroupListing.jsx|  3 +-
 .../users_details/UserListing.jsx  |  3 +-
 7 files changed, 127 insertions(+), 98 deletions(-)

diff --git a/security-admin/src/main/webapp/react-webapp/src/styles/style.css 
b/security-admin/src/main/webapp/react-webapp/src/styles/style.css
index aaa54a380..6e8678a57 100644
--- a/security-admin/src/main/webapp/react-webapp/src/styles/style.css
+++ b/security-admin/src/main/webapp/react-webapp/src/styles/style.css
@@ -2529,7 +2529,8 @@ li.list-group-item:hover {
   background-color: #e9ecef;
 }
 .manage-service .dropdown-toggle:focus,
-.manage-export .dropdown-toggle:focus {
+.manage-export .dropdown-toggle:focus,
+.manage-visibility .dropdown-toggle:focus {
   color: #0b7fad;
   background-color: #fff;
   border-color: #0062cc;
diff --git 
a/security-admin/src/main/webapp/react-webapp/src/views/PermissionsModule/EditPermission.jsx
 
b/security-admin/src/main/webapp/react-webapp/src/views/PermissionsModule/EditPermission.jsx
index a3e55dfbd..5e51faf27 100755
--- 
a/security-admin/src/main/webapp/react-webapp/src/views/PermissionsModule/EditPermission.jsx
+++ 
b/security-admin/src/main/webapp/react-webapp/src/views/PermissionsModule/EditPermission.jsx
@@ -32,7 +32,7 @@ import { Loader } from "Components/CommonComponents";
 import { fetchApi } from "Utils/fetchAPI";
 import AsyncSelect from "react-select/async";
 import { toast } from "react-toastify";
-import { cloneDeep, find, findIndex, reverse } from "lodash";
+import { cloneDeep, find, findIndex, isEmpty, map, reverse } from "lodash";
 import { AccessResult } from "Utils/XAEnums";
 import {
   CustomInfinteScroll,
@@ -88,7 +88,7 @@ function reducer(state, action) {
   throw new Error();
   }
 }
-const EditPermission = (props) => {
+const EditPermission = () => {
   let { permissionId } = useParams();
   const navigate = useNavigate();
   const toastId = useRef(null);
@@ -211,18 +211,27 @@ const EditPermission = (props) => {
   };
 
   const fetchGroups = async (inputValue) => {
-let params = {};
+let params = { isVisible: 1 };
+let groupsOp = [];
+
 if (inputValue) {
   params["name"] = inputValue || "";
 }
-const groupResp = await fetchApi({
-  url: "xusers/groups",
-  params: params
+
+try {
+  const groupResp = await fetchApi({
+url: "xusers/groups",
+params: params
+  });
+  groupsOp = groupResp.data?.vXGroups;
+} catch (error) {
+  console.error(`Error occurred while fetching Groups ! ${error}`);
+  serverError(error);
+}
+
+return map(groupsOp, function (group) {
+  return { label: group.name, value: group.id };
 });
-return groupResp.data.vXGroups.map(({ name, id }) => ({
-  label: name,
-  value: id
-}));
   };
 
   const filterGrpOp = ({ data }) => {
@@ -255,19 +264,27 @@ const EditPermission = (props) => {
   };
 
   const fetchUsers = async (inputValue) => {
-let params = {};
+let params = { isVisible: 1 };
+let usersOp = [];
+
 if (inputValue) {
   params["name"] = inputValue || "";
 }
-const userResp = await fetchApi({
-  url: "xusers/users",
-  params: params
-});
 
-return userResp.data.vXUsers.map(({ name, id }) => ({
-  label: name,
-  value: id
-}));
+try {
+  const userResp = await fetchApi({
+url: "xusers/users",
+params: params
+  });
+  usersOp = userResp.data?.vXUsers;
+} catch (error) {
+  console.error(`Error occurred while fetching Users ! ${error}`);
+  serverError(error);
+}
+
+return map(usersOp, function (user) {
+  return { label: user.name, value: user.id };
+});
   };
 
   const filterUsrOp = ({ data }) => {
@@ -375,7 +392,7 @@ const EditPermission = (props) => {
  (
+  render={({ input }) => (
 
   {" "}
{
   
 
 
-  {!_.isEmpty(selectedGrp) ? (
+  

[ranger] 01/04: RANGER-4383: In Audit, Plugin Status tab if the record of respective service is in second page then Service Type filter for that service would show no result

2023-09-25 Thread dhavalshah9131
This is an automated email from the ASF dual-hosted git repository.

dhavalshah9131 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git

commit 622a1dacbdd39ec08783fd3d411bedb66f1407b1
Author: Brijesh Bhalala 
AuthorDate: Wed Sep 6 19:33:29 2023 +0530

RANGER-4383: In Audit, Plugin Status tab if the record of respective 
service is in second page then Service Type filter for that service would show 
no result
---
 .../react-webapp/src/components/Editable.jsx   | 16 ++---
 .../react-webapp/src/components/XATableLayout.jsx  |  9 ++-
 .../main/webapp/react-webapp/src/utils/fetchAPI.js |  2 +-
 .../src/views/AuditEvent/AdminLogs/UserLogs.jsx|  6 +-
 .../src/views/AuditEvent/PluginStatusLogs.jsx  |  9 +--
 .../src/views/Encryption/KeyManager.jsx| 72 +++---
 .../role_details/RoleListing.jsx   |  8 +--
 .../users_details/UserFormComp.jsx | 26 +++-
 8 files changed, 65 insertions(+), 83 deletions(-)

diff --git 
a/security-admin/src/main/webapp/react-webapp/src/components/Editable.jsx 
b/security-admin/src/main/webapp/react-webapp/src/components/Editable.jsx
index 4e98134ab..4d6d7d265 100644
--- a/security-admin/src/main/webapp/react-webapp/src/components/Editable.jsx
+++ b/security-admin/src/main/webapp/react-webapp/src/components/Editable.jsx
@@ -17,13 +17,7 @@
  * under the License.
  */
 
-import React, {
-  useEffect,
-  useReducer,
-  useRef,
-  useState,
-  useCallback
-} from "react";
+import React, { useEffect, useReducer, useRef, useState } from "react";
 import {
   OverlayTrigger,
   Popover,
@@ -33,7 +27,7 @@ import {
   Col,
   Badge
 } from "react-bootstrap";
-import { find, findIndex, isArray, isEmpty, map } from "lodash";
+import { find, findIndex, isArray, isEmpty, sortBy } from "lodash";
 import { isObject } from "Utils/XAUtils";
 import CreatableSelect from "react-select/creatable";
 import Select from "react-select";
@@ -82,7 +76,7 @@ const CheckboxComp = (props) => {
 
   return (
 <>
-  {options.map((obj, index) => (
+  {options.map((obj) => (
 
{
 const policyConditionDisplayValue = () => {
   let ipRangVal, uiHintVal;
   if (selectVal) {
-return _.sortBy(Object.keys(selectVal)).map((property, index) => {
+return sortBy(Object.keys(selectVal)).map((property, index) => {
   let conditionObj = find(conditionDefVal, function (m) {
 if (m.name == property) {
   return m;
@@ -651,7 +645,7 @@ const Editable = (props) => {
   const handleApply = (e) => {
 let errors, uiHintVal;
 if (selectValRef?.current) {
-  _.sortBy(Object.keys(selectValRef.current)).map((property) => {
+  sortBy(Object.keys(selectValRef.current)).map((property) => {
 let conditionObj = find(conditionDefVal, function (m) {
   if (m.name == property) {
 return m;
diff --git 
a/security-admin/src/main/webapp/react-webapp/src/components/XATableLayout.jsx 
b/security-admin/src/main/webapp/react-webapp/src/components/XATableLayout.jsx
index d275598ce..71a33f1c7 100644
--- 
a/security-admin/src/main/webapp/react-webapp/src/components/XATableLayout.jsx
+++ 
b/security-admin/src/main/webapp/react-webapp/src/components/XATableLayout.jsx
@@ -59,6 +59,7 @@ function XATableLayout({
   loading,
   data,
   fetchData,
+  showPagination = true,
   pageCount: controlledPageCount,
   currentpageIndex,
   currentpageSize,
@@ -85,6 +86,7 @@ function XATableLayout({
   : [];
 return filterColVal;
   };
+
   const {
 getTableProps,
 getTableBodyProps,
@@ -160,6 +162,7 @@ function XATableLayout({
   });
 }
   );
+
   const currentPageValRef = useRef();
   const [currentPageVal, setCurrentPageVal] = useState("");
 
@@ -317,7 +320,7 @@ function XATableLayout({
   
 ) : (
   
-{rows.map((row, index) => {
+{rows.map((row) => {
   prepareRow(row);
   return (
 
 
   
-  {totalCount > 25 && (
+  {showPagination && totalCount > 25 && (
 
   
 
@@ -406,7 +409,7 @@ function XATableLayout({
 currPage > pageOptions.length ||
 !Number.isInteger(Number(currPage))
   ) {
-return (currPage = currPage);
+return currPage;
   } else {
 const page = currPage ? Number(currPage) - 1 : 0;
 gotoPage(page);
diff --git a/security-admin/src/main/webapp/react-webapp/src/utils/fetchAPI.js 
b/security-admin/src/main/webapp/react-webapp/src/utils/fetchAPI.js
index 135182b40..fbdd91737 100644
--- a/security-admin/src/main/webapp/react-webapp/src/utils/fetchAPI.js
+++ 

[ranger] 03/04: RANGER-4407 : Add server side validation for service audit filter

2023-09-25 Thread dhavalshah9131
This is an automated email from the ASF dual-hosted git repository.

dhavalshah9131 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git

commit 0f70a24f45b394043239d1898d7276b67400bfd2
Author: Dineshkumar Yadav 
AuthorDate: Wed Sep 13 21:18:45 2023 +0530

RANGER-4407 : Add server side validation for service audit filter
---
 .../java/org/apache/ranger/biz/ServiceDBStore.java |  7 +--
 .../src/views/ServiceManager/ServiceDefinition.jsx | 21 
 .../views/ServiceManager/ServiceViewDetails.jsx| 23 +-
 3 files changed, 40 insertions(+), 11 deletions(-)

diff --git 
a/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java 
b/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
index 84b096e9b..cfb7a6f23 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
@@ -3608,10 +3608,13 @@ public class ServiceDBStore extends 
AbstractServiceStore {

MessageEnums.INVALID_INPUT_DATA);
}
 
-   if (StringUtils.equals(svcConfDef.getName(), 
RANGER_PLUGIN_AUDIT_FILTERS) && 
!configs.containsKey(RANGER_PLUGIN_AUDIT_FILTERS)) {
-   if (svcConfDef.getDefaultvalue() != null) {
+   if (StringUtils.equals(svcConfDef.getName(), 
RANGER_PLUGIN_AUDIT_FILTERS)) {
+   if (svcConfDef.getDefaultvalue() != null && 
!configs.containsKey(RANGER_PLUGIN_AUDIT_FILTERS)) {

configs.put(RANGER_PLUGIN_AUDIT_FILTERS, svcConfDef.getDefaultvalue());
}
+   if 
(!stringUtil.isEmpty(configs.get(RANGER_PLUGIN_AUDIT_FILTERS)) && 
JsonUtils.jsonToAuditFilterList(configs.get(RANGER_PLUGIN_AUDIT_FILTERS)) == 
null) {
+   throw 
restErrorUtil.createRESTException("Invalid value for " + svcConfDef.getName());
+   }
}
}
Map validConfigs = new HashMap();
diff --git 
a/security-admin/src/main/webapp/react-webapp/src/views/ServiceManager/ServiceDefinition.jsx
 
b/security-admin/src/main/webapp/react-webapp/src/views/ServiceManager/ServiceDefinition.jsx
index 696c25c8c..bedce6f4b 100644
--- 
a/security-admin/src/main/webapp/react-webapp/src/views/ServiceManager/ServiceDefinition.jsx
+++ 
b/security-admin/src/main/webapp/react-webapp/src/views/ServiceManager/ServiceDefinition.jsx
@@ -19,7 +19,7 @@
 
 import React, { Component } from "react";
 import { Link } from "react-router-dom";
-import { Badge, Button, Col, Modal, Row, Table } from "react-bootstrap";
+import { Alert, Badge, Button, Col, Modal, Row, Table } from "react-bootstrap";
 import { difference, isEmpty, keys, map, omit, pick } from "lodash";
 import { RangerPolicyType } from "Utils/XAEnums";
 import ExportPolicy from "./ExportPolicy";
@@ -193,9 +193,22 @@ class ServiceDefinition extends Component {
   return tableRow;
 }
 
-auditFilters = JSON.parse(
-  auditFilters["ranger.plugin.audit.filters"].replace(/'/g, '"')
-);
+try {
+  auditFilters = JSON.parse(
+auditFilters["ranger.plugin.audit.filters"].replace(/'/g, '"')
+  );
+} catch (error) {
+  tableRow.push(
+
+  
+
+  Error occured while parsing service audit filter!
+
+  
+
+  );
+  return tableRow;
+}
 
 auditFilters.map((a, index) =>
   tableRow.push(
diff --git 
a/security-admin/src/main/webapp/react-webapp/src/views/ServiceManager/ServiceViewDetails.jsx
 
b/security-admin/src/main/webapp/react-webapp/src/views/ServiceManager/ServiceViewDetails.jsx
index 52279345f..8016d4489 100644
--- 
a/security-admin/src/main/webapp/react-webapp/src/views/ServiceManager/ServiceViewDetails.jsx
+++ 
b/security-admin/src/main/webapp/react-webapp/src/views/ServiceManager/ServiceViewDetails.jsx
@@ -18,8 +18,8 @@
  */
 
 import React from "react";
-import { Row, Col, Table, Badge } from "react-bootstrap";
-import { difference, isEmpty, keys, map, omit, pick, upperCase } from "lodash";
+import { Alert, Row, Col, Table, Badge } from "react-bootstrap";
+import { difference, isEmpty, keys, map, omit, pick } from "lodash";
 
 export const ServiceViewDetails = (props) => {
   let { serviceData, serviceDefData } = props;
@@ -135,9 +135,22 @@ export const ServiceViewDetails = (props) => {
   return tableRow;
 }
 
-auditFilters = JSON.parse(
-  auditFilters["ranger.plugin.audit.filters"].replace(/'/g, '"')
-);
+try {
+  auditFilters = JSON.parse(
+auditFilters["ranger.plugin.audit.filters"].replace(/'/g, '"')
+  );
+} catch (error) {
+  tableRow.push(
+
+  
+

[ranger] 04/04: RANGER-4358: Keep the usersync details popup names same as the backbone js names

2023-09-25 Thread dhavalshah9131
This is an automated email from the ASF dual-hosted git repository.

dhavalshah9131 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git

commit f740ad33208618fd47f5d2b314c4978300cbd7c2
Author: princeap173 
AuthorDate: Mon Sep 11 15:14:56 2023 +0530

RANGER-4358: Keep the usersync details popup names same as the backbone js 
names
---
 .../src/main/webapp/react-webapp/src/utils/XAEnums.js   | 13 +
 .../src/views/UserGroupRoleListing/SyncSourceDetails.jsx|  4 +++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/security-admin/src/main/webapp/react-webapp/src/utils/XAEnums.js 
b/security-admin/src/main/webapp/react-webapp/src/utils/XAEnums.js
index 6e5eb0d5b..194cf3bef 100644
--- a/security-admin/src/main/webapp/react-webapp/src/utils/XAEnums.js
+++ b/security-admin/src/main/webapp/react-webapp/src/utils/XAEnums.js
@@ -808,3 +808,16 @@ export const ServiceRequestDataRangerAcl = [
 ];
 
 export const ServiceRequestDataHadoopAcl = [ServiceType.Service_HDFS.label];
+
+export const UsersyncDetailsKeyDisplayMap = {
+'unixBackend': 'Unix',
+'fileName': 'File Name',
+'syncTime': 'Sync time',
+'lastModified': 'Last modified time',
+'minUserId': 'Minimum user id',
+'minGroupId': 'Minimum group id',
+'totalUsersSynced': 'Total number of users synced',
+'totalGroupsSynced': 'Total number of groups synced',
+'totalUsersDeleted': 'Total number of users marked for delete',
+'totalGroupsDeleted': 'Total number of groups marked for delete'
+}
\ No newline at end of file
diff --git 
a/security-admin/src/main/webapp/react-webapp/src/views/UserGroupRoleListing/SyncSourceDetails.jsx
 
b/security-admin/src/main/webapp/react-webapp/src/views/UserGroupRoleListing/SyncSourceDetails.jsx
index 42a886ef3..105659759 100644
--- 
a/security-admin/src/main/webapp/react-webapp/src/views/UserGroupRoleListing/SyncSourceDetails.jsx
+++ 
b/security-admin/src/main/webapp/react-webapp/src/views/UserGroupRoleListing/SyncSourceDetails.jsx
@@ -19,6 +19,8 @@
 
 import React, { useState, useCallback, useRef } from "react";
 import { Table } from "react-bootstrap";
+import { UsersyncDetailsKeyDisplayMap } from "../../utils/XAEnums"
+
 export function SyncSourceDetails(props) {
   const { syncDetails } = props;
   return Object.keys(props.syncDetails).length == 0 ? (
@@ -51,7 +53,7 @@ export function SyncSourceDetails(props) {
 
   {Object.entries(props.syncDetails).map(([key, value]) => (
 
-  {key}
+  {UsersyncDetailsKeyDisplayMap[key]? 
UsersyncDetailsKeyDisplayMap[key]: key}
   {value}
 
   ))}



[ranger] branch master updated (1438644b7 -> f740ad332)

2023-09-25 Thread dhavalshah9131
This is an automated email from the ASF dual-hosted git repository.

dhavalshah9131 pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


from 1438644b7 RANGER-4234: simplify condition/row-filter expressions that 
deal with delimited strings
 new 622a1dacb RANGER-4383: In Audit, Plugin Status tab if the record of 
respective service is in second page then Service Type filter for that service 
would show no result
 new 6b3bd1c85 RANGER-4381 : Difference in user lookup API request in 
permissions module page between React UI and BackBone UI
 new 0f70a24f4 RANGER-4407 : Add server side validation for service audit 
filter
 new f740ad332 RANGER-4358: Keep the usersync details popup names same as 
the backbone js names

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/ranger/biz/ServiceDBStore.java |  7 +-
 .../react-webapp/src/components/Editable.jsx   | 16 ++---
 .../react-webapp/src/components/XATableLayout.jsx  |  9 ++-
 .../main/webapp/react-webapp/src/styles/style.css  |  3 +-
 .../main/webapp/react-webapp/src/utils/XAEnums.js  | 13 
 .../main/webapp/react-webapp/src/utils/fetchAPI.js |  2 +-
 .../src/views/AuditEvent/AdminLogs/UserLogs.jsx|  6 +-
 .../src/views/AuditEvent/PluginStatusLogs.jsx  |  9 +--
 .../src/views/Encryption/KeyManager.jsx| 72 ++--
 .../src/views/PermissionsModule/EditPermission.jsx | 61 +++--
 .../views/PolicyListing/AddUpdatePolicyForm.jsx|  2 +-
 .../src/views/SecurityZone/SecurityZoneForm.jsx| 74 +++-
 .../src/views/ServiceManager/ServiceDefinition.jsx | 21 --
 .../src/views/ServiceManager/ServiceForm.jsx   | 79 +++---
 .../views/ServiceManager/ServiceViewDetails.jsx| 23 +--
 .../UserGroupRoleListing/SyncSourceDetails.jsx |  4 +-
 .../groups_details/GroupListing.jsx|  3 +-
 .../role_details/RoleListing.jsx   |  8 +--
 .../users_details/UserFormComp.jsx | 26 +++
 .../users_details/UserListing.jsx  |  3 +-
 20 files changed, 248 insertions(+), 193 deletions(-)