mirror of
https://github.com/reconurge/flowsint.git
synced 2026-06-10 00:30:17 -05:00
[PR #168] fix: use aware UTC in auth and log cutoffs #2635
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/reconurge/flowsint/pull/168
Author: @Ghraven
Created: 6/4/2026
Status: 🔄 Open
Base:
main← Head:fix-core-aware-utc-auth-log📝 Commits (1)
a8aef7efix: use aware utc in auth and log cutoffs📊 Changes
4 files changed (+44 additions, -4 deletions)
View changed files
📝
flowsint-api/tests/test_events_auth.py(+23 -0)📝
flowsint-core/src/flowsint_core/core/auth.py(+2 -2)📝
flowsint-core/src/flowsint_core/core/repositories/log_repository.py(+2 -2)📝
flowsint-core/tests/repositories/test_log_repository.py(+17 -0)📄 Description
What changed
This replaces the remaining naive UTC timestamp calls in core auth/log paths with timezone-aware UTC timestamps:
create_access_token()now builds JWT expiration withdatetime.now(timezone.utc)LogRepository.get_by_sketch()now uses a timezone-aware default cutoff for the last 24 hoursProblem
These two paths still used
datetime.utcnow(), while nearby service timestamps had already moved to aware UTC values. Keeping these call sites naive can make comparisons and future Python compatibility more brittle.Before / after
Before:
After:
timezone.utcdatetime.utcnow()Verification
python -m py_compile flowsint-core\src\flowsint_core\core\auth.py flowsint-core\src\flowsint_core\core\repositories\log_repository.py flowsint-api\tests\test_events_auth.py flowsint-core\tests\repositories\test_log_repository.pyI also tried:
PYTHONPATH=flowsint-core\src;flowsint-api python -m pytest flowsint-api\tests\test_events_auth.py flowsint-core\tests\repositories\test_log_repository.pybut local collection is blocked in this environment by missing
passlibbefore the tests run (ModuleNotFoundError: No module named 'passlib').🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.