fix(api): add missing public access middleware to routes EE-5191 (#9086)

pull/9171/head^2
matias-portainer 1 year ago committed by GitHub
parent 801b7d43ee
commit 29c1862754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -76,10 +76,10 @@ func NewHandler(bouncer security.BouncerService, demoService *demo.Service) *Han
h.Handle("/endpoints/{id}/registries/{registryId}",
bouncer.AuthenticatedAccess(httperror.LoggerHandler(h.endpointRegistryAccess))).Methods(http.MethodPut)
h.Handle("/endpoints/global-key", httperror.LoggerHandler(h.endpointCreateGlobalKey)).Methods(http.MethodPost)
h.Handle("/endpoints/global-key", bouncer.PublicAccess(httperror.LoggerHandler(h.endpointCreateGlobalKey))).Methods(http.MethodPost)
// DEPRECATED
h.Handle("/endpoints/{id}/status", httperror.LoggerHandler(h.endpointStatusInspect)).Methods(http.MethodGet)
h.Handle("/endpoints/{id}/status", bouncer.PublicAccess(httperror.LoggerHandler(h.endpointStatusInspect))).Methods(http.MethodGet)
return h
}

@ -81,7 +81,7 @@ func NewHandler(bouncer security.BouncerService) *Handler {
h.Handle("/stacks/{id}/stop",
bouncer.AuthenticatedAccess(httperror.LoggerHandler(h.stackStop))).Methods(http.MethodPost)
h.Handle("/stacks/webhooks/{webhookID}",
httperror.LoggerHandler(h.webhookInvoke)).Methods(http.MethodPost)
bouncer.PublicAccess(httperror.LoggerHandler(h.webhookInvoke))).Methods(http.MethodPost)
return h
}

Loading…
Cancel
Save