mirror of https://github.com/apache/activemq.git
updated patch for https://issues.apache.org/activemq/browse/AMQ-1010
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@496571 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ba7519049f
commit
f490982c38
|
@ -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;
|
||||||
|
|
|
@ -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));
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue