You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "Arsnael (via GitHub)" <gi...@apache.org> on 2023/03/02 09:22:06 UTC

[GitHub] [james-project] Arsnael commented on a diff in pull request #1471: JAMES-3893 Add a WebAdmin API allowing creation/updation user identity

Arsnael commented on code in PR #1471:
URL: https://github.com/apache/james-project/pull/1471#discussion_r1122778649


##########
server/protocols/webadmin/webadmin-jmap/src/main/java/org/apache/james/webadmin/data/jmap/dto/UserIdentity.java:
##########
@@ -113,6 +131,43 @@ public UserIdentity(String name, String email, String id,
         this.replyTo = replyTo;
     }
 
+    @JsonCreator
+    public UserIdentity(@JsonProperty("name") String name,

Review Comment:
   I don't get:
   - why there is no mayDelete field (I think the always true is if it's missing? but if it is filled it should not be server set? Can't the create identity webadmin route be used for creating non default identities as well logically?)
   - I don't think it's a valid constructor... I would see more this as a UserIdentityCreate or something similar. The identity does not exist yet, there is no id for example, I would tend to think it is a slightly different object?



##########
server/protocols/webadmin/webadmin-jmap/src/test/java/org/apache/james/webadmin/data/jmap/UserIdentitiesRoutesTest.java:
##########
@@ -290,4 +292,219 @@ void listIdentitiesShouldReturnNotFoundWhenCanNotQueryDefaultIdentity() {
                 "    \"details\": null" +
                 "}");
     }
+
+    @Test
+    void createIdentityShouldWork() {
+        String creationRequest = "" +
+            "    {" +
+            "        \"name\": \"create name 1\"," +
+            "        \"email\": \"bob@domain.tld\"," +
+            "        \"mayDelete\": true," +

Review Comment:
   that would go with my previous point.. you do declare the mayDelete field in your creation payload?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org