Skip to content

Fix doubled UTC offset in aws_session_expiration - #120

Merged
victorskl merged 1 commit into
victorskl:mainfrom
varunanil:fix-session-expiration-format
Sep 11, 2026
Merged

victorskl merged 1 commit into
victorskl:mainfrom
varunanil:fix-session-expiration-format

Conversation

@varunanil

Copy link
Copy Markdown
Contributor

Fixes #119. Writes the expected +0000 format directly via strftime, and normalizes legacy values when parsing (doubled offset written by v1.2.1 through v1.4.0, and fractional seconds) so existing credentials files keep working after upgrade. strftime also truncates sub-second precision on write, which only ever makes the stored expiry earlier, and keeps the historical +0000 on-disk format that all existing fixtures use.

Tests: regression tests for the legacy doubled-offset and fractional values with exact-instant assertions, a deterministic write-then-parse round trip (the write/parse pair was previously only tested against hand-seeded values), and an integration test reproducing the crash through update_profile -> eager_sync_source_profile. Full suite passes, coverage stays 100%.

🤖 Generated with Claude Code

Since ce9b8b9 (v1.2.1), update_aws_cli_v1_credentials appends '+0000' to
an aware datetime isoformat() which already ends in '+00:00', producing
values like 2020-06-14T17:13:26+00:00+0000 that
parse_credentials_file_session_expiry cannot parse back. A later run
that eager-syncs a source_profile then crashes with ValueError.

Write the expected '+0000' format directly via strftime, and normalise
legacy values when parsing (doubled offset and fractional seconds) so
credentials files written by v1.2.1 through v1.4.0 keep working after
upgrade.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2881a9e) to head (4143e13).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #120   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          620       622    +2     
=========================================
+ Hits           620       622    +2     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@victorskl victorskl left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you for bug fix.
I will follow up with release soon.

@victorskl
victorskl merged commit e9ccb3a into victorskl:main Sep 11, 2026
9 checks passed
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.

aws_session_expiration written with doubled UTC offset since v1.2.1, crashes eager source_profile sync

2 participants