Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 783 Bytes

README.md

File metadata and controls

33 lines (22 loc) · 783 Bytes

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!"}