maxcountryman / tower-sessions

🥠 Sessions as a `tower` and `axum` middleware.
MIT License
253 stars 42 forks source link

push active filtering down to stores #65

Closed maxcountryman closed 1 year ago

maxcountryman commented 1 year ago

Following along with the Django approach, we push the responsibility of defining an active session semantic down to the stores themselves. Most stores already filter results based on e.g. the expiry date, but with this change we allow that semantic to be defined however implementors might like.

Provided stores that did not already do their own filtering have been updated to account for this change.

codecov[bot] commented 1 year ago

Codecov Report

Merging #65 (0bb43f7) into main (73ebd97) will decrease coverage by 14.66%. Report is 2 commits behind head on main. The diff coverage is 90.00%.

@@             Coverage Diff             @@
##             main      #65       +/-   ##
===========================================
- Coverage   79.58%   64.92%   -14.66%     
===========================================
  Files          14       14               
  Lines         573      573               
===========================================
- Hits          456      372       -84     
- Misses        117      201       +84     
Files Coverage Δ
src/cookie_config.rs 83.33% <ø> (ø)
src/lib.rs 7.14% <ø> (ø)
src/memory_store.rs 100.00% <100.00%> (ø)
src/moka_store.rs 93.75% <100.00%> (+2.84%) :arrow_up:
src/mongodb_store.rs 82.85% <100.00%> (ø)
src/redis_store.rs 100.00% <100.00%> (ø)
src/session_store.rs 52.77% <100.00%> (ø)
src/sqlx_store/mysql_store.rs 89.47% <100.00%> (ø)
src/sqlx_store/postgres_store.rs 80.95% <100.00%> (ø)
src/sqlx_store/sqlite_store.rs 78.37% <100.00%> (ø)
... and 3 more