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: session support improvements #325

Merged
merged 2 commits into from
Feb 8, 2023
Merged

feat: session support improvements #325

merged 2 commits into from
Feb 8, 2023

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Feb 8, 2023

  • Support maxAge to expire sessions
    • Stored new session.createdAt
    • Cookie expiration time is based on createdAt + maxAge Note: Cookies are session-only be default and removed after browser closed unless setting ttl
    • Sealing uses maxAge
    • Unseal operaion (double) checks age
  • Invalid/Expired sessions are silently dropped and renewed
  • Exposed new sealSession (useful for generating tokens) / unsealSessin
  • Header based auth support (default header is x-{name}-session / x-h3-session)
  • Cookie can be disabled with cookie: false

Overall this provides a more stable session support, header authorization and expiration feature.

@codecov
Copy link

codecov bot commented Feb 8, 2023

Codecov Report

Merging #325 (c0b962b) into main (a4b6f0d) will decrease coverage by 2.34%.
The diff coverage is 11.11%.

@@            Coverage Diff             @@
##             main     #325      +/-   ##
==========================================
- Coverage   73.16%   70.82%   -2.34%     
==========================================
  Files          22       22              
  Lines        1904     1981      +77     
  Branches      289      289              
==========================================
+ Hits         1393     1403      +10     
- Misses        511      578      +67     
Impacted Files Coverage Δ
src/utils/session.ts 21.96% <11.11%> (-5.05%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@pi0 pi0 merged commit 5ca9c41 into main Feb 8, 2023
@pi0 pi0 deleted the feat/session-token branch February 8, 2023 14:10
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.

None yet

1 participant