Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50713
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 16 Feb 2011 13:43:39 +0000 (13:43 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 16 Feb 2011 13:43:39 +0000 (13:43 +0000)
Remove roles command from Manager application

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1071243 13f79535-47bb-0310-9956-ffa450edef68

13 files changed:
java/org/apache/catalina/ant/RolesTask.java [deleted file]
java/org/apache/catalina/ant/antlib.xml
java/org/apache/catalina/ant/catalina.tasks
java/org/apache/catalina/manager/LocalStrings.properties
java/org/apache/catalina/manager/LocalStrings_de.properties
java/org/apache/catalina/manager/LocalStrings_es.properties
java/org/apache/catalina/manager/LocalStrings_fr.properties
java/org/apache/catalina/manager/LocalStrings_ja.properties
java/org/apache/catalina/manager/ManagerServlet.java
webapps/docs/changelog.xml
webapps/docs/html-manager-howto.xml
webapps/docs/manager-howto.xml
webapps/manager/WEB-INF/web.xml

diff --git a/java/org/apache/catalina/ant/RolesTask.java b/java/org/apache/catalina/ant/RolesTask.java
deleted file mode 100644 (file)
index a3e4d03..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.catalina.ant;
-
-
-import org.apache.tools.ant.BuildException;
-
-
-/**
- * Ant task that implements the <code>/roles</code> command, supported by the
- * Tomcat manager application.
- *
- * @author Craig R. McClanahan
- * @version $Id$
- * @since 4.1
- */
-public class RolesTask extends AbstractCatalinaTask {
-
-
-    // ------------------------------------------------------------- Properties
-
-
-    // --------------------------------------------------------- Public Methods
-
-
-    /**
-     * Execute the requested operation.
-     *
-     * @exception BuildException if an error occurs
-     */
-    @Override
-    public void execute() throws BuildException {
-
-        super.execute();
-        execute("/roles");
-
-    }
-
-
-}
index 0c5e36a..5923ec0 100644 (file)
@@ -35,9 +35,6 @@
         name="undeploy"
         classname="org.apache.catalina.ant.UndeployTask" />
   <typedef
-        name="roles"
-        classname="org.apache.catalina.ant.RolesTask" />
-  <typedef
         name="resources"
         classname="org.apache.catalina.ant.ResourcesTask" />
   <typedef
index 6871628..119432e 100644 (file)
@@ -19,7 +19,6 @@ list=org.apache.catalina.ant.ListTask
 reload=org.apache.catalina.ant.ReloadTask
 sessions=org.apache.catalina.ant.SessionsTask
 resources=org.apache.catalina.ant.ResourcesTask
-roles=org.apache.catalina.ant.RolesTask
 start=org.apache.catalina.ant.StartTask
 stop=org.apache.catalina.ant.StopTask
 undeploy=org.apache.catalina.ant.UndeployTask
index 70c7038..3b02e01 100644 (file)
@@ -95,7 +95,6 @@ managerServlet.postCommand=FAIL - Tried to use command {0} via a GET request but
 managerServlet.reloaded=OK - Reloaded application at context path {0}
 managerServlet.resourcesAll=OK - Listed global resources of all types
 managerServlet.resourcesType=OK - Listed global resources of type {0}
-managerServlet.rolesList=OK - Listed security roles
 managerServlet.saveFail=FAIL - Configuration save failed: {0}
 managerServlet.saved=OK - Server configuration saved
 managerServlet.savedContext=OK - Context {0} configuration saved
index 135a74e..f9082e8 100644 (file)
@@ -76,7 +76,6 @@ managerServlet.noWrapper=Container hat setWrapper() f\u00fcr dieses Servlet nich
 managerServlet.reloaded=OK - Anwendung mit Kontext Pfad {0} neu geladen
 managerServlet.resourcesAll=OK - Auflistung globaler Ressourcen (alle Typen)
 managerServlet.resourcesType=OK - Auflistung globaler Ressourcen von Typ {0}
-managerServlet.rolesList=OK - Auflistung der Sicherheits-Rollen
 managerServlet.saveFail=FEHLER - Speichern der Konfiguration fehlgeschlagen: {0}
 managerServlet.sessiondefaultmax=Voreingestellter Sitzungsablauf nach maximal {0} Minuten Inaktivit\u00e4t
 #TODO: Please review the following three messages. These are displayed when "Expire sessions" button is pressed in the Manager webapp:
index 98ded90..cb783f8 100644 (file)
@@ -81,7 +81,6 @@ managerServlet.notDeployed = FALLO - El contexto {0} est\u00E1 definido en serve
 managerServlet.reloaded = OK - Recargada aplicaci\u00F3n en trayectoria de contexto {0}
 managerServlet.resourcesAll = OK - Listados recursos globales de todos los tipos
 managerServlet.resourcesType = OK - Listados recursos globales de tipo {0}
-managerServlet.rolesList = OK - Listados papeles de seguridad
 managerServlet.saveFail = FAIL - Fallo al guardar la configuraci\u00F3n\: {0}
 managerServlet.saved = OK - Configuraci\u00F3n de Servidor guardada
 managerServlet.savedContext = OK - Configuraci\u00F3n de Contexto {0} guardada
index f4f86a1..4a1c9d5 100644 (file)
@@ -82,7 +82,6 @@ managerServlet.notDeployed=ECHEC - Le contexte {0} est d\u00e9fini dans server.x
 managerServlet.reloaded=OK - L''application associ\u00e9e au chemin de contexte {0} a \u00e9t\u00e9 recharg\u00e9e
 managerServlet.resourcesAll=OK - Liste des ressources globales de tout type
 managerServlet.resourcesType=OK - Liste des ressources globales de type {0}
-managerServlet.rolesList=OK - Liste de r\u00f4les de securit\u00e9
 managerServlet.saveFail=ECHEC - La sauvegarde de la configuration a \u00e9chou\u00e9: {0}
 managerServlet.saved=OK - Configuration serveur sauvegard\u00e9e
 managerServlet.savedContext=OK - Configuration du contexte {0} sauvegard\u00e9e
index 2be5183..11dca74 100644 (file)
@@ -74,7 +74,6 @@ managerServlet.noWrapper=\u30b3\u30f3\u30c6\u30ca\u306f\u3053\u306e\u30b5\u30fc\
 managerServlet.reloaded=OK - \u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30d1\u30b9 {0} \u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u518d\u30ed\u30fc\u30c9\u3057\u307e\u3057\u305f
 managerServlet.resourcesAll=OK - \u3059\u3079\u3066\u306e\u30bf\u30a4\u30d7\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u30ea\u30bd\u30fc\u30b9\u3092\u5217\u6319\u3057\u307e\u3057\u305f
 managerServlet.resourcesType=OK - \u30bf\u30a4\u30d7 {0} \u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u30ea\u30bd\u30fc\u30b9\u3092\u5217\u6319\u3057\u307e\u3057\u305f
-managerServlet.rolesList=OK - \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ed\u30fc\u30eb\u3092\u5217\u6319\u3057\u307e\u3057\u305f
 managerServlet.saveFail=FAIL - \u8a2d\u5b9a\u306e\u4fdd\u5b58\u306b\u5931\u6557\u3057\u307e\u3057\u305f: {0}
 managerServlet.saved=OK - \u30b5\u30fc\u30d0\u306e\u8a2d\u5b9a\u3092\u4fdd\u5b58\u3057\u307e\u3057\u305f
 managerServlet.savedContext=OK - \u30b3\u30f3\u30c6\u30ad\u30b9\u30c8 {0} \u306e\u8a2d\u5b9a\u3092\u4fdd\u5b58\u3057\u307e\u3057\u305f
index 12588e8..bf1e8f5 100644 (file)
@@ -26,15 +26,12 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.Enumeration;
-import java.util.Iterator;
 import java.util.Locale;
 
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 import javax.naming.Binding;
-import javax.naming.InitialContext;
 import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 import javax.servlet.ServletInputStream;
@@ -50,10 +47,8 @@ import org.apache.catalina.Engine;
 import org.apache.catalina.Globals;
 import org.apache.catalina.Host;
 import org.apache.catalina.Manager;
-import org.apache.catalina.Role;
 import org.apache.catalina.Server;
 import org.apache.catalina.Session;
-import org.apache.catalina.UserDatabase;
 import org.apache.catalina.Wrapper;
 import org.apache.catalina.core.StandardHost;
 import org.apache.catalina.core.StandardServer;
@@ -101,9 +96,6 @@ import org.apache.tomcat.util.res.StringManager;
  * <li><b>/resources?type=xxxx</b> - Enumerate the available global JNDI
  *     resources, optionally limited to those of the specified type
  *     (fully qualified Java class name), if available.</li>
- * <li><b>/roles</b> - Enumerate the available security role names and
- *     descriptions from the user database connected to the <code>users</code>
- *     resource reference.
  * <li><b>/serverinfo</b> - Display system OS and JVM properties.
  * <li><b>/sessions</b> - Deprecated. Use expire.
  * <li><b>/expire?path=/xxx</b> - List session idle timeinformation about the
@@ -362,8 +354,6 @@ public class ManagerServlet extends HttpServlet implements ContainerServlet {
             reload(writer, cn, smClient);
         } else if (command.equals("/resources")) {
             resources(writer, type, smClient);
-        } else if (command.equals("/roles")) {
-            roles(writer, smClient);
         } else if (command.equals("/save")) {
             save(writer, path, smClient);
         } else if (command.equals("/serverinfo")) {
@@ -1034,57 +1024,6 @@ public class ManagerServlet extends HttpServlet implements ContainerServlet {
 
 
     /**
-     * Render a list of security role names (and corresponding descriptions)
-     * from the <code>org.apache.catalina.UserDatabase</code> resource that is
-     * connected to the <code>users</code> resource reference.  Typically, this
-     * will be the global user database, but can be adjusted if you have
-     * different user databases for different virtual hosts.
-     *
-     * @param writer Writer to render to
-     */
-    protected void roles(PrintWriter writer,  StringManager smClient) {
-
-        if (debug >= 1) {
-            log("roles:  List security roles from user database");
-        }
-
-        // Look up the UserDatabase instance we should use
-        UserDatabase database = null;
-        try {
-            InitialContext ic = new InitialContext();
-            database = (UserDatabase) ic.lookup("java:comp/env/users");
-        } catch (NamingException e) {
-            writer.println(smClient.getString(
-                    "managerServlet.userDatabaseError"));
-            log("java:comp/env/users", e);
-            return;
-        }
-        if (database == null) {
-            writer.println(smClient.getString(
-                    "managerServlet.userDatabaseMissing"));
-            return;
-        }
-
-        // Enumerate the available roles
-        writer.println(smClient.getString("managerServlet.rolesList"));
-        Iterator<Role> roles = database.getRoles();
-        if (roles != null) {
-            while (roles.hasNext()) {
-                Role role = roles.next();
-                writer.print(role.getRolename());
-                writer.print(':');
-                if (role.getDescription() != null) {
-                    writer.print(role.getDescription());
-                }
-                writer.println();
-            }
-        }
-
-
-    }
-
-
-    /**
      * Writes System OS and JVM properties.
      * @param writer Writer to render to
      */
index 2dc466c..0b50470 100644 (file)
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Wep applications">
+    <changelog>
+      <fix>
+        <bug>50713</bug>: Remove roles command from the Manager application.
+        (markt)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Tribes">
     <changelog>
       <fix>
-        <rev>1068549</rev> <bug>50667</bug>: Allow RPC callers to get confirmation when sending a reply.
+        <rev>1068549</rev> <bug>50667</bug>: Allow RPC callers to get
+        confirmation when sending a reply. (fhanik)
       </fix>  
     </changelog>
   </subsection>
index f8cd402..6fd0c43 100644 (file)
@@ -388,11 +388,6 @@ Tomcat <code>server.xml</code> configuration file. Here is an
 example for Tomcat running on Windows:</p>
 <source>
 &lt;Context path="/foobar" docBase="C:\path\to\application\foobar"&gt;
-
-  &lt;!-- Link to the user database we will get roles from --&gt;
-  &lt;ResourceLink name="users" global="UserDatabase"
-                type="org.apache.catalina.UserDatabase"/&gt;
-
 &lt;/Context&gt;
 </source>
 
index a4fe986..cfa9f2b 100644 (file)
@@ -58,7 +58,6 @@ the following functions:</p>
 <li>List the available global JNDI resources, for use in deployment
     tools that are preparing <code>&lt;ResourceLink&gt;</code> elements
     nested in a <code>&lt;Context&gt;</code> deployment description.</li>
-<li>List the available security roles defined in the user database.</li>
 <li>Start a stopped application (thus making it available again).</li>
 <li>Stop an existing application (so that it becomes unavailable), but
     do not undeploy it.</li>
@@ -390,11 +389,6 @@ Tomcat <code>server.xml</code> configuration file. Here is an
 example:</p>
 <source>
 &lt;Context path="/foobar" docBase="/path/to/application/foobar"&gt;
-
-  &lt;!-- Link to the user database we will get roles from --&gt;
-  &lt;ResourceLink name="users" global="UserDatabase"
-                type="org.apache.catalina.UserDatabase"/&gt;
-
 &lt;/Context&gt;
 </source>
 
@@ -652,60 +646,6 @@ include an error message.  Possible causes for problems include:</p>
 
 </subsection>
 
-
-<subsection name="List Available Security Roles">
-
-<source>
-http://localhost:8080/manager/text/roles
-</source>
-
-<p>List the security role names (and corresponding descriptions) that are
-available in the <code>org.apache.catalina.UserDatabase</code> resource that
-is linked to the <code>users</code> resource reference in the web.xml file
-for the Manager web application.  This would typically be used, for example,
-by a deployment tool that wanted to create
-<code>&lt;security-role-ref&gt;</code> elements to map security role names
-used in a web application to the role names actually defined within the
-container.</p>
-
-<p>By default, the <code>users</code> resource reference is pointed at the
-global <code>UserDatabase</code> resource.  If you choose to utilize a
-different user database per virtual host, you should modify the
-<code>&lt;ResourceLink&gt;</code> element in the default
-<code>manager.xml</code> context configuration file to point at the global
-user database resource for this virtual host.</p>
-
-<p>When this command is executed, the first line of the response will be:</p>
-<pre>
-  OK - Listed security roles
-</pre>
-<p>followed by one line for each security role.  Each line is composed of
-fields delimited by colon characters (":") as follows:</p>
-<ul>
-<li><em>Security Role Name</em> - A security role name that is known to Tomcat
-    in the user database.</li>
-<li><em>Description</em> - Description of this security role (useful in
-    creating user interfaces for selecting roles.</li>
-</ul>
-
-<p>If an error occurs, the response will start with <code>FAIL</code> and
-include an error message.  Possible causes for problems include:</p>
-<ul>
-<li><em>Cannot resolve user database reference</em> - A JNDI error prevented
-    the successful lookup of the <code>org.apache.catalina.UserDatabase</code>
-    resource.  Check the Tomcat log files for a stack trace associated with
-    this error.</li>
-<li><em>No user database is available</em> - You have not configured a resource
-    reference for the <code>users</code> resource that points at an
-    appropriate user database instance.  Check your <code>manager.xml</code>
-    file and ensure that you have created an appropriate
-    <code>&lt;ResourceLink&gt;</code> or
-    <code>&lt;ResourceParams&gt;</code> element for this resource.</li>
-</ul>
-
-</subsection>
-
-
 <subsection name="Session Statistics">
 
 <source>
@@ -996,7 +936,6 @@ file might look something like this:</p>
   &lt;taskdef name="list"      classname="org.apache.catalina.ant.ListTask"/&gt;
   &lt;taskdef name="reload"    classname="org.apache.catalina.ant.ReloadTask"/&gt;
   &lt;taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"/&gt;
-  &lt;taskdef name="roles"     classname="org.apache.catalina.ant.RolesTask"/&gt;
   &lt;taskdef name="start"     classname="org.apache.catalina.ant.StartTask"/&gt;
   &lt;taskdef name="stop"      classname="org.apache.catalina.ant.StopTask"/&gt;
   &lt;taskdef name="undeploy"  classname="org.apache.catalina.ant.UndeployTask"/&gt;
index e23e226..2d13269 100644 (file)
     <servlet-name>jsp</servlet-name>
   </filter-mapping>
   
-  <!-- Define reference to the user database for looking up roles -->
-  <resource-env-ref>
-    <description>
-      Link to the UserDatabase instance from which we request lists of
-      defined role names.  Typically, this will be connected to the global
-      user database with a ResourceLink element in server.xml or the context
-      configuration file for the Manager web application.
-    </description>
-    <resource-env-ref-name>users</resource-env-ref-name>
-    <resource-env-ref-type>
-      org.apache.catalina.UserDatabase
-    </resource-env-ref-type>
-  </resource-env-ref>
-
   <!-- Define a Security Constraint on this Application -->
   <!-- NOTE:  None of these roles are present in the default users file -->
   <security-constraint>