Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [cli] Pulsar Tokens Create is mishandling time units (specifically, treating seconds as milliseconds) #22811

Closed
3 tasks done
entvex opened this issue May 30, 2024 · 1 comment · Fixed by #22815
Closed
3 tasks done
Assignees
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@entvex
Copy link
Contributor

entvex commented May 30, 2024

Search before asking

  • I searched in the issues and found nothing similar.

Read release policy

  • I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

Version

The versions affected 3.2.0 3.2.1 3.2.2 and 3.2.3

Minimal reproduce step

Create a JWT token using an affected version.
bin/pulsar tokens create --secret-key /pulsar/secret.key --subject test-user --expiry-time 3600s
Use a JWT decoder and you will see that the expiry time is wrong.

What did you expect to see?

A JWT token with the desired --expiry-time

What did you see instead?

As a workaround, you can multiply the --expiry-time by 1000 if you specify s in at the end of --expiry-time. To convert it to mili sec.

The mentioned bug affects all time units, not just seconds.

Anything else?

It appears that the bug was introduced in this pull request: GitHub link. I'll work on fixing it and submit a pull request. Additionally, I'll look into adding test coverage.

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@entvex entvex added the type/bug The PR fixed a bug or issue reported a bug label May 30, 2024
@entvex entvex self-assigned this May 30, 2024
@lhotari
Copy link
Member

lhotari commented May 30, 2024

this is a regression caused by https://github.com/apache/pulsar/pull/21412/files changes.

HofmeisterAn added a commit to testcontainers/testcontainers-dotnet that referenced this issue Sep 3, 2024
…ffected versions (#1232)

Co-authored-by: David Jensen <djn@danskecommodities.com>
Co-authored-by: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com>
This was referenced Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants