Authentication, sessions, admin dashboard, and per-user stores for the enlace platform
Project description
enlace_auth
Authentication, sessions, an admin dashboard, and per-user stores for the enlace multi-app platform.
enlace itself is auth-agnostic — it composes apps and routes traffic. This
package plugs in at compose time and adds:
/auth/login,/auth/logout,/auth/register,/auth/whoami,/auth/csrf,/auth/me/password,/auth/shared-login/_admin/api/*— list/create/delete users, admin password reset, view app policy. Gated by an admin allowlist.- per-user data injection via
request.state.store PlatformAuthMiddleware+CSRFMiddleware- optional OAuth2 / OIDC via Authlib
Quick start
from enlace import build_backend, PlatformConfig
from enlace_auth import plugin as auth_plugin
config = PlatformConfig.from_toml("platform.toml")
app = build_backend(config, plugins=[auth_plugin])
Or, if you serve via uvicorn --factory enlace.compose:create_app, set:
export ENLACE_PLUGINS=enlace_auth:plugin
Configuration
In platform.toml:
[auth]
enabled = true
session_cookie_name = "enlace_session"
session_max_age_seconds = 86400
signing_key_env = "ENLACE_SIGNING_KEY"
secure_cookies = true
[auth.stores]
backend = "file"
path = "~/.enlace/platform_store"
[stores.user_data]
backend = "file"
path = "~/.enlace/user_data"
Plus environment variables:
ENLACE_SIGNING_KEY— signing key (32+ chars). Generate withpython -c "import secrets; print(secrets.token_urlsafe(32))".ENLACE_ADMIN_EMAILS— comma-separated admin emails (gate/_admin).ENLACE_ALLOW_UNSIGNED=1— opt-out from fail-fast (diagnostics only).
Doctor checks
from enlace.doctor import run_doctor
from enlace_auth.diagnostics import static_checks, http_checks
report = run_doctor(
config,
base_url="http://localhost:8000",
extra_static_checks=static_checks,
extra_http_checks=http_checks,
)
Status
Extracted from enlace 0.0.11. The Python API is stable; an admin frontend
ships separately as a normal enlaced app.
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 enlace_auth-0.1.2.tar.gz.
File metadata
- Download URL: enlace_auth-0.1.2.tar.gz
- Upload date:
- Size: 37.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
885c40ffee674bc3d8f88f3703b55ed86da5f7c406aac22abe5da775eec4888b
|
|
| MD5 |
50dd61e883ce0d03739ebbb05e2f92ff
|
|
| BLAKE2b-256 |
5fe6f5ffabbac6f43d1e55ba039a6298e20f07d53c2d95c50312fbbcfd840f50
|
File details
Details for the file enlace_auth-0.1.2-py3-none-any.whl.
File metadata
- Download URL: enlace_auth-0.1.2-py3-none-any.whl
- Upload date:
- Size: 33.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55d26ce020ebeca0d561ebf527fec60bad0f4198ea2aca9af4755ebf17571bb7
|
|
| MD5 |
5254436e85c52911cb8374d66b2eeadb
|
|
| BLAKE2b-256 |
e3e5e9dc450e4cd40b2142064806eefe1c83d19937df2d74c1c4ffc1419c2a1e
|