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 2020/04/20 10:37:40 UTC

[GitHub] [pulsar] erobot commented on issue #6761: Wrong tokenSecretKey configuration description about using base64 inline

erobot commented on issue #6761:
URL: https://github.com/apache/pulsar/issues/6761#issuecomment-616463322


   > @erobot How to identify it is wrong/correct result?
   
   I think secret key is the 128 bit binary data after base64 decoded. The base64 encoded string is the convenient representantion.
   
   Then binary secret key in file should get the same result and the result same as this method is the correct result.
   
   ```
   apache-pulsar-2.5.0>echo qcsXyb5eo8c09YXIMJaA97RYPCmIuyTlrN2KcI0zzxM= | base64 -d > secret.key
   apache-pulsar-2.5.0>hexdump secret.key 
   0000000 cba9 c917 5ebe c7a3 f534 c885 9630 f780
   0000010 58b4 293c bb88 e524 ddac 708a 338d 13cf
   0000020
   apache-pulsar-2.5.0>bin/pulsar tokens create --secret-key file://path/to/secret.key --subject admin
   eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiJ9.L869nKrziQIPkgqIawIh-RxxDelfGIiol1DBhoBl26Y
   ```
   
   
   If base64 string itself is secret key, there is no need to mention base64.
   
   ```
   // 'data:text' is same result as 'data:base64'
   apache-pulsar-2.5.0>bin/pulsar tokens create --secret-key 'data:text,qcsXyb5eo8c09YXIMJaA97RYPCmIuyTlrN2KcI0zzxM=' --subject admin
   eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiJ9.ne2WjK3zY4cecotgUYkU0kkviOyslnCqPDHcPYF-HDc
   apache-pulsar-2.5.0>bin/pulsar tokens create --secret-key 'data:base64,qcsXyb5eo8c09YXIMJaA97RYPCmIuyTlrN2KcI0zzxM=' --subject admin
   eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiJ9.ne2WjK3zY4cecotgUYkU0kkviOyslnCqPDHcPYF-HDc
   ```
   


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