activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject [1/2] git commit: Fixe bug were exception was being thrown on start up if a optional command could not load (for example if the jasypt lib was removed).
Date Thu, 27 Mar 2014 17:10:50 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk da07a1176 -> 5da7ab3c0


Fixe bug were exception was being thrown on start up if a optional command could not load
(for example if the jasypt lib was removed).

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

Branch: refs/heads/trunk
Commit: bc470202dac2d9efe35170ce70a7a810de76f1fb
Parents: da07a11
Author: Hiram Chirino <hiram@hiramchirino.com>
Authored: Thu Mar 27 13:09:42 2014 -0400
Committer: Hiram Chirino <hiram@hiramchirino.com>
Committed: Thu Mar 27 13:09:42 2014 -0400

----------------------------------------------------------------------
 .../org/apache/activemq/jaas/PropertiesLoginModule.java   | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/bc470202/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java
----------------------------------------------------------------------
diff --git a/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java
b/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java
index cc0d847..2961520 100644
--- a/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java
+++ b/activemq-jaas/src/main/java/org/apache/activemq/jaas/PropertiesLoginModule.java
@@ -54,6 +54,7 @@ public class PropertiesLoginModule implements LoginModule {
     private final Set<Principal> principals = new HashSet<Principal>();
     private File baseDir;
     private boolean loginSucceeded;
+    private boolean decrypt = true;
 
     @Override
     public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState,
Map options) {
@@ -79,6 +80,15 @@ public class PropertiesLoginModule implements LoginModule {
                 LOG.debug("Reloading users from " + uf.getAbsolutePath());
             }
             users = new PrincipalProperties("user", uf, LOG);
+            if( decrypt ) {
+                try {
+                    EncryptionSupport.decrypt(users.getPrincipals());
+                } catch(NoClassDefFoundError e) {
+                    // this Happens whe jasypt is not on the classpath..
+                    decrypt = false;
+                    LOG.info("jasypt is not on the classpath: password decryption disabled.");
+                }
+            }
         }
 
         String groupsFile = (String) options.get(GROUP_FILE) + "";


Mime
View raw message