camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r837619 - in /websites/production/camel/content: cache/main.pageCache spring-security-example.html
Date Thu, 08 Nov 2012 04:18:44 GMT
Author: buildbot
Date: Thu Nov  8 04:18:44 2012
New Revision: 837619

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/spring-security-example.html

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/camel/content/spring-security-example.html
==============================================================================
--- websites/production/camel/content/spring-security-example.html (original)
+++ websites/production/camel/content/spring-security-example.html Thu Nov  8 04:18:44 2012
@@ -107,7 +107,88 @@
 
 <p>Here is the camel route configuration:</p>
 
-<div class="error"><span class="error">Error formatting macro: snippet: java.lang.IndexOutOfBoundsException:
Index: 20, Size: 20</span> </div>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-xml">&lt;beans xmlns=<span class="code-quote">"http://www.springframework.org/schema/beans"</span>
+       <span class="code-keyword">xmlns:xsi</span>=<span class="code-quote">"http://www.w3.org/2001/XMLSchema-instance"</span>
+       <span class="code-keyword">xmlns:spring-security</span>=<span class="code-quote">"http://www.springframework.org/schema/security"</span>
+       xsi:schemaLocation="
+         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+         http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+         http://camel.apache.org/schema/spring-security http://camel.apache.org/schema/spring-security/camel-spring-security.xsd
+         http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd"&gt;
+
+  <span class="code-tag">&lt;spring-security:http realm=<span class="code-quote">"User
Restrict Realm"</span>&gt;</span>
+    <span class="code-tag">&lt;spring-security:intercept-url pattern=<span class="code-quote">"/camel/**"</span>
access=<span class="code-quote">"ROLE_USER"</span>/&gt;</span>
+    <span class="code-tag">&lt;spring-security:http-basic/&gt;</span>
+    <span class="code-tag">&lt;spring-security:remember-me/&gt;</span>
+  <span class="code-tag">&lt;/spring-security:http&gt;</span>
+
+    <span class="code-tag"><span class="code-comment">&lt;!--  set up the
user configuration here --&gt;</span></span>
+  <span class="code-tag">&lt;spring-security:authentication-manager alias=<span
class="code-quote">"authenticationManager"</span>&gt;</span>
+    <span class="code-tag">&lt;spring-security:authentication-provider user-service-ref=<span
class="code-quote">"userDetailsService"</span>/&gt;</span>
+  <span class="code-tag">&lt;/spring-security:authentication-manager&gt;</span>
+
+  <span class="code-tag">&lt;spring-security:user-service id=<span class="code-quote">"userDetailsService"</span>&gt;</span>
+    <span class="code-tag">&lt;spring-security:user name=<span class="code-quote">"jim"</span>
password=<span class="code-quote">"jimspassword"</span> authorities=<span class="code-quote">"ROLE_USER,
ROLE_ADMIN"</span>/&gt;</span>
+    <span class="code-tag">&lt;spring-security:user name=<span class="code-quote">"bob"</span>
password=<span class="code-quote">"bobspassword"</span> authorities=<span class="code-quote">"ROLE_USER"</span>/&gt;</span>
+  <span class="code-tag">&lt;/spring-security:user-service&gt;</span>
+
+  <span class="code-tag">&lt;bean id=<span class="code-quote">"accessDecisionManager"</span>
class=<span class="code-quote">"org.springframework.security.access.vote.AffirmativeBased"</span>&gt;</span>
+    <span class="code-tag">&lt;property name=<span class="code-quote">"allowIfAllAbstainDecisions"</span>
value=<span class="code-quote">"true"</span>/&gt;</span>
+    <span class="code-tag">&lt;property name=<span class="code-quote">"decisionVoters"</span>&gt;</span>
+      <span class="code-tag">&lt;list&gt;</span>
+        <span class="code-tag">&lt;bean class=<span class="code-quote">"org.springframework.security.access.vote.RoleVoter"</span>/&gt;</span>
+      <span class="code-tag">&lt;/list&gt;</span>
+    <span class="code-tag">&lt;/property&gt;</span>
+  <span class="code-tag">&lt;/bean&gt;</span>
+
+  <span class="code-tag"><span class="code-comment">&lt;!-- The Policy for
checking the authentication role of ADMIN --&gt;</span></span>
+  &lt;authorizationPolicy id=<span class="code-quote">"admin"</span> access=<span
class="code-quote">"ROLE_ADMIN"</span>
+                       authenticationManager=<span class="code-quote">"authenticationManager"</span>
+                       accessDecisionManager=<span class="code-quote">"accessDecisionManager"</span>
+                       xmlns=<span class="code-quote">"http://camel.apache.org/schema/spring-security"</span>/&gt;
+
+  <span class="code-tag"><span class="code-comment">&lt;!-- The Policy for
checking the authentication role of USER --&gt;</span></span>
+  &lt;authorizationPolicy id=<span class="code-quote">"user"</span> access=<span
class="code-quote">"ROLE_USER"</span>
+                       xmlns=<span class="code-quote">"http://camel.apache.org/schema/spring-security"</span>/&gt;
+
+  <span class="code-tag">&lt;camelContext id=<span class="code-quote">"myCamelContext"</span>
xmlns=<span class="code-quote">"http://camel.apache.org/schema/spring"</span>&gt;</span>
+    <span class="code-tag"><span class="code-comment">&lt;!-- Catch the authorization
exception and set the Access Denied message back --&gt;</span></span>
+    <span class="code-tag">&lt;onException&gt;</span>
+      <span class="code-tag">&lt;exception&gt;</span>org.apache.camel.CamelAuthorizationException<span
class="code-tag">&lt;/exception&gt;</span>
+      <span class="code-tag">&lt;handled&gt;</span>
+        <span class="code-tag">&lt;constant&gt;</span>true<span class="code-tag">&lt;/constant&gt;</span>
+      <span class="code-tag">&lt;/handled&gt;</span>
+      <span class="code-tag">&lt;transform&gt;</span>
+        <span class="code-tag">&lt;simple&gt;</span>Access Denied with
the Policy of ${exception.policyId} !<span class="code-tag">&lt;/simple&gt;</span>
+      <span class="code-tag">&lt;/transform&gt;</span>
+    <span class="code-tag">&lt;/onException&gt;</span>
+
+    <span class="code-tag">&lt;route&gt;</span>
+      <span class="code-tag">&lt;from uri=<span class="code-quote">"servlet:///user"</span>/&gt;</span>
+      <span class="code-tag"><span class="code-comment">&lt;!-- wrap the
route in the policy which enforces security check --&gt;</span></span>
+      <span class="code-tag">&lt;policy ref=<span class="code-quote">"user"</span>&gt;</span>
+        <span class="code-tag">&lt;transform&gt;</span>
+          <span class="code-tag">&lt;simple&gt;</span>Normal user can
access this service<span class="code-tag">&lt;/simple&gt;</span>
+        <span class="code-tag">&lt;/transform&gt;</span>
+      <span class="code-tag">&lt;/policy&gt;</span>
+    <span class="code-tag">&lt;/route&gt;</span>
+
+    <span class="code-tag">&lt;route&gt;</span>
+      <span class="code-tag">&lt;from uri=<span class="code-quote">"servlet:///admin"</span>/&gt;</span>
+      <span class="code-tag"><span class="code-comment">&lt;!-- wrap the
route in the policy which enforces security check --&gt;</span></span>
+      <span class="code-tag">&lt;policy ref=<span class="code-quote">"admin"</span>&gt;</span>
+        <span class="code-tag">&lt;transform&gt;</span>
+          <span class="code-tag">&lt;simple&gt;</span>Call the admin
operation OK<span class="code-tag">&lt;/simple&gt;</span>
+        <span class="code-tag">&lt;/transform&gt;</span>
+      <span class="code-tag">&lt;/policy&gt;</span>
+    <span class="code-tag">&lt;/route&gt;</span>
+
+  <span class="code-tag">&lt;/camelContext&gt;</span>
+
+<span class="code-tag">&lt;/beans&gt;</span>
+</pre>
+</div></div>
 
 <p>You can find how to configure the camel-servlet with http basic authentication by
check the files in <a shape="rect" class="external-link" href="https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-spring-security/src/main/webapp/WEB-INF">WEB-INF</a>
</p></div>
         </td>



Mime
View raw message