EndPointBlank for Elixir and Phoenix

Authorize service-to-service calls and report every request from Phoenix or any Plug app. Add end_point_blank_elixir from Hex and two plugs.

Package
end_point_blank_elixir
Requires
Elixir 1.14 or later
Works with
Phoenix and any Plug app

1. Install

Published on Hex.

# mix.exs
{:end_point_blank_elixir, "~> 0.12"}

2. Configure and report every request

Use the client ID and secret of an application environment you created in EndPointBlank.

EndPointBlank.configure(
  client_id: System.fetch_env!("ENDPOINTBLANK_CLIENT_ID"),
  client_secret: System.fetch_env!("ENDPOINTBLANK_CLIENT_SECRET"),
  app_name: "orders-service",
  environment: "production"
)

# lib/my_app_web/endpoint.ex
plug EndPointBlank.Plug.ReportInteraction
plug MyAppWeb.Router

Configure it in your application's start/2, before the endpoint starts. The ReportInteraction plug then reports every request and response.

3. Protect a route

pipeline :api do
  plug :accepts, ["json"]
  plug EndPointBlank.Plug.Authorized
end

Authorized checks every request in the pipeline against your grants before it reaches a controller.

Next

The README covers every setting: masking rules, the authorization cache, authorizing outbound calls and the management API client. The quickstart walks through creating the application and credentials this page assumes.

Ready to deprecate with confidence?

Sign up in under a minute. No credit card, no sales call.