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 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.password = password;
|
||||
this.group = group;
|
||||
this.groups = groups;
|
||||
}
|
||||
|
||||
|
||||
public String getGroup() {
|
||||
return group;
|
||||
public String getGroups() {
|
||||
return groups;
|
||||
}
|
||||
public void setGroup(String group) {
|
||||
this.group = group;
|
||||
public void setGroups(String groups) {
|
||||
this.groups = groups;
|
||||
}
|
||||
public String getPassword() {
|
||||
return password;
|
||||
|
|
|
@ -70,7 +70,7 @@ public class SimpleAuthenticationPlugin implements BrokerPlugin {
|
|||
AuthenticationUser user = (AuthenticationUser)it.next();
|
||||
userPasswords.put(user.getUsername(), user.getPassword());
|
||||
Set groups = new HashSet();
|
||||
StringTokenizer iter = new StringTokenizer(user.getGroup(), ",");
|
||||
StringTokenizer iter = new StringTokenizer(user.getGroups(), ",");
|
||||
while (iter.hasMoreTokens()) {
|
||||
String name = iter.nextToken().trim();
|
||||
groups.add(new GroupPrincipal(name));
|
||||
|
|
|
@ -28,10 +28,10 @@ import org.apache.commons.logging.LogFactory;
|
|||
|
||||
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() {
|
||||
return suite(XBeanSecurityTest.class);
|
||||
return suite(SimpleAuthenticationPluginTest.class);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
|
|
@ -27,10 +27,10 @@
|
|||
<simpleAuthenticationPlugin>
|
||||
<users>
|
||||
<authenticationUser username="system" password="manager"
|
||||
group="users,admins"/>
|
||||
groups="users,admins"/>
|
||||
<authenticationUser username="user" password="password"
|
||||
group="users"/>
|
||||
<authenticationUser username="guest" password="password" group="guests"/>
|
||||
groups="users"/>
|
||||
<authenticationUser username="guest" password="password" groups="guests"/>
|
||||
</users>
|
||||
</simpleAuthenticationPlugin>
|
||||
|
||||
|
|
Loading…
Reference in New Issue