This is a simple ACL (Access Control List) implementation for Supabase. It is based on the FastAPI framework.
pip install fastsupabased-acl
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!"}