You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ni...@apache.org on 2022/04/14 05:47:20 UTC

[ranger] branch master updated (838449630 -> b0a7df141)

This is an automated email from the ASF dual-hosted git repository.

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


    from 838449630 RANGER-3687: Password Policy Best Practices for Strong Security
     new e39b96e47 RANGER-3666 : Ranger UI improvement - Add warning popup if auto-complete for resource lookup is failing in Edit policy page
     new b0a7df141 RANGER-3544 : security zones listing will be in alphabetical order.

The 2 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:
 .../webapp/scripts/collection_bases/RangerZoneListBase.js |  3 +++
 .../main/webapp/scripts/modules/globalize/message/en.js   |  3 ++-
 .../webapp/scripts/views/policies/RangerPolicyForm.js     | 15 ++++++++++++---
 .../webapp/scripts/views/policymanager/ServiceLayout.js   |  1 +
 .../scripts/views/policymanager/ServiceLayoutSidebar.js   |  1 +
 .../src/main/webapp/scripts/views/reports/AuditLayout.js  |  1 +
 .../main/webapp/scripts/views/reports/UserAccessLayout.js |  1 +
 .../scripts/views/security_zone/ZoneResourceForm.js       | 15 ++++++++++++---
 .../scripts/views/service/ServiceAuditFilterResources.js  | 15 ++++++++++++---
 security-admin/src/main/webapp/styles/xa.css              |  4 ++++
 10 files changed, 49 insertions(+), 10 deletions(-)


[ranger] 01/02: RANGER-3666 : Ranger UI improvement - Add warning popup if auto-complete for resource lookup is failing in Edit policy page

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e39b96e47ab60927e697d65d9fb392c66588a4a1
Author: Dhaval.Rajpara <dh...@gmail.com>
AuthorDate: Wed Mar 23 18:24:26 2022 +0530

    RANGER-3666 : Ranger UI improvement - Add warning popup if auto-complete for resource lookup is failing in Edit policy page
    
    Signed-off-by: Nitin Galave <ni...@apache.org>
---
 .../main/webapp/scripts/modules/globalize/message/en.js   |  3 ++-
 .../webapp/scripts/views/policies/RangerPolicyForm.js     | 15 ++++++++++++---
 .../scripts/views/security_zone/ZoneResourceForm.js       | 15 ++++++++++++---
 .../scripts/views/service/ServiceAuditFilterResources.js  | 15 ++++++++++++---
 security-admin/src/main/webapp/styles/xa.css              |  4 ++++
 5 files changed, 42 insertions(+), 10 deletions(-)

