This release is a pre-release and may not be stable for production use.
warden
Identity and audit for Python web applications: users, sign-in, invitations, OpenID Connect single sign-on, roles and permissions, API keys, and a tamper-evident audit trail with syslog forwarding.
Status: beta. 0.1.0 is feature complete and in testing; it takes fixes only until its release. Before 1.0 a minor version may break the public API, and every break is named in the changelog with an upgrade note.
warden is built by Cognisn as the shared identity and audit foundation for its products. It is an embedded library, not a service: an application installs it, passes in its database connection pool and configuration, and mounts warden's FastAPI routers wherever it chooses. warden has no user interface; each application builds its own screens against warden's documented HTTP contract.
What it provides
Identity
- User lifecycle: invite, activate, suspend and deactivate.
- Password sign-in with TOTP and recovery codes, with Argon2id hashing.
- Invitations and password reset by single-use, expiring emailed links.
- OpenID Connect single sign-on: authorisation code with PKCE, pre-provisioned accounts only, and local password sign-in kept as the break-glass path.
- Access tokens and rotating refresh tokens, with reuse detection and an absolute session lifespan.
- API keys scoped to a subset of permissions.
- Roles defined by the application as named sets of its own permissions, with FastAPI dependencies to enforce them.
Audit
- One recording funnel for warden's own events and the application's.
- A hash-chained, append-only audit trail, with a verification command.
- Forwarding to a syslog collector (RFC 5424 over UDP, TCP or TLS) that never slows a request.
- Filtering and export to CSV or NDJSON.
- Configurable retention, with signed checkpoints that keep the chain verifiable across purges.
- Signed anchors of the chain's head, which a SIEM keeps and verification checks the database against.
The audit half works on its own, so an application with its own authentication can still use it.
Requirements
- Python 3.12 or later.
- PostgreSQL. warden keeps its tables in a dedicated
wardenschema with its own migration history. - FastAPI and psycopg 3, installed with warden.
cognisn-konfigfor configuration and secrets, installed with warden.
psycopg needs the PostgreSQL client library, libpq. Install the binary build alongside warden (psycopg[binary]) or provide a system libpq.
Installation
pip install cognisn-warden "psycopg[binary]"
The import name is warden. A pre-release, such as 0.1.0rc1, needs pip install --pre cognisn-warden or the exact version.
An application loads its WardenConfig through konfig, runs warden migrate against its database, passes warden its connection pool, and mounts warden's routers under prefixes it chooses. The client-behaviour guide describes what a client of those routes must do, and the HTTP contract documents every route.
Documentation
- Design overview: decisions, scope, acceptance tests and delivery plan.
- Client-behaviour guide
- HTTP contract
- Changelog
- Security policy
Sample console
examples/console is a small sample product that mounts warden's routers in FastAPI and exercises them from a plain HTML and JavaScript console: sign-in with TOTP, single sign-on, invitations and password reset (with an in-memory outbox), administration, API keys, and the audit trail with export, verification, anchors and syslog. It shows how a product integrates warden, using only warden's public surface. It is for local development only, not a deployment template, and it is not part of the published package.
Licence
Licensed under the Apache License, Version 2.0. Copyright 2026 Cognisn Pty Ltd. See NOTICE.
Metadata
Release files for cognisn-warden 0.1.0b8
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 |
|---|---|---|---|---|
| cognisn_warden-0.1.0b8.tar.gz | 370.8 kB | With provenance | Details for cognisn_warden-0.1.0b8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cognisn_warden-0.1.0b8-py3-none-any.whl | Python 3 | none | any | Details for cognisn_warden-0.1.0b8-py3-none-any.whl |
Total release size: 572.2 kB
Release files / cognisn_warden-0.1.0b8.tar.gz
| Download URL | cognisn_warden-0.1.0b8.tar.gz |
|---|---|
| Size | 370.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd651f751155e56359a4a99a45270367f11452f40735c85db1917e030c9ca931
|
|
BLAKE2b-256 checksum How to use checksums |
2c821e18c7d9417cbebd0e48ef08a2e3f83aacaee4799bc04e8a9f58c2aab267
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / cognisn_warden-0.1.0b8-py3-none-any.whl
| Download URL | cognisn_warden-0.1.0b8-py3-none-any.whl |
|---|---|
| Size | 201.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc99dc0c37454207d08202b2a3525401da772dfff9121e1563e0a35523ae3706
|
|
BLAKE2b-256 checksum How to use checksums |
ac9b5a97e55b9086f80f97b024f1b64ad46bbba86a1b411293a35ac5a428ad1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logSecurity for cognisn-warden 0.1.0b8
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for cognisn_warden-0.1.0b8.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logA 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.