Bug 32082 - Minor enhancement allowing MemoryRealm to be more usefully extended
Summary: Minor enhancement allowing MemoryRealm to be more usefully extended
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 5.5.3
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-05 14:17 UTC by Brian E. Gallew
Modified: 2004-11-17 09:14 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian E. Gallew 2004-11-05 14:17:50 UTC
Due to the private nature of the the principals data element, extensions of
MemoryRealm are extremely limited in what they can do.  The following trivial
patch provides an accessor for the principals element.

diff -u -r1.7 MemoryRealm.java
--- catalina/src/share/org/apache/catalina/realm/MemoryRealm.java 24 Sep 2004
07:25:07 -0000      1.7
+++ catalina/src/share/org/apache/catalina/realm/MemoryRealm.java 4 Nov 2004
19:53:01 -0000
@@ -244,6 +244,16 @@
 
 
     /**
+     * Return a short name for this Realm implementation.
+     */
+    protected HashMap getPrincipals() {
+
+        return (principals);
+
+    }
+
+
+    /**
      * Return the password associated with the given principal's user name.
      */
     protected String getPassword(String username) {
Comment 1 Yoav Shapira 2004-11-17 18:07:24 UTC
Done for Tomcat 5.0.
Comment 2 Yoav Shapira 2004-11-17 18:14:40 UTC
And done for 5.5 as well.  Thanks for submitting this issue.