You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plugins should be configurable per handler. This is especially important for plugins which use interceptors.
Examples:
mux.Handler(..., csp.Disable()) -- CSP plugin is installed on the mux, but disabled for a given handler.
mux.Handler(..., cors.Enable()) -- CORS plugin is installed on the mux, but by default it is not applied to any handlers, therefore we need to enable it.
mux.Handler(..., auth.AllowAnonymous()) -- to change how access control is done.
This need stems from the design decision of not having per-handler plugins. The problems of having per-handler plugins (as opposed to mux-level plugins and per-plugin configurations):
what should be the order of interceptors execution?
overriding of plugins installed on handler level by the ones on mux level - how to remove a plugin?
Overall, having configurations seems like an easier option.
The text was updated successfully, but these errors were encountered:
Plugins should be configurable per handler. This is especially important for plugins which use interceptors.
Examples:
mux.Handler(..., csp.Disable())
-- CSP plugin is installed on the mux, but disabled for a given handler.mux.Handler(..., cors.Enable())
-- CORS plugin is installed on the mux, but by default it is not applied to any handlers, therefore we need to enable it.mux.Handler(..., auth.AllowAnonymous())
-- to change how access control is done.This need stems from the design decision of not having per-handler plugins. The problems of having per-handler plugins (as opposed to mux-level plugins and per-plugin configurations):
Overall, having configurations seems like an easier option.
The text was updated successfully, but these errors were encountered: