This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch SLING-12885
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-auth-core.git
The following commit(s) were added to refs/heads/SLING-12885 by this push:
new 594b5df SLING-12885 : AuthenticationHandler.FAILURE_REASON_CODES is
deprecated with no non-deprecated replacement
594b5df is described below
commit 594b5dfe63daacdb1d45fdbf64bca90eff7b5efe
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Thu Aug 14 07:09:00 2025 +0200
SLING-12885 : AuthenticationHandler.FAILURE_REASON_CODES is deprecated with
no non-deprecated replacement
---
.../sling/auth/core/spi/AuthenticationHandler.java | 30 +++++++++++++++++-----
.../apache/sling/auth/core/spi/package-info.java | 4 +--
2 files changed, 25 insertions(+), 9 deletions(-)
diff --git
a/src/main/java/org/apache/sling/auth/core/spi/AuthenticationHandler.java
b/src/main/java/org/apache/sling/auth/core/spi/AuthenticationHandler.java
index d0b59f6..cd1e9ef 100644
--- a/src/main/java/org/apache/sling/auth/core/spi/AuthenticationHandler.java
+++ b/src/main/java/org/apache/sling/auth/core/spi/AuthenticationHandler.java
@@ -23,23 +23,27 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
-import aQute.bnd.annotation.baseline.BaselineIgnore;
import org.osgi.annotation.versioning.ConsumerType;
/**
* The <code>AuthenticationHandler</code> interface defines the service API
used
* by the authentication implementation to support plugin various ways of
* extracting credentials from the request.
- * @deprecated Use {@link JakartaAuthenticationHandler} instead
+ * <blockquote>
+ * <strong>Important:</strong> This interface is deprecated. Use {@link
JakartaAuthenticationHandler} instead.
+ * This interface is not directly marked as deprecated as the inner enum
+ * {@link AuthenticationHandler.FAILURE_REASON_CODES} is not deprecated!
+ * </blockquote>
*/
-@Deprecated
@ConsumerType
public interface AuthenticationHandler {
/**
* The name under which an implementation of this interface must be
* registered to be used as an authentication handler.
+ * @deprecated Use {@link JakartaAuthenticationHandler}
*/
+ @Deprecated
static final String SERVICE_NAME =
"org.apache.sling.auth.core.spi.AuthenticationHandler";
/**
@@ -54,7 +58,9 @@ public interface AuthenticationHandler {
* <p>
* Authentication handlers without a <code>path</code> service registration
* property are ignored.
+ * @deprecated Use {@link JakartaAuthenticationHandler}
*/
+ @Deprecated
static final String PATH_PROPERTY = "path";
/**
@@ -71,7 +77,9 @@ public interface AuthenticationHandler {
* method.
*
* @see #REQUEST_LOGIN_PARAMETER
+ * @deprecated Use {@link JakartaAuthenticationHandler}
*/
+ @Deprecated
static final String TYPE_PROPERTY = "authtype";
/**
@@ -82,7 +90,9 @@ public interface AuthenticationHandler {
*
* @see #requestCredentials(HttpServletRequest, HttpServletResponse)
* @see #TYPE_PROPERTY
+ * @deprecated Use {@link JakartaAuthenticationHandler}
*/
+ @Deprecated
static final String REQUEST_LOGIN_PARAMETER = "sling:authRequestLogin";
/**
@@ -95,7 +105,9 @@ public interface AuthenticationHandler {
*
* @see #extractCredentials(HttpServletRequest, HttpServletResponse)
* @since 1.0.2 (Bundle version 1.0.4)
+ * @deprecated Use {@link JakartaAuthenticationHandler}
*/
+ @Deprecated
static final String FAILURE_REASON = "j_reason";
/**
@@ -108,7 +120,9 @@ public interface AuthenticationHandler {
*
* @see #extractCredentials(HttpServletRequest, HttpServletResponse)
* @since 1.1.0
+ * @deprecated Use {@link JakartaAuthenticationHandler}
*/
+ @Deprecated
static final String FAILURE_REASON_CODE = "j_reason_code";
/**
@@ -123,10 +137,6 @@ public interface AuthenticationHandler {
* </ul>
* @since 1.1.0
*/
- // When adding a new field to the enum bnd will require a minor version
bump
- // That's unfortunately too much for an SPI package and should really have
no impact
- // on implementors since the enum values are not exposed from any public
API
- @BaselineIgnore("1.2.3")
enum FAILURE_REASON_CODES {
/** Login is invald */
INVALID_LOGIN,
@@ -206,7 +216,9 @@ public interface AuthenticationHandler {
* null if the request does not contain authentication information.
* In case of {@link AuthenticationInfo#DOING_AUTH}, the method
must
* have sent a response indicating that fact to the client.
+ * @deprecated Use {@link JakartaAuthenticationHandler}
*/
+ @Deprecated
AuthenticationInfo extractCredentials(HttpServletRequest request,
HttpServletResponse response);
/**
@@ -244,7 +256,9 @@ public interface AuthenticationHandler {
* inquiry for the given request. <code>false</code> otherwise.
* @throws IOException If an error occurs sending the authentication
* inquiry to the client.
+ * @deprecated Use {@link JakartaAuthenticationHandler}
*/
+ @Deprecated
boolean requestCredentials(HttpServletRequest request, HttpServletResponse
response) throws IOException;
/**
@@ -255,6 +269,8 @@ public interface AuthenticationHandler {
* @param response The response object to which to send the request.
* @throws IOException If an error occurs asking the client to drop any
* authentication traces.
+ * @deprecated Use {@link JakartaAuthenticationHandler}
*/
+ @Deprecated
void dropCredentials(HttpServletRequest request, HttpServletResponse
response) throws IOException;
}
diff --git a/src/main/java/org/apache/sling/auth/core/spi/package-info.java
b/src/main/java/org/apache/sling/auth/core/spi/package-info.java
index 5b1bae8..d8cf23e 100755
--- a/src/main/java/org/apache/sling/auth/core/spi/package-info.java
+++ b/src/main/java/org/apache/sling/auth/core/spi/package-info.java
@@ -26,7 +26,7 @@
* being an abstract base implementation from which concrete
* implementations may inherit.
*
- * @version 1.3.0
+ * @version 1.3.1
*/
[email protected]("1.3.0")
[email protected]("1.3.1")
package org.apache.sling.auth.core.spi;