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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastsupabased_acl-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 0855a898aa4fce49addbc5a0239878fd33a732e43bf9c3784ad1a920092715cb
MD5 dc99e8c64f188f8bcd6135c78abc4cfa
BLAKE2b-256 fe0165174e58683fb345f449a13c6678ab1f2f08555de1452b3b4063825a2865

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastsupabased_acl-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2fd84d9b7992e8a845b59831f8fdee095287ae880c99955fcf21045aaf03f799
MD5 1d5a727d6c69342665949e9e748922b9
BLAKE2b-256 a889cf7794e1f044fe2062974b7cc90364d0836c756fb428e01acbcfcaa73130

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