You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pl...@apache.org on 2015/09/09 03:36:49 UTC

[28/46] directory-kerby git commit: Fix javadoc issues in kerb-client module.

Fix javadoc issues in kerb-client 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/205295a8
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/205295a8
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/205295a8

Branch: refs/heads/pkinit-support
Commit: 205295a8eaa0ea81a4ee6b5b6826b139883e1d5d
Parents: 947c15c
Author: plusplusjiajia <ji...@intel.com>
Authored: Mon Aug 24 14:38:58 2015 +0800
Committer: plusplusjiajia <ji...@intel.com>
Committed: Mon Aug 24 14:38:58 2015 +0800

----------------------------------------------------------------------
 .../kerby/kerberos/kerb/client/ClientUtil.java  |  9 ++-
 .../kerby/kerberos/kerb/client/KrbClient.java   | 67 +++++++++++---------
 .../kerby/kerberos/kerb/client/KrbHandler.java  |  3 +
 .../kerby/kerberos/kerb/client/KrbSetting.java  |  4 +-
 .../kerb/client/preauth/KrbPreauth.java         | 32 +++++++++-
 .../kerb/client/request/KdcRequest.java         |  8 +++
 6 files changed, 86 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/205295a8/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/ClientUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/ClientUtil.java b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/ClientUtil.java
