incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1346876 - in /sling/trunk/bundles/auth/core/src: main/java/org/apache/sling/auth/core/spi/AuthenticationInfo.java main/java/org/apache/sling/auth/core/spi/package-info.java test/java/org/apache/sling/auth/core/spi/AuthenticationInfoTest.java
Date Wed, 06 Jun 2012 13:13:44 GMT
Author: justin
Date: Wed Jun  6 13:13:43 2012
New Revision: 1346876

URL: http://svn.apache.org/viewvc?rev=1346876&view=rev
Log:
Revert "SLING-2441 - allowing put(AUTH_TYPE, null) in AuthenticationInfo. Bumping export version
as it is an API change."

This reverts r1304352

Modified:
    sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/AuthenticationInfo.java
    sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/package-info.java
    sling/trunk/bundles/auth/core/src/test/java/org/apache/sling/auth/core/spi/AuthenticationInfoTest.java

Modified: sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/AuthenticationInfo.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/AuthenticationInfo.java?rev=1346876&r1=1346875&r2=1346876&view=diff
==============================================================================
--- sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/AuthenticationInfo.java
(original)
+++ sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/AuthenticationInfo.java
Wed Jun  6 13:13:43 2012
@@ -82,8 +82,7 @@ public class AuthenticationInfo extends 
      * effectively use this instance the user Id with optional password and/or
      * the credentials should be set.
      *
-     * @param authType The authentication type.  Can be <code>null</code> to
-     *                 indicate anonymous access.
+     * @param authType The authentication type, must not be <code>null</code>.
      */
     public AuthenticationInfo(final String authType) {
         this(authType, null, null);
@@ -133,7 +132,7 @@ public class AuthenticationInfo extends 
 
     /**
      * Returns the authentication type stored as the {@link #AUTH_TYPE} property
-     * in this map.
+     * in this map. This value is expected to never be <code>null</code>.
      * <p>
      * If authentication is taking place through one of the standard ways, such
      * as Basic or Digest, the return value is one of the predefined constants
@@ -210,7 +209,7 @@ public class AuthenticationInfo extends 
     @Override
     public Object put(final String key, final Object value) {
 
-        if (AUTH_TYPE.equals(key) && !(value == null || value instanceof String))
{
+        if (AUTH_TYPE.equals(key) && !(value instanceof String)) {
             throw new IllegalArgumentException(AUTH_TYPE
                 + " property must be a String");
         }

Modified: sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/package-info.java?rev=1346876&r1=1346875&r2=1346876&view=diff
==============================================================================
--- sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/package-info.java
(original)
+++ sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/package-info.java
Wed Jun  6 13:13:43 2012
@@ -28,7 +28,7 @@
  *
  * @version 1.0.4
  */
-@Version("1.1.0")
+@Version("1.0.4")
 package org.apache.sling.auth.core.spi;
 
 import aQute.bnd.annotation.Version;

Modified: sling/trunk/bundles/auth/core/src/test/java/org/apache/sling/auth/core/spi/AuthenticationInfoTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/auth/core/src/test/java/org/apache/sling/auth/core/spi/AuthenticationInfoTest.java?rev=1346876&r1=1346875&r2=1346876&view=diff
==============================================================================
--- sling/trunk/bundles/auth/core/src/test/java/org/apache/sling/auth/core/spi/AuthenticationInfoTest.java
(original)
+++ sling/trunk/bundles/auth/core/src/test/java/org/apache/sling/auth/core/spi/AuthenticationInfoTest.java
Wed Jun  6 13:13:43 2012
@@ -241,7 +241,7 @@ public class AuthenticationInfoTest {
         info.put(CREDENTIALS,
                 new SimpleCredentials("user", new char[2]));
 
-        test_put_success(info, AuthenticationInfo.AUTH_TYPE, null);
+        test_put_fail(info, AuthenticationInfo.AUTH_TYPE, null);
         test_put_fail(info, ResourceResolverFactory.USER, null);
         test_put_fail(info, ResourceResolverFactory.PASSWORD, null);
 



Mime
View raw message