Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per-handler configuration for plugins #87

Closed
kele opened this issue Aug 14, 2020 · 0 comments · Fixed by #114
Closed

Per-handler configuration for plugins #87

kele opened this issue Aug 14, 2020 · 0 comments · Fixed by #114
Assignees
Labels
core enhancement New feature or request v0.1

Comments

@kele
Copy link
Collaborator

kele commented Aug 14, 2020

Plugins should be configurable per handler. This is especially important for plugins which use interceptors.

Examples:

  1. mux.Handler(..., csp.Disable()) -- CSP plugin is installed on the mux, but disabled for a given handler.
  2. 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.
  3. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core enhancement New feature or request v0.1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants