From e2f7d57d8a18b9bae369ac94b161c288bdee37e7 Mon Sep 17 00:00:00 2001 From: Dmitriy Tverdiakov Date: Tue, 24 Oct 2023 14:54:21 +0100 Subject: [PATCH] Make AuthToken rotation and session auth support API GA This update promotes the AuthToken rotation and session auth support API from preview to GA status. --- driver/src/main/java/org/neo4j/driver/AuthToken.java | 2 -- .../main/java/org/neo4j/driver/AuthTokenAndExpiration.java | 2 -- driver/src/main/java/org/neo4j/driver/AuthTokenManager.java | 2 -- driver/src/main/java/org/neo4j/driver/AuthTokenManagers.java | 2 -- driver/src/main/java/org/neo4j/driver/Driver.java | 3 --- driver/src/main/java/org/neo4j/driver/GraphDatabase.java | 5 ----- .../exceptions/AuthTokenManagerExecutionException.java | 2 -- .../neo4j/driver/exceptions/SecurityRetryableException.java | 2 -- 8 files changed, 20 deletions(-) diff --git a/driver/src/main/java/org/neo4j/driver/AuthToken.java b/driver/src/main/java/org/neo4j/driver/AuthToken.java index 038529e3ba..7af176a594 100644 --- a/driver/src/main/java/org/neo4j/driver/AuthToken.java +++ b/driver/src/main/java/org/neo4j/driver/AuthToken.java @@ -21,7 +21,6 @@ import java.util.function.Supplier; import org.neo4j.driver.internal.security.InternalAuthToken; import org.neo4j.driver.internal.security.InternalAuthTokenAndExpiration; -import org.neo4j.driver.util.Preview; /** * Token for holding authentication details, such as user name and password. @@ -45,7 +44,6 @@ public sealed interface AuthToken permits InternalAuthToken { * @see AuthTokenManagers#bearer(Supplier) * @see AuthTokenManagers#bearerAsync(Supplier) */ - @Preview(name = "AuthToken rotation and session auth support") default AuthTokenAndExpiration expiringAt(long utcExpirationTimestamp) { return new InternalAuthTokenAndExpiration(this, utcExpirationTimestamp); } diff --git a/driver/src/main/java/org/neo4j/driver/AuthTokenAndExpiration.java b/driver/src/main/java/org/neo4j/driver/AuthTokenAndExpiration.java index 0fde6bf14e..6dfb3554d2 100644 --- a/driver/src/main/java/org/neo4j/driver/AuthTokenAndExpiration.java +++ b/driver/src/main/java/org/neo4j/driver/AuthTokenAndExpiration.java @@ -20,7 +20,6 @@ import java.util.function.Supplier; import org.neo4j.driver.internal.security.InternalAuthTokenAndExpiration; -import org.neo4j.driver.util.Preview; /** * A container used by the expiration based {@link AuthTokenManager} implementation provided by the driver, it contains an @@ -33,7 +32,6 @@ * @see AuthTokenManagers#bearer(Supplier) * @see AuthTokenManagers#bearerAsync(Supplier) */ -@Preview(name = "AuthToken rotation and session auth support") public sealed interface AuthTokenAndExpiration permits InternalAuthTokenAndExpiration { /** * Returns the {@link AuthToken}. diff --git a/driver/src/main/java/org/neo4j/driver/AuthTokenManager.java b/driver/src/main/java/org/neo4j/driver/AuthTokenManager.java index 6eee414deb..ac31ab7b84 100644 --- a/driver/src/main/java/org/neo4j/driver/AuthTokenManager.java +++ b/driver/src/main/java/org/neo4j/driver/AuthTokenManager.java @@ -22,7 +22,6 @@ import org.neo4j.driver.exceptions.AuthTokenManagerExecutionException; import org.neo4j.driver.exceptions.SecurityException; import org.neo4j.driver.exceptions.SecurityRetryableException; -import org.neo4j.driver.util.Preview; /** * A manager of {@link AuthToken} instances used by the driver. @@ -43,7 +42,6 @@ * be done on the calling thread. * @since 5.8 */ -@Preview(name = "AuthToken rotation and session auth support") public interface AuthTokenManager { /** * Returns a {@link CompletionStage} for a valid {@link AuthToken}. diff --git a/driver/src/main/java/org/neo4j/driver/AuthTokenManagers.java b/driver/src/main/java/org/neo4j/driver/AuthTokenManagers.java index d8e23189e2..b1f7dbb32a 100644 --- a/driver/src/main/java/org/neo4j/driver/AuthTokenManagers.java +++ b/driver/src/main/java/org/neo4j/driver/AuthTokenManagers.java @@ -30,14 +30,12 @@ import org.neo4j.driver.exceptions.SecurityException; import org.neo4j.driver.exceptions.TokenExpiredException; import org.neo4j.driver.internal.security.ExpirationBasedAuthTokenManager; -import org.neo4j.driver.util.Preview; /** * Implementations of {@link AuthTokenManager}. * * @since 5.8 */ -@Preview(name = "AuthToken rotation and session auth support") public final class AuthTokenManagers { private AuthTokenManagers() {} diff --git a/driver/src/main/java/org/neo4j/driver/Driver.java b/driver/src/main/java/org/neo4j/driver/Driver.java index 1d477969f0..92a421904c 100644 --- a/driver/src/main/java/org/neo4j/driver/Driver.java +++ b/driver/src/main/java/org/neo4j/driver/Driver.java @@ -25,7 +25,6 @@ import org.neo4j.driver.reactive.RxSession; import org.neo4j.driver.types.TypeSystem; import org.neo4j.driver.util.Experimental; -import org.neo4j.driver.util.Preview; /** * Accessor for a specific Neo4j graph database. @@ -174,7 +173,6 @@ default T session(Class sessionClass) { * @throws IllegalArgumentException for unsupported session types * @since 5.8 */ - @Preview(name = "AuthToken rotation and session auth support") @SuppressWarnings("deprecation") default T session(Class sessionClass, AuthToken sessionAuthToken) { return session(sessionClass, SessionConfig.defaultConfig(), sessionAuthToken); @@ -247,7 +245,6 @@ default T session(Class sessionClass, SessionConfig s * @throws IllegalArgumentException for unsupported session types * @since 5.8 */ - @Preview(name = "AuthToken rotation and session auth support") @SuppressWarnings("deprecation") T session(Class sessionClass, SessionConfig sessionConfig, AuthToken sessionAuthToken); diff --git a/driver/src/main/java/org/neo4j/driver/GraphDatabase.java b/driver/src/main/java/org/neo4j/driver/GraphDatabase.java index 1519d2c94d..a936336acb 100644 --- a/driver/src/main/java/org/neo4j/driver/GraphDatabase.java +++ b/driver/src/main/java/org/neo4j/driver/GraphDatabase.java @@ -24,7 +24,6 @@ import org.neo4j.driver.internal.DriverFactory; import org.neo4j.driver.internal.security.StaticAuthTokenManager; import org.neo4j.driver.internal.security.ValidatingAuthTokenManager; -import org.neo4j.driver.util.Preview; /** * Creates {@link Driver drivers}, optionally letting you {@link #driver(URI, Config)} to configure them. @@ -135,7 +134,6 @@ public static Driver driver(URI uri, AuthToken authToken, Config config) { * @since 5.8 * @see AuthTokenManager */ - @Preview(name = "AuthToken rotation and session auth support") public static Driver driver(URI uri, AuthTokenManager authTokenManager) { return driver(uri, authTokenManager, Config.defaultConfig()); } @@ -150,7 +148,6 @@ public static Driver driver(URI uri, AuthTokenManager authTokenManager) { * @since 5.8 * @see AuthTokenManager */ - @Preview(name = "AuthToken rotation and session auth support") public static Driver driver(String uri, AuthTokenManager authTokenManager) { return driver(URI.create(uri), authTokenManager); } @@ -165,7 +162,6 @@ public static Driver driver(String uri, AuthTokenManager authTokenManager) { * @since 5.8 * @see AuthTokenManager */ - @Preview(name = "AuthToken rotation and session auth support") public static Driver driver(URI uri, AuthTokenManager authTokenManager, Config config) { return driver(uri, authTokenManager, config, new DriverFactory()); } @@ -180,7 +176,6 @@ public static Driver driver(URI uri, AuthTokenManager authTokenManager, Config c * @since 5.8 * @see AuthTokenManager */ - @Preview(name = "AuthToken rotation and session auth support") public static Driver driver(String uri, AuthTokenManager authTokenManager, Config config) { return driver(URI.create(uri), authTokenManager, config); } diff --git a/driver/src/main/java/org/neo4j/driver/exceptions/AuthTokenManagerExecutionException.java b/driver/src/main/java/org/neo4j/driver/exceptions/AuthTokenManagerExecutionException.java index 7e5207954b..833f98d190 100644 --- a/driver/src/main/java/org/neo4j/driver/exceptions/AuthTokenManagerExecutionException.java +++ b/driver/src/main/java/org/neo4j/driver/exceptions/AuthTokenManagerExecutionException.java @@ -20,7 +20,6 @@ import java.io.Serial; import org.neo4j.driver.AuthTokenManager; -import org.neo4j.driver.util.Preview; /** * The {@link org.neo4j.driver.AuthTokenManager} execution has lead to an unexpected result. @@ -35,7 +34,6 @@ * * @since 5.8 */ -@Preview(name = "AuthToken rotation and session auth support") public class AuthTokenManagerExecutionException extends ClientException { @Serial private static final long serialVersionUID = -5964665406806723214L; diff --git a/driver/src/main/java/org/neo4j/driver/exceptions/SecurityRetryableException.java b/driver/src/main/java/org/neo4j/driver/exceptions/SecurityRetryableException.java index afbd2b0370..e999e190e1 100644 --- a/driver/src/main/java/org/neo4j/driver/exceptions/SecurityRetryableException.java +++ b/driver/src/main/java/org/neo4j/driver/exceptions/SecurityRetryableException.java @@ -22,7 +22,6 @@ import java.util.Objects; import org.neo4j.driver.AuthToken; import org.neo4j.driver.util.Experimental; -import org.neo4j.driver.util.Preview; /** * Indicates that the contained {@link SecurityException} is a {@link RetryableException}, which is determined by the @@ -34,7 +33,6 @@ * * @since 5.12 */ -@Preview(name = "AuthToken rotation and session auth support") public class SecurityRetryableException extends SecurityException implements RetryableException { @Serial private static final long serialVersionUID = 3914900631374208080L;