cbornet commented on code in PR #18358:
URL: https://github.com/apache/pulsar/pull/18358#discussion_r1027814683
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java:
##########
@@ -367,16 +370,49 @@ public class ClientConfigurationData implements
Serializable, Cloneable {
@Secret
private String socks5ProxyPassword;
+ /**
+ * Gets the authentication settings for the client.
+ * <p>
+ * If the authentication has not been specified an attempt is made to
determine one using auth-related
+ * properties. In this case, the {@code authPluginClassName} and one of
{@code authParams} or {@code authParamMap}
+ * must be configured for the authentication to be determined. Otherwise,
a default of
+ * {@link AuthenticationDisabled} is returned.
+ *
+ * @return authentication settings for the client
+ */
public Authentication getAuthentication() {
if (authentication == null) {
- this.authentication = AuthenticationDisabled.INSTANCE;
+ setAuthenticationFromPropsIfAvailable();
Review Comment:
I agree with @eolivelli that a getter should not mutate state. Maybe the
logic can be moved to the setters ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]