You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/01/12 09:33:47 UTC

[GitHub] [pulsar] WalterMa opened a new issue #9187: Token authentication not support JSON type auth params as described in doc

WalterMa opened a new issue #9187:
URL: https://github.com/apache/pulsar/issues/9187


   **Describe the bug**
   https://pulsar.apache.org/docs/en/security-jwt/#enable-token-authentication-on-brokers
   In the official doc, token auth params are configured in JSON type, like:
   ```properties
   brokerClientAuthenticationPlugin=org.apache.pulsar.client.impl.auth.AuthenticationToken
   brokerClientAuthenticationParameters={"token":"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0LXVzZXIifQ.9OHgE9ZUDeBTZs7nSMEFIuGNEX18FLR3qvy8mqxSxXw"}
   ```
   
   While in `org.apache.pulsar.client.impl.auth.AuthenticationToken`, it does not support JSON type auth params:
   ```java
    @Override
       public void configure(String encodedAuthParamString) {
           // Interpret the whole param string as the token. If the string contains the notation `token:xxxxx` then strip
           // the prefix
           if (encodedAuthParamString.startsWith("token:")) {
               this.tokenSupplier = () -> encodedAuthParamString.substring("token:".length());
           } else if (encodedAuthParamString.startsWith("file:")) {
               // Read token from a file
               URI filePath = URI.create(encodedAuthParamString);
               this.tokenSupplier = () -> {
                   try {
                       return new String(Files.readAllBytes(Paths.get(filePath)), Charsets.UTF_8).trim();
                   } catch (IOException e) {
                       throw new RuntimeException("Failed to read token from file", e);
                   }
               };
           } else {
               this.tokenSupplier = () -> encodedAuthParamString;
           }
       }
   ```
   As well as in its test class: `org.apache.pulsar.client.impl.auth.AuthenticationTokenTest`.
   
   **Expected behavior**
   The related doc is changed in https://github.com/apache/pulsar/issues/8872 by PR https://github.com/apache/pulsar/pull/8920
   I'm not sure it's belong to **doc bug or code bug.**
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] Jennifer88huang commented on issue #9187: Token authentication not support JSON type auth params as described in doc

Posted by GitBox <gi...@apache.org>.
Jennifer88huang commented on issue #9187:
URL: https://github.com/apache/pulsar/issues/9187#issuecomment-759854242


   @WalterMa thank you for your feedback. JSON type is supported by token auth.
   Maybe we should sync the code changes with the doc change. cc @sijie @codelipenghui @freeznet


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] Anonymitaet removed a comment on issue #9187: Token authentication not support JSON type auth params as described in doc

Posted by GitBox <gi...@apache.org>.
Anonymitaet removed a comment on issue #9187:
URL: https://github.com/apache/pulsar/issues/9187#issuecomment-763550949


   As confirmed in last week's meeting, this issue is related to code rather than doc, correct? @jiazhai 


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui closed issue #9187: Token authentication not support JSON type auth params as described in doc

Posted by GitBox <gi...@apache.org>.
codelipenghui closed issue #9187:
URL: https://github.com/apache/pulsar/issues/9187


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on issue #9187: Token authentication not support JSON type auth params as described in doc

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #9187:
URL: https://github.com/apache/pulsar/issues/9187#issuecomment-770232713


   Close this issue via #9313 @WalterMa feel free to reopen it if needed.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] Huanli-Meng commented on issue #9187: Token authentication not support JSON type auth params as described in doc

Posted by GitBox <gi...@apache.org>.
Huanli-Meng commented on issue #9187:
URL: https://github.com/apache/pulsar/issues/9187#issuecomment-759151161


   @Jennifer88huang @sijia-w , could you please help check and confirm this issue? Thanks.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] Anonymitaet commented on issue #9187: Token authentication not support JSON type auth params as described in doc

Posted by GitBox <gi...@apache.org>.
Anonymitaet commented on issue #9187:
URL: https://github.com/apache/pulsar/issues/9187#issuecomment-763550949


   As confirmed in last week's meeting, this issue is related to code rather than doc, correct? @jiazhai 


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org