index 6c75678..3dd4ae0 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/ClientUtil.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/ClientUtil.java
@@ -35,6 +35,9 @@ public final class ClientUtil {
 
     /**
      * Load krb5.conf from specified conf dir.
+     * @param confDir The conf dir
+     * @return KrbConfig
+     * @throws KrbException e
      */
     public static KrbConfig getConfig(File confDir) throws KrbException {
         File confFile = new File(confDir, KRB5_FILE_NAME);
@@ -58,6 +61,8 @@ public final class ClientUtil {
 
     /**
      * Load default krb5.conf
+     * @return The KrbConfig
+     * @throws KrbException e
      */
     public static KrbConfig getDefaultConfig() throws KrbException {
         File confFile = null;
@@ -98,9 +103,9 @@ public final class ClientUtil {
 
     /**
      * Get KDC network transport addresses according to krb client setting.
-     * @param setting
+     * @param setting The krb setting
      * @return UDP and TCP addresses pair
-     * @throws KrbException
+     * @throws KrbException e
      */
     public static TransportPair getTransportPair(
             KrbSetting setting) throws KrbException {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/205295a8/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbClient.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbClient.java b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbClient.java
index 4d67217..2067a6e 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbClient.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbClient.java
@@ -57,7 +57,7 @@ public class KrbClient {
 
     /**
      * Construct with prepared KrbConfig.
-     * @param krbConfig
+     * @param krbConfig The krb config
      */
     public KrbClient(KrbConfig krbConfig) {
         this.krbConfig = krbConfig;
@@ -67,7 +67,8 @@ public class KrbClient {
 
     /**
      * Constructor with conf dir
-     * @param confDir
+     * @param confDir The conf dir
+     * @throws KrbException e
      */
     public KrbClient(File confDir) throws KrbException {
         this.commonOptions = new KOptions();
@@ -77,7 +78,7 @@ public class KrbClient {
 
     /**
      * Set KDC realm for ticket request
-     * @param realm
+     * @param realm The realm
      */
     public void setKdcRealm(String realm) {
         commonOptions.add(KrbOption.KDC_REALM, realm);
@@ -85,7 +86,7 @@ public class KrbClient {
 
     /**
      * Set KDC host.
-     * @param kdcHost
+     * @param kdcHost The kdc host
      */
     public void setKdcHost(String kdcHost) {
         commonOptions.add(KrbOption.KDC_HOST, kdcHost);
@@ -93,7 +94,7 @@ public class KrbClient {
 
     /**
      * Set KDC tcp port.
-     * @param kdcTcpPort
+     * @param kdcTcpPort The kdc tcp port
      */
     public void setKdcTcpPort(int kdcTcpPort) {
         if (kdcTcpPort < 1) {
@@ -105,7 +106,7 @@ public class KrbClient {
 
     /**
      * Set to allow UDP or not.
-     * @param allowUdp
+     * @param allowUdp true if allow udp
      */
     public void setAllowUdp(boolean allowUdp) {
         commonOptions.add(KrbOption.ALLOW_UDP, allowUdp);
@@ -113,7 +114,7 @@ public class KrbClient {
 
     /**
      * Set to allow TCP or not.
-     * @param allowTcp
+     * @param allowTcp true if allow tcp
      */
     public void setAllowTcp(boolean allowTcp) {
         commonOptions.add(KrbOption.ALLOW_TCP, allowTcp);
@@ -121,7 +122,7 @@ public class KrbClient {
 
     /**
      * Set KDC udp port. Only makes sense when allowUdp is set.
-     * @param kdcUdpPort
+     * @param kdcUdpPort The kdc udp port
      */
     public void setKdcUdpPort(int kdcUdpPort) {
         if (kdcUdpPort < 1) {
@@ -141,7 +142,7 @@ public class KrbClient {
 
     /**
      * Init the client.
-     * @throws KrbException
+     * @throws KrbException e
      */
     public void init() throws KrbException {
         innerClient = new DefaultInternalKrbClient(krbSetting);
@@ -162,10 +163,10 @@ public class KrbClient {
 
     /**
      * Request a TGT with user plain credential
-     * @param principal
-     * @param password
+     * @param principal The principal
+     * @param password The password
      * @return
-     * @throws KrbException
+     * @throws KrbException e
      */
     public TgtTicket requestTgtWithPassword(String principal,
                                       String password) throws KrbException {
@@ -178,10 +179,10 @@ public class KrbClient {
 
     /**
      * Request a TGT with user plain credential
-     * @param principal
-     * @param keytabFile
+     * @param principal The principal
+     * @param keytabFile The keytab file
      * @return TGT
-     * @throws KrbException
+     * @throws KrbException e
      */
     public TgtTicket requestTgtWithKeytab(String principal,
                                       File keytabFile) throws KrbException {
@@ -194,10 +195,10 @@ public class KrbClient {
 
     /**
      * Request a TGT with user x509 certificate credential
-     * @param certificate
-     * @param privateKey
+     * @param certificate The certificate
+     * @param privateKey The private key
      * @return TGT
-     * @throws KrbException
+     * @throws KrbException e
      */
     public TgtTicket requestTgtWithCert(Certificate certificate,
                                         PrivateKey privateKey) throws KrbException {
@@ -210,7 +211,7 @@ public class KrbClient {
     /**
      * Request a TGT with using Anonymous PKINIT
      * @return TGT
-     * @throws KrbException
+     * @throws KrbException e
      */
     public TgtTicket requestTgtWithPkintAnonymous() throws KrbException {
         KOptions requestOptions = new KOptions();
@@ -220,9 +221,10 @@ public class KrbClient {
 
     /**
      * Request a TGT with user token credential
-     * @param token
+     * @param token The auth token
+     * @param armorCache The armor cache
      * @return TGT
-     * @throws KrbException
+     * @throws KrbException e
      */
     public TgtTicket requestTgtWithToken(AuthToken token, String armorCache) throws KrbException {
         if (!token.isIdToken()) {
@@ -237,9 +239,9 @@ public class KrbClient {
 
     /**
      * Request a TGT with using well prepared requestOptions.
-     * @param requestOptions
+     * @param requestOptions The request options
      * @return TGT
-     * @throws KrbException
+     * @throws KrbException e
      */
     public TgtTicket requestTgtWithOptions(KOptions requestOptions) throws KrbException {
         if (requestOptions == null) {
@@ -251,10 +253,10 @@ public class KrbClient {
 
     /**
      * Request a service ticket with a TGT targeting for a server
-     * @param tgt
-     * @param serverPrincipal
-     * @return
-     * @throws KrbException
+     * @param tgt The tgt ticket
+     * @param serverPrincipal The server principal
+     * @return Service ticket
+     * @throws KrbException e
      */
     public ServiceTicket requestServiceTicketWithTgt(
             TgtTicket tgt, String serverPrincipal) throws KrbException {
@@ -266,8 +268,11 @@ public class KrbClient {
 
     /**
      * Request a service ticket using an Access Token.
+     * @param token The auth token
+     * @param serverPrincipal The server principal
+     * @param armorCache The armor cache
      * @return service ticket
-     * @throws KrbException
+     * @throws KrbException e
      */
     public ServiceTicket requestServiceTicketWithAccessToken(
             AuthToken token, String serverPrincipal,
@@ -284,9 +289,9 @@ public class KrbClient {
 
     /**
      * Store tgt into the specified credential cache file.
-     * @param tgtTicket
-     * @param ccacheFile
-     * @throws KrbException
+     * @param tgtTicket The tgt ticket
+     * @param ccacheFile The credential cache file
+     * @throws KrbException e
      */
     public void storeTicket(TgtTicket tgtTicket,
                             File ccacheFile) throws KrbException {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/205295a8/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbHandler.java b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbHandler.java
index 4191265..89eb1f5 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbHandler.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbHandler.java
@@ -63,6 +63,7 @@ public abstract class KrbHandler {
      * Handle the kdc request.
      *
      * @param kdcRequest The kdc request
+     * @throws KrbException e
      */
     public void handleRequest(KdcRequest kdcRequest) throws KrbException {
         kdcRequest.process();
@@ -93,6 +94,7 @@ public abstract class KrbHandler {
      *
      * @param kdcRequest The kdc request
      * @param responseMessage The message from kdc
+     * @throws KrbException e
      */
     public void onResponseMessage(
             KdcRequest kdcRequest, ByteBuffer responseMessage) throws KrbException {
@@ -141,6 +143,7 @@ public abstract class KrbHandler {
      *
      * @param kdcRequest The kdc request
      * @param requestMessage The request message to kdc
+     * @throws IOException e
      */
     protected abstract void sendMessage(KdcRequest kdcRequest,
                                         ByteBuffer requestMessage) throws IOException;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/205295a8/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbSetting.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbSetting.java b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbSetting.java
index 7a16be7..167f977 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbSetting.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/KrbSetting.java
@@ -62,7 +62,7 @@ public class KrbSetting {
     /**
      * Check kdc tcp setting and see if any bad.
      * @return valid tcp port or -1 if not allowTcp
-     * @throws KrbException
+     * @throws KrbException e
      */
     public int checkGetKdcTcpPort() throws KrbException {
         if (allowTcp()) {
@@ -78,7 +78,7 @@ public class KrbSetting {
     /**
      * 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()) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/205295a8/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/KrbPreauth.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/KrbPreauth.java b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/KrbPreauth.java
index 5e00043..1fd36c8 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/KrbPreauth.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/KrbPreauth.java
@@ -40,28 +40,40 @@ public interface KrbPreauth extends PreauthPluginMeta {
 
     /**
      * Initializing preauth plugin context
+     * @param krbContext The krb context
      */
     void init(KrbContext krbContext);
 
     /**
      * Initializing request context
+     * @param kdcRequest The kdc request
+     * @return PluginRequestContext
      */
     PluginRequestContext initRequestContext(KdcRequest kdcRequest);
 
     /**
      * Prepare questions to prompt to you asking for credential
+     * @param kdcRequest The kdc request
+     * @param requestContext The request context
+     * @throws KrbException e
      */
     void prepareQuestions(KdcRequest kdcRequest,
                                  PluginRequestContext requestContext) throws KrbException;
 
     /**
      * Get supported encryption types
+     * @param kdcRequest The kdc request
+     * @param requestContext The request context
+     * @return The encryption type list
      */
     List<EncryptionType> getEncTypes(KdcRequest kdcRequest,
                                             PluginRequestContext requestContext);
 
     /**
      * Set krb options passed from user
+     * @param kdcRequest The kdc request
+     * @param requestContext The request context
+     * @param preauthOptions The preauth options
      */
     void setPreauthOptions(KdcRequest kdcRequest,
                                   PluginRequestContext requestContext,
@@ -69,6 +81,10 @@ public interface KrbPreauth extends PreauthPluginMeta {
 
     /**
      * Attempt to try any initial padata derived from user options
+     * @param kdcRequest The kdc request
+     * @param requestContext The request context
+     * @param outPadata The outPadata
+     * @throws KrbException e
      */
     void tryFirst(KdcRequest kdcRequest,
                          PluginRequestContext requestContext,
@@ -76,7 +92,12 @@ public interface KrbPreauth extends PreauthPluginMeta {
 
     /**
      * Process server returned paData and return back any result paData
-     * Return true indicating padata is added
+     * @param kdcRequest The kdc request
+     * @param requestContext The request context
+     * @param inPadata The inPadata
+     * @param outPadata The outPadata
+     * @return true indicating padata is added
+     * @throws KrbException e
      */
     boolean process(KdcRequest kdcRequest,
                            PluginRequestContext requestContext,
@@ -85,7 +106,12 @@ public interface KrbPreauth extends PreauthPluginMeta {
 
     /**
      * When another request to server in the 4 pass, any paData to provide?
-     * Return true indicating padata is added
+     * @param kdcRequest The kdc request
+     * @param requestContext The request context
+     * @param preauthType The preauth type
+     * @param errPadata The error padata
+     * @param outPadata The outPadata
+     * @return true indicating padata is added
      */
     boolean tryAgain(KdcRequest kdcRequest,
                             PluginRequestContext requestContext,
@@ -96,6 +122,8 @@ public interface KrbPreauth extends PreauthPluginMeta {
     /**
      * Return PA_REAL if pa_type is a real preauthentication type or PA_INFO if it is
      * an informational type.
+     * @param paType The pa_type
+     * @return PaFlags
      */
     PaFlags getFlags(PaDataType paType);
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/205295a8/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
index 50ae39f..9ee3340 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
@@ -323,6 +323,7 @@ public abstract class KdcRequest {
 
     /**
      * Indicate interest in the AS key.
+     * @throws KrbException e
      */
     public void needAsKey() throws KrbException {
         EncryptionKey clientKey = getClientKey();
@@ -337,6 +338,7 @@ public abstract class KdcRequest {
      * the AS_REP packet.  When handling a PREAUTH_REQUIRED error, this
      * typically comes from etype-info2.  When handling an AS reply, it is
      * initialized from the AS reply itself.
+     * @return The encryption type
      */
     public EncryptionType getEncType() {
 
@@ -349,6 +351,7 @@ public abstract class KdcRequest {
 
     /**
      * Get a pointer to the FAST armor key, or NULL if the client is not using FAST.
+     * @return The encryption key
      */
     public EncryptionKey getArmorKey() {
         return fastRequestState.getArmorKey();
@@ -363,6 +366,7 @@ public abstract class KdcRequest {
      * will only be used if it is protected by a FAST channel.  Only set
      * allow_unauth_time if using an unauthenticated time offset would not
      * create a security issue.
+     * @return The current kerberos time
      */
     public KerberosTime getPreauthTime() {
         return KerberosTime.now();
@@ -372,6 +376,8 @@ public abstract class KdcRequest {
      * Get a state item from an input ccache, which may allow it
      * to retrace the steps it took last time.  The returned data string is an
      * alias and should not be freed.
+     * @param key The key string
+     * @return The item
      */
     public Object getCacheValue(String key) {
         return credCache.get(key);
@@ -381,6 +387,8 @@ public abstract class KdcRequest {
      * Set a state item which will be recorded to an output
      * ccache, if the calling application supplied one.  Both key and data
      * should be valid UTF-8 text.
+     * @param key The key string
+     * @param value The value
      */
     public void cacheValue(String key, Object value) {
         credCache.put(key, value);