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
github-merge-queue bot pushed a commit to microsoft/semantic-kernel that referenced this issue Sep 10, 2024
Bumps
[Testcontainers.Milvus](https://github.com/testcontainers/testcontainers-dotnet)
from 3.8.0 to 3.10.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/testcontainers/testcontainers-dotnet/releases">Testcontainers.Milvus's
releases</a>.</em></p>
<blockquote>
<h2>3.10.0</h2>
<p>Hey everyone, just wanted to say a huge thanks to all of you who
helped with this version — whether through contributions, reporting
issues, or discussions. I've been very busy lately, and your support has
been a huge help. I really appreciate it!</p>
<h1>What's Changed</h1>
<h2>🚀 Features</h2>
<ul>
<li>feat: Add MongoDB replica set support (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1196">#1196</a>)
<a href="https://github.com/artiomchi"><code>@​artiomchi</code></a></li>
<li>feat: Detect CSharp, FSharp and Visual Basic projects (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1234">#1234</a>)
<a
href="https://github.com/HofmeisterAn"><code>@​HofmeisterAn</code></a></li>
<li>feat: Improve parsing of Docker image tag version
<code>MatchVersion(Predicate&lt;Version&gt;)</code> (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1231">#1231</a>)
<a href="https://github.com/0xced"><code>@​0xced</code></a></li>
<li>feat: Log Docker daemon labels if present (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1226">#1226</a>)
<a
href="https://github.com/eddumelendez"><code>@​eddumelendez</code></a></li>
</ul>
<h2>🐛 Bug Fixes</h2>
<ul>
<li>fix: Get sqlcmd utility file path from container instead of const
file path (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1221">#1221</a>)
<a
href="https://github.com/outofrange-consulting"><code>@​outofrange-consulting</code></a></li>
<li>fix: Add Keycloak health port 9000 starting from major version 25
(<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1213">#1213</a>)
<a
href="https://github.com/paulomorgado"><code>@​paulomorgado</code></a></li>
<li>fix: Allow specifying the protocol (TCP, UDP, SCTP) to resolve the
public assigned host port (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1219">#1219</a>)
<a href="https://github.com/wolfman42"><code>@​wolfman42</code></a></li>
<li>fix: Trim relative path indicators from Dockerfile path (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1203">#1203</a>)
<a
href="https://github.com/HofmeisterAn"><code>@​HofmeisterAn</code></a></li>
</ul>
<h2>📖 Documentation</h2>
<ul>
<li>chore: Replace codeinclude with snippets (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1251">#1251</a>)
<a
href="https://github.com/HofmeisterAn"><code>@​HofmeisterAn</code></a></li>
<li>docs: Use codeinclude in module examples (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1245">#1245</a>)
<a
href="https://github.com/HofmeisterAn"><code>@​HofmeisterAn</code></a></li>
</ul>
<h2>🧹 Housekeeping</h2>
<ul>
<li>chore: Apply fix for redirect.github.com/apache/pulsar/issues/22811
only for affected versions (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1232">#1232</a>)
<a href="https://github.com/entvex"><code>@​entvex</code></a></li>
<li>chore: Replace codeinclude with snippets (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1251">#1251</a>)
<a
href="https://github.com/HofmeisterAn"><code>@​HofmeisterAn</code></a></li>
<li>chore: Change global.json roll-forward policy from
<code>latestPatch</code> to <code>latestMinor</code> (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1230">#1230</a>)
<a href="https://github.com/0xced"><code>@​0xced</code></a></li>
<li>chore: Remove obsolete UntilOperationIsSucceeded wait strategy (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1202">#1202</a>)
<a
href="https://github.com/HofmeisterAn"><code>@​HofmeisterAn</code></a></li>
</ul>
<h2>3.9.0</h2>
<p>Thank you to everyone whose contributions made this release
possible.</p>
<h1>What's Changed</h1>
<h2>⚠️ Breaking Changes</h2>
<p>The <code>UntilOperationIsSucceeded(Func&lt;bool&gt;, int,
Action&lt;IWaitStrategy&gt;)</code> wait strategy is obsolete. Instead
of this wait strategy, use any other wait strategy that matches your use
case and configure the retry behavior accordingly (<a
href="https://dotnet.testcontainers.org/api/wait_strategies/">wait
strategy options</a>).</p>
<p>Using reuse together with the container builder method
<code>WithName(string)</code> will generate a new reuse hash the first
time you use the configuration. The container name was not included in
calculating the reuse hash previously.</p>
<ul>
<li>feat: Add wait strategy options (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1168">#1168</a>)
<a
href="https://github.com/HofmeisterAn"><code>@​HofmeisterAn</code></a></li>
<li>feat: Include the container name in the reuse hash (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1162">#1162</a>)
<a href="https://github.com/0xced"><code>@​0xced</code></a></li>
</ul>
<h2>🚀 Features</h2>
<ul>
<li>feat: Add Apache Pulsar module (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1103">#1103</a>)
<a href="https://github.com/entvex"><code>@​entvex</code></a></li>
<li>feat: Add custom configuration for retries, interval and timeout (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1169">#1169</a>)
<a
href="https://github.com/HofmeisterAn"><code>@​HofmeisterAn</code></a></li>
<li>feat: Add wait strategy options (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1168">#1168</a>)
<a
href="https://github.com/HofmeisterAn"><code>@​HofmeisterAn</code></a></li>
<li>feat: Include the container name in the reuse hash (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1162">#1162</a>)
<a href="https://github.com/0xced"><code>@​0xced</code></a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/testcontainers/testcontainers-dotnet/commit/934d7f0c173253bb2bc9baddc4c9e41560ab13c9"><code>934d7f0</code></a>
chore: Apply fix for redirect.github.com/apache/pulsar/issues/22811 only
for affected ...</li>
<li><a
href="https://github.com/testcontainers/testcontainers-dotnet/commit/5b3d494d1c78e5715c4e26e7144a05126a960cb1"><code>5b3d494</code></a>
chore: Replace codeinclude with snippets (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1251">#1251</a>)</li>
<li><a
href="https://github.com/testcontainers/testcontainers-dotnet/commit/2da2080d9761d89189d8db9f52202ca8ca5a0289"><code>2da2080</code></a>
docs: Use codeinclude in module examples (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1245">#1245</a>)</li>
<li><a
href="https://github.com/testcontainers/testcontainers-dotnet/commit/b2699ccf9c0dc4e5fb8f34307651440d5b5368ae"><code>b2699cc</code></a>
fix: Get sqlcmd utility file path from container instead of const file
path (...</li>
<li><a
href="https://github.com/testcontainers/testcontainers-dotnet/commit/fffd384731bd280b9eacd84b65b772ed6c9f7846"><code>fffd384</code></a>
feat: Add MongoDB replica set support (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1196">#1196</a>)</li>
<li><a
href="https://github.com/testcontainers/testcontainers-dotnet/commit/87184e3e53b270ac352cdf59af6c2334488c7fd1"><code>87184e3</code></a>
feat: Detect CSharp, FSharp and Visual Basic projects (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1234">#1234</a>)</li>
<li><a
href="https://github.com/testcontainers/testcontainers-dotnet/commit/dd05999702f11f4264f91f8e69619c03264d6cda"><code>dd05999</code></a>
chore: Change global.json roll-forward policy from
<code>latestPatch</code> to `latestMi...</li>
<li><a
href="https://github.com/testcontainers/testcontainers-dotnet/commit/ace1fe03b6fc0bf58c5896480584c525b5c65abc"><code>ace1fe0</code></a>
feat: Improve parsing of Docker image tag version
`MatchVersion(Predicate&lt;Ver...</li>
<li><a
href="https://github.com/testcontainers/testcontainers-dotnet/commit/1a647621c7b9ed01b801efdddaac37206afc6b6e"><code>1a64762</code></a>
fix: Add Keycloak health port 9000 starting from major version 25 (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1213">#1213</a>)</li>
<li><a
href="https://github.com/testcontainers/testcontainers-dotnet/commit/9a59b3eda781b55ccf30d83d619079997770ac79"><code>9a59b3e</code></a>
feat: Log Docker daemon labels if present (<a
href="https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1226">#1226</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/testcontainers/testcontainers-dotnet/compare/3.8.0...3.10.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Testcontainers.Milvus&package-manager=nuget&previous-version=3.8.0&new-version=3.10.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
oskogstad pushed a commit to digdir/dialogporten that referenced this issue Sep 18, 2024
…1154)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [Testcontainers.PostgreSql](https://dotnet.testcontainers.org/)
([source](https://redirect.github.com/testcontainers/testcontainers-dotnet))
| `3.9.0` -> `3.10.0` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/Testcontainers.PostgreSql/3.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/Testcontainers.PostgreSql/3.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/Testcontainers.PostgreSql/3.9.0/3.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/Testcontainers.PostgreSql/3.9.0/3.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>testcontainers/testcontainers-dotnet
(Testcontainers.PostgreSql)</summary>

###
[`v3.10.0`](https://redirect.github.com/testcontainers/testcontainers-dotnet/releases/tag/3.10.0)

[Compare
Source](https://redirect.github.com/testcontainers/testcontainers-dotnet/compare/3.9.0...3.10.0)

Hey everyone, just wanted to say a huge thanks to all of you who helped
with this version — whether through contributions, reporting issues, or
discussions. I've been very busy lately, and your support has been a
huge help. I really appreciate it!

### What's Changed

#### 🚀 Features

- feat: Add MongoDB replica set support
([#&#8203;1196](https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1196))
[@&#8203;artiomchi](https://redirect.github.com/artiomchi)
- feat: Detect CSharp, FSharp and Visual Basic projects
([#&#8203;1234](https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1234))
[@&#8203;HofmeisterAn](https://redirect.github.com/HofmeisterAn)
- feat: Improve parsing of Docker image tag version
`MatchVersion(Predicate<Version>)`
([#&#8203;1231](https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1231))
[@&#8203;0xced](https://redirect.github.com/0xced)
- feat: Log Docker daemon labels if present
([#&#8203;1226](https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1226))
[@&#8203;eddumelendez](https://redirect.github.com/eddumelendez)

#### 🐛 Bug Fixes

- fix: Get sqlcmd utility file path from container instead of const file
path
([#&#8203;1221](https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1221))
[@&#8203;outofrange-consulting](https://redirect.github.com/outofrange-consulting)
- fix: Add Keycloak health port 9000 starting from major version 25
([#&#8203;1213](https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1213))
[@&#8203;paulomorgado](https://redirect.github.com/paulomorgado)
- fix: Allow specifying the protocol (TCP, UDP, SCTP) to resolve the
public assigned host port
([#&#8203;1219](https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1219))
[@&#8203;wolfman42](https://redirect.github.com/wolfman42)
- fix: Trim relative path indicators from Dockerfile path
([#&#8203;1203](https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1203))
[@&#8203;HofmeisterAn](https://redirect.github.com/HofmeisterAn)

#### 📖 Documentation

- chore: Replace codeinclude with snippets
([#&#8203;1251](https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1251))
[@&#8203;HofmeisterAn](https://redirect.github.com/HofmeisterAn)
- docs: Use codeinclude in module examples
([#&#8203;1245](https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1245))
[@&#8203;HofmeisterAn](https://redirect.github.com/HofmeisterAn)

#### 🧹 Housekeeping

- chore: Apply fix for
[github.com/apache/pulsar/issues/22811](redirect.github.com/apache/pulsar/issues/22811)
only for affected versions
([#&#8203;1232](https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1232))
[@&#8203;entvex](https://redirect.github.com/entvex)
- chore: Replace codeinclude with snippets
([#&#8203;1251](https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1251))
[@&#8203;HofmeisterAn](https://redirect.github.com/HofmeisterAn)
- chore: Change global.json roll-forward policy from `latestPatch` to
`latestMinor`
([#&#8203;1230](https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1230))
[@&#8203;0xced](https://redirect.github.com/0xced)
- chore: Remove obsolete UntilOperationIsSucceeded wait strategy
([#&#8203;1202](https://redirect.github.com/testcontainers/testcontainers-dotnet/issues/1202))
[@&#8203;HofmeisterAn](https://redirect.github.com/HofmeisterAn)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 7am on Sunday,before 7am on
Wednesday" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/digdir/dialogporten).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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