https://github.com/jordanisaacs/fastapi-sessions
Ready-to-use session cookies with custom backends for FastAPI
https://github.com/jordanisaacs/fastapi-sessions
authentication cookies fastapi sessions
Last synced: 3 months ago
JSON representation
Ready-to-use session cookies with custom backends for FastAPI
- Host: GitHub
- URL: https://github.com/jordanisaacs/fastapi-sessions
- Owner: jordanisaacs
- License: mit
- Archived: true
- Created: 2021-04-03T22:43:19.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T05:41:00.000Z (almost 2 years ago)
- Last Synced: 2025-01-16T09:13:29.694Z (4 months ago)
- Topics: authentication, cookies, fastapi, sessions
- Language: Python
- Homepage:
- Size: 802 KB
- Stars: 104
- Watchers: 8
- Forks: 31
- Open Issues: 9
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# FastAPI-Sessions
Note: Currently not maintained, feel free to fork and modify to your needs
---
Documentation: [https://jordanisaacs.github.io/fastapi-sessions/](https://jordanisaacs.github.io/fastapi-sessions/)
Source Code: [https://github.com/jordanisaacs/fastapi-sessions/](https://github.com/jordanisaacs/fastapi-sessions/)
PyPI: [https://pypi.org/project/fastapi-sessions/](https://pypi.org/project/fastapi-sessions/)
---
Quickly add session authentication to your FastAPI project. **FastAPI Sessions** is designed to be user friendly and customizable.
## Features
- [x] Dependency injection to protect routes
- [x] Compatible with FastAPI's auto generated docs
- [x] Pydantic models for verifying session data
- [x] Abstract session backend so you can build one that fits your needs
- [x] Abstract frontends to choose how you extract the session ids (cookies, header, etc.)
- [x] Create verifiers based on the session data
- [x] Mix and match frontends and backendsCurrently Included Backends/Frontends:
- [x] Backends
- [x] In memory dictionary
- [x] Frontends
- [x] Signed cookiesUpcoming:
* Documentation and user guides
* More backends and frontends## Installation
```python
pip install fastapi-sessions
```## Getting Started
Check out the guide to using fastapi-sessions: [https://jordanisaacs.github.io/fastapi-sessions/guide/getting_started/](https://jordanisaacs.github.io/fastapi-sessions/guide/getting_started/)