FastAPI Dependency for Supabase-based ACL using Supabase Roles
Project description
FastSupabased ACL
This is a simple ACL (Access Control List) implementation for Supabase. It is based on the FastAPI framework.
Installation
pip install fastsupabased-acl
Usage
Set the environment variables SUPABASE_URL
and SUPABASE_KEY
to your Supabase URL and key.
export SUPABASE_URL=https://your-supabase-url.com
export SUPABASE_KEY=your-supabase-key
Then, on your source code:
from fastapi import FastAPI, Depends
from fastsupabased_acl import FastSupabasedACL
app = FastAPI()
authenticated_acl = FastSupabasedACL(role=["authenticated"])
@app.get("/test", dependencies=[Depends(authenticated_acl)]
def simple_authenticated_route():
return {"message": "Hello, authenticated user!"}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fastsupabased_acl-0.1.0.tar.gz
.
File metadata
- Download URL: fastsupabased_acl-0.1.0.tar.gz
- Upload date:
- Size: 1.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a525cec9855e7df3d7ff8628d343f98271ee3b918f563a2688389f110d2b525 |
|
MD5 | 4a4f1ac6241284f3617f7d1d8eaaf91f |
|
BLAKE2b-256 | 7a214deb6aef9891b6cace275985677bdaf3d90f70eadea47fd0a5bebad9c419 |
File details
Details for the file fastsupabased_acl-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: fastsupabased_acl-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68cf1b2300cc4e5271ca43ad83eff808b3a11e34ad35c9d47872b853a884b15b |
|
MD5 | 43d57db0c40e9f751f5b688ecf917a22 |
|
BLAKE2b-256 | 74ea59f7a6e5a3ea10c40b6674470cf2bfb1bfc90f5287e9f02ae1a909d2288c |