[prev in list] [next in list] [prev in thread] [next in thread]
List: activemq-commits
Subject: [1/4] Fix for https://issues.apache.org/jira/browse/AMQ-3621 - Integrate Apache Shiro with ActiveMQ
From: ceposta () apache ! org
Date: 2014-02-24 15:30:48
Message-ID: 59fc298b160345f2b41f10b2cebe58e3 () git ! apache ! org
[Download RAW message or body]
Repository: activemq
Updated Branches:
refs/heads/trunk e7e317dc7 -> f9451e56e
http://git-wip-us.apache.org/repos/asf/activemq/blob/f9451e56/activemq-shiro/src/test/resources/org/apache/activemq/shiro/no-ini-config.xml
----------------------------------------------------------------------
diff --git a/activemq-shiro/src/test/resources/org/apache/activemq/shiro/no-ini-config.xml \
b/activemq-shiro/src/test/resources/org/apache/activemq/shiro/no-ini-config.xml new \
file mode 100644 index 0000000..f8e04a8
--- /dev/null
+++ b/activemq-shiro/src/test/resources/org/apache/activemq/shiro/no-ini-config.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- this file can only be parsed using the xbean-spring library -->
+<!-- START SNIPPET: example -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:amq="http://activemq.apache.org/schema/core"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans \
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd + \
http://activemq.apache.org/schema/core \
http://activemq.apache.org/schema/core/activemq-core.xsd"> +
+ <broker xmlns="http://activemq.apache.org/schema/core"
+ useJmx="false" persistent="false" populateJMSXUserID="true">
+
+ <destinations>
+ <queue physicalName="TEST.Q"/>
+ </destinations>
+
+ <transportConnectors>
+ <transportConnector name="default" uri="tcp://0.0.0.0:61616"/>
+ </transportConnectors>
+
+ <plugins>
+
+ <bean id="shiroPlugin" class="org.apache.activemq.shiro.ShiroPlugin"
+ xmlns="http://www.springframework.org/schema/beans">
+ <!-- This configuration doesn't rely on an INI file for config, and \
expects that Shiro is configured + entirely within Spring. See \
the Shiro securityManager bean below. --> + <property \
name="securityManager" ref="securityManager"/> + </bean>
+
+ </plugins>
+ </broker>
+
+ <bean id="securityManager" class="org.apache.shiro.mgt.DefaultSecurityManager">
+ <!-- Do not use this cache manager in a clustered broker setup. If your \
broker is clustered, you should + configure a cluster-aware CacheManager, \
e.g. Hazelcast, Terracotta+Ehcache, etc. --> + <property name="cacheManager">
+ <bean class="org.apache.shiro.cache.MemoryConstrainedCacheManager"/>
+ </property>
+ <property name="realms">
+ <list>
+ <!-- Replace this with the real realm you're going to use that \
accesses your security data store: --> + <bean id="myRealm" \
class="org.apache.shiro.realm.text.TextConfigurationRealm"> + \
<property name="userDefinitions"> + <value>
+ system = manager,system
+ </value>
+ </property>
+ <property name="roleDefinitions">
+ <value>
+ system = *
+ </value>
+ </property>
+ </bean>
+ <!-- Add other realms if necessary -->
+ </list>
+ </property>
+ </bean>
+ <bean class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>
+
+</beans>
http://git-wip-us.apache.org/repos/asf/activemq/blob/f9451e56/activemq-shiro/src/test/resources/shiro.ini
----------------------------------------------------------------------
diff --git a/activemq-shiro/src/test/resources/shiro.ini \
b/activemq-shiro/src/test/resources/shiro.ini new file mode 100644
index 0000000..5231365
--- /dev/null
+++ b/activemq-shiro/src/test/resources/shiro.ini
@@ -0,0 +1,64 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+[main]
+
+# Shiro object graph configuration here if desired/necessary
+
+[users]
+
+# users section format:
+#
+# username = password [, assignedRole1, assignedRole2, ..., assignedRoleN]
+#
+# for example:
+#
+# scott = tiger, users, administrators, advisory
+#
+# Roles and permissions assigned to roles are defined in the [roles] section
+# below. By transitive association, any user assigned a role is granted the
+# role's permissions.
+
+# ActiveMQ System User
+# needed for in-VM/local connections when authentication is enabled:
+system = manager, system
+
+[roles]
+
+# roles section format:
+#
+# roleName = wildcardPermission1, wildcardPermission2, ..., wildcardPermissionN
+
+# The 'system' role is assigned all permissions (*). Be careful when assigning
+# this to actual users other than then system user:
+system = *
+
+# Full access rights should generally be given to the ActiveMQ.Advisory.*
+# destinations because by default an ActiveMQConnection uses advisory topics to
+# get early knowledge of temp destination creation and deletion. For more info:
+#
+# http://activemq.apache.org/security.html
+#
+# So we create an 'advisory' role here with a wildcard/catch-all permissions
+# for all advisory topics. To make your life easy, ensure you assign this to
+# any/all users, e.g.
+#
+# jsmith = password, advisory, ...
+
+advisory = topic:ActiveMQ.Advisory*
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/activemq/blob/f9451e56/assembly/pom.xml
----------------------------------------------------------------------
diff --git a/assembly/pom.xml b/assembly/pom.xml
index a25c085..4c29cf8 100755
--- a/assembly/pom.xml
+++ b/assembly/pom.xml
@@ -177,6 +177,10 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
+ <artifactId>activemq-shiro</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
<artifactId>activemq-spring</artifactId>
</dependency>
<dependency>
@@ -286,6 +290,14 @@
<artifactId>geronimo-jta_1.0.1B_spec</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.shiro</groupId>
+ <artifactId>shiro-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shiro</groupId>
+ <artifactId>shiro-spring</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-spring</artifactId>
<optional>true</optional>
http://git-wip-us.apache.org/repos/asf/activemq/blob/f9451e56/assembly/src/main/descriptors/common-bin.xml
----------------------------------------------------------------------
diff --git a/assembly/src/main/descriptors/common-bin.xml \
b/assembly/src/main/descriptors/common-bin.xml index e08078e..67c293a 100644
--- a/assembly/src/main/descriptors/common-bin.xml
+++ b/assembly/src/main/descriptors/common-bin.xml
@@ -172,6 +172,7 @@
<include>${pom.groupId}:activemq-jms-pool</include>
<include>${pom.groupId}:activemq-pool</include>
<include>${pom.groupId}:activemq-partition</include>
+ <include>${pom.groupId}:activemq-shiro</include>
<include>${pom.groupId}:activeio-core</include>
<include>commons-beanutils:commons-beanutils</include>
<include>commons-collections:commons-collections</include>
@@ -223,7 +224,11 @@
<include>org.linkedin:org.linkedin.zookeeper-impl</include>
<include>org.linkedin:org.linkedin.util-core</include>
<include>org.apache.zookeeper:zookeeper</include>
-
+
+ <!-- Apache Shiro dependencies: -->
+ <include>org.apache.shiro:shiro-core</include>
+ <include>org.apache.shiro:shiro-spring</include>
+
</includes>
</dependencySet>
<dependencySet>
http://git-wip-us.apache.org/repos/asf/activemq/blob/f9451e56/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 35f7da2..54b1d64 100755
--- a/pom.xml
+++ b/pom.xml
@@ -107,7 +107,9 @@
<scala-plugin-version>3.1.0</scala-plugin-version>
<scala-version>2.9.1</scala-version>
<scala-bundle-version>2.9.1_3</scala-bundle-version>
+ <shiro-version>1.2.2</shiro-version>
<scalatest-version>1.8</scalatest-version>
+ <shiro-version>1.2.2</shiro-version>
<slf4j-version>1.7.5</slf4j-version>
<snappy-version>1.1.0.1</snappy-version>
<spring-version>3.2.5.RELEASE</spring-version>
@@ -244,6 +246,7 @@
<module>activemq-ra</module>
<module>activemq-rar</module>
<module>activemq-run</module>
+ <module>activemq-shiro</module>
<module>activemq-spring</module>
<module>activemq-runtime-config</module>
<module>activemq-tooling</module>
@@ -386,6 +389,11 @@
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-shiro</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
<artifactId>activemq-spring</artifactId>
<version>${project.version}</version>
</dependency>
@@ -667,6 +675,34 @@
<artifactId>openjpa-persistence-jdbc</artifactId>
<version>${openjpa-version}</version>
</dependency>
+
+ <!-- Optional Shiro Support -->
+ <dependency>
+ <groupId>org.apache.shiro</groupId>
+ <artifactId>shiro-core</artifactId>
+ <version>${shiro-version}</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shiro</groupId>
+ <artifactId>shiro-spring</artifactId>
+ <version>${shiro-version}</version>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- Optional Shiro Support -->
+ <dependency>
+ <groupId>org.apache.shiro</groupId>
+ <artifactId>shiro-core</artifactId>
+ <version>${shiro-version}</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shiro</groupId>
+ <artifactId>shiro-spring</artifactId>
+ <version>${shiro-version}</version>
+ <optional>true</optional>
+ </dependency>
<!-- Optional Spring Support -->
<dependency>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic