Route policy management for enabling/disabling endpoints.
Backed by DETS for persistence. Routes are keyed as "method|path"
(e.g. "get|/api/users"). Some routes are immutable (protected) and
cannot be toggled — configured via :api_management_console, :protected_routes.
Supports string prefixes/suffixes and regex patterns (matched against path and controller):
config :api_management_console,
protected_routes: ["/dev/dashboard", ~r{HealthController}]
Summary
Functions
Adds keys to the selection atomically.
Returns a specification to start this module under a supervisor.
Check if a path belongs to the API console itself.
Check if a route is enabled by key.
Returns the current route selection as a MapSet of route keys.
Checks if a key is in the current selection.
Returns all routes as a flat list.
Returns routes grouped by namespace, with enabled state and mutable flag.
Removes keys from the selection atomically.
Check if a request (method + path) is allowed.
Reset all policies — delete DETS file.
Returns the count of selected routes.
Toggle all mutable routes in a group. Returns [{key, old_state}].
Toggle a single route by key. Returns the old state.
Sets the route selection atomically.
Functions
Adds keys to the selection atomically.
Returns a specification to start this module under a supervisor.
See Supervisor.
Check if a path belongs to the API console itself.
Check if a route is enabled by key.
Returns the current route selection as a MapSet of route keys.
Checks if a key is in the current selection.
Returns all routes as a flat list.
Returns routes grouped by namespace, with enabled state and mutable flag.
Removes keys from the selection atomically.
Check if a request (method + path) is allowed.
Reset all policies — delete DETS file.
Returns the count of selected routes.
Toggle all mutable routes in a group. Returns [{key, old_state}].
Toggle a single route by key. Returns the old state.
Sets the route selection atomically.