Skip to content

Commit

Permalink
address linter concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
thefinn93 committed Aug 8, 2024
1 parent 0481859 commit ee22306
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,12 @@ func Parse() {
}

if config.Opts.DisableLocalAuth() {
if config.Opts.OAuth2Provider() == "" && config.Opts.AuthProxyHeader() == "" {
switch {
case config.Opts.OAuth2Provider() == "" && config.Opts.AuthProxyHeader() == "":
printErrorAndExit(errors.New("DISABLE_LOCAL_AUTH is enabled but neither OAUTH2_PROVIDER nor AUTH_PROXY_HEADER is not set. Please enable at least one authentication source"))
} else if config.Opts.OAuth2Provider() != "" && !config.Opts.IsOAuth2UserCreationAllowed() {
case config.Opts.OAuth2Provider() != "" && !config.Opts.IsOAuth2UserCreationAllowed():
printErrorAndExit(errors.New("DISABLE_LOCAL_AUTH is enabled and an OAUTH2_PROVIDER is configured, but OAUTH2_USER_CREATION is not enabled"))
} else if config.Opts.AuthProxyHeader() != "" && !config.Opts.IsAuthProxyUserCreationAllowed() {
case config.Opts.AuthProxyHeader() != "" && !config.Opts.IsAuthProxyUserCreationAllowed():
printErrorAndExit(errors.New("DISABLE_LOCAL_AUTH is enabled and an AUTH_PROXY_HEADER is configured, but AUTH_PROXY_USER_CREATION is not enabled"))
}
}
Expand Down

0 comments on commit ee22306

Please sign in to comment.