fix(backend): standardize timezone handling to UTC ISO-8601#2033
Open
NaitikVerma6776 wants to merge 2 commits into
Open
fix(backend): standardize timezone handling to UTC ISO-8601#2033NaitikVerma6776 wants to merge 2 commits into
NaitikVerma6776 wants to merge 2 commits into
Conversation
Add shared time_utils helpers and use timezone-aware UTC with an explicit offset for generated_at and discovered_at across reports, findings API responses, and report generation. Closes utksh1#1882
Default to_utc_iso to timespec=auto so finding intelligence tests can compare against datetime.now(UTC). Update TLS verification mocks for crawler client.stream() and stub crawl_target in API scanner tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add shared time_utils helpers and use timezone-aware UTC with an explicit offset for generated_at and discovered_at across reports, findings API responses, and report generation.
Closes #1882
What changed
Added backend/secuscan/time_utils.py for shared UTC helpers
Reports now emit UTC ISO-8601 generated_at / discovered_at (with offset)
Findings/reports API responses normalize timestamps to UTC with offset
_parse_discovered_at always returns timezone-aware UTC
Added unit tests for UTC parsing/formatting + frontend date consistency