v0.2.0
π Features
AreasBase: declare business areas as typed class attributes;Areaobjects
are instantiated automatically on__init__β no more dict-based accessADMIN = 2permission level added; satisfiesREADandWRITErequirementsAreanow exposesREAD,WRITE, andADMINAccessRuleattributesTokenBearer: canonical name for the cookie-with-header-fallback bearer
π Refactor
(bearers)FallbackTokenBearerrenamed toTokenBearer; old name kept as
a deprecated alias via__getattr__(rules)Scoperenamed toArea;make_scopes/make_scoperenamed to
make_areas/make_area; old names kept as deprecated aliases(rules)DENY = -1removed β it was reserved but never implemented; use
PermissionDeniedExceptionto block access unconditionally(rules)make_areas()andmake_area()are now deprecated in favour of
AreasBase; both emitDeprecationWarningat call time
π Documentation
- Full API reference rewrite covering
AreasBase,Area,AccessRule,
ADMIN, all bearers,ProtectedRouter, JWT utilities, and exceptions index.md: end-to-end example, permission hierarchy table, compatibility
requirements, and improved cookie/header token sending guiderules.md: migration guide (make_areasβAreasBase,make_areaβArea)
with before/after tabs anddangeradmonitions on deprecated sectionsbearers.md: bearer comparison table, token revocation hook example,
JWTClaimssubclassing guiderouters.md:ProtectedRouterrouter-level vs endpoint-level rules tableREADME.md: full rewrite with current API,AreasBase, and ADMIN examplemkdocs.yaml: enablepymdownx.tabbedso===tab blocks render correctly
π§ͺ Testing
TestAreasBase: 4 tests covering field creation, name matching,
AccessRuleinstantiation, and non-Areaannotation filteringmake_area/make_areastests now assertDeprecationWarningis emittedtest_admin_access: new parametrised test for/finances/adminand
/finances/admin/routerendpointstest_write_access: updated to expect HTTP 200 β the sample token now
carriesADMINlevel, which satisfiesWRITE
βοΈ Miscellaneous Tasks
- Bump version to
0.2.0 - Sample app migrated to
AreasBasewithfinances: ADMINtoken and
/finances/admin+finances_admin_routerendpoints