Phzyx Auth — identity, sessions, JWT, API keys, RBAC. Docs: https://phzyx.xyz/forge/tutorials/auth
Project description
Phzyx Auth
Secure-by-default identity, sessions, JWT, API keys, and RBAC for Forge apps and AdminBoard.
This is an optional battery. Most apps start with:
uv add phzyx-forge
uv add 'phzyx-forge[auth]'
# or: uv add phzyx-auth
Full docs live on the website
PyPI is the install surface. Tutorials, production notes, and product context are on phzyx.xyz:
| Auth tutorial | https://phzyx.xyz/forge/tutorials/auth |
| Forge docs | https://phzyx.xyz/forge |
| Getting started | https://phzyx.xyz/forge/getting-started |
| Product home | https://phzyx.xyz |
| Source | https://github.com/phzyxyz/forge |
After install → open phzyx.xyz/forge/tutorials/auth.
Install
uv add 'phzyx-forge[auth]'
# equivalent
uv add 'phzyx-auth[fastapi]'
Requires phzyx-forge (product wheel).
What you get (0.1)
| Area | Capability |
|---|---|
| Passwords | Argon2id, policy min length |
| Sessions | Opaque cookie sessions (hashed at rest), idle + absolute TTL |
| JWT | HS256 access + rotating refresh |
| API keys | phx_ prefix, scopes, list/revoke |
| RBAC | Groups / permissions, Principal, guards |
| Lockout | Failed-login counter + rate limits + audit log |
| Reset / change | Forgot/reset (anti-enum), change password, revoke sessions |
| CSRF | Double-submit cookie + X-CSRF-Token for session mutations |
| AdminBoard | Permission bridge for staff UI |
| CLI | phzyx-auth create-superuser |
Pre-1.0: APIs may change. Prefer lockfiles.
Quick start (FastAPI)
from fastapi import Depends, FastAPI
from phzyx.auth import AuthConfig, AuthService, Principal
from phzyx.auth.adapters.fastapi import mount_auth, require_user
app = FastAPI()
svc = AuthService(
config=AuthConfig(
secret="use-PHZYX_AUTH_SECRET-32+bytes-in-prod!!",
production=False,
cookie_secure=False,
)
)
mount_auth(app, svc)
@app.get("/private")
async def private(user: Principal = Depends(require_user)):
return {"email": user.email}
phzyx-auth create-superuser --email admin@example.com --password 'longpassword1'
Full walkthrough: Auth tutorial.
Related
- Product: phzyx-forge
- Cache battery: phzyx-cache
- Site: phzyx.xyz
License
MIT · phzyx.xyz
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phzyx_auth-0.1.1.tar.gz.
File metadata
- Download URL: phzyx_auth-0.1.1.tar.gz
- Upload date:
- Size: 43.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a13436230043b06e3361f8f64c1ad133eb6cb8e705d81fdd44c624e34209512a
|
|
| MD5 |
73f59128d9ca4f88ca856f6107a77e34
|
|
| BLAKE2b-256 |
82024340b3a66198ab9247c9829a9ef3399a29eabcd8de9f74e71d5a8f418159
|
Provenance
The following attestation bundles were made for phzyx_auth-0.1.1.tar.gz:
Publisher:
publish.yml on phzyxyz/forge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phzyx_auth-0.1.1.tar.gz -
Subject digest:
a13436230043b06e3361f8f64c1ad133eb6cb8e705d81fdd44c624e34209512a - Sigstore transparency entry: 2270075360
- Sigstore integration time:
-
Permalink:
phzyxyz/forge@2b0de8bbd47ad6563bb700115c2aa67073f4e403 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/phzyxyz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2b0de8bbd47ad6563bb700115c2aa67073f4e403 -
Trigger Event:
push
-
Statement type:
File details
Details for the file phzyx_auth-0.1.1-py3-none-any.whl.
File metadata
- Download URL: phzyx_auth-0.1.1-py3-none-any.whl
- Upload date:
- Size: 47.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45358cdc1ba7f25b80e4f81ccaea6feb4ea8c138fd86e6b364fdbcbd553f44ec
|
|
| MD5 |
9b911fa69af7b54d38c0a1a84e4b9d49
|
|
| BLAKE2b-256 |
a54bd68e175d88b90a3136916683c1939491d5deb3659baa95f8e28dc83a8556
|
Provenance
The following attestation bundles were made for phzyx_auth-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on phzyxyz/forge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phzyx_auth-0.1.1-py3-none-any.whl -
Subject digest:
45358cdc1ba7f25b80e4f81ccaea6feb4ea8c138fd86e6b364fdbcbd553f44ec - Sigstore transparency entry: 2270075676
- Sigstore integration time:
-
Permalink:
phzyxyz/forge@2b0de8bbd47ad6563bb700115c2aa67073f4e403 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/phzyxyz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2b0de8bbd47ad6563bb700115c2aa67073f4e403 -
Trigger Event:
push
-
Statement type: