This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit c48714554aaa422d16d1cbfdcc075a89252e6dc6 Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri May 20 06:47:21 2022 +0100 Add Javadoc --- java/jakarta/security/auth/message/ClientAuth.java | 39 ++++++++++++++++++++++ java/jakarta/security/auth/message/ServerAuth.java | 39 ++++++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/java/jakarta/security/auth/message/ClientAuth.java b/java/jakarta/security/auth/message/ClientAuth.java index f9aab007df..063075f35a 100644 --- a/java/jakarta/security/auth/message/ClientAuth.java +++ b/java/jakarta/security/auth/message/ClientAuth.java @@ -20,13 +20,52 @@ import javax.security.auth.Subject; public interface ClientAuth { + /** + * Secure (authenticate) the request. + * + * @param messageInfo The associated request and response + * @param clientSubject The subject that represents the source of the + * request + * + * @return An AuthStatus instance that represents the result of the + * authentication + * + * @throws AuthException If the a failure occurred in a manner that + * prevented the failure from being communicated via + * messageInfo + */ AuthStatus secureRequest(MessageInfo messageInfo, Subject clientSubject) throws AuthException; + /** + * Validate a response. + * + * @param messageInfo The associated request and response + * @param clientSubject The subject that represents the recipient of the + * response + * @param serviceSubject The subject that represents the source of the + * response + * + * @return An AuthStatus instance that represents the result of the + * validation + * + * @throws AuthException If the a failure occurred in a manner that + * prevented the failure from being communicated via + * messageInfo + */ default AuthStatus validateResponse(MessageInfo messageInfo, Subject clientSubject, Subject serviceSubject) throws AuthException { return AuthStatus.SUCCESS; } + /** + * Remove principals and/or credentials from the subject that were + * previously added by this authentication mechanism. + * + * @param messageInfo The associated request and response + * @param subject The subject to clean + * + * @throws AuthException If the a failure occurred + */ default void cleanSubject(MessageInfo messageInfo, Subject subject) throws AuthException { // NO-OP } diff --git a/java/jakarta/security/auth/message/ServerAuth.java b/java/jakarta/security/auth/message/ServerAuth.java index a5b0a8a323..d0777618f5 100644 --- a/java/jakarta/security/auth/message/ServerAuth.java +++ b/java/jakarta/security/auth/message/ServerAuth.java @@ -20,13 +20,52 @@ import javax.security.auth.Subject; public interface ServerAuth { + /** + * Validate the request. + * + * @param messageInfo The associated request and response + * @param clientSubject The subject that represents the source of the + * request + * @param serviceSubject The subject that represents the recipient of the + * request + * + * @return An AuthStatus instance that represents the result of the + * validation + * + * @throws AuthException If the a failure occurred in a manner that + * prevented the failure from being communicated via + * messageInfo + */ AuthStatus validateRequest(MessageInfo messageInfo, Subject clientSubject, Subject serviceSubject) throws AuthException; + /** + * Secure (authenticate) the response. + * + * @param messageInfo The associated request and response + * @param serviceSubject The subject that represents the source of the + * response + * + * @return An AuthStatus instance that represents the result of the + * authentication + * + * @throws AuthException If the a failure occurred in a manner that + * prevented the failure from being communicated via + * messageInfo + */ default AuthStatus secureResponse(MessageInfo messageInfo, Subject serviceSubject) throws AuthException { return AuthStatus.SUCCESS; } + /** + * Remove principals and/or credentials from the subject that were + * previously added by this authentication mechanism. + * + * @param messageInfo The associated request and response + * @param subject The subject to clean + * + * @throws AuthException If the a failure occurred + */ default void cleanSubject(MessageInfo messageInfo, Subject subject) throws AuthException { // NO-OP } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org