go-safeweb
go-safeweb copied to clipboard
Find a way to make plugins cooperate
Problem
Some plugins need to cooperate. For instance: framing
plugin needs to cooperate with a csp
plugin, cors
would usually disable xsrf
.
Proposed solution
To avoid the extra complexity of facilitating plugins (their interceptors) cooperation during execution time, we want to introduce orchestrators (name TBD).
At mux startup time, orchestrators would add other plugins to the respective handlers. Example:
mux.Handler(..., framing.Orchestrate(framing.UseCSP, framing.UseXFO))
The framing
package would depend on the csp
and the xfo
packages in order to install and/or amend their configuration to support safe iframing.
SGTM, should I provide some sample implementations?