bug(node): SigV4 presign date applies the epoch offset twice — media uploads can never validate
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start with sigv4_timestamps in src/psi_service.rs and the existing presigning test, which currently checks URL fields but not the date. Check how civil_date_from_days applies the epoch offset, then add regression coverage that compares X-Amz-Date with the credential scope and verifies the real UTC date. Done when the regression catches the incorrect year and the requested Rust checks pass.
Written by the indexing model from the issue text.
Description
Problem
POST /v1/media/presign returns presigned S3 URLs whose X-Amz-Date is ~1970 years in the future, so MinIO/S3 rejects every upload and the media path is unusable even when object storage is healthy.
Evidence (live deployment, 2026-12-04)
With MinIO running, the node answered:
{"presigned_url":"http://minio:9000/sonaraim-media-ephemeral/deadbeef?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...%2F39961005%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=39961005T184857Z&..."}
The time part (184857Z) matches the current UTC time, but the date part is 3996-10-05 instead of 2026-12-04.
Root cause
src/psi_service.rs:
let (year, month, day) = civil_date_from_days((epoch_secs / 86_400) as i64 + 719_468);
civil_date_from_days already adds 719_468 internally (let z = days + 719_468;), so the offset is applied twice — exactly 1970 years.
The existing test only asserted that the URL contains X-Amz-Algorithm, X-Amz-Signature and AKIDEXAMPLE, never that the date is correct, so the defect passed.
Expected vs actual
- Expected:
X-Amz-Dateis the current UTC timestamp and the signature validates against MinIO/S3. - Actual: the date is ~1970 years ahead and no upload can succeed.
Acceptance criteria
sigv4_timestampsproduces the real civil date (single epoch offset).- A regression test fails if the date is not the current UTC date (or is not within a sane year range) and pins that
X-Amz-Dateand the credential scope agree. cargo fmt --check,cargo clippy --all-targets -- -D warningsandcargo testare green.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- Avg merge
- 4m
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from alfonsodg/sonaraim-node
-
area::node effort::xs impact::low priority::low source::auto status::review type::docs
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
alfonsodg/sonaraim-node#28 · 1 comment ·
-
area::node effort::s impact::medium priority::low source::auto status::review type::docs
Difficulty 3/5 1-2 days Newbie friendliness 72/100
alfonsodg/sonaraim-node#27 · 1 comment ·
-
area::node effort::m impact::medium priority::medium source::user status::review type::refactor
Difficulty 1/5 Under an hour Newbie friendliness 20/100
alfonsodg/sonaraim-node#26 · 1 comment ·
-
area::node effort::m impact::high priority::medium source::auto status::review type::bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
alfonsodg/sonaraim-node#25 · 2 comments ·
-
area::node effort::s impact::low priority::low source::auto status::review type::feature
Difficulty 3/5 1-2 days Newbie friendliness 64/100
alfonsodg/sonaraim-node#24 ·
All issues in alfonsodg/sonaraim-node
Similar issues
-
O-windows relnotes relnotes-needs-review relnotes-tracking-issue T-libs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
marketing
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Maintainers usually reply within 1 day
-
num_ode_rk4_adaptive rejects atol = 0 while accepting rtol = 0 and while num_ode_dopri5 accepts bothOpenarea/ode-pde good first issue help wanted kind/contract severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#383 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 1 day
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day