Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #158, closes #178, and closes #179. This is a massive PR that completely overhauls our auth flow. The old auth flow had multiple problems detailed in #178 (comment).
With this PR we now have a session based auth workflow that is independent of the UI through the following endpoints:
GET /login
: user defined login pagePOST /login
: login endpoint for form-based auth, e.g. username and passwordGET /oauth-callback
: login endpoint for OAuth based authGET /logout
: logout endpoint to clear the active sessionThe login endpoints can be configured through the
ragna.config.Auth
object.After a successful login we set a session cookie and create an entry for the corresponding user in a key-value-store. With this PR we have support for in-memory and Redis key-value-stores.
Although we don't have a way to display it yet, the auth flow already supports authenticating with an API token, which is generated for each user.
Todo in follow-up PRs:
I'm aware that reviewing this is quite the ask. Happy to schedule some time to walk you through any part of the change.