diff src/org/eclipse/jetty/server/Authentication.java @ 813:f8f7cb485c25

remove UserIdentity
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 08 Sep 2016 22:01:33 -0600
parents 3428c60d7cfc
children
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/Authentication.java	Thu Sep 08 21:44:37 2016 -0600
+++ b/src/org/eclipse/jetty/server/Authentication.java	Thu Sep 08 22:01:33 2016 -0600
@@ -35,121 +35,119 @@
  */
 public interface Authentication
 {
-    /* ------------------------------------------------------------ */
-    /** A successful Authentication with User information.
-     */
-    public interface User extends Authentication
-    {
-        String getAuthMethod();
-        UserIdentity getUserIdentity(); 
-        boolean isUserInRole(UserIdentity.Scope scope,String role);
-        void logout();
-    }
-    
-    /* ------------------------------------------------------------ */
-    /** A wrapped authentication with methods provide the
-     * wrapped request/response for use by the application
-     */
-    public interface Wrapped extends Authentication
-    {
-        HttpServletRequest getHttpServletRequest();
-        HttpServletResponse getHttpServletResponse();
-    }
-    
-    /* ------------------------------------------------------------ */
-    /** A deferred authentication with methods to progress 
-     * the authentication process.
-     */
-    public interface Deferred extends Authentication
-    {
-        /* ------------------------------------------------------------ */
-        /** Authenticate if possible without sending a challenge.
-         * This is used to check credentials that have been sent for 
-         * non-manditory authentication.
-         * @return The new Authentication state.
-         */
-        Authentication authenticate(ServletRequest request);
+	/* ------------------------------------------------------------ */
+	/** A successful Authentication with User information.
+	 */
+	public interface User extends Authentication
+	{
+		String getAuthMethod();
+		void logout();
+	}
+	
+	/* ------------------------------------------------------------ */
+	/** A wrapped authentication with methods provide the
+	 * wrapped request/response for use by the application
+	 */
+	public interface Wrapped extends Authentication
+	{
+		HttpServletRequest getHttpServletRequest();
+		HttpServletResponse getHttpServletResponse();
+	}
+	
+	/* ------------------------------------------------------------ */
+	/** A deferred authentication with methods to progress 
+	 * the authentication process.
+	 */
+	public interface Deferred extends Authentication
+	{
+		/* ------------------------------------------------------------ */
+		/** Authenticate if possible without sending a challenge.
+		 * This is used to check credentials that have been sent for 
+		 * non-manditory authentication.
+		 * @return The new Authentication state.
+		 */
+		Authentication authenticate(ServletRequest request);
 
-        /* ------------------------------------------------------------ */
-        /** Authenticate and possibly send a challenge.
-         * This is used to initiate authentication for previously 
-         * non-manditory authentication.
-         * @return The new Authentication state.
-         */
-        Authentication authenticate(ServletRequest request,ServletResponse response);
-        
-        
-        /* ------------------------------------------------------------ */
-        /** Login with the LOGIN authenticator
-         * @param username
-         * @param password
-         * @return The new Authentication state
-         */
-        Authentication login(String username,Object password,ServletRequest request);
-    }
+		/* ------------------------------------------------------------ */
+		/** Authenticate and possibly send a challenge.
+		 * This is used to initiate authentication for previously 
+		 * non-manditory authentication.
+		 * @return The new Authentication state.
+		 */
+		Authentication authenticate(ServletRequest request,ServletResponse response);
+		
+		
+		/* ------------------------------------------------------------ */
+		/** Login with the LOGIN authenticator
+		 * @param username
+		 * @param password
+		 * @return The new Authentication state
+		 */
+		Authentication login(String username,Object password,ServletRequest request);
+	}
 
-    
-    /* ------------------------------------------------------------ */
-    /** Authentication Response sent state.
-     * Responses are sent by authenticators either to issue an
-     * authentication challenge or on successful authentication in
-     * order to redirect the user to the original URL.
-     */
-    public interface ResponseSent extends Authentication
-    { 
-    }
-    
-    /* ------------------------------------------------------------ */
-    /** An Authentication Challenge has been sent.
-     */
-    public interface Challenge extends ResponseSent
-    { 
-    }
+	
+	/* ------------------------------------------------------------ */
+	/** Authentication Response sent state.
+	 * Responses are sent by authenticators either to issue an
+	 * authentication challenge or on successful authentication in
+	 * order to redirect the user to the original URL.
+	 */
+	public interface ResponseSent extends Authentication
+	{ 
+	}
+	
+	/* ------------------------------------------------------------ */
+	/** An Authentication Challenge has been sent.
+	 */
+	public interface Challenge extends ResponseSent
+	{ 
+	}
 
-    /* ------------------------------------------------------------ */
-    /** An Authentication Failure has been sent.
-     */
-    public interface Failure extends ResponseSent
-    { 
-    }
+	/* ------------------------------------------------------------ */
+	/** An Authentication Failure has been sent.
+	 */
+	public interface Failure extends ResponseSent
+	{ 
+	}
 
-    public interface SendSuccess extends ResponseSent
-    {
-    }
+	public interface SendSuccess extends ResponseSent
+	{
+	}
 
-    /* ------------------------------------------------------------ */
-    /** Unauthenticated state.
-     * <p> 
-     * This convenience instance is for non mandatory authentication where credentials
-     * have been presented and checked, but failed authentication. 
-     */
-    public final static Authentication UNAUTHENTICATED = new Authentication(){@Override
-    public String toString(){return "UNAUTHENTICATED";}};
+	/* ------------------------------------------------------------ */
+	/** Unauthenticated state.
+	 * <p> 
+	 * This convenience instance is for non mandatory authentication where credentials
+	 * have been presented and checked, but failed authentication. 
+	 */
+	public final static Authentication UNAUTHENTICATED = new Authentication(){@Override
+	public String toString(){return "UNAUTHENTICATED";}};
 
-    /* ------------------------------------------------------------ */
-    /** Authentication not checked
-     * <p>
-     * This convenience instance us for non mandatory authentication when no 
-     * credentials are present to be checked.
-     */
-    public final static Authentication NOT_CHECKED = new Authentication(){@Override
-    public String toString(){return "NOT CHECKED";}};
+	/* ------------------------------------------------------------ */
+	/** Authentication not checked
+	 * <p>
+	 * This convenience instance us for non mandatory authentication when no 
+	 * credentials are present to be checked.
+	 */
+	public final static Authentication NOT_CHECKED = new Authentication(){@Override
+	public String toString(){return "NOT CHECKED";}};
 
-    /* ------------------------------------------------------------ */
-    /** Authentication challenge sent.
-     * <p>
-     * This convenience instance is for when an authentication challenge has been sent.
-     */
-    public final static Authentication SEND_CONTINUE = new Authentication.Challenge(){@Override
-    public String toString(){return "CHALLENGE";}};
+	/* ------------------------------------------------------------ */
+	/** Authentication challenge sent.
+	 * <p>
+	 * This convenience instance is for when an authentication challenge has been sent.
+	 */
+	public final static Authentication SEND_CONTINUE = new Authentication.Challenge(){@Override
+	public String toString(){return "CHALLENGE";}};
 
-    /* ------------------------------------------------------------ */
-    /** Authentication failure sent.
-     * <p>
-     * This convenience instance is for when an authentication failure has been sent.
-     */
-    public final static Authentication SEND_FAILURE = new Authentication.Failure(){@Override
-    public String toString(){return "FAILURE";}};
-    public final static Authentication SEND_SUCCESS = new SendSuccess(){@Override
-    public String toString(){return "SEND_SUCCESS";}};
+	/* ------------------------------------------------------------ */
+	/** Authentication failure sent.
+	 * <p>
+	 * This convenience instance is for when an authentication failure has been sent.
+	 */
+	public final static Authentication SEND_FAILURE = new Authentication.Failure(){@Override
+	public String toString(){return "FAILURE";}};
+	public final static Authentication SEND_SUCCESS = new SendSuccess(){@Override
+	public String toString(){return "SEND_SUCCESS";}};
 }