https://github.com/abe-winter/oflex
Stack-specific flask extensions for auth & connection pooling
https://github.com/abe-winter/oflex
flask login
Last synced: 3 months ago
JSON representation
Stack-specific flask extensions for auth & connection pooling
- Host: GitHub
- URL: https://github.com/abe-winter/oflex
- Owner: abe-winter
- Created: 2020-04-06T19:32:10.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-19T05:47:59.000Z (almost 4 years ago)
- Last Synced: 2025-01-17T20:19:01.735Z (5 months ago)
- Topics: flask, login
- Language: Python
- Homepage:
- Size: 67.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Oflex
O(pinionated) fl(ask) ex(tensions).
Flask login and connection-pooling stuff that I reuse in all my prototyping. The one-line goal of this project is to have drop-in login, however inflexible, rather than spending 6 hours setting it up every time.
This is only compatible with my postgres / redis stack and a similar DB users schema.
Will happily add docs if anyone else needs this, post a github issue to LMK.
## Features
These things wouldn't normally belong together and are only bound together by the common themes of (1) me needing them every time (2) I haven't found a right-fit library to do any of them in flask (3) they're all difficult to integrate automatically without some schema / template / backend assumptions.
* [x] flask blueprints for create-account and login pages
* [x] and scrypt passwords
* [x] and twilio login
* [x] login-required decorator which populates `flask.g.session`
* [x] graphene / graphql middleware login-required
* [ ] HSTS middleware
* [x] postgres & redis initializer
* [x] postgres connection pool context manager
* [ ] basic RBAC
* [ ] werkzeug remote IP
* [ ] in-memory and redis rate limiting
* [ ] email verification
* [ ] invitations & preapproval lists
* [ ] oauth
* [ ] add sample schema## What you should do to use this
* Look in `config.py` in this repo and make sure your SQL users table and environment variables conform to what this package expects.
* (You can customize the configs, but that's a waste)
* use `flask.current_app.pool` or `pool.withcon`, and `flask.current_app.redis` in your thing
* You have a base.htm template that defines styles, headers, etc## Consider also
These other flask login libraries that I haven't evaluated at all:
* https://github.com/mattupstate/flask-security
* https://github.com/lingthio/Flask-User
* https://github.com/maxcountryman/flask-loginThere are a lot of these because schema integration is difficult.