Skip to content

๐Ÿ› ๏ธ Development

Working on jwtlib itself.


๐Ÿ“‚ Repository layout

Path Purpose
jwtlib/ The library package (app, introspection, models, repository, security, utils, exceptions)
jwtlib/*.pyi Type stubs published alongside the implementations
tests/ Auth-flow tests (register โ†’ login โ†’ verify โ†’ logout)
docs/lib/ Generated library reference (docforge, flat layout)
docs/mcp/ Machine-readable bundle served by the MCP server
docs/wiki/ This hand-written wiki

๐Ÿ”ง Setup

python -m venv .venv
.venv/Scripts/pip install -e ".[dev]"

๐Ÿงช Tests

.venv/Scripts/python -m pytest

The suite drives the full async auth flow: registration, login, duplicate handling, session lookup, logout, and introspection.


โœ… Quality gates

The CI quality gate runs, matching the Drone pipeline:

1
2
3
4
.venv/Scripts/black --check .
.venv/Scripts/ruff check .
.venv/Scripts/mypy
.venv/Scripts/python -m pytest

๐Ÿ“ Building documentation (docforge)

The site is generated by docforge and served per kind under site/{kind}:

1
2
3
4
doc-forge build \
  --mkdocs --mcp --wiki \
  --module-is-source --module jwtlib \
  --site-name "JWT Authentication Library"
  • --module-is-source renders the flat docs/lib/ layout (no nesting under jwtlib/), matching docforge.nav.yml and docs/mkdocs.lib.yml.
  • --mcp regenerates the structured bundle in docs/mcp/.
  • --wiki builds this wiki.

Preview locally:

1
2
3
doc-forge serve --lib
doc-forge serve --wiki
doc-forge serve --mcp

๐Ÿ”’ Security checklist

  • Never log passwords, tokens, or hash material.
  • Keep new flows pure: models in models/, token logic in security.py, orchestration in app.py.
  • Add a regression test for every auth behavior change.