Search in sources :

Example 1 with DestinationMap

use of org.apache.activemq.filter.DestinationMap in project activemq-artemis by apache.

the class SimpleSecurityBrokerSystemTest method createAuthorizationMap.

public static AuthorizationMap createAuthorizationMap() {
    DestinationMap readAccess = new DefaultAuthorizationMap();
    readAccess.put(new ActiveMQQueue(">"), ADMINS);
    readAccess.put(new ActiveMQQueue("USERS.>"), USERS);
    readAccess.put(new ActiveMQQueue("GUEST.>"), GUESTS);
    readAccess.put(new ActiveMQTopic(">"), ADMINS);
    readAccess.put(new ActiveMQTopic("USERS.>"), USERS);
    readAccess.put(new ActiveMQTopic("GUEST.>"), GUESTS);
    DestinationMap writeAccess = new DefaultAuthorizationMap();
    writeAccess.put(new ActiveMQQueue(">"), ADMINS);
    writeAccess.put(new ActiveMQQueue("USERS.>"), USERS);
    writeAccess.put(new ActiveMQQueue("GUEST.>"), USERS);
    writeAccess.put(new ActiveMQQueue("GUEST.>"), GUESTS);
    writeAccess.put(new ActiveMQTopic(">"), ADMINS);
    writeAccess.put(new ActiveMQTopic("USERS.>"), USERS);
    writeAccess.put(new ActiveMQTopic("GUEST.>"), USERS);
    writeAccess.put(new ActiveMQTopic("GUEST.>"), GUESTS);
    readAccess.put(new ActiveMQTopic("ActiveMQ.Advisory.>"), WILDCARD);
    writeAccess.put(new ActiveMQTopic("ActiveMQ.Advisory.>"), WILDCARD);
    DestinationMap adminAccess = new DefaultAuthorizationMap();
    adminAccess.put(new ActiveMQTopic(">"), ADMINS);
    adminAccess.put(new ActiveMQTopic(">"), USERS);
    adminAccess.put(new ActiveMQTopic(">"), GUESTS);
    adminAccess.put(new ActiveMQQueue(">"), ADMINS);
    adminAccess.put(new ActiveMQQueue(">"), USERS);
    adminAccess.put(new ActiveMQQueue(">"), GUESTS);
    return new SimpleAuthorizationMap(writeAccess, readAccess, adminAccess);
}
Also used : ActiveMQTopic(org.apache.activemq.command.ActiveMQTopic) ActiveMQQueue(org.apache.activemq.command.ActiveMQQueue) DestinationMap(org.apache.activemq.filter.DestinationMap)

Example 2 with DestinationMap

use of org.apache.activemq.filter.DestinationMap in project activemq-artemis by apache.

the class SecureDLQTest method createAuthorizationMap.

public static AuthorizationMap createAuthorizationMap() {
    DestinationMap readAccess = new DefaultAuthorizationMap();
    readAccess.put(new ActiveMQQueue("TEST"), ADMINS);
    readAccess.put(new ActiveMQQueue("TEST"), USERS);
    readAccess.put(new ActiveMQQueue("ActiveMQ.DLQ"), ADMINS);
    DestinationMap writeAccess = new DefaultAuthorizationMap();
    writeAccess.put(new ActiveMQQueue("TEST"), ADMINS);
    writeAccess.put(new ActiveMQQueue("TEST"), USERS);
    writeAccess.put(new ActiveMQQueue("ActiveMQ.DLQ"), ADMINS);
    readAccess.put(new ActiveMQTopic("ActiveMQ.Advisory.>"), WILDCARD);
    writeAccess.put(new ActiveMQTopic("ActiveMQ.Advisory.>"), WILDCARD);
    DestinationMap adminAccess = new DefaultAuthorizationMap();
    adminAccess.put(new ActiveMQQueue("TEST"), ADMINS);
    adminAccess.put(new ActiveMQQueue("TEST"), USERS);
    adminAccess.put(new ActiveMQQueue("ActiveMQ.DLQ"), ADMINS);
    adminAccess.put(new ActiveMQTopic("ActiveMQ.Advisory.>"), WILDCARD);
    return new SimpleAuthorizationMap(writeAccess, readAccess, adminAccess);
}
Also used : ActiveMQTopic(org.apache.activemq.command.ActiveMQTopic) SimpleAuthorizationMap(org.apache.activemq.security.SimpleAuthorizationMap) DefaultAuthorizationMap(org.apache.activemq.security.DefaultAuthorizationMap) ActiveMQQueue(org.apache.activemq.command.ActiveMQQueue) DestinationMap(org.apache.activemq.filter.DestinationMap)

Aggregations

ActiveMQQueue (org.apache.activemq.command.ActiveMQQueue)2 ActiveMQTopic (org.apache.activemq.command.ActiveMQTopic)2 DestinationMap (org.apache.activemq.filter.DestinationMap)2 DefaultAuthorizationMap (org.apache.activemq.security.DefaultAuthorizationMap)1 SimpleAuthorizationMap (org.apache.activemq.security.SimpleAuthorizationMap)1