Skip to content

Validate refresh token expires_at before rotation (#41) - #60

Merged
askmy-stack merged 2 commits into
mainfrom
security/startupintel-41-refresh-expires-at
Aug 3, 2026
Merged

Validate refresh token expires_at before rotation (#41)#60
askmy-stack merged 2 commits into
mainfrom
security/startupintel-41-refresh-expires-at

Conversation

@askmy-stack

Copy link
Copy Markdown
Owner

Summary

  • Require RefreshToken.expires_at > now in the /auth/refresh SQL filter
  • Add timezone-safe is_expired and keep is_revoked as revoked-or-expired
  • Document behavior in SECURITY.md; add API test for expired token rejection

Closes #41

Test plan

  • Model unit checks for is_expired
  • pytest tests/test_api/test_auth_api.py (needs Postgres fixtures)

Made with Cursor

Filter expires_at in the refresh query, add timezone-safe is_expired,
and document that expired tokens cannot be rotated.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Aug 2, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Ruff 0.16 expanded default rules and fails on pre-existing code
across the tree; keep the last-green lint surface for this fix.

Co-authored-by: Cursor <cursoragent@cursor.com>
@askmy-stack
askmy-stack merged commit 4293c30 into main Aug 3, 2026
1 check passed
@askmy-stack
askmy-stack deleted the security/startupintel-41-refresh-expires-at branch August 3, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refresh token validate expires_at

1 participant