knock-elixir
knock-elixir copied to clipboard
Add ability to modify middleware via a configured callback. #14
This allows dynamic configuration of the middleware passed to the Tesla client. If a middleware_callback is configured, the middleware is passed to the callback, and may be modified as needed.
This resolves #14
Usage for open telemetry middleware:
# config.exs
config :my_app, MyApp.KnockImpl,
api_key: System.get_env("KNOCK_API_PRIVATE_KEY"),
middleware_callback: &MyApp.Tesla.customize_middleware/1
# my_app/tesla.exs
defmodule MyApp.Tesla do
def customize_middleware(middleware), do: [ Tesla.Middleware.OpenTelemetry | middleware]
end
any update about this please?