mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 22:39:41 +02:00
feat(unit-testing): add a mock for the RequestBouncer EE-5610 (#9089)
This commit is contained in:
parent
933e764a13
commit
f7dd73b0f7
42 changed files with 147 additions and 126 deletions
|
@ -3,10 +3,9 @@ package webhooks
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
httperror "github.com/portainer/libhttp/error"
|
||||
"github.com/portainer/portainer/api/dataservices"
|
||||
dockerclient "github.com/portainer/portainer/api/docker/client"
|
||||
|
||||
httperror "github.com/portainer/libhttp/error"
|
||||
"github.com/portainer/portainer/api/http/security"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
|
@ -15,13 +14,13 @@ import (
|
|||
// Handler is the HTTP handler used to handle webhook operations.
|
||||
type Handler struct {
|
||||
*mux.Router
|
||||
requestBouncer *security.RequestBouncer
|
||||
requestBouncer security.BouncerService
|
||||
DataStore dataservices.DataStore
|
||||
DockerClientFactory *dockerclient.ClientFactory
|
||||
}
|
||||
|
||||
// NewHandler creates a handler to manage webhooks operations.
|
||||
func NewHandler(bouncer *security.RequestBouncer) *Handler {
|
||||
func NewHandler(bouncer security.BouncerService) *Handler {
|
||||
h := &Handler{
|
||||
Router: mux.NewRouter(),
|
||||
requestBouncer: bouncer,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue