directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject directory-kerby git commit: Remove logging output from console during build
Date Tue, 01 Dec 2015 11:14:58 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 54c10a31e -> 0138b2a75


Remove logging output from console during build


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/0138b2a7
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/0138b2a7
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/0138b2a7

Branch: refs/heads/master
Commit: 0138b2a75c489437d8a8e4e61f0c62f358ae13b7
Parents: 54c10a3
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Dec 1 11:14:46 2015 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Dec 1 11:14:46 2015 +0000

----------------------------------------------------------------------
 .../src/test/resources/log4j.properties         | 30 ++++++++++++++++++++
 kerby-kerb/integration-test/run/login.conf      |  2 +-
 .../kerb/integration/test/AppClient.java        |  2 +-
 .../kerb/integration/test/AppServer.java        |  4 +--
 .../kerb/integration/test/gss/GssAppClient.java | 16 +++++------
 .../kerb/integration/test/gss/GssAppServer.java | 30 +++++++++-----------
 .../integration/test/sasl/SaslAppClient.java    |  4 +--
 .../integration/test/sasl/SaslAppServer.java    | 18 ++++++------
 .../integration/test/TokenLoginTestBase.java    |  2 +-
 .../src/test/resources/log4j.properties         | 30 ++++++++++++++++++++
 .../kerby/kerberos/kerb/client/JaasKrbUtil.java |  2 +-
 pom.xml                                         |  1 +
 12 files changed, 100 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/0138b2a7/kerby-kdc-test/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/kerby-kdc-test/src/test/resources/log4j.properties b/kerby-kdc-test/src/test/resources/log4j.properties
