Quansight / ragna

RAG orchestration framework ⛵️
https://ragna.chat
BSD 3-Clause "New" or "Revised" License
181 stars 22 forks source link

add session based auth workflow #464

Open pmeier opened 4 months ago

pmeier commented 4 months ago

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 https://github.com/Quansight/ragna/issues/178#issuecomment-2003254762.

With this PR we now have a session based auth workflow that is independent of the UI through the following endpoints:

The 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.