Authorization superpowers for your Ecto schemas.
Janus prioritizes:
Single source of truth: authorization rules should be defined once and used for authorizing individual actions as well as composing Ecto queries.
Minimal library footprint: expose a small set of useful functions that application authors can use to set up their own optimal authorization API.
Minimal application footprint: "hide" Janus behind application- controlled policy modules that define the interface for the rest of the application.
Escape hatches: easily "drop down" to your own code when the declarative API doesn't cut it.
Documentation
If you're reading this on GitHub, head over to the HexDocs.
If you're already on HexDocs, here's where you might head next:
Janusmodule docs- The Basics cheatsheet
- Generated Policy Modules - ideas behind
mix janus.gen.policy
Installation
Janus can be installed by adding ex_janus to your deps in mix.exs:
defp deps do
[
{:ex_janus, "~> 0.2.0-alpha.3"}
]
end
Development
To set up and test Janus locally:
$ git clone https://github.com/zachallaun/ex_janus && cd ex_janus
$ mix deps.get
# Set up test database and run tests with code coverage report
$ mix setup
$ mix t