1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00

feat(unit-testing): add a mock for the RequestBouncer EE-5610 (#9089)

This commit is contained in:
andres-portainer 2023-06-16 10:44:22 -03:00 committed by GitHub
parent 933e764a13
commit f7dd73b0f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 147 additions and 126 deletions

View file

@ -24,7 +24,7 @@ func hideFields(registry *portainer.Registry, hideAccesses bool) {
// Handler is the HTTP handler used to handle registry operations.
type Handler struct {
*mux.Router
requestBouncer *security.RequestBouncer
requestBouncer security.BouncerService
DataStore dataservices.DataStore
FileService portainer.FileService
ProxyManager *proxy.Manager
@ -32,14 +32,14 @@ type Handler struct {
}
// NewHandler creates a handler to manage registry operations.
func NewHandler(bouncer *security.RequestBouncer) *Handler {
func NewHandler(bouncer security.BouncerService) *Handler {
h := newHandler(bouncer)
h.initRouter(bouncer)
return h
}
func newHandler(bouncer *security.RequestBouncer) *Handler {
func newHandler(bouncer security.BouncerService) *Handler {
return &Handler{
Router: mux.NewRouter(),
requestBouncer: bouncer,