mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
improve javadoc of AuthenticationResource for the webservice documentation
This commit is contained in:
@@ -39,6 +39,7 @@ import com.google.inject.Inject;
|
|||||||
import com.google.inject.Provider;
|
import com.google.inject.Provider;
|
||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
|
|
||||||
|
import org.codehaus.enunciate.jaxrs.TypeHint;
|
||||||
import org.codehaus.enunciate.modules.jersey.SpringManagedLifecycle;
|
import org.codehaus.enunciate.modules.jersey.SpringManagedLifecycle;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -109,18 +110,24 @@ public class AuthenticationResource
|
|||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Authenticate a user and return the state of the application.<br />
|
||||||
|
* <br />
|
||||||
|
* <ul>
|
||||||
|
* <li>200 success</li>
|
||||||
|
* <li>401 unauthorized, the specified username or password is wrong</li>
|
||||||
|
* <li>500 internal server error</li>
|
||||||
|
* </ul>
|
||||||
*
|
*
|
||||||
*
|
* @param request the current http request
|
||||||
* @param request
|
* @param response the current http response
|
||||||
* @param response
|
* @param username the username for the authentication
|
||||||
* @param username
|
* @param password the password for the authentication
|
||||||
* @param password
|
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("login")
|
@Path("login")
|
||||||
|
@TypeHint(ScmState.class)
|
||||||
public ScmState authenticate(@Context HttpServletRequest request,
|
public ScmState authenticate(@Context HttpServletRequest request,
|
||||||
@Context HttpServletResponse response,
|
@Context HttpServletResponse response,
|
||||||
@FormParam("username") String username,
|
@FormParam("username") String username,
|
||||||
@@ -144,16 +151,22 @@ public class AuthenticationResource
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Logout the current user. Returns the current state of the application,
|
||||||
|
* if public access is enabled.<br />
|
||||||
|
* <br />
|
||||||
|
* <ul>
|
||||||
|
* <li>200 success</li>
|
||||||
|
* <li>500 internal server error</li>
|
||||||
|
* </ul>
|
||||||
*
|
*
|
||||||
*
|
* @param request the current http request
|
||||||
* @param request
|
* @param response the current http response
|
||||||
* @param response
|
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("logout")
|
@Path("logout")
|
||||||
|
@TypeHint(ScmState.class)
|
||||||
public Response logout(@Context HttpServletRequest request,
|
public Response logout(@Context HttpServletRequest request,
|
||||||
@Context HttpServletResponse response)
|
@Context HttpServletResponse response)
|
||||||
{
|
{
|
||||||
@@ -181,14 +194,20 @@ public class AuthenticationResource
|
|||||||
//~--- get methods ----------------------------------------------------------
|
//~--- get methods ----------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Returns the current state of the application.<br />
|
||||||
|
* <br />
|
||||||
|
* <ul>
|
||||||
|
* <li>200 success</li>
|
||||||
|
* <li>401 unauthorized, user is not authenticated and public access is disabled.</li>
|
||||||
|
* <li>500 internal server error</li>
|
||||||
|
* </ul>
|
||||||
*
|
*
|
||||||
*
|
* @param request the current http request
|
||||||
* @param request
|
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
|
@TypeHint(ScmState.class)
|
||||||
public Response getState(@Context HttpServletRequest request)
|
public Response getState(@Context HttpServletRequest request)
|
||||||
{
|
{
|
||||||
Response response = null;
|
Response response = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user