Skip to content

Commit

Permalink
don't require strong auth password if auth disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Laine committed Jul 1, 2020
1 parent a4ed688 commit b3b477c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions main/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,15 @@ func init() {
// HTTP:
Config.HTTPHost = *httpHost
Config.HTTPPort = uint16(*httpPort)
if Config.APIRequireAuthToken && Config.APIAuthPassword == "" {
errs.Add(errors.New("api-auth-password must be provided if api-require-auth is true"))
return
}
if !password.SufficientlyStrong(Config.APIAuthPassword, auth.RequiredPasswordStrength) {
errs.Add(errors.New("api-auth-password is not strong enough. Add more characters"))
return
if Config.APIRequireAuthToken {
if Config.APIAuthPassword == "" {
errs.Add(errors.New("api-auth-password must be provided if api-require-auth is true"))
return
}
if !password.SufficientlyStrong(Config.APIAuthPassword, auth.RequiredPasswordStrength) {
errs.Add(errors.New("api-auth-password is not strong enough. Add more characters"))
return
}
}

// Logging:
Expand Down

0 comments on commit b3b477c

Please sign in to comment.