incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1230154 - in /sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core: ./ impl/ impl/engine/
Date Wed, 11 Jan 2012 17:06:33 GMT
Author: justin
Date: Wed Jan 11 17:06:32 2012
New Revision: 1230154

URL: http://svn.apache.org/viewvc?rev=1230154&view=rev
Log:
SLING-2349 - changing auth handler class event property to auth type

Modified:
    sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/AuthConstants.java
    sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AbstractAuthenticationHandlerHolder.java
    sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AuthenticationHandlerHolder.java
    sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java
    sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/engine/EngineAuthenticationHandlerHolder.java

Modified: sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/AuthConstants.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/AuthConstants.java?rev=1230154&r1=1230153&r2=1230154&view=diff
==============================================================================
--- sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/AuthConstants.java
(original)
+++ sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/AuthConstants.java
Wed Jan 11 17:06:32 2012
@@ -79,8 +79,9 @@ public final class AuthConstants {
 
     /**
      * The topic for the OSGi event which is sent when a user has logged in successfully.
-     * The event contains at least the {@link org.apache.sling.api.SlingConstants#PROPERTY_USERID},
-     * and {@link #PROPERTY_AUTH_HANDLER_CLASS} properties.
+     * The event contains at least the {@link org.apache.sling.api.SlingConstants#PROPERTY_USERID}
+     * and the {@link org.apache.sling.auth.core.spi.AuthenticationInfo#AUTH_TYPE}
+     * properties.
      */
     public static final String TOPIC_LOGIN = "org/apache/sling/auth/core/Authenticator/LOGIN";
 
@@ -91,11 +92,6 @@ public final class AuthConstants {
      */
     public static final String TOPIC_LOGOUT = "org/apache/sling/auth/core/Authenticator/LOGOUT";
 
-    /**
-     * The name of the event property holding the authentication handler class name.
-     */
-    public static final String PROPERTY_AUTH_HANDLER_CLASS = "authHandlerClassName";
-
     private AuthConstants() {
     }
 

Modified: sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AbstractAuthenticationHandlerHolder.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AbstractAuthenticationHandlerHolder.java?rev=1230154&r1=1230153&r2=1230154&view=diff
==============================================================================
--- sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AbstractAuthenticationHandlerHolder.java
(original)
+++ sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AbstractAuthenticationHandlerHolder.java
Wed Jan 11 17:06:32 2012
@@ -153,13 +153,6 @@ public abstract class AbstractAuthentica
     protected abstract void doDropCredentials(HttpServletRequest request,
             HttpServletResponse response) throws IOException;
 
-    /**
-     * Return the held handler.
-     * 
-     * @return the held handler
-     */
-    protected abstract Object getHandler();
-
     // ---------- internal
 
     /**

Modified: sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AuthenticationHandlerHolder.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AuthenticationHandlerHolder.java?rev=1230154&r1=1230153&r2=1230154&view=diff
==============================================================================
--- sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AuthenticationHandlerHolder.java
(original)
+++ sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/AuthenticationHandlerHolder.java
Wed Jan 11 17:06:32 2012
@@ -148,9 +148,4 @@ final class AuthenticationHandlerHolder 
         final String requestLogin = AuthUtil.getAttributeOrParameter(request, REQUEST_LOGIN_PARAMETER,
null);
         return requestLogin == null || authType.equals(requestLogin);
     }
-
-    @Override
-    protected AuthenticationHandler getHandler() {
-        return handler;
-    }
 }
\ No newline at end of file

Modified: sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java?rev=1230154&r1=1230153&r2=1230154&view=diff
==============================================================================
--- sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java
(original)
+++ sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java
Wed Jan 11 17:06:32 2012
@@ -196,14 +196,6 @@ public class SlingAuthenticator implemen
      */
     private static final String ATTR_RESOURCE_RESOLVER_SKIP_CLOSE = "org.apache.sling.api.resource.ResourceResolver.skip.close";
 
-    /**
-     * The name of the {@link AuthenticationInfo} property providing the
-     * handler which extracted the credentials. May be an instance of either
-     * {@link org.apache.sling.auth.core.spi.AuthenticationHandler} or
-     * {@link org.apache.sling.auth.sling.engine.auth.AuthenticationHandler}
-     */
-    private static final String AUTH_INFO_PROP_AUTHENTICATION_HANDLER = "$$sling.auth.AuthenticationHandler$$";
-
     @Reference
     private ResourceResolverFactory resourceResolverFactory;
 
@@ -706,9 +698,6 @@ public class SlingAuthenticator implemen
                             request, response);
 
                         if (authInfo != null) {
-                            authInfo.put(AUTH_INFO_PROP_AUTHENTICATION_HANDLER,
-                                holder.getHandler());
-
                             // add the feedback handler to the info (may be null)
                             authInfo.put(AUTH_INFO_PROP_FEEDBACK_HANDLER,
                                 holder.getFeedbackHandler());
@@ -1372,7 +1361,7 @@ public class SlingAuthenticator implemen
     private void postLoginEvent(final AuthenticationInfo authInfo) {
         final Dictionary<String, Object> properties = new Hashtable<String, Object>();
         properties.put(SlingConstants.PROPERTY_USERID, authInfo.getUser());
-        properties.put(AuthConstants.PROPERTY_AUTH_HANDLER_CLASS, authInfo.get(AUTH_INFO_PROP_AUTHENTICATION_HANDLER).getClass().getName());
+        properties.put(AuthenticationInfo.AUTH_TYPE, authInfo.getAuthType());
 
         EventAdmin localEA = this.eventAdmin;
         if (localEA != null) {

Modified: sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/engine/EngineAuthenticationHandlerHolder.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/engine/EngineAuthenticationHandlerHolder.java?rev=1230154&r1=1230153&r2=1230154&view=diff
==============================================================================
--- sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/engine/EngineAuthenticationHandlerHolder.java
(original)
+++ sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/engine/EngineAuthenticationHandlerHolder.java
Wed Jan 11 17:06:32 2012
@@ -105,11 +105,6 @@ public final class EngineAuthenticationH
     }
 
     @Override
-    protected AuthenticationHandler getHandler() {
-        return handler;
-    }
-
-    @Override
     public String toString() {
         return handler.toString() + " (Legacy API Handler)";
     }



Mime
View raw message