phoenix_client_ssl v0.3.0 PhoenixClientSsl.Plug.CommonNameBlacklist
This Plug checks a given common name against patterns.
Best used together with PhoenixClientSsl.Plug.ExtractCommonName
.
Installation
The plug can be installed in any pipeline
of the Phoenix Router. It takes the option patterns
.
Router:
defmodule Aceme.Web.Router do
use Acme.Web, :router
pipeline :api do
plug :accepts, ["json"]
# This line enables the plug
plug PhoenixClientSsl.Plug.CommonNameBlacklist, Application.get_env(:acme, :common_name_blacklist, [])
end
scope "/", Acme.Web do
pipe_through :api
get "/", SomeController, :index
end
end
Config:
config :acme, :common_name_blacklist,
patterns: ["*.example.com"],
handler: &Acme.ErrorHandler.handle_blacklist_error/2
Link to this section Summary
Functions
Check if the common name matches against a given blacklist of patterns
Configuration for Plug
Link to this section Functions
Link to this function
call(conn, map)
Check if the common name matches against a given blacklist of patterns.
Link to this function
init(options)
Configuration for Plug.
Options
patterns
- List of blacklisted patternshandler
- Handler function of failures