keylex v0.1.0 Keylex.Plugs.Sheriff View Source
Keylex.Plugs.Sheriff will check for an authorization header with value: “#{entity} #{code}” and place the entity in as a private property in the Plug.Conn structure.
Here is an usage example in Phoenix Framework:
defmodule MyAppWeb.Router do
use MyAppWeb, :router
pipeline :api do
plug :accepts, ["json"]
plug Keylex.Plugs.GQLSheriff
end
scope "/" do
pipe_through :api
# protected routes here
end
end