keylex v0.1.0 Keylex.Plugs.GQLSheriff View Source

Keylex.Plugs.GQLSheriff will check for an authorization header with value: “#{entity} #{code}” and place the entity in as a private property in the Plug.Conn structure absinthe context.

Here is an usage example for GraphQL using Absinthe & Phoenix:

defmodule MyAppWeb.Router do
  use MyAppWeb, :router

  pipeline :api do
    plug :accepts, ["json"]
    plug Keylex.Plugs.GQLSheriff
  end

  scope "/" do
    pipe_through :api
    forward "/", Absinthe.Plug, schema: MyAppWeb.Schema
  end
end

Link to this section Summary

Functions

Callback implementation for Plug.call/2

Callback implementation for Plug.init/1

Link to this section Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.