new file mode 100644
index 0000000..a42f39a
--- /dev/null
+++ b/kerby-kdc-test/src/test/resources/log4j.properties
@@ -0,0 +1,30 @@
+#############################################################################
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file to You under the Apache License, Version 2.0
+#    (the "License"); you may not use this file except in compliance with
+#    the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#############################################################################
+log4j.rootLogger=ERROR, LOGFILE
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n
+
+# LOGFILE is set to be a File appender using a PatternLayout.
+log4j.appender.LOGFILE=org.apache.log4j.FileAppender
+log4j.appender.LOGFILE.File=target/kerby.log
+log4j.appender.LOGFILE.Append=false
+log4j.appender.LOGFILE.Threshold=DEBUG
+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/0138b2a7/kerby-kerb/integration-test/run/login.conf
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/run/login.conf b/kerby-kerb/integration-test/run/login.conf
index 0e2facb..8932d38 100644
--- a/kerby-kerb/integration-test/run/login.conf
+++ b/kerby-kerb/integration-test/run/login.conf
@@ -24,7 +24,7 @@
 
 com.sun.security.jgss.initiate {
   kerb.token.login.Krb5TokenAuthnLoginModule required 
-  debug=true
+  debug=false
   principal="drankye@SH.INTEL.COM"
   useTicketCache=true
   doNotPrompt=false;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/0138b2a7/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/AppClient.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/AppClient.java
b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/AppClient.java
index 264fab6..c0a636a 100644
--- a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/AppClient.java
+++ b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/AppClient.java
@@ -43,7 +43,7 @@ public abstract class AppClient {
     }
 
     public void run() {
-        System.out.println("Connected to server");
+        // System.out.println("Connected to server");
 
         try {
             withConnection(conn);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/0138b2a7/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/AppServer.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/AppServer.java
b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/AppServer.java
index 337507c..77abc65 100644
--- a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/AppServer.java
+++ b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/AppServer.java
@@ -65,10 +65,10 @@ public abstract class AppServer implements Runnable {
     }
 
     private void runOnce() {
-        System.out.println("Waiting for incoming connection...");
+        // System.out.println("Waiting for incoming connection...");
 
         Transport.Connection conn = acceptor.accept();
-        System.out.println("Got connection from client");
+        // System.out.println("Got connection from client");
 
         try {
             onConnection(conn);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/0138b2a7/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/gss/GssAppClient.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/gss/GssAppClient.java
b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/gss/GssAppClient.java
index 278f294..32fdf5c 100644
--- a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/gss/GssAppClient.java
+++ b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/gss/GssAppClient.java
@@ -86,18 +86,18 @@ public class GssAppClient extends AppClient {
             }
         }
 
-        System.out.println("Context Established! ");
-        System.out.println("Client is " + context.getSrcName());
-        System.out.println("Server is " + context.getTargName());
+        //System.out.println("Context Established! ");
+        //System.out.println("Client is " + context.getSrcName());
+        //System.out.println("Server is " + context.getTargName());
 
-        if (context.getMutualAuthState()) {
-            System.out.println("Mutual authentication took place!");
-        }
+        //if (context.getMutualAuthState()) {
+            //System.out.println("Mutual authentication took place!");
+        //}
 
         byte[] messageBytes = "Hello There!\0".getBytes(StandardCharsets.UTF_8);
         MessageProp prop =  new MessageProp(0, true);
         token = context.wrap(messageBytes, 0, messageBytes.length, prop);
-        System.out.println("Will send wrap token of size " + token.length);
+        //System.out.println("Will send wrap token of size " + token.length);
         conn.sendToken(token);
 
         token = conn.recvToken();
@@ -105,7 +105,7 @@ public class GssAppClient extends AppClient {
                 messageBytes, 0, messageBytes.length, prop);
         setTestOK(true);
 
-        System.out.println("Verified received MIC for message.");
+        //System.out.println("Verified received MIC for message.");
         context.dispose();
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/0138b2a7/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/gss/GssAppServer.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/gss/GssAppServer.java
b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/gss/GssAppServer.java
index 84ffff2..3e5d3cf 100644
--- a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/gss/GssAppServer.java
+++ b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/gss/GssAppServer.java
@@ -29,8 +29,6 @@ import org.ietf.jgss.GSSName;
 import org.ietf.jgss.MessageProp;
 import org.ietf.jgss.Oid;
 
-import java.nio.charset.StandardCharsets;
-
 public class GssAppServer extends AppServer {
     private String serverPrincipal;
     private GSSManager manager;
@@ -67,7 +65,7 @@ public class GssAppServer extends AppServer {
     protected void onConnection(Transport.Connection conn) throws Exception {
         byte[] token;
 
-        System.out.print("Starting negotiating security context");
+        // System.out.print("Starting negotiating security context");
         while (!context.isEstablished()) {
             token = conn.recvToken();
             token = context.acceptSecContext(token, 0, token.length);
@@ -76,9 +74,9 @@ public class GssAppServer extends AppServer {
             }
         }
 
-        System.out.print("Context Established! ");
-        System.out.println("Client is " + context.getSrcName());
-        System.out.println("Server is " + context.getTargName());
+        // System.out.print("Context Established! ");
+        // System.out.println("Client is " + context.getSrcName());
+        // System.out.println("Server is " + context.getTargName());
 
         doWith(context, conn);
 
@@ -87,24 +85,24 @@ public class GssAppServer extends AppServer {
 
     protected void doWith(GSSContext context,
                           Transport.Connection conn) throws Exception {
-        if (context.getMutualAuthState()) {
-            System.out.println("Mutual authentication took place!");
-        }
+        //if (context.getMutualAuthState()) {
+            // System.out.println("Mutual authentication took place!");
+        //}
 
         MessageProp prop = new MessageProp(0, false);
         byte[] token = conn.recvToken();
         byte[] bytes = context.unwrap(token, 0, token.length, prop);
-        String str = new String(bytes, StandardCharsets.UTF_8);
-        System.out.println("Received data \""
-                + str + "\" of length " + str.length());
+        //String str = new String(bytes, StandardCharsets.UTF_8);
+        // System.out.println("Received data \""
+        //        + str + "\" of length " + str.length());
 
-        System.out.println("Confidentiality applied: "
-                + prop.getPrivacy());
+        //System.out.println("Confidentiality applied: "
+        //       + prop.getPrivacy());
 
         prop.setQOP(0);
         token = context.getMIC(bytes, 0, bytes.length, prop);
-        System.out.println("Will send MIC token of size "
-                + token.length);
+        //System.out.println("Will send MIC token of size "
+                //+ token.length);
         conn.sendToken(token);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/0138b2a7/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/sasl/SaslAppClient.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/sasl/SaslAppClient.java
b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/sasl/SaslAppClient.java
index 2509df9..b928e01 100644
--- a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/sasl/SaslAppClient.java
+++ b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/sasl/SaslAppClient.java
@@ -79,10 +79,10 @@ public class SaslAppClient extends AppClient {
             }
         }
 
-        System.out.println("Context Established! ");
+        //System.out.println("Context Established! ");
 
         token = "Hello There!\0".getBytes(StandardCharsets.UTF_8);
-        System.out.println("Will send wrap token of size " + token.length);
+        //System.out.println("Will send wrap token of size " + token.length);
 
         conn.sendToken(token);
         setTestOK(true);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/0138b2a7/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/sasl/SaslAppServer.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/sasl/SaslAppServer.java
b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/sasl/SaslAppServer.java
index f769d5e..a681dae 100644
--- a/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/sasl/SaslAppServer.java
+++ b/kerby-kerb/integration-test/src/main/java/org/apache/kerby/kerberos/kerb/integration/test/sasl/SaslAppServer.java
@@ -30,7 +30,6 @@ import javax.security.sasl.Sasl;
 import javax.security.sasl.SaslException;
 import javax.security.sasl.SaslServer;
 import java.io.IOException;
-import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -63,7 +62,7 @@ public class SaslAppServer extends AppServer {
 
     @Override
     protected void onConnection(Transport.Connection conn) throws Exception {
-        System.out.print("Starting negotiating security context");
+        // System.out.print("Starting negotiating security context");
 
         //mechanism, protocol, serverId, saslProperties, callback
         CallbackHandler callbackHandler = new SaslGssCallbackHandler();
@@ -90,7 +89,7 @@ public class SaslAppServer extends AppServer {
             }
         }
 
-        System.out.print("Context Established! ");
+        // System.out.print("Context Established! ");
 
         doWith(ss, props, conn);
 
@@ -99,10 +98,11 @@ public class SaslAppServer extends AppServer {
 
     protected void doWith(SaslServer ss, Map<String, Object> props,
                           Transport.Connection conn) throws IOException, Exception {
-        byte[] token = conn.recvToken();
-        String str = new String(token, StandardCharsets.UTF_8);
-        System.out.println("Received data \""
-                + str + "\" of length " + str.length());
+        conn.recvToken();
+        //byte[] token = conn.recvToken();
+        //String str = new String(token, StandardCharsets.UTF_8);
+        // System.out.println("Received data \""
+        //        + str + "\" of length " + str.length());
     }
 
     public static class SaslGssCallbackHandler implements CallbackHandler {
@@ -128,8 +128,8 @@ public class SaslAppServer extends AppServer {
                     ac.setAuthorized(false);
                 }
                 if (ac.isAuthorized()) {
-                    System.out.println("SASL server GSSAPI callback: setting "
-                            + "canonicalized client ID: " + authzid);
+                    // System.out.println("SASL server GSSAPI callback: setting "
+                            //+ "canonicalized client ID: " + authzid);
                     ac.setAuthorizedID(authzid);
                 }
             }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/0138b2a7/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestBase.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestBase.java
b/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestBase.java
index 025a9fa..4741372 100644
--- a/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestBase.java
+++ b/kerby-kerb/integration-test/src/test/java/org/apache/kerby/kerberos/kerb/integration/test/TokenLoginTestBase.java
@@ -86,7 +86,7 @@ public class TokenLoginTestBase extends LoginTestBase {
         AuthToken token = issueToken(getClientPrincipal());
         String tokenStr = tokenEncoder.encodeAsString(token);
         TokenCache.writeToken(tokenStr);
-        System.out.println("Issued token: " + tokenStr);
+        // System.out.println("Issued token: " + tokenStr);
         tokenCache = TokenCache.getDefaultTokenCache();
 
         TgtTicket tgt = getKrbClient().requestTgt(getClientPrincipal(),

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/0138b2a7/kerby-kerb/integration-test/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/kerby-kerb/integration-test/src/test/resources/log4j.properties b/kerby-kerb/integration-test/src/test/resources/log4j.properties
new file mode 100644
index 0000000..a42f39a
--- /dev/null
+++ b/kerby-kerb/integration-test/src/test/resources/log4j.properties
@@ -0,0 +1,30 @@
+#############################################################################
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file to You under the Apache License, Version 2.0
+#    (the "License"); you may not use this file except in compliance with
+#    the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#############################################################################
+log4j.rootLogger=ERROR, LOGFILE
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n
+
+# LOGFILE is set to be a File appender using a PatternLayout.
+log4j.appender.LOGFILE=org.apache.log4j.FileAppender
+log4j.appender.LOGFILE.File=target/kerby.log
+log4j.appender.LOGFILE.Append=false
+log4j.appender.LOGFILE.Threshold=DEBUG
+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/0138b2a7/kerby-kerb/kerb-simplekdc/src/main/java/org/apache/kerby/kerberos/kerb/client/JaasKrbUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-simplekdc/src/main/java/org/apache/kerby/kerberos/kerb/client/JaasKrbUtil.java
b/kerby-kerb/kerb-simplekdc/src/main/java/org/apache/kerby/kerberos/kerb/client/JaasKrbUtil.java
index c5f10bc..0d6f366 100644
--- a/kerby-kerb/kerb-simplekdc/src/main/java/org/apache/kerby/kerberos/kerb/client/JaasKrbUtil.java
+++ b/kerby-kerb/kerb-simplekdc/src/main/java/org/apache/kerby/kerberos/kerb/client/JaasKrbUtil.java
@@ -42,7 +42,7 @@ import java.util.Set;
  */
 public final class JaasKrbUtil {
 
-    public static final boolean ENABLE_DEBUG = true;
+    public static final boolean ENABLE_DEBUG = false;
 
     private JaasKrbUtil() { }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/0138b2a7/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 90be760..bdbc5df 100644
--- a/pom.xml
+++ b/pom.xml
@@ -177,6 +177,7 @@
             <skipTests>${skipTests}</skipTests>
             <reuseForks>false</reuseForks>
             <systemPropertyVariables>
+              <log4j.configuration>log4j.properties</log4j.configuration>
             </systemPropertyVariables>
             <failIfNoTests>false</failIfNoTests>
           </configuration>


Mime
View raw message