Metadata-Version: 2.5
Name: feature-standards-python-auth
Version: 0.2.0
Summary: Contract-tested session authentication for FastAPI
Project-URL: Repository, https://github.com/jongko54/feature-standards
Project-URL: Documentation, https://github.com/jongko54/feature-standards/tree/main/implementations/python-fastapi
Project-URL: Issues, https://github.com/jongko54/feature-standards/issues
Author: jongko54
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: argon2-cffi<26,>=25.1.0
Requires-Dist: fastapi<1,>=0.115
Requires-Dist: psycopg[binary]<4,>=3.2
Requires-Dist: uvicorn<1,>=0.34
Description-Content-Type: text/markdown

# Feature Standards Python authentication

Session authentication for FastAPI with a reusable application factory and authentication dependency. The implementation follows the same behavioral contracts as the project's Go, Java, Rust, and browser clients.

```python
from typing import Annotated
from fastapi import Depends
from feature_auth import create_app, current_user

app = create_app()

@app.get("/private")
def private(user: Annotated[dict, Depends(current_user)]):
    return {"user": user}
```

Python 3.12 or later is required. Configuration is read when the application lifespan starts. In-memory mode supports one configured user and process-local sessions. PostgreSQL mode adds shared persistent sessions; the optional account lifecycle profile adds registration, email verification, and password reset.

For a loopback-only demo, explicitly set `AUTH_DEMO=true`, `AUTH_COOKIE_SECURE=false`, and `AUTH_ALLOWED_ORIGIN=http://127.0.0.1:5173`. Run Uvicorn with `--no-proxy-headers`. Demo credentials are `demo@example.com` / `correct-horse-battery-staple`; they are not production credentials.

Database migrations and seeding are explicit repository tools. Installing or starting this package does not create tables or users. Production HTTPS, proxy policy, secrets, mail delivery, and operational controls require deployment-specific configuration.

See the [source and integration guide](https://github.com/jongko54/feature-standards/tree/main/implementations/python-fastapi), [contracts](https://github.com/jongko54/feature-standards/tree/main/features/auth), and [security policy](https://github.com/jongko54/feature-standards/security/policy). Contract tests are not an independent security audit. MIT licensed.
