Skip to content

Commit

Permalink
Changed the error message slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmcintosh committed Aug 13, 2019
1 parent 14144b2 commit b49cf06
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,27 @@ public void validate(ConfigProblemSetBuilder p, Ldap ldap) {

switch (UserSearchMethod.toUserSearchMethod(ldap)) {
case DN_PATTERN: // fall through.
case SEARCH_AND_OR_FILTER:
case SEARCH_AND_OR_BASE:
break;
case UNSPECIFIED_OR_INVALID: // fall through.
default:
p.addProblem(
Problem.Severity.ERROR,
"No valid user search method defined. Please "
+ "specify with either --user-dn-pattern OR (--user-search-base and/or --user-search-filter).");
+ "specify with either --user-dn-pattern OR (--user-search-filter with an optional --user-search-base).");
}
}

enum UserSearchMethod {
UNSPECIFIED_OR_INVALID,
DN_PATTERN,
SEARCH_AND_OR_FILTER;
SEARCH_AND_OR_BASE;

static UserSearchMethod toUserSearchMethod(Ldap ldap) {
if (StringUtils.isNotEmpty(ldap.getUserDnPattern())) {
return DN_PATTERN;
} else if (StringUtils.isNotEmpty(ldap.getUserSearchFilter())) {
return SEARCH_AND_OR_FILTER;
return SEARCH_AND_OR_BASE;
}
return UNSPECIFIED_OR_INVALID;
}
Expand Down

0 comments on commit b49cf06

Please sign in to comment.