camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: Fixed spring-security example. Thanks to Olivier Delobre for the patch.
Date Mon, 22 Aug 2016 19:13:49 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.17.x 0a186cbc4 -> f28d32e02
  refs/heads/master 82c01b6fa -> ba6fc872e


Fixed spring-security example. Thanks to Olivier Delobre for the patch.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ba6fc872
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ba6fc872
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ba6fc872

Branch: refs/heads/master
Commit: ba6fc872e40b48344330b7bc469892e63eb739cc
Parents: 82c01b6
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Aug 22 21:11:51 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Aug 22 21:11:51 2016 +0200

----------------------------------------------------------------------
 .../camel-example-spring-security/README.md     |  7 ++-----
 examples/camel-example-spring-security/pom.xml  | 20 --------------------
 .../src/main/resources/camel-context.xml        | 11 +++++------
 3 files changed, 7 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ba6fc872/examples/camel-example-spring-security/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-security/README.md b/examples/camel-example-spring-security/README.md
index 3b15376..eb6d828 100644
--- a/examples/camel-example-spring-security/README.md
+++ b/examples/camel-example-spring-security/README.md
@@ -1,6 +1,7 @@
 # Camel Spring Security Example
 
 ### Introduction
+
 This example shows how to leverage the Spring Security to secure the camel endpoint.
 
 
@@ -10,11 +11,7 @@ You will need to compile this example first:
 	mvn clean install
 
 ### Run
-To run the example, you need to start up the server by typing
-
-	mvn jetty:run
-
-To stop the server hit <kbd>ctrl</kbd>+<kbd>c</kbd>
+To run the example, you need to start up the server and copy the .war to the application
server
 
 The example consumes messages from a servlet endpoint which is secured by Spring Security
 with http basic authentication, there are two service:

http://git-wip-us.apache.org/repos/asf/camel/blob/ba6fc872/examples/camel-example-spring-security/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-security/pom.xml b/examples/camel-example-spring-security/pom.xml
index eba9653..ecbd64c 100755
--- a/examples/camel-example-spring-security/pom.xml
+++ b/examples/camel-example-spring-security/pom.xml
@@ -80,24 +80,4 @@
 
   </dependencies>
 
-  <build>
-    <plugins>
-      <!-- so we can run mvn jetty:run -->
-      <plugin>
-        <groupId>org.mortbay.jetty</groupId>
-        <artifactId>jetty-maven-plugin</artifactId>
-        <version>${jetty-plugin-version}</version>
-        <configuration>
-          <connectors>
-            <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
-              <port>8080</port>
-              <maxIdleTime>60000</maxIdleTime>
-            </connector>
-          </connectors>
-        </configuration>
-      </plugin>
-    </plugins>
-
-  </build>
-
 </project>

http://git-wip-us.apache.org/repos/asf/camel/blob/ba6fc872/examples/camel-example-spring-security/src/main/resources/camel-context.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-security/src/main/resources/camel-context.xml b/examples/camel-example-spring-security/src/main/resources/camel-context.xml
index d51dc0a..286ca49 100644
--- a/examples/camel-example-spring-security/src/main/resources/camel-context.xml
+++ b/examples/camel-example-spring-security/src/main/resources/camel-context.xml
@@ -26,7 +26,8 @@
          http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">
 
   <spring-security:http realm="User Restrict Realm">
-    <spring-security:intercept-url pattern="/camel/**" access="ROLE_USER"/>
+    <spring-security:intercept-url pattern="/camel/**"
+                                   access="hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')"/>
     <spring-security:http-basic/>
     <spring-security:remember-me/>
   </spring-security:http>
@@ -42,12 +43,10 @@
   </spring-security:user-service>
 
   <bean id="accessDecisionManager" class="org.springframework.security.access.vote.AffirmativeBased">
+    <constructor-arg>
+      <bean class="org.springframework.security.access.vote.RoleVoter"/>
+    </constructor-arg>
     <property name="allowIfAllAbstainDecisions" value="true"/>
-    <property name="decisionVoters">
-      <list>
-        <bean class="org.springframework.security.access.vote.RoleVoter"/>
-      </list>
-    </property>
   </bean>
 
   <!-- The Policy for checking the authentication role of ADMIN -->


Mime
View raw message