From 2db166e939a7da8174742d7e71c6ce9d25608a8b Mon Sep 17 00:00:00 2001 From: alexandreh2ag Date: Fri, 17 Jun 2022 12:02:00 +0200 Subject: [PATCH] Fix traefik analyzer #1 --- checker.go | 1 - middleware.go | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/checker.go b/checker.go index 12afb92..ff62305 100644 --- a/checker.go +++ b/checker.go @@ -76,7 +76,6 @@ func (ip *Checker) Contains(addr string) (bool, error) { // ContainsIP checks if provided address is in the trusted IPs. func (ip *Checker) ContainsIP(addr net.IP) bool { for _, authorizedIP := range ip.authorizedIPs { - fmt.Println("Client IP: " + addr.String() + " - ip check : " + authorizedIP.String()) if authorizedIP.Equal(addr) { return true } diff --git a/middleware.go b/middleware.go index c9cbbe6..4fe71a4 100644 --- a/middleware.go +++ b/middleware.go @@ -12,21 +12,21 @@ import ( ) type BasicAuth struct { - Users []string `json:"users,omitempty" toml:"users,omitempty" yaml:"users,omitempty" loggable:"false"` - UsersFile string `json:"usersFile,omitempty" toml:"usersFile,omitempty" yaml:"usersFile,omitempty"` - Realm string `json:"realm,omitempty" toml:"realm,omitempty" yaml:"realm,omitempty"` - RemoveHeader bool `json:"removeHeader,omitempty" toml:"removeHeader,omitempty" yaml:"removeHeader,omitempty" export:"true"` - HeaderField string `json:"headerField,omitempty" toml:"headerField,omitempty" yaml:"headerField,omitempty" export:"true"` + Users []string `json:"users,omitempty"` + UsersFile string `json:"usersFile,omitempty"` + Realm string `json:"realm,omitempty"` + RemoveHeader bool `json:"removeHeader,omitempty"` + HeaderField string `json:"headerField,omitempty"` } type IPWhiteList struct { - SourceRange []string `json:"sourceRange,omitempty" toml:"sourceRange,omitempty" yaml:"sourceRange,omitempty"` + SourceRange []string `json:"sourceRange,omitempty"` } // Config the plugin configuration. type Config struct { - BasicAuth BasicAuth `json:"basicAuth,omitempty" toml:"basicAuth,omitempty" yaml:"basicAuth,omitempty"` - IPWhiteList IPWhiteList `json:"ipWhiteList,omitempty" toml:"ipWhiteList,omitempty" yaml:"ipWhiteList,omitempty"` + BasicAuth BasicAuth `json:"basicAuth,omitempty"` + IPWhiteList IPWhiteList `json:"ipWhiteList,omitempty"` } // CreateConfig creates the default plugin configuration.