fix(extensions): W3 add tests for auth-jwt and sqlalchemy, prep incompatibleWith - #185
Conversation
…patibleWith - extensions/fastapi-auth-jwt: add tests/test_auth.py (16 tests) covering password hashing (salted Argon2), JWT create/decode round-trip, extra claims, algorithm, secret rotation, expiry, Pydantic schemas, and router wire-up via TestClient ($auth endpoints). - extensions/fastapi-sqlalchemy: add tests/test_sqlalchemy.py (9 tests) covering DeclarativeBase registration, engine/session factory smoke, get_db generator contract, isolated in-memory round-trip, Alembic env wiring via static content check, DATABASE_URL override, and sqlite connect_args style guard. - docs/AUTHORING.md: document upcoming celery-docker vs flower-docker incompatibleWith prep for PR #178 (symmetric validation via scripts/ci/validate-registry.py / templates.schema.json). - extensions/all-postgres: fix .env.example.append style consistency (remove duplicate header and leading blank line). Co-authored-by: cpa-templates W3 task
|
Warning Review limit reached
Next review available in: 22 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
W3 extension hardening for
cpa-templates(fix/w3-extensionsbranched fromorigin/main@b6d108b).Adds missing extension tests for the two previously untested overlays and preps
incompatibleWithfor the upcomingflower-docker(PR #178).Added
extensions/fastapi-auth-jwt/template/tests/test_auth.py(16 tests): Argon2hash_password/verify_password(including salt uniqueness),create_access_token/decode_access_tokenround-trip, extra claims,JWT_ALGORITHMheader check, secret rotation (InvalidSignatureError), expiry future-window,LoginRequest/TokenResponse/UserPublicschema validation, and router wiring viaTestClientfor/auth/login(success 200 + token decode, 401 on bad password/email, 422 on bad payload) and/auth/me.extensions/fastapi-sqlalchemy/template/tests/test_sqlalchemy.py(9 tests):Basedeclarative sanity, model registration + cleanup,engine/session_factorysmoke (SELECT 1),get_dbsingle-yield generator contract, isolated in-memory sqlite round-trip with throwaway model, Alembicenv.pystatic wiring check (Baseimport,target_metadata,DATABASE_URL),DATABASE_URLenv-overrideSELECT 1, andsession.pysqlitecheck_same_threadstyle guard. Ruff/mypy/pyright green (was fixed forFromClause/Tabletyping and import sorting).Changed
docs/AUTHORING.md— documentincompatibleWithprep:celery-dockervs upcomingflower-docker(PR feat: add flower-docker extension for Celery monitoring #178) both targetcelery-workerand must declare symmetricincompatibleWithwhenflower-dockerlands. Points toscripts/ci/validate-registry.py+templates.schema.json(validation already hardened in W1).extensions/all-postgres/template/.env.example.append— style consistency: remove duplicate# PostgreSQL (optional overlay)header and leading blank line to match other extensions (# Auth JWT …,# SQLAlchemy …).Validation
python scripts/ci/validate-registry.py→✅ registry ok (6 templates, 18 extensions)onfix/w3-extensions.file://URLs viauvx create-awesome-python-app@latest):fastapi-starter + fastapi-auth-jwt + fastapi-sqlalchemy→uv sync→ruff check✅,mypy✅,pyright✅,pytest -q34 passed.fastapi-starter + fastapi-auth-jwtalone → 25 passed, lint/type green.fastapi-starter + fastapi-sqlalchemyalone → 17 passed, lint/type green.Notes
incompatibleWithforflower-dockernot yet added totemplates.json— symmetric validation would fail without theflower-dockerextension present (it doesn't exist onmainyet). This PR only documents the intent and ensures validation is ready (W1 already addedincompatibleWith+compatibleWithhandling). PR feat: add flower-docker extension for Celery monitoring #178 will add the symmetric entries.templates.jsonentry changes; no new extension slugs.fix/w3-extensionspushes 4 files changed (+335/-3), commit075069b.