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

Separate SessionManager and SessionManagerLayer #15

Closed
wants to merge 4 commits into from

Conversation

justmangoou
Copy link
Contributor

@justmangoou justmangoou commented Sep 28, 2023

Implementing the design from #11 .

This is not the final design so I expect any feedback. Also this could block (or be blocked by) #8

@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Merging #15 (6c5e40e) into main (48f41bf) will decrease coverage by 3.85%.
Report is 1 commits behind head on main.
The diff coverage is 54.00%.

❗ Current head 6c5e40e differs from pull request most recent head 8963c18. Consider uploading reports for the commit 8963c18 to get more accurate results

@@            Coverage Diff             @@
##             main      #15      +/-   ##
==========================================
- Coverage   79.35%   75.51%   -3.85%     
==========================================
  Files          13       13              
  Lines         431      441      +10     
==========================================
- Hits          342      333       -9     
- Misses         89      108      +19     
Files Coverage Δ
src/lib.rs 25.00% <ø> (-8.34%) ⬇️
src/mongodb_store.rs 96.66% <87.50%> (-3.34%) ⬇️
src/service.rs 72.72% <83.33%> (+1.95%) ⬆️
src/cookie_config.rs 37.50% <0.00%> (-48.22%) ⬇️

@maxcountryman
Copy link
Owner

I think I missed from the previous discussion why this requires making the session manager a parameter of the layer.

@justmangoou
Copy link
Contributor Author

justmangoou commented Oct 2, 2023

I intentionally decided to separate SessionManager from SessionManagerLayer but I started thinking this is a bad decision

@justmangoou
Copy link
Contributor Author

But if you're wondering, this

Edited design:

Allow construct SessionManager publicly.
Add SessionManager to State (idk if tower has this) and retrieve it from middleware.
Add option to allow SessionManager issues session automatically or not.

@justmangoou justmangoou closed this Oct 3, 2023
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.

2 participants