Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AuthToken rotation and session auth support API GA #1495

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions driver/src/main/java/org/neo4j/driver/AuthToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 <em>user name</em> and <em>password</em>.
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}.
Expand Down
2 changes: 0 additions & 2 deletions driver/src/main/java/org/neo4j/driver/AuthTokenManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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}.
Expand Down
2 changes: 0 additions & 2 deletions driver/src/main/java/org/neo4j/driver/AuthTokenManagers.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

Expand Down
3 changes: 0 additions & 3 deletions driver/src/main/java/org/neo4j/driver/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -174,7 +173,6 @@ default <T extends BaseSession> T session(Class<T> sessionClass) {
* @throws IllegalArgumentException for unsupported session types
* @since 5.8
*/
@Preview(name = "AuthToken rotation and session auth support")
@SuppressWarnings("deprecation")
default <T extends BaseSession> T session(Class<T> sessionClass, AuthToken sessionAuthToken) {
return session(sessionClass, SessionConfig.defaultConfig(), sessionAuthToken);
Expand Down Expand Up @@ -247,7 +245,6 @@ default <T extends BaseSession> T session(Class<T> sessionClass, SessionConfig s
* @throws IllegalArgumentException for unsupported session types
* @since 5.8
*/
@Preview(name = "AuthToken rotation and session auth support")
@SuppressWarnings("deprecation")
<T extends BaseSession> T session(Class<T> sessionClass, SessionConfig sessionConfig, AuthToken sessionAuthToken);

Expand Down
5 changes: 0 additions & 5 deletions driver/src/main/java/org/neo4j/driver/GraphDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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());
}
Expand All @@ -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);
}
Expand All @@ -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());
}
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -35,7 +34,6 @@
* </ul>
* @since 5.8
*/
@Preview(name = "AuthToken rotation and session auth support")
public class AuthTokenManagerExecutionException extends ClientException {
@Serial
private static final long serialVersionUID = -5964665406806723214L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down