Skip to content

Commit

Permalink
Prevent empty "description" from being sent with UMAPI
Browse files Browse the repository at this point in the history
This closes #724
  • Loading branch information
kwin committed Jun 10, 2024
1 parent 5654dd4 commit 112cdf6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.fasterxml.jackson.annotation.JsonTypeName;

@JsonTypeName("createUserGroup")
@JsonInclude(Include.NON_NULL)
@JsonInclude(Include.NON_EMPTY) // neither empty strings nor null values are allowed for "description", compare with https://github.com/Netcentric/accesscontroltool/issues/724
public class CreateGroupStep implements Step {

// this cannot be a constant, but still needs to be serialized as literal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public HttpClientBuilder newBuilder() {
AuthorizableConfigBean group2 = new AuthorizableConfigBean();
group2.setAuthorizableId("testGroup");
imsUserManagement.updateGroups(Collections.singleton(group2));

// test with empty description
AuthorizableConfigBean group3 = new AuthorizableConfigBean();
group3.setAuthorizableId("testGroup");
group3.setDescription("");
imsUserManagement.updateGroups(Collections.singleton(group3));
}

private static String getMandatoryEnvironmentVariable(String name) {
Expand Down

0 comments on commit 112cdf6

Please sign in to comment.