Author: hadrian
Date: Wed Apr 11 20:01:35 2012
New Revision: 1324967

URL: http://svn.apache.org/viewvc?rev=1324967&view=rev
Log:
Merged revisions 1310249 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r1310249 | davsclaus | 2012-04-06 05:03:37 -0400 (Fri, 06 Apr 2012) | 1 line
  
  Polished
........

Modified:
    camel/branches/camel-2.9.x/   (props changed)
    
camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java
    
camel/branches/camel-2.9.x/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityPolicy.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java?rev=1324967&r1=1324966&r2=1324967&view=diff
==============================================================================
--- 
camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java
 (original)
+++ 
camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java
 Wed Apr 11 20:01:35 2012
@@ -94,10 +94,10 @@ public final class ExchangeHelper {
         throw new NoSuchPropertyException(exchange, propertyName, type);
     }
 
-    public static <T> T getMandatoryHeader(Exchange exchange, String 
propertyName, Class<T> type) throws NoSuchHeaderException {
-        T answer = exchange.getIn().getHeader(propertyName, type);
+    public static <T> T getMandatoryHeader(Exchange exchange, String 
headerName, Class<T> type) throws NoSuchHeaderException {
+        T answer = exchange.getIn().getHeader(headerName, type);
         if (answer == null) {
-            throw new NoSuchHeaderException(exchange, propertyName, type);
+            throw new NoSuchHeaderException(exchange, headerName, type);
         }
         return answer;
     }

Modified: 
camel/branches/camel-2.9.x/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityPolicy.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityPolicy.java?rev=1324967&r1=1324966&r2=1324967&view=diff
==============================================================================
--- 
camel/branches/camel-2.9.x/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityPolicy.java
 (original)
+++ 
camel/branches/camel-2.9.x/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityPolicy.java
 Wed Apr 11 20:01:35 2012
@@ -31,6 +31,7 @@ import org.apache.camel.spi.Authorizatio
 import org.apache.camel.spi.RouteContext;
 import org.apache.camel.util.AsyncProcessorConverterHelper;
 import org.apache.camel.util.AsyncProcessorHelper;
+import org.apache.camel.util.ExchangeHelper;
 import org.apache.camel.util.IOHelper;
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.authc.AuthenticationException;
@@ -161,7 +162,7 @@ public class ShiroSecurityPolicy impleme
             }
             
             private void applySecurityPolicy(Exchange exchange) throws 
Exception {
-                ByteSource encryptedToken = 
(ByteSource)exchange.getIn().getHeader("SHIRO_SECURITY_TOKEN");
+                ByteSource encryptedToken = 
ExchangeHelper.getMandatoryHeader(exchange, "SHIRO_SECURITY_TOKEN", 
ByteSource.class);
                 ByteSource decryptedToken = 
getCipherService().decrypt(encryptedToken.getBytes(), getPassPhrase());
                 
                 ByteArrayInputStream byteArrayInputStream = new 
ByteArrayInputStream(decryptedToken.getBytes());


Reply via email to