Skip to content

Releases: ericmiguel/missil

v0.2.1

08 Apr 20:31

Choose a tag to compare

🚀 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

08 Apr 16:54

Choose a tag to compare

🚀 Features

  • AreasBase: declare business areas as typed class attributes; Area objects
    are instantiated automatically on __init__ — no more dict-based access
  • ADMIN = 2 permission level added; satisfies READ and WRITE requirements
  • Area now exposes READ, WRITE, and ADMIN AccessRule attributes
  • TokenBearer: canonical name for the cookie-with-header-fallback bearer

🚜 Refactor

  • (bearers) FallbackTokenBearer renamed to TokenBearer; old name kept as
    a deprecated alias via __getattr__
  • (rules) Scope renamed to Area; make_scopes/make_scope renamed to
    make_areas/make_area; old names kept as deprecated aliases
  • (rules) DENY = -1 removed — it was reserved but never implemented; use
    PermissionDeniedException to block access unconditionally
  • (rules) make_areas() and make_area() are now deprecated in favour of
    AreasBase; both emit DeprecationWarning at 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 guide
  • rules.md: migration guide (make_areasAreasBase, make_areaArea)
    with before/after tabs and danger admonitions on deprecated sections
  • bearers.md: bearer comparison table, token revocation hook example,
    JWTClaims subclassing guide
  • routers.md: ProtectedRouter router-level vs endpoint-level rules table
  • README.md: full rewrite with current API, AreasBase, and ADMIN example
  • mkdocs.yaml: enable pymdownx.tabbed so === tab blocks render correctly

🧪 Testing

  • TestAreasBase: 4 tests covering field creation, name matching,
    AccessRule instantiation, and non-Area annotation filtering
  • make_area/make_areas tests now assert DeprecationWarning is emitted
  • test_admin_access: new parametrised test for /finances/admin and
    /finances/admin/router endpoints
  • test_write_access: updated to expect HTTP 200 — the sample token now
    carries ADMIN level, which satisfies WRITE

⚙️ Miscellaneous Tasks

  • Bump version to 0.2.0
  • Sample app migrated to AreasBase with finances: ADMIN token and
    /finances/admin + finances_admin_router endpoints

v0.1.7

05 May 02:26

Choose a tag to compare

[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