package org.apache.sshd.server;

import org.apache.sshd.common.SshConstants;
import org.apache.sshd.common.util.Buffer;
import org.apache.sshd.server.session.ServerSession;

/**
 * Extension of UserAuth for use with methods which require handshakes, such as gssapi-with-mic.
 * 
 * @author Richard Evans
 */

public interface HandshakingUserAuth extends UserAuth {
  
  /**
   * Set the service name from the original request.  This may be required for MIC verification later.
   * 
   * @param service The service name
   */
  
  void setServiceName(String service);
  
  /**
   * Check whether a particular message is handled here.
   * 
   * @param msg The message
   * 
   * @return <code>true</code> if the message is handled
   */
  
  boolean handles(SshConstants.Message msg);
  
  /**
   * Handle another step in the authentication process. 
   *
   * @param session the current ssh session
   * @param msg The message type
   * @param buffer the request buffer containing parameters specific to this request
   * @return <code>true</code> if the authentication succeeded, <code>false</code> if the authentication
   *          is not finished yet
   * @throws Exception if the authentication fails
   */
  
  Boolean next(ServerSession session, SshConstants.Message msg, Buffer buffer) throws Exception;
  
  /**
   * Get a user name which has been derived from the handshaking process, or the intial name if
   * nothing has been found.
   * 
   * @return The user name
   * 
   * @throws Exception if the request fails
   */
  
  String getUserName() throws Exception;
  
  /**
   * Free any system resources used by the module.
   */
  
  void destroy();
}

@@ -1,8 +1,816 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A */%0A
 package 
@@ -1095,21 +1095,73 @@
 hor 
-Richard Evans
+%3Ca href=%22mailto:dev@mina.apache.org%22%3EApache MINA SSHD Project%3C/a%3E
 %0A */

Add missing AL header