Skip to content

1.11.0 — Batch Evaluation

Choose a tag to compare

@Cheater121 Cheater121 released this 03 Apr 18:37
· 22 commits to main since this release
65f214d

Adds batch authorization checks for faster multi-request evaluation:

  • New APIs: Guard.evaluate_batch_async() and Guard.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 as evaluate_sync(): asyncio.run() when no loop is active, otherwise the class-level ThreadPoolExecutor

No breaking changes

Upgrade

pip install -U rbacx