mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #4379] [feature]: store user sessions in DB #1599
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#1599
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RaHehl on GitHub (Sep 26, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4379
Is there an existing issue for this?
Summary
We would like to use pod scaling, as far as I understand it would be necessary for all (api) pods to have the same session information, so the best solution would probably be to store the sessions in the database.
Maybe this can be easily solved: https://github.com/kleydon/prisma-session-store
Why should this be worked on?
Makes Hoppscotch more enterprise-ready
@sah246ir commented on GitHub (Sep 29, 2024):
i am really interested in working on this issue.
@yashs33244 commented on GitHub (Oct 7, 2024):
Hey there, if no one's working on this, can i be assigned this issue? Thank you!
@iRittikSharma commented on GitHub (Oct 8, 2024):
Hi @RaHehl I would like to work on this issue. Could You please assign it to me
@RaHehl commented on GitHub (Oct 8, 2024):
Hi, I'm just the creator of the "issue". From what I understand, this should be assigned by someone from the Hopscotch team? @liyasthomas
@liyasthomas commented on GitHub (Oct 8, 2024):
Hi @iRittikSharma, do you have a proposal for the implementation. I'd love to discuss different possibilities of the implementation with Hoppscotch development team.
Feel free to open up a draft PR if you've already started working on it.
@sah246ir commented on GitHub (Oct 9, 2024):
here's my workflow for the issue
p.s @liyasthomas it would be better if you could assign it to someone so that there is only one person responsible for the task.
i would love to work on this too.
@liyasthomas commented on GitHub (Oct 9, 2024):
Looping in @AndrewBastin.
@balub commented on GitHub (Oct 9, 2024):
Hey 👋 seems interesting, I can work on this.
@balub commented on GitHub (Oct 9, 2024):
@RaHehl correct me if I am wrong here, but we essentially need to implement basic session storage now, where the session info is stored in our postgres?
@AndrewBastin commented on GitHub (Oct 9, 2024):
@RaHehl The self-hosted backend server uses JWTs to encode session information, so I am kinda confused by the session point you are raising here, the authorisation is done by reading the token, not across the DB or a session state that we maintain.
The challenge to pod scaling (horizontal scaling) implementation is actually related to mostly regarding two things.
Support for horizontal scaling is something we are working on and we will aim to ship it by the end of this month for the 2024.10 release cycle.
@RaHehl, can you confirm that you meant this issue to raise support for horizontal scaling (ability to have multiple instances of AIO/Backend containers to handle scaled loads ?) and not something else ?
@RaHehl commented on GitHub (Oct 14, 2024):
@AndrewBastin yes i can confirm it's for horizontal scaling, scaling loads and maybe version upgrades without downtime.
From a security perspective I would like to understand the jwt theme better
Am I seeing this correctly? The API issues a JWT token with the user ID and signs the whole thing. And when the client uses this signed token, is it the stateless authentication for the backend?
@AndrewBastin commented on GitHub (Oct 14, 2024):
yes, the token is signed and contains all the info the backend needs to authenticate and authorize a request coming in, the tokens are also short lived and contain a TTL info attached with as well and lives as long as the duration
ACCESS_TOKEN_VALIDITYenvironment variable specifies, after which the frontend has to request for a token refresh with the given refresh token, the refresh token is a plain value stored in the DB and using it the client can get new access tokens.Anything more to clarify ?
If so, can we rephrase this issue to be specifically addressing horizontal scaling concerns ? For our plans for the release this month, we are planning on resolving most of the blockers to horizontal scaling here. We are generally skeptical about recommending version upgrades without downtime, not because there are technical blockers, but mostly because we want to still preserve our ability to make breaking changes to the database, atleast for a couple more releases, but hopefully we can provide that in the future.