git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@496571 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonas B. Lim 2007-01-16 02:05:48 +00:00
parent ba7519049f
commit f490982c38
4 changed files with 13 additions and 13 deletions

View File

@ -29,22 +29,22 @@ public class AuthenticationUser {
String username; String username;
String password; String password;
String group; String groups;
public AuthenticationUser(String username, String password, String group) { public AuthenticationUser(String username, String password, String groups) {
this.username = username; this.username = username;
this.password = password; this.password = password;
this.group = group; this.groups = groups;
} }
public String getGroup() { public String getGroups() {
return group; return groups;
} }
public void setGroup(String group) { public void setGroups(String groups) {
this.group = group; this.groups = groups;
} }
public String getPassword() { public String getPassword() {
return password; return password;

View File

@ -70,7 +70,7 @@ public class SimpleAuthenticationPlugin implements BrokerPlugin {
AuthenticationUser user = (AuthenticationUser)it.next(); AuthenticationUser user = (AuthenticationUser)it.next();
userPasswords.put(user.getUsername(), user.getPassword()); userPasswords.put(user.getUsername(), user.getPassword());
Set groups = new HashSet(); Set groups = new HashSet();
StringTokenizer iter = new StringTokenizer(user.getGroup(), ","); StringTokenizer iter = new StringTokenizer(user.getGroups(), ",");
while (iter.hasMoreTokens()) { while (iter.hasMoreTokens()) {
String name = iter.nextToken().trim(); String name = iter.nextToken().trim();
groups.add(new GroupPrincipal(name)); groups.add(new GroupPrincipal(name));

View File

@ -28,10 +28,10 @@ import org.apache.commons.logging.LogFactory;
public class SimpleAuthenticationPluginTest extends SecurityTestSupport { public class SimpleAuthenticationPluginTest extends SecurityTestSupport {
private static final Log log = LogFactory.getLog(XBeanSecurityTest.class); private static final Log log = LogFactory.getLog(SimpleAuthenticationPluginTest.class);
public static Test suite() { public static Test suite() {
return suite(XBeanSecurityTest.class); return suite(SimpleAuthenticationPluginTest.class);
} }
public static void main(String[] args) { public static void main(String[] args) {

View File

@ -27,10 +27,10 @@
<simpleAuthenticationPlugin> <simpleAuthenticationPlugin>
<users> <users>
<authenticationUser username="system" password="manager" <authenticationUser username="system" password="manager"
group="users,admins"/> groups="users,admins"/>
<authenticationUser username="user" password="password" <authenticationUser username="user" password="password"
group="users"/> groups="users"/>
<authenticationUser username="guest" password="password" group="guests"/> <authenticationUser username="guest" password="password" groups="guests"/>
</users> </users>
</simpleAuthenticationPlugin> </simpleAuthenticationPlugin>