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

fix: handle the zero cases for oidc.Time #339

Merged
merged 1 commit into from
Mar 20, 2023
Merged

fix: handle the zero cases for oidc.Time #339

merged 1 commit into from
Mar 20, 2023

Conversation

muhlemmer
Copy link
Collaborator

When Time fields was not set in JSON, the zero value 0, resulted in a non-zero time.Time in conversion. This made verifier checks against a zero (unset) time always pass:

if issuedAt.IsZero() {

This bug was most likely introduced in #283 refactorings.

Likewise, passing an empty time to oidc.FromTime now results in a 0 value for the JSON.

@muhlemmer muhlemmer added the bug Something isn't working label Mar 20, 2023
@codecov
Copy link

codecov bot commented Mar 20, 2023

Codecov Report

Merging #339 (5a14f8d) into main (62caf5d) will increase coverage by 0.13%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #339      +/-   ##
==========================================
+ Coverage   50.80%   50.94%   +0.13%     
==========================================
  Files          74       74              
  Lines        5623     5638      +15     
==========================================
+ Hits         2857     2872      +15     
  Misses       2506     2506              
  Partials      260      260              
Impacted Files Coverage Δ
pkg/oidc/token.go 56.47% <100.00%> (+2.43%) ⬆️
pkg/oidc/types.go 91.47% <100.00%> (+0.41%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@muhlemmer muhlemmer merged commit 115813e into main Mar 20, 2023
@muhlemmer muhlemmer deleted the fix-astime-zero branch March 20, 2023 15:18
@github-actions
Copy link

🎉 This PR is included in version 2.1.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@muhlemmer muhlemmer mentioned this pull request Mar 21, 2023
3 tasks
@github-actions
Copy link

github-actions bot commented May 2, 2023

🎉 This PR is included in version 3.0.0-next.6 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants