Skip to content

Commit

Permalink
[cleanup][proxy] Remove unused AuthenticationDataSource variable (apa…
Browse files Browse the repository at this point in the history
…che#19278)

### Motivation

The `AuthenticationDataSource` variable was added to the `ProxyConnection` class in apache#1200. It is no longer needed.

Note that we store this variable in the `ServerCnx` because it is used for authorization. Because we do not do authorization in the proxy, we don't need it.

### Modifications

* Remove unused variable

### Verifying this change

This is a trivial change.

### Does this pull request potentially affect one of the following parts:

The only conceivable way this is a breaking change is if a third party implementation implemented their library so that `authState.getAuthDataSource()` has a side effect.

### Documentation

- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->

No docs needed.

(cherry picked from commit a9b6519)
  • Loading branch information
michaeljmarshall committed Apr 19, 2023
1 parent 9645bc4 commit 7b7ee93
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import javax.net.ssl.SSLSession;
import lombok.Getter;
import org.apache.pulsar.broker.PulsarServerException;
import org.apache.pulsar.broker.authentication.AuthenticationDataSource;
import org.apache.pulsar.broker.authentication.AuthenticationProvider;
import org.apache.pulsar.broker.authentication.AuthenticationState;
import org.apache.pulsar.client.api.Authentication;
Expand Down Expand Up @@ -82,7 +81,6 @@ public class ProxyConnection extends PulsarHandler {
new AtomicLong(ThreadLocalRandom.current().nextLong(0, Long.MAX_VALUE / 2));
private final ProxyService service;
private final DnsAddressResolverGroup dnsAddressResolverGroup;
AuthenticationDataSource authenticationData;
private State state;

private LookupProxyHandler lookupProxyHandler = null;
Expand Down Expand Up @@ -480,7 +478,6 @@ remoteAddress, protocolVersionToAdvertise, getRemoteEndpointProtocolVersion(),
}

authState = authenticationProvider.newAuthState(clientData, remoteAddress, sslSession);
authenticationData = authState.getAuthDataSource();
doAuthentication(clientData);
} catch (Exception e) {
LOG.warn("[{}] Unable to authenticate: ", remoteAddress, e);
Expand Down

0 comments on commit 7b7ee93

Please sign in to comment.