|
31 | 31 | import java.net.SocketAddress;
|
32 | 32 | import java.time.Clock;
|
33 | 33 | import org.neo4j.driver.AuthToken;
|
34 |
| -import org.neo4j.driver.AuthTokens; |
35 | 34 | import org.neo4j.driver.Logging;
|
36 |
| -import org.neo4j.driver.exceptions.ClientException; |
37 | 35 | import org.neo4j.driver.internal.BoltServerAddress;
|
38 | 36 | import org.neo4j.driver.internal.ConnectionSettings;
|
39 | 37 | import org.neo4j.driver.internal.DomainNameResolver;
|
40 | 38 | import org.neo4j.driver.internal.async.inbound.ConnectTimeoutHandler;
|
41 | 39 | import org.neo4j.driver.internal.cluster.RoutingContext;
|
42 |
| -import org.neo4j.driver.internal.security.InternalAuthToken; |
43 | 40 | import org.neo4j.driver.internal.security.SecurityPlan;
|
44 | 41 |
|
45 | 42 | public class ChannelConnectorImpl implements ChannelConnector {
|
@@ -80,7 +77,7 @@ public ChannelConnectorImpl(
|
80 | 77 | RoutingContext routingContext,
|
81 | 78 | DomainNameResolver domainNameResolver) {
|
82 | 79 | this.userAgent = connectionSettings.userAgent();
|
83 |
| - this.authToken = requireValidAuthToken(connectionSettings.authToken()); |
| 80 | + this.authToken = connectionSettings.authToken(); |
84 | 81 | this.routingContext = routingContext;
|
85 | 82 | this.connectTimeoutMillis = connectionSettings.connectTimeoutMillis();
|
86 | 83 | this.securityPlan = requireNonNull(securityPlan);
|
@@ -143,13 +140,4 @@ private void installHandshakeCompletedListeners(
|
143 | 140 | handshakeCompleted.addListener(
|
144 | 141 | new HandshakeCompletedListener(userAgent, authToken, routingContext, connectionInitialized));
|
145 | 142 | }
|
146 |
| - |
147 |
| - private static AuthToken requireValidAuthToken(AuthToken token) { |
148 |
| - if (token instanceof InternalAuthToken) { |
149 |
| - return token; |
150 |
| - } else { |
151 |
| - throw new ClientException("Unknown authentication token, `" + token + "`. Please use one of the supported " |
152 |
| - + "tokens from `" + AuthTokens.class.getSimpleName() + "`."); |
153 |
| - } |
154 |
| - } |
155 | 143 | }
|
0 commit comments