jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r641786 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security: AuthContext.java authentication/JAASAuthContext.java authentication/LocalAuthContext.java
Date Thu, 27 Mar 2008 11:21:08 GMT
Author: angela
Date: Thu Mar 27 04:21:00 2008
New Revision: 641786

URL: http://svn.apache.org/viewvc?rev=641786&view=rev
Log:
simplify deprecated AuthContext (and derived)

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AuthContext.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/JAASAuthContext.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AuthContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AuthContext.java?rev=641786&r1=641785&r2=641786&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AuthContext.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AuthContext.java
Thu Mar 27 04:21:00 2008
@@ -21,7 +21,6 @@
 
 import javax.jcr.Credentials;
 import javax.security.auth.Subject;
-import javax.security.auth.login.LoginContext;
 import javax.security.auth.login.LoginException;
 import javax.security.auth.spi.LoginModule;
 import java.util.Collections;
@@ -43,38 +42,11 @@
 public abstract class AuthContext implements org.apache.jackrabbit.core.security.authentication.AuthContext
{
 
     /**
-     * Perform the authentication and, if successful, associate Principals and Credentials
-     * with the authenticated<code>Subject</code>.
-     *
-     * @see LoginContext#login()
-     * @throws LoginException if the authentication fails.
-     */
-    public abstract void login() throws LoginException;
-
-    /**
-     * Return the authenticated Subject.
-     *
-     * @see LoginContext#getSubject()
-     * @return the authenticated Subject or <code>null</code> if authentication
failed.
-     */
-    public abstract Subject getSubject();
-
-    /**
-     * Logout the <code>Subject</code>.
-     *
-     * @see LoginContext#logout()
-     * @exception LoginException if the logout fails.
-     */
-    public abstract void logout() throws LoginException;
-
-    /**
      * An {@link AuthContext} implemented using a regular JAAS <code>LoginContext</code>.
      *
      * @deprecated Use {@link org.apache.jackrabbit.core.security.authentication.JAASAuthContext}
instead
      */
-    public static class JAAS extends AuthContext {
-
-        private final LoginContext ctx;
+    public static class JAAS extends org.apache.jackrabbit.core.security.authentication.JAASAuthContext
{
 
         /**
          * Creates an authentication context given a JAAS configuration name and some credentials.
@@ -84,30 +56,8 @@
          * @throws LoginException if the JAAS context couldn't be created
          */
         public JAAS(String name, Credentials creds) throws LoginException {
-            this.ctx = new LoginContext(name, new CredentialsCallbackHandler(creds));
+            super(name, new CredentialsCallbackHandler(creds), null);
         }
-
-        /**
-         * {@inheritDoc}
-         */
-        public void login() throws LoginException {
-            ctx.login();
-        }
-
-        /**
-         * {@inheritDoc}
-         */
-        public Subject getSubject() {
-            return ctx.getSubject();
-        }
-
-        /**
-         * {@inheritDoc}
-         */
-        public void logout() throws LoginException {
-            ctx.logout();
-        }
-
     }
 
     /**
@@ -116,6 +66,7 @@
      * @deprecated Use {@link org.apache.jackrabbit.core.security.authentication.LocalAuthContext}
instead.
      */
     public static class Local extends AuthContext {
+
         private final LoginModule module;
         private final Map options;
         private Subject subject;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/JAASAuthContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/JAASAuthContext.java?rev=641786&r1=641785&r2=641786&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/JAASAuthContext.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/JAASAuthContext.java
Thu Mar 27 04:21:00 2008
@@ -35,7 +35,8 @@
      * @param cbHandler CallbackHandler for login-modules
      * @param subject   to extend authentication
      */
-    JAASAuthContext(String appName, CallbackHandler cbHandler, Subject subject) {
+    protected JAASAuthContext(String appName, CallbackHandler cbHandler,
+                              Subject subject) {
 
         // make sure we are using our own context class loader when we
         // instantiate a LoginContext. See bug# 14329.

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java?rev=641786&r1=641785&r2=641786&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java
Thu Mar 27 04:21:00 2008
@@ -53,8 +53,9 @@
      * @param cbHandler CallbackHandler for the LoginModule
      * @param subject   Subject if a pre-authenticated exists
      */
-    LocalAuthContext(LoginModuleConfig config, CallbackHandler cbHandler,
-                     Subject subject) {
+    protected LocalAuthContext(LoginModuleConfig config,
+                               CallbackHandler cbHandler,
+                               Subject subject) {
         this.config = config;
         this.cbHandler = cbHandler;
         this.subject = (null == subject) ? new Subject() : subject;



Mime
View raw message