Complete rewrite around a macro-based DSL that compiles to introspectable data, replacing the keyword-list meta(...) approach.
Highlights
- New macros:
authorize,load,authorize_owner,loaders/loader. Auth rules read like English:authorize "close_todos", when: arg(:state) == "CLOSED". - Conditions compiled to data form —
{:cmp, [:eq, {:arg, :state}, ...]}— fully introspectable, hashable, serialisable. - Public introspection API +
mix absinthe_permission.auditMix task with text or JSON output. - Telemetry on every decision and loader call.
- Custom exceptions with helpful messages (
MissingContextError,UnauthorizedError,CompileError). - Fail-loud on missing context (was fail-open in v0.1).
- No
String.to_atomon data — Sobelow-clean. AGENTS.mdcookbook for AI coding agents.
Compatibility
- Bumped Absinthe to
~> 1.7, telemetry to~> 1.0, Elixir to~> 1.14. - Not API-compatible with v0.1.x. See CHANGELOG.md for the full migration table.
Quality bar
- 60 tests, 0 failures (incl. 6 doctests)
mix compile --warnings-as-errors— cleanmix credo --strict— cleanmix sobelow— cleanmix format --check-formatted— clean