Releases: ericmiguel/missil
Releases · ericmiguel/missil
v0.2.1
🚀 features
Role: group multiple AccessRule objects into a single FastAPI Depends - declare named permission bundles and reuse them across endpoints.
analyst = missil.Role(areas.finances.READ, areas.it.READ)
# Reuse across many endpoints
@app.get("/dashboard", dependencies=[analyst])
def dashboard(): ...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
v0.1.7
[0.1.7] - 2024-05-05
🚀 Features
- Rule dependencies now inject the complete decoded token
🚜 Refactor
- (bearers) Remove unused args and kwargs parameters
- (TokenBearer) Remove unused call method
📚 Documentation
- Update project logo
🎨 Styling
- Apply new formatting and import sorting standards
- Fix ruff D401 alerts
- Fix ruff B006 and B008 alerts
- Fix ruff B904 alerts
🧪 Testing
- Cover decoded jwt token content get from dependency injection
⚙️ Miscellaneous Tasks
- Remove orphan config key
- Adjust pypi classifiers
- (pytest) Set log level to info
- (ci) Remove macos14 runner due to 'dyld: Library not loaded'
- Update CI actions
- Update CI workflow
- Add ruff check dry-run utility script
- (ruff) Ignore D100, D103 and D104 alerts for tests dir
- Update pdm scripts and pre-commit hooks using ruff and vulture
- Update issue templates