Skip to content

fix: datetime verification evaluation about UTC in issuance and expiration#36

Merged
peppelinux merged 2 commits into
IdentityPython:mainfrom
peppelinux:utc-fix
Jul 21, 2026
Merged

fix: datetime verification evaluation about UTC in issuance and expiration#36
peppelinux merged 2 commits into
IdentityPython:mainfrom
peppelinux:utc-fix

Conversation

@peppelinux

Copy link
Copy Markdown
Member

This pull request improves the handling of date-only validity periods in the MsoIssuer class by introducing a new date parsing method and updating the signing logic to ensure correct interpretation of expiry dates. It also adds a new test to verify that validity intervals are correctly set when issuance and expiry are on the same day.

Date parsing and validity handling improvements:

  • Added a new static method parse_date to MsoIssuer in issuer.py to parse date-only strings and, when appropriate, set the time to the end of the day for expiry dates.
  • Updated the sign method in MsoIssuer to use the new parse_date method for both issuance and expiry dates, ensuring expiry is interpreted as the end of the day.

Testing enhancements:

  • Added a new test test_mso_issuer_validity_same_day to verify that when issuance and expiry dates are the same, the validity interval includes the entire day and the validUntil time is set to 23:59:59.
  • Added necessary imports for datetime and cbor2 in the test file.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 94.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.31%. Comparing base (db4eb31) to head (92fcb33).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pymdoccbor/tools.py 88.46% 3 Missing ⚠️
pymdoccbor/tests/test_06_mso_issuer.py 90.00% 2 Missing ⚠️
pymdoccbor/mso/verifier.py 75.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #36      +/-   ##
==========================================
+ Coverage   89.79%   90.31%   +0.52%     
==========================================
  Files          26       27       +1     
  Lines        1039     1126      +87     
==========================================
+ Hits          933     1017      +84     
- Misses        106      109       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@peppelinux
peppelinux merged commit 07eaec5 into IdentityPython:main Jul 21, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants