directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yan...@apache.org
Subject [1/2] directory-kerby git commit: add JavaDoc for kerb-server module
Date Tue, 25 Aug 2015 01:07:38 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 61e0f0f50 -> a4825f0d7


add JavaDoc for kerb-server module


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

Branch: refs/heads/master
Commit: 954dd2671790f0f004ecac044cd06fc48185f829
Parents: e0dd503
Author: yaningxu <yaning0123@gmail.com>
Authored: Tue Aug 25 09:06:28 2015 +0800
Committer: yaningxu <yaning0123@gmail.com>
Committed: Tue Aug 25 09:06:28 2015 +0800

----------------------------------------------------------------------
 .../kerby/kerberos/kerb/server/KdcHandler.java  |  12 +-
 .../kerby/kerberos/kerb/server/KdcServer.java   |  10 +-
 .../kerby/kerberos/kerb/server/KdcSetting.java  |  37 +++++-
 .../kerby/kerberos/kerb/server/KdcUtil.java     |  20 +++-
 .../kerb/server/preauth/KdcPreauth.java         |  15 +++
 .../kerberos/kerb/server/request/AsRequest.java |   1 +
 .../kerb/server/request/KdcRequest.java         | 113 ++++++++++++++++++-
 .../kerb/server/request/TgsRequest.java         |  11 ++
 8 files changed, 206 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/954dd267/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcHandler.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcHandler.java
