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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastsupabased_acl-0.1.4.tar.gz.
File metadata
- Download URL: fastsupabased_acl-0.1.4.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 |
f56bcbc781dbaba1b3d128b56e3d227fb191d56910ee26bcc93be2e9b25849a6
|
|
| MD5 |
54fc76269c3461cb5f2b729ad380f8f0
|
|
| BLAKE2b-256 |
5d6289f343efdc7593cf420e5f74c8a87ce37cbde09bd1159ad64cde09d8c2f3
|
File details
Details for the file fastsupabased_acl-0.1.4-py3-none-any.whl.
File metadata
- Download URL: fastsupabased_acl-0.1.4-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 |
b27a25d4939542ff80aca66e11c3deeb9d58c08caaa72bb7c37c4ea00cff27a6
|
|
| MD5 |
7a2780371e99f4a893509c872ea0d0d6
|
|
| BLAKE2b-256 |
a1a2f317c9ab37585c72c678488527aa582e5e1aaf6dc87604cf818a588c0c80
|