Author: cziegeler
Date: Fri Sep 20 08:28:30 2013
New Revision: 1524939
URL: http://svn.apache.org/r1524939
Log:
SLING-3079 : Move constant for "sling.auth.requirements" to AuthConstants
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/SlingAuthenticator.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=1524939&r1=1524938&r2=1524939&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
Fri Sep 20 08:28:30 2013
@@ -18,6 +18,9 @@
*/
package org.apache.sling.auth.core;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
/**
* The <code>AuthConstants</code> provides a collection of constants used to
* configure and customize the Sling authentication infrastructure.
@@ -99,6 +102,16 @@ public final class AuthConstants {
*/
public static final String TOPIC_LOGIN =
"org/apache/sling/auth/core/Authenticator/LOGIN";
+ /**
+ * Any OSGi service may provide a sling.auth.requirements registration
property which is used
+ * to dynamically extend the authentication requirements from the
Authentication Requirements
+ * configuration. This may for example be set by AuthenticationHandler
implementations providing
+ * a login form to ensure access to the login form does not require
authentication. The value
+ * of this property is a single string, an array of strings or a
Collection of strings and is
+ * formatted in the same way as the Authentication Requirements
configuration property.
+ */
+ public static final String AUTH_REQUIREMENTS = "sling.auth.requirements";
+
private AuthConstants() {
}
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=1524939&r1=1524938&r2=1524939&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
Fri Sep 20 08:28:30 2013
@@ -118,7 +118,7 @@ public class SlingAuthenticator implemen
public static final String PAR_ANONYMOUS_ALLOWED = "auth.annonymous";
@Property(cardinality = 2147483647)
- private static final String PAR_AUTH_REQ = "sling.auth.requirements";
+ private static final String PAR_AUTH_REQ = AuthConstants.AUTH_REQUIREMENTS;
@Property()
private static final String PAR_ANONYMOUS_USER =
"sling.auth.anonymous.user";
@@ -1457,7 +1457,7 @@ public class SlingAuthenticator implemen
SlingAuthenticatorServiceListener listener = new
SlingAuthenticatorServiceListener(
authenticator);
try {
- final String filter = "(" + PAR_AUTH_REQ + "=*)";
+ final String filter = "(" + AuthConstants.AUTH_REQUIREMENTS +
"=*)";
context.addServiceListener(listener, filter);
ServiceReference[] refs = context.getAllServiceReferences(null,
filter);