Skip to main content

simple_module_api_tokens

Personal access tokens and service API keys for simple_module apps.

  • smpat_… tokens act for their owner, smsk_… service keys act for no one, with roles chosen at creation (never admin) and a pinned tenant.
  • Every token carries scopes, which cap what it can do on every request, even when its owner is an admin. Demoting the owner shrinks the token at once.
  • Only sha256(token) is stored, and the secret is shown once. Revocation applies on the next request.
  • Tokens can only be created, listed and revoked from a signed-in browser session, with a CSRF token.

Install

pip install simple_module_api_tokens

Add simple_module_api_tokens to your host's dependencies and generate a migration. It needs the auth module. Under keycloak (no users) service keys work and personal tokens are refused, since the owner's roles live in the IdP.

Usage

curl -H "Authorization: Bearer smpat_…" https://app.example.com/api/feature_flags/
Route Page Purpose
GET /api-tokens/ ApiTokens/Index Your own tokens (api_tokens.use)
GET /admin/api-tokens/ ApiTokens/Admin All tokens and service keys (api_tokens.manage)

Settings: max_lifetime_days (default 365), DB-backed.

See docs/modules/api_tokens.md for the resolution order, the scope cap and the tenancy rules.

Metadata

Release files for simple-module-api-tokens 0.0.48

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simple-module-api-tokens 0.0.48
File Size Uploaded Provenance Actions
simple_module_api_tokens-0.0.48.tar.gz 47.3 kB With provenance Details for simple_module_api_tokens-0.0.48.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simple-module-api-tokens 0.0.48
File Interpreter ABI Platform Actions
simple_module_api_tokens-0.0.48-py3-none-any.whl Python 3 none any Details for simple_module_api_tokens-0.0.48-py3-none-any.whl

Total release size: 92.6 kB

Release files / simple_module_api_tokens-0.0.48.tar.gz

Download URL simple_module_api_tokens-0.0.48.tar.gz
Size 47.3 kB
Tags Source
SHA-256 checksum
How to use checksums
becc146ad034b6e51c0cc5082ae32c0032c8fff4649bdc9c4850f3a2dd70bc62
BLAKE2b-256 checksum
How to use checksums
f28f5becaa4d486a1fc9f67a54b0e1266f4a6478889760a6e5a11a5b7e0202e0
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 19, 2026.

Transparency log

Release files / simple_module_api_tokens-0.0.48-py3-none-any.whl

Download URL simple_module_api_tokens-0.0.48-py3-none-any.whl
Size 45.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aea3e0dfe7b07584af5c35b295c00ac9ed02ad6a2ee5ed75ac0fa403b00fc7e9
BLAKE2b-256 checksum
How to use checksums
88b42cc3686613b4b85abdb32776e501e0c479f7168140ff2caaf4875bb0a5d0
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 19, 2026.

Transparency log

Security for simple-module-api-tokens 0.0.48

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for simple_module_api_tokens-0.0.48.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 19, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page