Skip to content

Commit df680a5

Browse files
consider UNKNOWN as an invalid query option
1 parent 08b61bf commit df680a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

api/src/main/java/org/apache/cloudstack/api/command/admin/user/ListUsersCmd.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class ListUsersCmd extends BaseListAccountResourcesCmd implements UserCmd
6767
private Boolean showIcon;
6868

6969
@Parameter(name = ApiConstants.USER_SOURCE, type = CommandType.STRING, since = "4.21.0.0",
70-
description = "List users by their authentication source. Valid values are: native, LDAP, SAML2 and SAML2DISABLED.")
70+
description = "List users by their authentication source. Valid values are: native, ldap, saml2 and saml2disabled.")
7171
private String userSource;
7272

7373
/////////////////////////////////////////////////////
@@ -104,8 +104,8 @@ public User.Source getUserSource() {
104104
}
105105

106106
User.Source source = EnumUtils.getEnumIgnoreCase(User.Source.class, userSource);
107-
if (source == null || source == User.Source.OAUTH2) {
108-
throw new InvalidParameterValueException(String.format("Invalid user source: %s. Valid values are: native, LDAP, SAML2 and SAML2DISABLED.", source));
107+
if (source == null || List.of(User.Source.OAUTH2, User.Source.UNKNOWN).contains(source)) {
108+
throw new InvalidParameterValueException(String.format("Invalid user source: %s. Valid values are: native, ldap, saml2 and saml2disabled.", source));
109109
}
110110

111111
if (source == User.Source.NATIVE) {

0 commit comments

Comments
 (0)