Skip to content

talkdai/fastsupabased-acl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Supabase'd FastAPI Auth mechanism with Roles

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages