|
|
|
@ -64,7 +64,7 @@ func newError(message string, err error) *Error { |
|
|
|
|
|
|
|
|
|
// Error returns a Error error string
|
|
|
|
|
func (err *Error) Error() string { |
|
|
|
|
return fmt.Sprintf("%s", err.Message) |
|
|
|
|
return err.Message |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Options for the AuthProxy
|
|
|
|
@ -98,20 +98,12 @@ func New(options *Options) *AuthProxy { |
|
|
|
|
func (auth *AuthProxy) IsEnabled() bool { |
|
|
|
|
|
|
|
|
|
// Bail if the setting is not enabled
|
|
|
|
|
if !auth.enabled { |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return true |
|
|
|
|
return auth.enabled |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// HasHeader checks if the we have specified header
|
|
|
|
|
func (auth *AuthProxy) HasHeader() bool { |
|
|
|
|
if len(auth.header) == 0 { |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return true |
|
|
|
|
return len(auth.header) != 0 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// IsAllowedIP compares presented IP with the whitelist one
|
|
|
|
|