Development
Working on the auth server itself.
Repository layout
| Path | Purpose |
|---|---|
main.py |
FastAPI app factory, environment wiring, lifespan, OpenAPI customization |
jwt/ |
The auth routes package (router, get_current_user) |
generate_spec.py |
Regenerates the committed OpenAPI spec |
docs/api/ |
API reference (Swagger UI embed + openapi.json) |
docs/lib/ |
Generated library reference (docforge) |
docs/wiki/ |
This hand-written wiki |
tests/ |
Async route tests against an in-memory Mongo mock |
Setup
Dependencies are installed from the private pip index (see requirements.txt
and the Dockerfile). Core runtime packages:
py-jwt==0.0.4— providesjwtlib(applications logic, models, security, introspection)mongo-ops==0.1.3— MongoDB persistence layerfastapi,uvicorn,python-jose,passlib,bcrypt,pymongo
Tests
Run the suite (no network or Mongo required — an in-memory mock is used):
Coverage spans the full HTTP flow: register → login → wrong-password 401 →
/me with and without a token → stateless logout.
Regenerating the OpenAPI spec
The committed docs/api/openapi.json is produced offline:
MONGO_HOST only needs to be set for the import; no connection is opened.
Building documentation (docforge)
The site is generated by docforge
and served per kind under site/{kind}:
--apirendersopenapi.jsonwith Swagger UI.--mkdocsrenders the library reference fromjwtdocstrings.--wikibuilds this wiki.- Navigation layout is defined in
docforge.nav.yml.
Preview locally: