Skip to content

Wrong tokenSecretKey configuration description about using base64 inline #6761

@erobot

Description

@erobot

Describe the bug
When using base64 line in tokenSecretKey, config should specify like "tokenSecretKey=data:;base64,xxxxxxxxx" but not "tokenSecretKey=data:base64,xxxxxxxxx". Description in documnet is missing a semicolon.

data URI scheme:
https://en.wikipedia.org/wiki/Data_URI_scheme

wrong documents:
https://pulsar.apache.org/docs/en/reference-configuration/

Configure the secret key to be used to validate auth tokens. The key can be specified like: tokenSecretKey=data:base64,xxxxxxxxx or tokenSecretKey=file:///my/secret.key

https://pulsar.apache.org/docs/en/security-jwt/

# If using secret key
tokenSecretKey=file:///path/to/secret.key
# The key can also be passed inline:
# tokenSecretKey=data:base64,FLFyW0oLJ2Fi22KKCm21J18mbAdztfSHN/lAT5ucEKU=

To Reproduce
// correct result
apache-pulsar-2.5.0>bin/pulsar tokens create --secret-key 'qcsXyb5eo8c09YXIMJaA97RYPCmIuyTlrN2KcI0zzxM=' --subject admin
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiJ9.L869nKrziQIPkgqIawIh-RxxDelfGIiol1DBhoBl26Y

// wrong result
apache-pulsar-2.5.0>bin/pulsar tokens create --secret-key 'data:base64,qcsXyb5eo8c09YXIMJaA97RYPCmIuyTlrN2KcI0zzxM=' --subject admin
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiJ9.ne2WjK3zY4cecotgUYkU0kkviOyslnCqPDHcPYF-HDc

// correct result
apache-pulsar-2.5.0>bin/pulsar tokens create --secret-key 'data:;base64,qcsXyb5eo8c09YXIMJaA97RYPCmIuyTlrN2KcI0zzxM=' --subject admin
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiJ9.L869nKrziQIPkgqIawIh-RxxDelfGIiol1DBhoBl26Y

Expected behavior
Correct tokenSecretKey base64 inline description in documents and examples.

Metadata

Metadata

Assignees

Labels

type/bugThe PR fixed a bug or issue reported a bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions