You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2023/08/07 07:48:49 UTC
[GitHub] [pulsar] tisonkun commented on a diff in pull request #20860: [improve][sql] Support add pulsar admin JWT token
tisonkun commented on code in PR #20860:
URL: https://github.com/apache/pulsar/pull/20860#discussion_r1285506796
##########
pulsar-sql/presto-pulsar/src/main/java/org/apache/pulsar/sql/presto/PulsarConnectorConfig.java:
##########
@@ -500,10 +513,19 @@ public PulsarAdmin getPulsarAdmin() throws PulsarClientException {
if (this.pulsarAdmin == null) {
PulsarAdminBuilder builder = PulsarAdmin.builder();
+ if (getAuthPlugin() != null && getAuthToken() != null) {
+ throw new IllegalArgumentException("Either pulsar.auth-plugin or pulsar.auth-token can be used,"
+ + " but not both at the same time");
+ }
+
if (getAuthPlugin() != null) {
builder.authentication(getAuthPlugin(), getAuthParams());
}
+ if (getAuthToken() != null){
Review Comment:
```suggestion
if (getAuthToken() != null) {
```
You may checkstyle locally with `mvn checkstyle:check`.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org