Repository navigation
1.11.0 — Batch Evaluation
Adds batch authorization checks for faster multi-request evaluation:
-
New APIs:
Guard.evaluate_batch_async()andGuard.evaluate_batch_sync() -
Evaluates a sequence of
(Subject, Action, Resource, Context | None)tuples in a single call -
Returns
list[Decision]in the same order as the input -
Async batch evaluation runs requests concurrently via
asyncio.gather(), so total latency tracks the slowest request rather than the full batch size -
All DI hooks are invoked per request, just like
evaluate_async()/evaluate_sync():- metrics
- logger
- obligation checker
- role resolver
- cache
-
evaluate_batch_sync()follows the same event-loop strategy asevaluate_sync():asyncio.run()when no loop is active, otherwise the class-levelThreadPoolExecutor
No breaking changes
Upgrade
pip install -U rbacx