You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2013/12/20 18:47:46 UTC
[1/2] git commit: CAMEL-7079: Favor storing the encrypted shiro token
instead of unecrypted. Thanks to Colm for the patch.
Updated Branches:
refs/heads/camel-2.12.x 0e3ed7f3d -> 2f3a336e4
refs/heads/master 8ad63b860 -> 6d8af2f2b
CAMEL-7079: Favor storing the encrypted shiro token instead of unecrypted. Thanks to Colm 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/6d8af2f2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6d8af2f2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6d8af2f2
Branch: refs/heads/master
Commit: 6d8af2f2b79ae84ed8353b4b91cfb6d74740a79f
Parents: 8ad63b8
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Dec 20 18:50:05 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Dec 20 18:50:05 2013 +0100
----------------------------------------------------------------------
.../camel/component/shiro/security/ShiroSecurityProcessor.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/6d8af2f2/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityProcessor.java b/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityProcessor.java
index 99226ee..e942912 100644
--- a/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityProcessor.java
+++ b/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityProcessor.java
@@ -97,6 +97,9 @@ public class ShiroSecurityProcessor extends DelegateAsyncProcessor {
if (token instanceof ShiroSecurityToken) {
ShiroSecurityToken sst = (ShiroSecurityToken) token;
encryptedToken = ShiroSecurityHelper.encrypt(sst, policy.getPassPhrase(), policy.getCipherService());
+ // Remove unencrypted token + replace with an encrypted token
+ exchange.getIn().removeHeader(ShiroSecurityConstants.SHIRO_SECURITY_TOKEN);
+ exchange.getIn().setHeader(ShiroSecurityConstants.SHIRO_SECURITY_TOKEN, encryptedToken);
} else if (token instanceof String) {
String data = (String) token;
if (policy.isBase64()) {
[2/2] git commit: CAMEL-7079: Favor storing the encrypted shiro token
instead of unecrypted. Thanks to Colm for the patch.
Posted by da...@apache.org.
CAMEL-7079: Favor storing the encrypted shiro token instead of unecrypted. Thanks to Colm 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/2f3a336e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2f3a336e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2f3a336e
Branch: refs/heads/camel-2.12.x
Commit: 2f3a336e42b2105db3d60c48780b0fba4793de3d
Parents: 0e3ed7f
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Dec 20 18:50:05 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Dec 20 18:50:21 2013 +0100
----------------------------------------------------------------------
.../camel/component/shiro/security/ShiroSecurityProcessor.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/2f3a336e/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityProcessor.java
----------------------------------------------------------------------
diff --git a/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityProcessor.java b/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityProcessor.java
index 99226ee..e942912 100644
--- a/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityProcessor.java
+++ b/components/camel-shiro/src/main/java/org/apache/camel/component/shiro/security/ShiroSecurityProcessor.java
@@ -97,6 +97,9 @@ public class ShiroSecurityProcessor extends DelegateAsyncProcessor {
if (token instanceof ShiroSecurityToken) {
ShiroSecurityToken sst = (ShiroSecurityToken) token;
encryptedToken = ShiroSecurityHelper.encrypt(sst, policy.getPassPhrase(), policy.getCipherService());
+ // Remove unencrypted token + replace with an encrypted token
+ exchange.getIn().removeHeader(ShiroSecurityConstants.SHIRO_SECURITY_TOKEN);
+ exchange.getIn().setHeader(ShiroSecurityConstants.SHIRO_SECURITY_TOKEN, encryptedToken);
} else if (token instanceof String) {
String data = (String) token;
if (policy.isBase64()) {