MCPcopy
hub / github.com/moby/moby / RemovePlugin

Method RemovePlugin

pkg/authorization/middleware.go:42–52  ·  view source on GitHub ↗

RemovePlugin removes a single plugin from this authz middleware chain

(name string)

Source from the content-addressed store, hash-verified

40
41// RemovePlugin removes a single plugin from this authz middleware chain
42func (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.
55func (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 {

Callers 1

DisableMethod · 0.80

Calls 3

UnlockMethod · 0.80
NameMethod · 0.65
LockMethod · 0.45

Tested by

no test coverage detected