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.1.tar.gz
.
File metadata
- Download URL: fastsupabased_acl-0.1.1.tar.gz
- Upload date:
- Size: 1.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a5b5b989e1f5af1b55556e2db5fffcd251d8972b7d1a73e549769ba9a158ecb |
|
MD5 | 0a7d20d93f7698133297912d8869ecd3 |
|
BLAKE2b-256 | f6b44c588528a3bc352fa6defbb47208915ed83d17f6b38061f8ff0a632072b0 |
File details
Details for the file fastsupabased_acl-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: fastsupabased_acl-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.0 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 | 229a8af4832cc91c16893bc4db0f65641b532f71ca3568aeb8e9a5ce5087074e |
|
MD5 | 22c9dbcbbbb4fa18991fee624da638a1 |
|
BLAKE2b-256 | bd0462a4bffcfdb24b66351431e873ce564ef1045102bdd036b760273e069526 |