Phlow Auth Python
JWT authentication middleware for AI agents with Supabase integration.
Installation
pip install phlow-auth
Quick Start
from phlow_auth import PhlowMiddleware, PhlowConfig, AgentCard
# Configure your agent
config = PhlowConfig(
supabase_url="https://your-project.supabase.co",
supabase_anon_key="your-anon-key",
agent_card=AgentCard(
name="My Agent",
description="AI assistant agent",
service_url="https://my-agent.com",
skills=["chat", "analysis"],
metadata={"agent_id": "my-agent-id", "public_key": "your-public-key"}
),
private_key="your-private-key"
)
# Initialize middleware
phlow = PhlowMiddleware(config)
# Use as decorator with FastAPI
from fastapi import FastAPI, Request
app = FastAPI()
@app.post("/api/chat")
@phlow.authenticate()
async def chat(request: Request):
# Access agent context
agent = request.phlow.agent
supabase = request.phlow.supabase
return {"message": f"Hello from {agent.name}"}
Features
- JWT Authentication - Verify A2A Protocol JWT tokens
- Agent Storage - Store and retrieve agent cards from Supabase
- RLS Helpers - Generate basic Row Level Security policies
- Event Logging - Track authentication events
- Multi-Framework - Works with FastAPI, Flask, and Django
Development
# Clone the repository
git clone https://github.com/prassanna-ravishankar/phlow.git
cd phlow/packages/phlow-auth-python
# Install development dependencies
uv sync --extra dev
# Run tests
uv run pytest
# Format code
uv run black src tests
uv run isort src tests
# Type checking
uv run mypy src
Documentation
- 📖 Documentation: https://prassanna.io/phlow/
- 🐛 Issues: https://github.com/prassanna-ravishankar/phlow/issues
- 💬 Discussions: https://github.com/prassanna-ravishankar/phlow/discussions
License
MIT License - see LICENSE file for details.
Metadata
Release files for phlow-auth 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| phlow_auth-0.0.5.tar.gz | 10.6 kB | Without provenance | Details for phlow_auth-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| phlow_auth-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for phlow_auth-0.0.5-py3-none-any.whl |
Total release size: 23.6 kB
Release files / phlow_auth-0.0.5.tar.gz
| Download URL | phlow_auth-0.0.5.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e5eacc17b2b2183106bca0a1829215870c1942dbb5cfebe5c562715146ec5604
|
|
BLAKE2b-256 checksum How to use checksums |
d1085ded9b9ff53cc2a0d3b85ef1f928467cba45d54a7b8ec5adeed9c53d1e28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.13
|
Release files / phlow_auth-0.0.5-py3-none-any.whl
| Download URL | phlow_auth-0.0.5-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3aa4def66a491c8272d6f6f39b5b0a3c8e33e56777828612f7242ebc22f3e870
|
|
BLAKE2b-256 checksum How to use checksums |
9362b97800d061132bfb83361dd949e5a1f989839139887e901331f89801732b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.13
|
Security for phlow-auth 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.