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: More Kerby PMD work
Date Tue, 28 Apr 2015 09:51:11 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 2825f1e0d -> aebcc0b0c


More Kerby PMD work


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

Branch: refs/heads/master
Commit: aebcc0b0c3dab015e6bf18a0bf8ef225b15d6d91
Parents: 2825f1e
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Apr 28 10:51:00 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Apr 28 10:51:00 2015 +0100

----------------------------------------------------------------------
 .../kerby/kerberos/kdc/impl/NettyKdcServerImpl.java   |  2 +-
 .../kerby/kerberos/kerb/server/TestKdcServer.java     |  3 +--
 .../kerby/kerberos/kerb/server/BackendConfig.java     |  4 ----
 .../kerby/kerberos/kerb/server/InternalKdcServer.java | 12 +++++-------
 .../kerby/kerberos/kerb/server/KdcConfigKey.java      |  2 +-
 .../kerb/server/impl/DefaultInternalKdcServer.java    |  2 +-
 .../server/impl/DefaultInternalKdcServerImpl.java     |  2 +-
 .../kerberos/kerb/server/impl/DefaultKdcHandler.java  |  2 +-
 .../kerb/server/impl/event/EventBasedKdcServer.java   |  2 +-
 .../kerb/server/impl/event/EventKdcHandler.java       |  2 +-
 .../kerberos/kerb/server/preauth/KdcFastContext.java  |  6 ++----
 .../kerberos/kerb/server/preauth/KdcPreauth.java      | 14 +++++++-------
 .../kerberos/kerb/server/preauth/PreauthHandler.java  |  7 +++----
 .../kerberos/kerb/server/request/KdcRequest.java      |  1 -
 14 files changed, 25 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/aebcc0b0/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java
----------------------------------------------------------------------
diff --git a/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java
b/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java
index 276af8f..6ff72fa 100644
--- a/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java
+++ b/kerby-kdc/src/main/java/org/apache/kerby/kerberos/kdc/impl/NettyKdcServerImpl.java
@@ -62,7 +62,7 @@ public class NettyKdcServerImpl extends AbstractInternalKdcServer {
         kdcContext = new KdcContext(getSetting());
         kdcContext.setIdentityService(getBackend());
         PreauthHandler preauthHandler = new PreauthHandler();
-        preauthHandler.init(kdcContext.getConfig());
+        preauthHandler.init();
         kdcContext.setPreauthHandler(preauthHandler);
     }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/aebcc0b0/kerby-kerb/kerb-kdc-test/src/main/java/org/apache/kerby/kerberos/kerb/server/TestKdcServer.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-kdc-test/src/main/java/org/apache/kerby/kerberos/kerb/server/TestKdcServer.java
b/kerby-kerb/kerb-kdc-test/src/main/java/org/apache/kerby/kerberos/kerb/server/TestKdcServer.java
index d00602d..03e8ea8 100644
--- a/kerby-kerb/kerb-kdc-test/src/main/java/org/apache/kerby/kerberos/kerb/server/TestKdcServer.java
+++ b/kerby-kerb/kerb-kdc-test/src/main/java/org/apache/kerby/kerberos/kerb/server/TestKdcServer.java
@@ -23,7 +23,6 @@ import org.apache.kerby.kerberos.kerb.KrbException;
 import org.apache.kerby.kerberos.kerb.common.EncryptionUtil;
 import org.apache.kerby.kerberos.kerb.common.KrbUtil;
 import org.apache.kerby.kerberos.kerb.identity.KrbIdentity;
-import org.apache.kerby.kerberos.kerb.identity.backend.IdentityBackend;
 import org.apache.kerby.kerberos.kerb.keytab.Keytab;
 import org.apache.kerby.kerberos.kerb.keytab.KeytabEntry;
 import org.apache.kerby.kerberos.kerb.spec.KerberosTime;