index fb56038..eb63a13 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcHandler.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcHandler.java
@@ -50,7 +50,7 @@ public class KdcHandler {
     /**
      * Constructor with kdc context.
      *
-     * @param kdcContext
+     * @param kdcContext kdc context
      */
     public KdcHandler(KdcContext kdcContext) {
         this.kdcContext = kdcContext;
@@ -59,8 +59,9 @@ public class KdcHandler {
     /**
      * Process the client request message.
      *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
      * @param receivedMessage The client request message
-     * @param  isTcp
+     * @param  isTcp whether the protocol is tcp
      * @param remoteAddress Address from remote side
      * @return The response message
      */
@@ -133,7 +134,7 @@ public class KdcHandler {
      * Process the recoverable exception.
      *
      * @param e The exception return by kdc
-     * @param kdcRequest
+     * @param kdcRequest kdc request
      * @return The KrbError
      */
     private KrbMessage handleRecoverableException(KdcRecoverableException e,
@@ -156,6 +157,11 @@ public class KdcHandler {
         return error;
     }
 
+    /**
+     * Get request realm.
+     * @param kdcReq kdc request
+     * @return realm
+     */
     private String getRequestRealm(KdcReq kdcReq) {
         String realm = kdcReq.getReqBody().getRealm();
         if (realm == null && kdcReq.getReqBody().getCname() != null) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/954dd267/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcServer.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcServer.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcServer.java
index 88af20c..3d4f7b9 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcServer.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcServer.java
@@ -162,6 +162,7 @@ public class KdcServer {
 
     /**
      * Allow to hook customized kdc implementation.
+     *
      * @param innerKdcImpl
      */
     public void setInnerKdcImpl(InternalKdcServer innerKdcImpl) {
@@ -186,7 +187,8 @@ public class KdcServer {
 
     /**
      * Get backend config.
-     * @return
+     *
+     * @return backend configuration
      */
     public BackendConfig getBackendConfig() {
         return backendConfig;
@@ -205,6 +207,8 @@ public class KdcServer {
 
     /**
      * Initialize.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e.
      */
     public void init() throws KrbException {
         if (startupOptions.contains(KdcServerOption.INNER_KDC_IMPL)) {
@@ -219,6 +223,8 @@ public class KdcServer {
 
     /**
      * Start the KDC server.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e.
      */
     public void start() throws KrbException {
         if (innerKdc == null) {
@@ -229,6 +235,8 @@ public class KdcServer {
 
     /**
      * Stop the KDC server.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e.
      */
     public void stop() throws KrbException {
         if (innerKdc != null) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/954dd267/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcSetting.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcSetting.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcSetting.java
index 35685c2..85f4da7 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcSetting.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcSetting.java
@@ -31,6 +31,12 @@ public class KdcSetting {
     private final KdcConfig kdcConfig;
     private final BackendConfig backendConfig;
 
+    /**
+     * KdcSetting constructor
+     * @param startupOptions startup options
+     * @param config kdc configuration
+     * @param backendConfig backend configuration
+     */
     public KdcSetting(KOptions startupOptions,
                       KdcConfig config, BackendConfig backendConfig) {
         this.startupOptions = startupOptions;
@@ -44,7 +50,7 @@ public class KdcSetting {
 
     /**
      * Get the KDC config.
-     * @return
+     * @return kdc configuration
      */
     public KdcConfig getKdcConfig() {
         return kdcConfig;
@@ -52,7 +58,7 @@ public class KdcSetting {
 
     /**
      * Get the backend config.
-     * @return
+     * @return backend configuration
      */
     public BackendConfig getBackendConfig() {
         return backendConfig;
@@ -70,7 +76,7 @@ public class KdcSetting {
     /**
      * Check kdc tcp setting and see if any bad.
      * @return valid tcp port or -1 if not allowTcp
-     * @throws org.apache.kerby.kerberos.kerb.KrbException
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
      */
     public int checkGetKdcTcpPort() throws KrbException {
         if (allowTcp()) {
@@ -86,7 +92,7 @@ public class KdcSetting {
     /**
      * Check kdc udp setting and see if any bad.
      * @return valid udp port or -1 if not allowUdp
-     * @throws KrbException
+     * @throws KrbException e
      */
     public int checkGetKdcUdpPort() throws KrbException {
         if (allowUdp()) {
@@ -99,6 +105,11 @@ public class KdcSetting {
         return -1;
     }
 
+    /**
+     * Get kdc tcp port
+     *
+     * @return kdc tcp port
+     */
     public int getKdcTcpPort() {
         int tcpPort = startupOptions.getIntegerOption(KdcServerOption.KDC_TCP_PORT);
         if (tcpPort < 1) {
@@ -111,6 +122,11 @@ public class KdcSetting {
         return tcpPort;
     }
 
+    /**
+     * Get kdc port
+     *
+     * @return kdc port
+     */
     public int getKdcPort() {
         int kdcPort = startupOptions.getIntegerOption(KdcServerOption.KDC_PORT);
         if (kdcPort < 1) {
@@ -119,18 +135,31 @@ public class KdcSetting {
         return kdcPort;
     }
 
+    /**
+     * Get whether tcp protocol is allowed
+     * @return tcp protocol is allowed or not
+     */
     public boolean allowTcp() {
         Boolean allowTcp = startupOptions.getBooleanOption(
                 KdcServerOption.ALLOW_TCP, kdcConfig.allowTcp());
         return allowTcp;
     }
 
+    /**
+     * Get whether udp protocol is allowed
+     * @return udp protocol is allowed or not
+     */
     public boolean allowUdp() {
         Boolean allowUdp = startupOptions.getBooleanOption(
                 KdcServerOption.ALLOW_UDP, kdcConfig.allowUdp());
         return allowUdp;
     }
 
+    /**
+     * Get kdc udp port
+     *
+     * @return udp port
+     */
     public int getKdcUdpPort() {
         int udpPort = startupOptions.getIntegerOption(KdcServerOption.KDC_UDP_PORT);
         if (udpPort < 1) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/954dd267/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcUtil.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcUtil.java
index c923ef6..1b41a08 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcUtil.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/KdcUtil.java
@@ -36,6 +36,12 @@ public final class KdcUtil {
 
     private KdcUtil() { }
 
+    /**
+     * Get kdc configuration
+     * @param confDir configuration directory
+     * @return kdc configuration
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e.
+     */
     public static KdcConfig getKdcConfig(File confDir) throws KrbException {
         File kdcConfFile = new File(confDir, "kdc.conf");
         if (kdcConfFile.exists()) {
@@ -52,6 +58,12 @@ public final class KdcUtil {
         return null;
     }
 
+    /**
+     * Get backend configuration
+     * @param confDir configuration directory
+     * @return backend configuration
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e.
+     */
     public static BackendConfig getBackendConfig(File confDir) throws KrbException {
         File backendConfigFile = new File(confDir, "backend.conf");
         if (backendConfigFile.exists()) {
@@ -70,6 +82,10 @@ public final class KdcUtil {
 
     /**
      * Init the identity backend from backend configuration.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e.
+     * @param backendConfig backend configuration information
+     * @return backend
      */
     public static IdentityBackend getBackend(
             BackendConfig backendConfig) throws KrbException {
@@ -102,9 +118,9 @@ public final class KdcUtil {
 
     /**
      * Get KDC network transport addresses according to KDC setting.
-     * @param setting
+     * @param setting kdc setting
      * @return UDP and TCP addresses pair
-     * @throws KrbException
+     * @throws KrbException e
      */
     public static TransportPair getTransportPair(
             KdcSetting setting) throws KrbException {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/954dd267/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 7c43277..de862b3 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
@@ -36,17 +36,23 @@ public interface KdcPreauth extends PreauthPluginMeta {
 
     /**
      * Initializing plugin context for each realm
+     * @param context kdc context
      */
     void initWith(KdcContext context);
 
     /**
      * Initializing request context
+     * @param kdcRequest kdc context
      */
     PluginRequestContext initRequestContext(KdcRequest kdcRequest);
 
     /**
      * Optional: provide pa_data to send to the client as part of the "you need to
      * use preauthentication" error.
+     *
+     * @param kdcRequest kdc request
+     * @param requestContext request context
+     * @param outPaData out preauthentication data
      */
     void provideEdata(KdcRequest kdcRequest, PluginRequestContext requestContext,
                              PaData outPaData) throws KrbException;
@@ -55,6 +61,9 @@ public interface KdcPreauth extends PreauthPluginMeta {
      * Optional: verify preauthentication data sent by the client, setting the
      * TKT_FLG_PRE_AUTH or TKT_FLG_HW_AUTH flag in the enc_tkt_reply's "flags"
      * field as appropriate.
+     * @param kdcRequest kdc request
+     * @param requestContext request context
+     * @param paData preauthentication data
      */
     boolean verify(KdcRequest kdcRequest, PluginRequestContext requestContext,
                           PaDataEntry paData) throws KrbException;
@@ -62,6 +71,9 @@ public interface KdcPreauth extends PreauthPluginMeta {
     /**
      * Optional: generate preauthentication response data to send to the client as
      * part of the AS-REP.
+     * @param kdcRequest kdc request
+     * @param requestContext request context
+     * @param paData preauthentication data
      */
     void providePaData(KdcRequest kdcRequest, PluginRequestContext requestContext,
                               PaData paData);
@@ -69,6 +81,9 @@ public interface KdcPreauth extends PreauthPluginMeta {
     /**
      * Return PA_REAL if pa_type is a real preauthentication type or PA_INFO if it is
      * an informational type.
+     * @param kdcRequest kdc request
+     * @param requestContext request context
+     * @param paType preauthentication type
      */
     PaFlags getFlags(KdcRequest kdcRequest, PluginRequestContext requestContext,
                             PaDataType paType);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/954dd267/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/AsRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/AsRequest.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/AsRequest.java
index 367c8c2..688fed5 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/AsRequest.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/AsRequest.java
@@ -134,6 +134,7 @@ public class AsRequest extends KdcRequest {
 
     /**
      * Make EncKdcRepPart.
+     * @return encryption kdc request part
      */
     protected EncKdcRepPart makeEncKdcRepPart() {
         KdcReq request = getKdcReq();

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/954dd267/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 059eee0..191fdfa 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
@@ -96,6 +96,8 @@ public abstract class KdcRequest {
 
     /**
      * Get session key.
+     *
+     * @return session key
      */
     public EncryptionKey getSessionKey() {
         return sessionKey;
@@ -108,6 +110,11 @@ public abstract class KdcRequest {
         this.sessionKey = sessionKey;
     }
 
+    /**
+     * kdc request constructor
+     * @param kdcReq kdc request
+     * @param kdcContext kdc context
+     */
     public KdcRequest(KdcReq kdcReq, KdcContext kdcContext) {
         this.kdcReq = kdcReq;
         this.kdcContext = kdcContext;
@@ -119,6 +126,8 @@ public abstract class KdcRequest {
 
     /**
      * Get kdc context.
+     *
+     * @return kdc context
      */
     public KdcContext getKdcContext() {
         return kdcContext;
@@ -126,6 +135,8 @@ public abstract class KdcRequest {
 
     /**
      * Get KdcReq.
+     *
+     * @return kdc request
      */
     public KdcReq getKdcReq() {
         return kdcReq;
@@ -133,6 +144,8 @@ public abstract class KdcRequest {
 
     /**
      * Get preauth context.
+     *
+     * @return preauthentication context.
      */
     public PreauthContext getPreauthContext() {
         return preauthContext;
@@ -140,6 +153,8 @@ public abstract class KdcRequest {
 
     /**
      * Process the kdcrequest from client and issue the ticket.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e.
      */
     public void process() throws KrbException {
         checkVersion();
@@ -162,6 +177,8 @@ public abstract class KdcRequest {
 
     /**
      * Check the tgs entry.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e.
      */
     private void checkTgsEntry() throws KrbException {
         KrbIdentity tgsEntry = getEntry(getTgsPrincipal().getName());
@@ -170,6 +187,8 @@ public abstract class KdcRequest {
 
     /**
      * Find the fast from padata.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
      */
     private void kdcFindFast() throws KrbException {
 
@@ -202,6 +221,9 @@ public abstract class KdcRequest {
 
     /**
      * Get the armor key.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
+     * @param fastArmor krb fast armor
      */
     private void armorApRequest(KrbFastArmor fastArmor) throws KrbException {
         if (fastArmor.getArmorType() == ArmorType.ARMOR_AP_REQUEST) {
@@ -232,6 +254,8 @@ public abstract class KdcRequest {
 
     /**
      * Get tgs entry.
+     *
+     * @return TGS entry
      */
     public KrbIdentity getTgsEntry() {
         return tgsEntry;
@@ -239,6 +263,8 @@ public abstract class KdcRequest {
 
     /**
      * Set tgs entry .
+     *
+     * @param tgsEntry TGS entry
      */
     public void setTgsEntry(KrbIdentity tgsEntry) {
         this.tgsEntry = tgsEntry;
@@ -246,6 +272,8 @@ public abstract class KdcRequest {
 
     /**
      * Get whether is tcp.
+     *
+     * @return whether is tcp
      */
     public boolean isTcp() {
         return isTcp;
@@ -253,6 +281,8 @@ public abstract class KdcRequest {
 
     /**
      * Set use tcp.
+     *
+     * @param isTcp set kdc request though TCP protocol or not
      */
     public void isTcp(boolean isTcp) {
         this.isTcp = isTcp;
@@ -260,6 +290,8 @@ public abstract class KdcRequest {
 
     /**
      * Get the reply message.
+     *
+     * @return reply
      */
     public KrbMessage getReply() {
         return reply;
@@ -267,6 +299,8 @@ public abstract class KdcRequest {
 
     /**
      * Set kdc reply.
+     *
+     * @param reply reply
      */
     public void setReply(KdcRep reply) {
         this.reply = reply;
@@ -274,6 +308,8 @@ public abstract class KdcRequest {
 
     /**
      * Get client address.
+     *
+     * @return client address
      */
     public InetAddress getClientAddress() {
         return clientAddress;
@@ -281,6 +317,8 @@ public abstract class KdcRequest {
 
     /**
      * Set client address.
+     *
+     * @param clientAddress client address
      */
     public void setClientAddress(InetAddress clientAddress) {
         this.clientAddress = clientAddress;
@@ -288,6 +326,8 @@ public abstract class KdcRequest {
 
     /**
      * Get encryption type.
+     *
+     * @return encryption type
      */
     public EncryptionType getEncryptionType() {
         return encryptionType;
@@ -295,6 +335,8 @@ public abstract class KdcRequest {
 
     /**
      * Set encryption type.
+     *
+     * @param encryptionType encryption type
      */
     public void setEncryptionType(EncryptionType encryptionType) {
         this.encryptionType = encryptionType;
@@ -302,6 +344,8 @@ public abstract class KdcRequest {
 
     /**
      * Get ticket.
+     *
+     * @return ticket
      */
     public Ticket getTicket() {
         return ticket;
@@ -309,6 +353,8 @@ public abstract class KdcRequest {
 
     /**
      * Set ticket.
+     *
+     * @param ticket ticket
      */
     public void setTicket(Ticket ticket) {
         this.ticket = ticket;
@@ -316,6 +362,8 @@ public abstract class KdcRequest {
 
     /**
      * Get whether pre-authenticated.
+     *
+     * @return whether preauthenticated
      */
     public boolean isPreAuthenticated() {
         return isPreAuthenticated;
@@ -323,6 +371,8 @@ public abstract class KdcRequest {
 
     /**
      * Set whether pre-authenticated.
+     *
+     * @param isPreAuthenticated whether is preauthenticated
      */
     public void setPreAuthenticated(boolean isPreAuthenticated) {
         this.isPreAuthenticated = isPreAuthenticated;
@@ -330,6 +380,8 @@ public abstract class KdcRequest {
 
     /**
      * Get server entry.
+     *
+     * @return server entry
      */
     public KrbIdentity getServerEntry() {
         return serverEntry;
@@ -337,6 +389,8 @@ public abstract class KdcRequest {
 
     /**
      * Set server entry.
+     *
+     * @param serverEntry server entry
      */
     public void setServerEntry(KrbIdentity serverEntry) {
         this.serverEntry = serverEntry;
@@ -344,6 +398,8 @@ public abstract class KdcRequest {
 
     /**
      * Get client entry.
+     *
+     * @return client entry
      */
     public KrbIdentity getClientEntry() {
         return clientEntry;
@@ -351,6 +407,8 @@ public abstract class KdcRequest {
 
     /**
      * Set client entry.
+     *
+     * @param clientEntry client entry
      */
     public void setClientEntry(KrbIdentity clientEntry) {
         this.clientEntry = clientEntry;
@@ -358,6 +416,10 @@ public abstract class KdcRequest {
 
     /**
      * Get client key with entryption type.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
+     * @param encType encryption type
+     * @return encryption key
      */
     public EncryptionKey getClientKey(EncryptionType encType) throws KrbException {
         return getClientEntry().getKey(encType);
@@ -365,6 +427,8 @@ public abstract class KdcRequest {
 
     /**
      * Get client key.
+     *
+     * @return client key
      */
     public EncryptionKey getClientKey() {
         return clientKey;
@@ -372,6 +436,8 @@ public abstract class KdcRequest {
 
     /**
      * Set client key.
+     *
+     * @param clientKey client key
      */
     public void setClientKey(EncryptionKey clientKey) {
         this.clientKey = clientKey;
@@ -386,6 +452,8 @@ public abstract class KdcRequest {
 
     /**
      * Set server key.
+     *
+     * @param serverKey server key
      */
     public void setServerKey(EncryptionKey serverKey) {
         this.serverKey = serverKey;
@@ -393,6 +461,8 @@ public abstract class KdcRequest {
 
     /**
      * Get tgs principal name.
+     *
+     * @return principal name
      */
     public PrincipalName getTgsPrincipal() {
         PrincipalName result = KrbUtil.makeTgsPrincipal(kdcContext.getKdcRealm());
@@ -401,11 +471,15 @@ public abstract class KdcRequest {
 
     /**
      * Make reply.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
      */
     protected abstract void makeReply() throws KrbException;
 
     /**
      * Check Version.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
      */
     protected void checkVersion() throws KrbException {
         KdcReq request = getKdcReq();
@@ -420,6 +494,8 @@ public abstract class KdcRequest {
 
     /**
      * Check policy.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
      */
     protected void checkPolicy() throws KrbException {
         KrbIdentity entry = getClientEntry();
@@ -444,11 +520,14 @@ public abstract class KdcRequest {
 
     /**
      * Check client.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
      */
     protected abstract void checkClient() throws KrbException;
 
     /**
      * Do the preatuh.
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
      */
     protected void preauth() throws KrbException {
         KdcReq request = getKdcReq();
@@ -471,6 +550,7 @@ public abstract class KdcRequest {
 
     /**
      * Set whether preauth required.
+     * @param preauthRequired whether preauthentication required
      */
     protected void setPreauthRequired(boolean preauthRequired) {
         preauthContext.setPreauthRequired(preauthRequired);
@@ -478,6 +558,7 @@ public abstract class KdcRequest {
 
     /**
      * Get whether preauth required.
+     * @return whether preauthentication is required
      */
     protected boolean isPreauthRequired() {
         return preauthContext.isPreauthRequired();
@@ -485,6 +566,7 @@ public abstract class KdcRequest {
 
     /**
      * Get preauth handler.
+     * @return preauthencation handler
      */
     protected PreauthHandler getPreauthHandler() {
         return kdcContext.getPreauthHandler();
@@ -492,6 +574,8 @@ public abstract class KdcRequest {
 
     /**
      * Check encryption type.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
      */
     protected void checkEncryptionType() throws KrbException {
         List<EncryptionType> requestedTypes = getKdcReq().getReqBody().getEtypes();
@@ -509,6 +593,8 @@ public abstract class KdcRequest {
 
     /**
      * Do some authenticate.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
      */
     protected void authenticate() throws KrbException {
         checkEncryptionType();
@@ -517,11 +603,14 @@ public abstract class KdcRequest {
 
     /**
      * Issue ticket.
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
      */
     protected abstract void issueTicket() throws KrbException;
 
     /**
      * Check server.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
      */
     private void checkServer() throws KrbException {
         KdcReq request = getKdcReq();
@@ -548,9 +637,10 @@ public abstract class KdcRequest {
     /**
      * Make preauthentication error.
      *
-     * @param kdcContext
-     * @param request
-     * @param errorCode
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
+     * @param kdcContext kdc context
+     * @param request kdc request
+     * @param errorCode krb error code
      * @return The krb error reply to client
      */
     protected KrbError makePreAuthenticationError(KdcContext kdcContext, KdcReq request,
@@ -603,6 +693,10 @@ public abstract class KdcRequest {
 
     /**
      * Get identity entry with principal name.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException
+     * @param principal Principal
+     * @return krb identity entry
      */
     protected KrbIdentity getEntry(String principal) throws KrbException {
         KrbIdentity entry;
@@ -617,6 +711,9 @@ public abstract class KdcRequest {
 
     /**
      * Get request body.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
+     * @return request body
      */
     protected ByteBuffer getRequestBody() throws KrbException {
         return null;
@@ -624,6 +721,9 @@ public abstract class KdcRequest {
 
     /**
      * Get armor key.
+     *
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
+     * @return armor key
      */
     public EncryptionKey getArmorKey() throws KrbException {
         return fastContext.getArmorKey();
@@ -631,6 +731,8 @@ public abstract class KdcRequest {
 
     /**
      * Set armor key.
+     *
+     * @param armorKey armor key
      */
     protected void setArmorKey(EncryptionKey armorKey) {
         fastContext.setArmorKey(armorKey);
@@ -638,6 +740,7 @@ public abstract class KdcRequest {
 
     /**
      * Get server principal.
+     * @return server principal
      */
     public PrincipalName getServerPrincipal() {
         return serverPrincipal;
@@ -645,6 +748,7 @@ public abstract class KdcRequest {
 
     /**
      * Set server principal.
+     * @param serverPrincipal server principal
      */
     public void setServerPrincipal(PrincipalName serverPrincipal) {
         this.serverPrincipal = serverPrincipal;
@@ -652,6 +756,7 @@ public abstract class KdcRequest {
 
     /**
      * Get innerbodyout.
+     * @return inner body out
      */
     protected byte[] getInnerBodyout() {
         return innerBodyout;
@@ -659,6 +764,7 @@ public abstract class KdcRequest {
 
     /**
      * Get whether kdc request with token.
+     * @return whether isToken
      */
     protected boolean isToken() {
         return isToken;
@@ -673,6 +779,7 @@ public abstract class KdcRequest {
 
     /**
      * Get auth token.
+     * @return token
      */
     protected AuthToken getToken() {
         return token;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/954dd267/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/TgsRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/TgsRequest.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/TgsRequest.java
index d654550..4d6d50c 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/TgsRequest.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/TgsRequest.java
@@ -57,6 +57,10 @@ public class TgsRequest extends KdcRequest {
     private EncryptionKey tgtSessionKey;
     private Ticket tgtTicket;
 
+    /**
+     * @param tgsReq TGS request
+     * @param kdcContext kdc context
+     */
     public TgsRequest(TgsReq tgsReq, KdcContext kdcContext) {
         super(tgsReq, kdcContext);
 
@@ -110,6 +114,8 @@ public class TgsRequest extends KdcRequest {
 
     /**
      * Verify authenticator.
+     * @throws org.apache.kerby.kerberos.kerb.KrbException e
+     * @param paDataEntry preauthentication data entry
      */
     public void verifyAuthenticator(PaDataEntry paDataEntry) throws KrbException {
         ApReq apReq = KrbCodec.decode(paDataEntry.getPaDataValue(), ApReq.class);
@@ -222,6 +228,7 @@ public class TgsRequest extends KdcRequest {
 
     /**
      * Make EncKdcRepPart.
+     * @return encryption kdc response part
      */
     private EncKdcRepPart makeEncKdcRepPart() {
         KdcReq request = getKdcReq();
@@ -257,6 +264,10 @@ public class TgsRequest extends KdcRequest {
         return encKdcRepPart;
     }
 
+    /**
+     * @return request body
+     * @throws KrbException e
+     */
     public ByteBuffer getRequestBody() throws KrbException {
         return null;
     }


Mime
View raw message