Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add session cleanup, use ID type consistently, support password changes #8

Merged
merged 4 commits into from
Feb 7, 2025

Conversation

cmackenzie1
Copy link
Owner

Introduces background task for periodic session cleanup with configurable intervals and max session age. Extends SessionStorage trait with a new method to remove expired sessions, and adds a default configuration for session cleanup. Includes tests to verify the cleanup process works as expected.

Introduces background task for periodic session cleanup with configurable intervals and max session age. Extends SessionStorage trait with a new method to remove expired sessions, and adds a default configuration for session cleanup. Includes tests to verify the cleanup process works as expected.
Copy link

codecov bot commented Feb 7, 2025

Codecov Report

Attention: Patch coverage is 91.42091% with 32 lines in your changes missing coverage. Please review.

Project coverage is 75.63%. Comparing base (6722169) to head (bd8a05b).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
torii-core/src/plugin.rs 79.12% 19 Missing ⚠️
torii-storage-sqlite/src/lib.rs 96.39% 7 Missing ⚠️
torii-core/src/storage/mod.rs 50.00% 4 Missing ⚠️
torii-auth-email/src/lib.rs 97.43% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #8      +/-   ##
==========================================
+ Coverage   70.37%   75.63%   +5.26%     
==========================================
  Files           9        9              
  Lines        1259     1568     +309     
==========================================
+ Hits          886     1186     +300     
- Misses        373      382       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This commit updates various storage methods to use strongly typed `UserId` and `SessionId` instead of string references. The changes include:

- Modifying method signatures in storage traits to accept `&UserId` and `&SessionId`
- Updating implementations across different modules to use the new ID types
- Adjusting method calls to use `.id` or `SessionId::new()` where necessary
- Ensuring consistent ID handling throughout the authentication and storage layers
@cmackenzie1 cmackenzie1 changed the title feat: Add session cleanup functionality feat: Add session cleanup, use ID type consistently, support password changes Feb 7, 2025
@cmackenzie1 cmackenzie1 merged commit abc4d4e into main Feb 7, 2025
3 checks passed
@cmackenzie1 cmackenzie1 deleted the cole/session-cleanup branch February 7, 2025 02:39
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.

1 participant