Skip to content

refactor(webhook): Remove humantime dependency - #1335

Open
sbernauer wants to merge 5 commits into
mainfrom
chore/humantime-to-jiff
Open

sbernauer wants to merge 5 commits into
mainfrom
chore/humantime-to-jiff

Conversation

@sbernauer

@sbernauer sbernauer commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes https://rustsec.org/advisories/RUSTSEC-2026-0542

cargo deny fails because we need stackabletech/operator-templating#664 first.
We can force-merge if needed

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added

@sbernauer sbernauer self-assigned this Nov 17, 2026
@sbernauer
sbernauer requested a review from a team November 17, 2026 12:31
@sbernauer sbernauer changed the title chore(webhook): Replace humantime with jiff chore(webhook): Replace humantime with jiff Nov 17, 2026
@sbernauer sbernauer moved this to Development: Waiting for Review in Stackable Engineering Nov 17, 2026
@NickLarsenNZ

Copy link
Copy Markdown
Member

I assume we're not merging until the release branches are cut?

@sbernauer

Copy link
Copy Markdown
Member Author

Correct

NickLarsenNZ
NickLarsenNZ previously approved these changes Nov 17, 2026
@NickLarsenNZ NickLarsenNZ moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Nov 17, 2026

@Techassi Techassi left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a huge fan that we now have a fallible path for what is basically only a debug log statement.

I also looked at this briefly and the SystemTime comes from deep within x509-cert. We should also look into what other options they might expose which don't require a fallible path.

/// Rotate the certificate when less than 1/6 of its lifetime remains (4 hours for the current 24h
/// lifetime). Derived from [`CERTIFICATE_LIFETIME_HOURS`] so it scales if the lifetime changes.
const CERTIFICATE_EXPIRY_BUFFER_HOURS: u64 = CERTIFICATE_LIFETIME_HOURS * 60 / 6;
const CERTIFICATE_EXPIRY_BUFFER_MINUTES: u64 = CERTIFICATE_LIFETIME_HOURS * 60 / 6;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was just a rename, the name was wrong previously

@sbernauer

Copy link
Copy Markdown
Member Author

I'm not a huge fan that we now have a fallible path for what is basically only a debug log statement.

I noticed we actually don't need jiff to format as RFC 3339. The only problem is that the deadline calculation is fallible, so I moved that to earlier, when we create the certificate and store the computation result.
This also adds some tests. They might be excessive, happy to remove parts of them if you want

@sbernauer
sbernauer requested a review from Techassi November 18, 2026 08:56
@sbernauer sbernauer changed the title chore(webhook): Replace humantime with jiff chore(webhook): Remove humantime dependency Nov 18, 2026
@sbernauer sbernauer changed the title chore(webhook): Remove humantime dependency refactor(webhook): Remove humantime dependency Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: In Review

Development

Successfully merging this pull request may close these issues.

3 participants