Skip to main content

Email + password user management, admin invites, RBAC-ready — replaces Keycloak for simple_module apps

Project description

simple_module_users

Email+password user management for simple_module apps. Replaces Keycloak/Auth0 for the common case: local accounts, admin invites, password reset, optional public signup. Built on fastapi-users.

Install

pip install simple_module_users

Pre-wired into any app scaffolded with simple-module new.

What it provides

  • Email + password registration, login, logout, password reset.
  • Admin invite flow — admin enters an email, recipient clicks a link, sets a password, is logged in.
  • Public signup toggle (SM_USERS_ALLOW_SIGNUP, default false).
  • Bootstrap admin via env vars (SM_USERS_BOOTSTRAP_EMAIL + SM_USERS_BOOTSTRAP_PASSWORD) — idempotent, only creates if the users table is empty.
  • sm-users create-admin CLI for ad-hoc admin creation.
  • Inertia pages for login/register/invite-accept/admin-invite.
  • Console mailer (logs to stdout) or SMTP mailer (SM_USERS_MAILER=smtp).

Usage

CLI:

uv run sm-users create-admin --email admin@example.com --password 'change-me'

Bootstrap-on-boot (.env):

SM_USERS_BOOTSTRAP_EMAIL=admin@example.com
SM_USERS_BOOTSTRAP_PASSWORD=change-me

Program:

from users.deps import CurrentUser    # type: ignore[import-not-found]

@router.get("/profile")
async def profile(user: CurrentUser):
    return {"email": user.email}

Depends on

  • simple_module_core, simple_module_db, simple_module_hosting, simple_module_auth
  • fastapi-users[sqlalchemy]>=15,<16, aiosmtplib, cachetools, typer

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple_module_users-0.0.1.tar.gz (60.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_module_users-0.0.1-py3-none-any.whl (61.4 kB view details)

Uploaded Python 3

File details

Details for the file simple_module_users-0.0.1.tar.gz.

File metadata

  • Download URL: simple_module_users-0.0.1.tar.gz
  • Upload date:
  • Size: 60.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for simple_module_users-0.0.1.tar.gz
Algorithm Hash digest
SHA256 465543eb3e5a7ec8e72cf0323902b14710277185c98c814b1391598e0242a9f2
MD5 19ec86892c5fd7e8a676d3cd5d98dcfb
BLAKE2b-256 67773e694ed5016e9040a7a7ad82102f6c74f63fffa6d672fdcbaa25b040e19f

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_module_users-0.0.1.tar.gz:

Publisher: release.yml on antosubash/simple_module_python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_module_users-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_module_users-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 049f2d7a6762eeb1ff5e5f3089b1760faa1fdeb40b16ad6e58b38053da2e88eb
MD5 70caef89c552d2a5939b05609b94a7f1
BLAKE2b-256 afb3e9bff9aba5b90b3e40101a04c832250f3ff2c03bd68d5909d18f1fac6185

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_module_users-0.0.1-py3-none-any.whl:

Publisher: release.yml on antosubash/simple_module_python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page