Skip to main content

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

fastsupabased_acl-0.1.2.tar.gz (1.5 kB view details)

Uploaded Source

Built Distribution

fastsupabased_acl-0.1.2-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

Details for the file fastsupabased_acl-0.1.2.tar.gz.

File metadata

  • Download URL: fastsupabased_acl-0.1.2.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

Hashes for fastsupabased_acl-0.1.2.tar.gz
Algorithm Hash digest
SHA256 10e79348c865e049f9d3137a5ca0b477fc5e95e81e7ece041f4f36efe72b429c
MD5 fc6568eaf44d3cdc336bcf9b5a8d5f06
BLAKE2b-256 4dabf572b69440fe492882709c083f9e7a58c91fca09dc176618bb69f0604872

See more details on using hashes here.

File details

Details for the file fastsupabased_acl-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for fastsupabased_acl-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1440aa24f01265f37fe87298c2fa1748a13f0de3f95cfd2bb554d50b451bd03d
MD5 ee433e13114ad5efa9b93dd3ffa93cae
BLAKE2b-256 7266a2a497349b1c2356232315e272402cd92c291ca7ad1928298d27d3cf163f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page