Fix auth modes enabled by config file
Enable auth modes based on CLI options, but do not force auth modes selected by the config file if not enabled by the CLI options
This commit is contained in:
8
main.go
8
main.go
@@ -65,8 +65,12 @@ func main() {
|
|||||||
|
|
||||||
utils.ApplyFlags(cliFlags, flagMappings, c, appOptions, backendOptions)
|
utils.ApplyFlags(cliFlags, flagMappings, c, appOptions, backendOptions)
|
||||||
|
|
||||||
appOptions.EnableBasicAuth = c.IsSet("credential")
|
if c.IsSet("credential") {
|
||||||
appOptions.EnableTLSClientAuth = c.IsSet("tls-ca-crt")
|
appOptions.EnableBasicAuth = true
|
||||||
|
}
|
||||||
|
if c.IsSet("tls-ca-crt") {
|
||||||
|
appOptions.EnableTLSClientAuth = true
|
||||||
|
}
|
||||||
|
|
||||||
err = appOptions.Validate()
|
err = appOptions.Validate()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user