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 with datetime.now(timezone.utc)
LogRepository.get_by_sketch() now uses a timezone-aware default cutoff for the last 24 hours
added focused coverage for the token clock call and the default recent-log filter
Problem
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:
token expiration and default log cutoff used naive UTC datetimes
tests did not guard these remaining core paths
After:
both paths use explicit timezone.utc
token test fails if the implementation falls back to datetime.utcnow()
log repository test covers the default cutoff behavior with aware timestamps
but local collection is blocked in this environment by missing passlib before 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.
## 📋 Pull Request Information
**Original PR:** https://github.com/reconurge/flowsint/pull/168
**Author:** [@Ghraven](https://github.com/Ghraven)
**Created:** 6/4/2026
**Status:** ✅ Merged
**Merged:** 6/20/2026
**Merged by:** [@dextmorgn](https://github.com/dextmorgn)
**Base:** `main` ← **Head:** `fix-core-aware-utc-auth-log`
---
### 📝 Commits (1)
- [`a8aef7e`](https://github.com/reconurge/flowsint/commit/a8aef7eda1599996c3ec82958b2b975272609308) fix: use aware utc in auth and log cutoffs
### 📊 Changes
**4 files changed** (+44 additions, -4 deletions)
<details>
<summary>View changed files</summary>
📝 `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)
</details>
### 📄 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 with `datetime.now(timezone.utc)`
- `LogRepository.get_by_sketch()` now uses a timezone-aware default cutoff for the last 24 hours
- added focused coverage for the token clock call and the default recent-log filter
## Problem
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:
- token expiration and default log cutoff used naive UTC datetimes
- tests did not guard these remaining core paths
After:
- both paths use explicit `timezone.utc`
- token test fails if the implementation falls back to `datetime.utcnow()`
- log repository test covers the default cutoff behavior with aware timestamps
## 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.py`
I 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.py`
but local collection is blocked in this environment by missing `passlib` before the tests run (`ModuleNotFoundError: No module named 'passlib'`).
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/reconurge/flowsint/pull/168
Author: @Ghraven
Created: 6/4/2026
Status: ✅ Merged
Merged: 6/20/2026
Merged by: @dextmorgn
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.