@@ -128,4 +127,4 @@ public class TestKdcServer extends KdcServer {
 
         keytab.store(keytabFile);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/aebcc0b0/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/BackendConfig.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/BackendConfig.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/BackendConfig.java
index acbee82..48708d9 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/BackendConfig.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/BackendConfig.java
@@ -20,10 +20,6 @@
 package org.apache.kerby.kerberos.kerb.server;
 
 import org.apache.kerby.config.Conf;
-import org.apache.kerby.kerberos.kerb.common.KrbConfHelper;
-import org.apache.kerby.kerberos.kerb.spec.base.EncryptionType;
-
-import java.util.List;
 
 /**
  * Kerb KDC side backend configuration API.

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/aebcc0b0/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/InternalKdcServer.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/InternalKdcServer.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/InternalKdcServer.java
index dae169e..56b9189 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/InternalKdcServer.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/InternalKdcServer.java
@@ -21,8 +21,6 @@ package org.apache.kerby.kerberos.kerb.server;
 
 import org.apache.kerby.KOptions;
 import org.apache.kerby.kerberos.kerb.identity.IdentityService;
-import org.apache.kerby.kerberos.kerb.server.KdcContext;
-import org.apache.kerby.kerberos.kerb.server.KdcSetting;
 
 /**
  * An internal KDC server interface.
@@ -33,27 +31,27 @@ public interface InternalKdcServer {
      * Initialize with KDC startup options.
      * @param options
      */
-    public void init(KOptions options);
+    void init(KOptions options);
 
     /**
      * Start the KDC server.
      */
-    public void start();
+    void start();
 
     /**
      * Stop the KDC server.
      */
-    public void stop();
+    void stop();
 
     /**
      * Get KDC setting.
      * @return setting
      */
-    public KdcSetting getSetting();
+    KdcSetting getSetting();
 
     /**
      * Get identity service.
      * @return IdentityService
      */
-    public IdentityService getIdentityService();
+    IdentityService getIdentityService();
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/aebcc0b0/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcConfigKey.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcConfigKey.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcConfigKey.java
index bab2425..1c05cd4 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcConfigKey.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcConfigKey.java
@@ -25,7 +25,7 @@ public enum KdcConfigKey implements SectionConfigKey {
     KRB_DEBUG(true),
     KDC_SERVICE_NAME("KDC-Server"),
     KDC_IDENTITY_BACKEND,
-    KDC_HOST("127.0.0.1", "kdcdefaults"),
+    KDC_HOST("127.0.0.1", "kdcdefaults"),       // NOPMD
     KDC_PORT(8015, "kdcdefaults"),
     KDC_ALLOW_UDP(true, "kdcdefaults"),
     KDC_UDP_PORT(8016, "kdcdefaults"),

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/aebcc0b0/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServer.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServer.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServer.java
index a4561c3..649a70e 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServer.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServer.java
@@ -69,7 +69,7 @@ public class DefaultInternalKdcServer extends AbstractInternalKdcServer
{
         kdcContext = new KdcContext(getSetting());
         kdcContext.setIdentityService(getBackend());
         PreauthHandler preauthHandler = new PreauthHandler();
-        preauthHandler.init(kdcContext.getConfig());
+        preauthHandler.init();
         kdcContext.setPreauthHandler(preauthHandler);
     }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/aebcc0b0/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServerImpl.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServerImpl.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServerImpl.java
index 491d55a..5197c71 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServerImpl.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultInternalKdcServerImpl.java
@@ -69,7 +69,7 @@ public class DefaultInternalKdcServerImpl extends AbstractInternalKdcServer
{
         kdcContext = new KdcContext(getSetting());
         kdcContext.setIdentityService(getBackend());
         PreauthHandler preauthHandler = new PreauthHandler();
-        preauthHandler.init(kdcContext.getConfig());
+        preauthHandler.init();
         kdcContext.setPreauthHandler(preauthHandler);
     }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/aebcc0b0/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultKdcHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultKdcHandler.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultKdcHandler.java
index 3ff9a10..42b9134 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultKdcHandler.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/DefaultKdcHandler.java
@@ -61,7 +61,7 @@ public class DefaultKdcHandler extends KdcHandler implements Runnable {
 
     protected void handleMessage(ByteBuffer message) {
         InetAddress clientAddress = transport.getRemoteAddress();
-        boolean isTcp = (transport instanceof KrbTcpTransport);
+        boolean isTcp = transport instanceof KrbTcpTransport;
 
         try {
             ByteBuffer krbResponse = handleMessage(message, isTcp, clientAddress);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/aebcc0b0/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/event/EventBasedKdcServer.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/event/EventBasedKdcServer.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/event/EventBasedKdcServer.java
index a39a34b..ec076cf 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/event/EventBasedKdcServer.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/event/EventBasedKdcServer.java
@@ -61,7 +61,7 @@ public class EventBasedKdcServer extends AbstractInternalKdcServer {
         KdcContext kdcContext = new KdcContext(getSetting());
         kdcContext.setIdentityService(getBackend());
         PreauthHandler preauthHandler = new PreauthHandler();
-        preauthHandler.init(kdcContext.getConfig());
+        preauthHandler.init();
         kdcContext.setPreauthHandler(preauthHandler);
 
         this.kdcHandler = new EventKdcHandler(kdcContext);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/aebcc0b0/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/event/EventKdcHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/event/EventKdcHandler.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/event/EventKdcHandler.java
index cccdb27..5c6ab7b 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/event/EventKdcHandler.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/impl/event/EventKdcHandler.java
@@ -46,7 +46,7 @@ public class EventKdcHandler extends MessageHandler {
         Transport transport = event.getTransport();
 
         InetSocketAddress clientAddress = transport.getRemoteAddress();
-        boolean isTcp = (transport instanceof TcpTransport);
+        boolean isTcp = transport instanceof TcpTransport;
 
         try {
             ByteBuffer krbResponse = myKdcHandler.handleMessage(message, isTcp,

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/aebcc0b0/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/KdcFastContext.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/KdcFastContext.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/KdcFastContext.java
index 359f9bd..2fd15e0 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/KdcFastContext.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/KdcFastContext.java
@@ -21,8 +21,6 @@ package org.apache.kerby.kerberos.kerb.server.preauth;
 
 import org.apache.kerby.kerberos.kerb.spec.base.EncryptionKey;
 import org.apache.kerby.kerberos.kerb.spec.fast.FastOptions;
-import org.apache.kerby.kerberos.kerb.spec.fast.KrbFastArmor;
-import org.apache.kerby.kerberos.kerb.spec.fast.KrbFastResponse;
 import org.apache.kerby.kerberos.kerb.spec.kdc.KdcReq;
 
 /**
@@ -66,13 +64,13 @@ public class KdcFastContext {
         this.fastFlags = fastFlags;
     }
 
-    private void armorApRequest(KrbFastArmor armor) {
+    /*private void armorApRequest(KrbFastArmor armor) {
 
     }
 
     private byte[] encryptFastReply(KrbFastResponse fastResp) {
         return null;
-    }
+    }*/
 
     public byte[] findAndProcessFast(KdcReq kdcReq, byte[] checksumData,
                                    EncryptionKey tgsSubKey,

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/aebcc0b0/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/KdcPreauth.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/KdcPreauth.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/KdcPreauth.java
index ee0b247..2bd3516 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/KdcPreauth.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/KdcPreauth.java
@@ -37,18 +37,18 @@ public interface KdcPreauth extends PreauthPluginMeta {
     /**
      * Initializing plugin context for each realm
      */
-    public void initWith(KdcContext context);
+    void initWith(KdcContext context);
 
     /**
      * Initializing request context
      */
-    public PluginRequestContext initRequestContext(KdcRequest kdcRequest);
+    PluginRequestContext initRequestContext(KdcRequest kdcRequest);
 
     /**
      * Optional: provide pa_data to send to the client as part of the "you need to
      * use preauthentication" error.
      */
-    public void provideEdata(KdcRequest kdcRequest, PluginRequestContext requestContext,
+    void provideEdata(KdcRequest kdcRequest, PluginRequestContext requestContext,
                              PaData outPaData) throws KrbException;
 
     /**
@@ -56,26 +56,26 @@ public interface KdcPreauth extends PreauthPluginMeta {
      * TKT_FLG_PRE_AUTH or TKT_FLG_HW_AUTH flag in the enc_tkt_reply's "flags"
      * field as appropriate.
      */
-    public boolean verify(KdcRequest kdcRequest, PluginRequestContext requestContext,
+    boolean verify(KdcRequest kdcRequest, PluginRequestContext requestContext,
                           PaDataEntry paData) throws KrbException;
 
     /**
      * Optional: generate preauthentication response data to send to the client as
      * part of the AS-REP.
      */
-    public void providePaData(KdcRequest kdcRequest, PluginRequestContext requestContext,
+    void providePaData(KdcRequest kdcRequest, PluginRequestContext requestContext,
                               PaData paData);
 
     /**
      * Return PA_REAL if pa_type is a real preauthentication type or PA_INFO if it is
      * an informational type.
      */
-    public PaFlags getFlags(KdcRequest kdcRequest, PluginRequestContext requestContext,
+    PaFlags getFlags(KdcRequest kdcRequest, PluginRequestContext requestContext,
                             PaDataType paType);
 
     /**
      * When exiting...
      */
-    public void destroy();
+    void destroy();
 
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/aebcc0b0/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthHandler.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthHandler.java
index 262e152..1d17105 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthHandler.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/PreauthHandler.java
@@ -19,7 +19,6 @@
  */
 package org.apache.kerby.kerberos.kerb.server.preauth;
 
-import org.apache.kerby.kerberos.kerb.server.KdcConfig;
 import org.apache.kerby.kerberos.kerb.server.KdcContext;
 import org.apache.kerby.kerberos.kerb.server.preauth.builtin.EncTsPreauth;
 import org.apache.kerby.kerberos.kerb.server.preauth.builtin.TgtPreauth;
@@ -39,11 +38,11 @@ public class PreauthHandler {
     /**
      * Should be called only once, for global
      */
-    public void init(KdcConfig kdcConfig) {
-        loadPreauthPlugins(kdcConfig);
+    public void init() {
+        loadPreauthPlugins();
     }
 
-    private void loadPreauthPlugins(KdcConfig kdcConfig) {
+    private void loadPreauthPlugins() {
         preauths = new ArrayList<KdcPreauth>();
 
         KdcPreauth preauth = new EncTsPreauth();

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/aebcc0b0/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/KdcRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/KdcRequest.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/KdcRequest.java
index 9e0954b..bd9a43d 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/KdcRequest.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/KdcRequest.java
@@ -292,7 +292,6 @@ public abstract class KdcRequest {
     }
 
     protected KrbError makePreAuthenticationError(KdcContext kdcContext) throws KrbException
{
-        EncryptionType requestedType = getEncryptionType();
         List<EncryptionType> encryptionTypes = kdcContext.getConfig().getEncryptionTypes();
         boolean isNewEtype = true;
 


Mime
View raw message