diff --git a/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js b/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js
index d235ea7c9..0a332fc23 100644
--- a/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js
+++ b/security-admin/src/main/webapp/scripts/modules/globalize/message/en.js
@@ -500,7 +500,8 @@ define(function(require) {
                 signOutIsNotComplete    : 'Authentication to this instance of Ranger is managed externally(for example,Apache Knox). \
                                         You can still open this instance of Ranger from the same web browser without re-authentication. \
                                         To prevent additional access to Ranger, <b>close all browser windows and exit the browser</b>.',
-                pageNotFound            : 'Sorry, this page isn\'t here or has moved.'
+                pageNotFound            : 'Sorry, this page isn\'t here or has moved.',
+                resourcesLookup         : 'Resouce lookup fail for current resource'
 
 
 			},
diff --git a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js
index d4452a8d2..a672648b4 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js
@@ -712,7 +712,12 @@ define(function(require){
                             } else {
                                 response();
                             }
-                        }).fail(function(){
+                        }).fail(function(responses){
+                            if (responses && responses.responseJSON && responses.responseJSON.msgDesc) {
+                                XAUtil.notifyError('Error', responses.responseJSON.msgDesc);
+                            } else {
+                                XAUtil.notifyError('Error', localization.tt('msg.resourcesLookup'));
+                            }
                             response();
                         });
                         setTimeout(function(){
@@ -821,8 +826,12 @@ define(function(require){
 							};
 						},
 						transport: function (options) {
-                                                        $.ajax(options).fail(function() {
-								console.log("ajax failed");
+							$.ajax(options).fail(function(response) {
+								if (response && response.responseJSON && response.responseJSON.msgDesc) {
+									XAUtil.notifyError('Error', response.responseJSON.msgDesc);
+								} else {
+									XAUtil.notifyError('Error', localization.tt('msg.resourcesLookup'));
+								}
 								this.success({
 									resultSize : 0
 								});
diff --git a/security-admin/src/main/webapp/scripts/views/security_zone/ZoneResourceForm.js b/security-admin/src/main/webapp/scripts/views/security_zone/ZoneResourceForm.js
index 7242d7bc2..900d9da6e 100644
--- a/security-admin/src/main/webapp/scripts/views/security_zone/ZoneResourceForm.js
+++ b/security-admin/src/main/webapp/scripts/views/security_zone/ZoneResourceForm.js
@@ -265,7 +265,12 @@ define(function(require) {
                                 } else {
                                     response();
                                 }
-                            }).fail(function() {
+                            }).fail(function(responses) {
+                                if (responses && responses.responseJSON && responses.responseJSON.msgDesc) {
+                                    XAUtil.notifyError('Error', responses.responseJSON.msgDesc);
+                                } else {
+                                    XAUtil.notifyError('Error', localization.tt('msg.resourcesLookup'));
+                                }
                                 response();
                             });
                             setTimeout(function() {
@@ -403,8 +408,12 @@ define(function(require) {
                                 };
                             },
                             transport: function(options) {
-                                $.ajax(options).fail(function() {
-                                    console.log("ajax failed");
+                                $.ajax(options).fail(function(response) {
+                                    if (response && response.responseJSON && response.responseJSON.msgDesc) {
+                                        XAUtil.notifyError('Error', response.responseJSON.msgDesc);
+                                    } else {
+                                        XAUtil.notifyError('Error', localization.tt('msg.resourcesLookup'));
+                                    }
                                     this.success({
                                         resultSize: 0
                                     });
diff --git a/security-admin/src/main/webapp/scripts/views/service/ServiceAuditFilterResources.js b/security-admin/src/main/webapp/scripts/views/service/ServiceAuditFilterResources.js
index 115486efd..683fa4b18 100644
--- a/security-admin/src/main/webapp/scripts/views/service/ServiceAuditFilterResources.js
+++ b/security-admin/src/main/webapp/scripts/views/service/ServiceAuditFilterResources.js
@@ -259,7 +259,12 @@ define(function(require) {
                                 } else {
                                     response();
                                 }
-                            }).fail(function() {
+                            }).fail(function(responses) {
+                                if (responses && responses.responseJSON && responses.responseJSON.msgDesc) {
+                                    XAUtil.notifyError('Error', responses.responseJSON.msgDesc);
+                                } else {
+                                    XAUtil.notifyError('Error', localization.tt('msg.resourcesLookup'));
+                                }
                                 response();
                             });
                             setTimeout(function() {
@@ -389,8 +394,12 @@ define(function(require) {
                                 };
                             },
                             transport: function(options) {
-                                $.ajax(options).fail(function() {
-                                    console.log("ajax failed");
+                                $.ajax(options).fail(function(response) {
+                                    if (response && response.responseJSON && response.responseJSON.msgDesc) {
+                                        XAUtil.notifyError('Error', response.responseJSON.msgDesc);
+                                    } else {
+                                        XAUtil.notifyError('Error', localization.tt('msg.resourcesLookup'));
+                                    }
                                     this.success({
                                         resultSize: 0
                                     });
diff --git a/security-admin/src/main/webapp/styles/xa.css b/security-admin/src/main/webapp/styles/xa.css
index ff99fb195..2da2f29b7 100644
--- a/security-admin/src/main/webapp/styles/xa.css
+++ b/security-admin/src/main/webapp/styles/xa.css
@@ -1698,6 +1698,10 @@ background-color: #444444;
 	border:none;
 	word-break: break-all;
 }
+.alert-danger {
+  z-index: 1050 !important;
+}
+
 tr.disable-policy td {
 	background-color: #F0F0F0;
 }


[ranger] 02/02: RANGER-3544 : security zones listing will be in alphabetical order.

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b0a7df141f7d3325e151fe9866eadc0437e7b151
Author: Dhaval.Rajpara <dh...@gmail.com>
AuthorDate: Mon Apr 11 18:49:20 2022 +0530

    RANGER-3544 : security zones listing will be in alphabetical order.
    
    Signed-off-by: Nitin Galave <ni...@apache.org>
---
 .../src/main/webapp/scripts/collection_bases/RangerZoneListBase.js     | 3 +++
 .../src/main/webapp/scripts/views/policymanager/ServiceLayout.js       | 1 +
 .../main/webapp/scripts/views/policymanager/ServiceLayoutSidebar.js    | 1 +
 security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js    | 1 +
 .../src/main/webapp/scripts/views/reports/UserAccessLayout.js          | 1 +
 5 files changed, 7 insertions(+)

diff --git a/security-admin/src/main/webapp/scripts/collection_bases/RangerZoneListBase.js b/security-admin/src/main/webapp/scripts/collection_bases/RangerZoneListBase.js
index 170be9103..9f6f39073 100644
--- a/security-admin/src/main/webapp/scripts/collection_bases/RangerZoneListBase.js
+++ b/security-admin/src/main/webapp/scripts/collection_bases/RangerZoneListBase.js
@@ -41,6 +41,9 @@ define(function(require){
                         this.modelName = 'RangerZone';
                         this.modelAttrName = 'securityZones';
                         this.bindErrorEvents();
+                },
+                comparator: function(def) {
+                        return def.get('name');
                 }
         },{
                 // static class members
diff --git a/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js b/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
index 589a89abb..6d2d94589 100644
--- a/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
@@ -310,6 +310,7 @@ define(function(require){
             var zoneName = _.map(this.rangerZoneList.attributes, function(m){
                 return { 'id': m.name, 'text':m.name, 'zoneId' : m.id }
             });
+            zoneName = _.sortBy(zoneName, 'id')
             if(!_.isEmpty(App.vZone.vZoneName) && !_.isUndefined(App.vZone.vZoneName)){
                 this.ui.selectZoneName.val(App.vZone.vZoneName);
             }
diff --git a/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayoutSidebar.js b/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayoutSidebar.js
index d7d46399b..94fa3135d 100644
--- a/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayoutSidebar.js
+++ b/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayoutSidebar.js
@@ -388,6 +388,7 @@ define(function(require){
             var zoneName = _.map(this.rangerZoneList.attributes, function(m){
                 return { 'id':m.name, 'text':m.name, 'zoneId' : m.id}
             });
+            zoneName = _.sortBy(zoneName, 'id')
             if(!_.isEmpty(App.vZone.vZoneName) && !_.isUndefined(App.vZone.vZoneName)){
                 this.ui.selectZoneName.val(App.vZone.vZoneName);
             }
diff --git a/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js b/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
index 1420e90ea..4acebee98 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
@@ -535,6 +535,7 @@ define(function(require) {
 										zoneList.push({'label' : m.name, 'value' : m.name});
 									});
 								}
+								zoneList = _.sortBy(zoneList, 'label')
 								callback(zoneList);
 								break;
 						}
diff --git a/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js b/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js
index 08ef88b84..3b8d862a7 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/UserAccessLayout.js
@@ -672,6 +672,7 @@ define(function(require) {'use strict';
 			var zoneListOptions = _.map(this.rangerZoneList.attributes, function(m){
 				return { 'id':m.name, 'text':m.name}
 			});
+			zoneListOptions = _.sortBy(zoneListOptions, 'id')
                         var tags = [];
                         if (this.urlParam && this.urlParam['policyLabelsPartial'] && !_.isEmpty(this.urlParam['policyLabelsPartial'])) {
                                 tags.push( { 'id' : _.escape( this.urlParam['policyLabelsPartial'] ), 'text' : _.escape( this.urlParam['policyLabelsPartial'] ) } );