Missil

Latest version: v0.1.7

Safety actively analyzes 624698 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.1.61b

๐Ÿš€ Features

- Add make rule function (15)

โš™๏ธ Miscellaneous Tasks

- Add pull request template
- Bump to version 0.1.61b

Sample

python
bearer = ...
finances = missil.make_rule(bearer, "finances")

app.get("/finances/read", dependencies=[finances.READ])
def finances_read() -> dict[str, str]:
...

0.1.7

๐Ÿš€ Features

- Rule dependencies now inject the complete decoded token

๐Ÿšœ Refactor

- *(TokenBearer)* Remove unused __call__ method
- *(bearers)* Remove unused args and kwargs parameters

๐ŸŽจ Styling

- Fix ruff B904 alerts
- Fix ruff B006 and B008 alerts
- Fix ruff D401 alerts
- Apply new formatting and import sorting standards

๐Ÿงช Testing

- Cover decoded jwt token content get from dependency injection

โš™๏ธ Miscellaneous Tasks

- Update issue templates
- Update pdm scripts and pre-commit hooks using ruff and vulture
- *(ruff)* Ignore D100, D103 and D104 alerts for tests dir
- Add ruff check dry-run utility script
- Update CI workflow
- Update CI actions
- *(ci)* Remove macos14 runner due to 'dyld: Library not loaded'
- *(pytest)* Set log level to info
- Adjust pypi classifiers
- Remove orphan config key
- Bump to version 0.1.7

Ui

- Update project logo

0.1.6b

๐Ÿš€ Features

- Add qualified router (10)
- Simpler jwt exp (12)

โš™๏ธ Miscellaneous Tasks

- Pre-commit hooks fix (14)
- Bump to version 0.1.6b


---

Qualified Router (10)
A FastAPI APIRouter class, plus an extra rules parameter. It can be used to avoid multiple redundant rule declarations in same business area endpoints.

python
from fastapi import FastAPI
import missil
from missil.routers import QualifiedRouter

app = FastAPI()

ba = missil.make_rules(bearer, "sample") business area
sample_rule_router = missil.QualifiedRouter(rules=[ba["sample"].READ])

sample_rule_router .get("/sample/write")
def finances_write_route() -> dict[str, str]:
"""Requires read permission on finances."""
return {"msg": "finances write rights check via qualified router!"}

app.include_router(finances_read_router)


simpler JWT encode utility function (12)

python
token_expiration_in_hours = 8
token = missil.encode_jwt_token(claims, SECRET_KEY, token_expiration_in_hours)



**Full Changelog**: https://github.com/ericmiguel/missil/commits/v0.1.6b

0.1.5b

๐Ÿš€ Features

- Type-safe rules (9)

Links

Releases

Has known vulnerabilities

ยฉ 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.