Skip to content

Commit

Permalink
Fix traefik analyzer #1
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandreh2ag committed Jun 17, 2022
1 parent 3825151 commit 2db166e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
16 changes: 8 additions & 8 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2db166e

Please sign in to comment.