diff --git a/src/main/java/org/opensearch/security/dlic/rest/api/InternalUsersApiAction.java b/src/main/java/org/opensearch/security/dlic/rest/api/InternalUsersApiAction.java index 7986da8652..b986eba961 100644 --- a/src/main/java/org/opensearch/security/dlic/rest/api/InternalUsersApiAction.java +++ b/src/main/java/org/opensearch/security/dlic/rest/api/InternalUsersApiAction.java @@ -208,8 +208,8 @@ ValidationResult createOrUpdateAccount( try { final var username = securityConfiguration.entityName(); final var content = (ObjectNode) securityConfiguration.requestContent(); - if (request.hasParam("service")) { - content.put("service", request.param("service")); + if (request.hasParam("attributes")) { + content.put("attributes", request.param("attributes")); } if (request.hasParam("enabled")) { content.put("enabled", request.param("enabled")); diff --git a/src/test/java/org/opensearch/security/UserServiceUnitTests.java b/src/test/java/org/opensearch/security/UserServiceUnitTests.java index 2237c2e53d..533a4c7366 100644 --- a/src/test/java/org/opensearch/security/UserServiceUnitTests.java +++ b/src/test/java/org/opensearch/security/UserServiceUnitTests.java @@ -32,7 +32,7 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; -public class UserServiceUnitTests { +public class UserServiceUnitTests { SecurityDynamicConfiguration config; @Mock ClusterService clusterService; diff --git a/src/test/java/org/opensearch/security/dlic/rest/api/UserApiTest.java b/src/test/java/org/opensearch/security/dlic/rest/api/UserApiTest.java index 22490c214c..3b959b4d26 100644 --- a/src/test/java/org/opensearch/security/dlic/rest/api/UserApiTest.java +++ b/src/test/java/org/opensearch/security/dlic/rest/api/UserApiTest.java @@ -58,8 +58,7 @@ protected String getEndpointPrefix() { private static final String ENABLED_SERVICE_ACCOUNT_BODY = "{" + " \"attributes\": { \"service\": \"true\", " - + " \"enabled \": \"true\"}," - + " \"service\": \"true\" " + + " \"enabled \": \"true\"}" + " }\n"; private static final String DISABLED_SERVICE_ACCOUNT_BODY = "{"