You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ja...@apache.org on 2023/01/19 21:39:44 UTC

[solr] branch main updated: SOLR-15772 More visible security warnings in Admin UI (#1296)

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

janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new ee8c18188eb SOLR-15772 More visible security warnings in Admin UI (#1296)
ee8c18188eb is described below

commit ee8c18188eb8dc927098f21826a38942fa4d8e9b
Author: Jan Høydahl <ja...@users.noreply.github.com>
AuthorDate: Thu Jan 19 22:39:37 2023 +0100

    SOLR-15772 More visible security warnings in Admin UI (#1296)
---
 solr/CHANGES.txt                    | 2 ++
 solr/webapp/web/js/angular/app.js   | 1 +
 solr/webapp/web/partials/index.html | 7 ++++++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 3671e59d17a..d7b96214ea8 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -121,6 +121,8 @@ Improvements
 
 * SOLR-16616: JWTAuthPlugin: Read trusted X509 certificates from multiple files (janhoy)
 
+* SOLR-15772: More visible security warnings in Admin UI (janhoy)
+
 Optimizations
 ---------------------
 
diff --git a/solr/webapp/web/js/angular/app.js b/solr/webapp/web/js/angular/app.js
index a8bd2f5eb0e..206f246e866 100644
--- a/solr/webapp/web/js/angular/app.js
+++ b/solr/webapp/web/js/angular/app.js
@@ -524,6 +524,7 @@ solrAdminApp.controller('MainController', function($scope, $route, $rootScope, $
     System.get(function(data) {
       $scope.isCloudEnabled = data.mode.match( /solrcloud/i );
       $scope.usersPermissions = data.security.permissions;
+      $scope.isSecurityEnabled = $scope.authenticationPlugin != null;
 
       $scope.isSchemaDesignerEnabled = $scope.isPermitted([
         permissions.CONFIG_EDIT_PERM,
diff --git a/solr/webapp/web/partials/index.html b/solr/webapp/web/partials/index.html
index 3fe47efa64a..8e0c2b04882 100644
--- a/solr/webapp/web/partials/index.html
+++ b/solr/webapp/web/partials/index.html
@@ -260,7 +260,7 @@ limitations under the License.
 
           <h2>Security</h2>
 
-          <div class="content">
+          <div class="content" ng-show="isSecurityEnabled">
 
             <ul class="data">
 
@@ -286,7 +286,12 @@ limitations under the License.
 
             </ul>
 
+          </div>
 
+          <div ng-show="!isSecurityEnabled" style="text-align: left">
+            <p class="warning-msg"><img src="img/ico/shield--exclamation.png"/>&nbsp;WARNING: Security is not enabled for this server!</p>
+            <p>See <a href="/solr/#/~security">security screen</a> for how to enable authentication</p>
+            <p>TLS enabled? <img ng-show="tls" src="img/ico/tick.png"/><img ng-show="!tls" src="img/ico/cross.png"/></p>
           </div>
 
       </div>