RemovePlugin removes a single plugin from this authz middleware chain
(name string)
| 40 | |
| 41 | // RemovePlugin removes a single plugin from this authz middleware chain |
| 42 | func (m *Middleware) RemovePlugin(name string) { |
| 43 | m.mu.Lock() |
| 44 | defer m.mu.Unlock() |
| 45 | plugins := m.plugins[:0] |
| 46 | for _, authPlugin := range m.plugins { |
| 47 | if authPlugin.Name() != name { |
| 48 | plugins = append(plugins, authPlugin) |
| 49 | } |
| 50 | } |
| 51 | m.plugins = plugins |
| 52 | } |
| 53 | |
| 54 | // WrapHandler returns a new handler function wrapping the previous one in the request chain. |
| 55 | func (m *Middleware) WrapHandler(handler func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error) func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error { |