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.4.tar.gz (1.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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

Hashes for fastsupabased_acl-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f56bcbc781dbaba1b3d128b56e3d227fb191d56910ee26bcc93be2e9b25849a6
MD5 54fc76269c3461cb5f2b729ad380f8f0
BLAKE2b-256 5d6289f343efdc7593cf420e5f74c8a87ce37cbde09bd1159ad64cde09d8c2f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsupabased_acl-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b27a25d4939542ff80aca66e11c3deeb9d58c08caaa72bb7c37c4ea00cff27a6
MD5 7a2780371e99f4a893509c872ea0d0d6
BLAKE2b-256 a1a2f317c9ab37585c72c678488527aa582e5e1aaf6dc87604cf818a588c0c80

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