geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject incubator-geode git commit: Add debug logging
Date Tue, 15 Mar 2016 23:30:44 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-949-2 cd31f43f9 -> d72bab4c5


Add debug logging


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

Branch: refs/heads/feature/GEODE-949-2
Commit: d72bab4c5b1a6f0231067c2f1fee262ab1ac2389
Parents: cd31f43
Author: Kirk Lund <klund@apache.org>
Authored: Tue Mar 15 16:30:33 2016 -0700
Committer: Kirk Lund <klund@apache.org>
Committed: Tue Mar 15 16:30:33 2016 -0700

----------------------------------------------------------------------
 .../gemfire/security/generator/CredentialGenerator.java     | 5 +++++
 .../security/generator/LdapUserCredentialGenerator.java     | 9 +++++++++
 .../gemfire/security/templates/LdapUserAuthenticator.java   | 2 ++
 3 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d72bab4c/geode-core/src/test/java/com/gemstone/gemfire/security/generator/CredentialGenerator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/generator/CredentialGenerator.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/generator/CredentialGenerator.java
index b15599f..aee7ebb 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/generator/CredentialGenerator.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/generator/CredentialGenerator.java
@@ -24,11 +24,13 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
+import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.security.AuthInitialize;
 import com.gemstone.gemfire.security.Authenticator;
 import com.gemstone.gemfire.security.templates.DummyAuthenticator;
 import com.gemstone.gemfire.security.templates.LdapUserAuthenticator;
 import com.gemstone.gemfire.security.templates.PKCSAuthenticator;
+import org.apache.logging.log4j.Logger;
 
 /**
  * Encapsulates obtaining valid and invalid credentials. Implementations will be
@@ -38,6 +40,8 @@ import com.gemstone.gemfire.security.templates.PKCSAuthenticator;
  */
 public abstract class CredentialGenerator {
 
+  private static final Logger logger = LogService.getLogger();
+
   /**
    * A set of properties that should be added to the Gemfire system properties
    * before using the authentication module.
@@ -86,6 +90,7 @@ public abstract class CredentialGenerator {
    */
   public void init() throws IllegalArgumentException {
     this.systemProperties = initialize();
+    logger.info("Generating CredentialGenerator with {}", this.systemProperties);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d72bab4c/geode-core/src/test/java/com/gemstone/gemfire/security/generator/LdapUserCredentialGenerator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/generator/LdapUserCredentialGenerator.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/generator/LdapUserCredentialGenerator.java
index cd2fbe2..bbd9528 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/generator/LdapUserCredentialGenerator.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/generator/LdapUserCredentialGenerator.java
@@ -18,9 +18,12 @@ package com.gemstone.gemfire.security.generator;
 
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.cache.tier.sockets.HandShake;
+import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.test.dunit.Assert;
 import com.gemstone.gemfire.util.test.TestUtil;
 import com.gemstone.gemfire.security.templates.LdapUserAuthenticator;
 import com.gemstone.gemfire.security.templates.UserPasswordAuthInit;
+import org.apache.logging.log4j.Logger;
 
 import java.security.Principal;
 import java.util.Properties;
@@ -28,6 +31,8 @@ import java.util.Random;
 
 public class LdapUserCredentialGenerator extends CredentialGenerator {
 
+  private static final Logger logger = LogService.getLogger();
+
   private static final String USER_PREFIX = "gemfire";
   private static final Random RANDOM = new Random();
   private static final String[] CIPHERS = new String[] { "", "DESede", "AES:128", "Blowfish:128"
};
@@ -65,6 +70,10 @@ public class LdapUserCredentialGenerator extends CredentialGenerator {
       extraProps.setProperty(HandShake.PRIVATE_KEY_PASSWD_PROP, "gemfire");
     }
 
+    Assert.assertNotNull(extraProps.getProperty(LdapUserAuthenticator.LDAP_BASEDN_NAME));
+
+    logger.info("Generating LdapUserCredentialGenerator with {}", extraProps);
+
     return extraProps;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d72bab4c/geode-core/src/test/java/com/gemstone/gemfire/security/templates/LdapUserAuthenticator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/templates/LdapUserAuthenticator.java
b/geode-core/src/test/java/com/gemstone/gemfire/security/templates/LdapUserAuthenticator.java
index 9c888b2..5c89da9 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/templates/LdapUserAuthenticator.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/templates/LdapUserAuthenticator.java
@@ -51,6 +51,8 @@ public class LdapUserAuthenticator implements Authenticator {
   }
 
   public void init(final Properties securityProps, final LogWriter systemLogWriter, final
LogWriter securityLogWriter) throws AuthenticationFailedException {
+    logger.info("Initializing LdapUserAuthenticator with {}", securityProps);
+
     this.ldapServer = securityProps.getProperty(LDAP_SERVER_NAME);
     if (this.ldapServer == null || this.ldapServer.length() == 0) {
       throw new AuthenticationFailedException("LdapUserAuthenticator: LDAP server property
[" + LDAP_SERVER_NAME + "] not specified");


Mime
View raw message