You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2021/11/24 10:39:53 UTC

[GitHub] [james-project] vttranlina opened a new pull request #761: [WIP] JAMES-3534 Identity/set update + delete and Identity/get should fail for identities whose alias is deleted

vttranlina opened a new pull request #761:
URL: https://github.com/apache/james-project/pull/761


   https://github.com/linagora/james-project/issues/4433


-- 
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


[GitHub] [james-project] Arsnael merged pull request #761: JAMES-3534 Identity/set update + delete and Identity/get should fail for identities whose alias is deleted

Posted by GitBox <gi...@apache.org>.
Arsnael merged pull request #761:
URL: https://github.com/apache/james-project/pull/761


   


-- 
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


[GitHub] [james-project] Arsnael commented on a change in pull request #761: JAMES-3534 Identity/set update + delete and Identity/get should fail for identities whose alias is deleted

Posted by GitBox <gi...@apache.org>.
Arsnael commented on a change in pull request #761:
URL: https://github.com/apache/james-project/pull/761#discussion_r759144073



##########
File path: server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
##########
@@ -1666,5 +1666,318 @@ trait IdentitySetContract {
            |    ]
            |}""".stripMargin)
   }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWithItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get no longer returns the identity
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$customIdentityId"]
+         |			}, "c1"
+         |		]
+         |
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"notFound": [
+           |		"$customIdentityId"
+           |	],
+           |	"state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"list": []
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWhenAdminRemoveThatAliasThenUpdateThatIdentityShouldFail(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/set update of that identity fails
+    val request: String =
+      s"""{
+         |	"using": [
+         |		"urn:ietf:params:jmap:core",
+         |		"urn:ietf:params:jmap:submission"
+         |	],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/set",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"update": {
+         |					"$customIdentityId": {
+         |						"name": "NewName1",
+         |						"replyTo": [{
+         |							"name": "Difference Alice",
+         |							"email": "alice2@domain.tld"
+         |						}],
+         |						"bcc": [{
+         |							"name": "Difference David",
+         |							"email": "david2@domain.tld"
+         |						}],
+         |						"textSignature": "Difference text signature",
+         |						"htmlSignature": "<p>Difference html signature</p>"
+         |					}
+         |				}
+         |			},
+         |			"c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"newState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"notUpdated": {
+           |		"$customIdentityId": {
+           |			"type": "notFound",
+           |			"description": "IdentityId($customIdentityId) could not be found"
+           |		}
+           |	}
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndUserUpdateItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+    val serverIdentityId = UUID.nameUUIDFromBytes("bob-alias@domain.tld".getBytes(StandardCharsets.UTF_8))
+
+    // Bob update the default identity of bob-alias@domain.tld
+    `given`
+      .body(
+        s"""{
+           |	"using": [
+           |		"urn:ietf:params:jmap:core",
+           |		"urn:ietf:params:jmap:submission"
+           |	],
+           |	"methodCalls": [
+           |		[
+           |			"Identity/set",
+           |			{
+           |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |				"update": {
+           |					"$serverIdentityId": {
+           |						"name": "NewName1",
+           |						"replyTo": [{
+           |							"name": "Difference Alice",
+           |							"email": "alice2@domain.tld"
+           |						}],
+           |						"bcc": [{
+           |							"name": "Difference David",
+           |							"email": "david2@domain.tld"
+           |						}],
+           |						"textSignature": "Difference text signature",
+           |						"htmlSignature": "<p>Difference html signature</p>"
+           |					}
+           |				}
+           |			},
+           |			"c1"
+           |		]
+           |	]
+           |}""".stripMargin)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get that identity should no longer return
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$serverIdentityId"]
+         |			}, "c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"notFound": [
+           |		"$serverIdentityId"
+           |	],
+           |	"state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"list": []
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndUserUpdateItWhenAdminRemoveThatAliasThenUpdateThatIdentityShouldFail(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+    val serverIdentityId = UUID.nameUUIDFromBytes("bob-alias@domain.tld".getBytes(StandardCharsets.UTF_8))
+
+    // Bob update the default identity of bob-alias@domain.tld
+    `given`
+      .body(
+        s"""{
+           |	"using": [
+           |		"urn:ietf:params:jmap:core",
+           |		"urn:ietf:params:jmap:submission"
+           |	],
+           |	"methodCalls": [
+           |		[
+           |			"Identity/set",
+           |			{
+           |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |				"update": {
+           |					"$serverIdentityId": {
+           |						"name": "NewName1",
+           |						"replyTo": [{
+           |							"name": "Difference Alice",
+           |							"email": "alice2@domain.tld"
+           |						}],
+           |						"bcc": [{
+           |							"name": "Difference David",
+           |							"email": "david2@domain.tld"
+           |						}],
+           |						"textSignature": "Difference text signature",
+           |						"htmlSignature": "<p>Difference html signature</p>"
+           |					}
+           |				}
+           |			},
+           |			"c1"
+           |		]
+           |	]
+           |}""".stripMargin)
+      .when

Review comment:
       indent

##########
File path: server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
##########
@@ -1666,5 +1666,318 @@ trait IdentitySetContract {
            |    ]
            |}""".stripMargin)
   }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWithItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get no longer returns the identity
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$customIdentityId"]
+         |			}, "c1"
+         |		]
+         |
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"notFound": [
+           |		"$customIdentityId"
+           |	],
+           |	"state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"list": []
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWhenAdminRemoveThatAliasThenUpdateThatIdentityShouldFail(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/set update of that identity fails
+    val request: String =
+      s"""{
+         |	"using": [
+         |		"urn:ietf:params:jmap:core",
+         |		"urn:ietf:params:jmap:submission"
+         |	],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/set",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"update": {
+         |					"$customIdentityId": {
+         |						"name": "NewName1",
+         |						"replyTo": [{
+         |							"name": "Difference Alice",
+         |							"email": "alice2@domain.tld"
+         |						}],
+         |						"bcc": [{
+         |							"name": "Difference David",
+         |							"email": "david2@domain.tld"
+         |						}],
+         |						"textSignature": "Difference text signature",
+         |						"htmlSignature": "<p>Difference html signature</p>"
+         |					}
+         |				}
+         |			},
+         |			"c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`

Review comment:
       indent

##########
File path: server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
##########
@@ -1666,5 +1666,318 @@ trait IdentitySetContract {
            |    ]
            |}""".stripMargin)
   }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWithItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get no longer returns the identity
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$customIdentityId"]
+         |			}, "c1"
+         |		]
+         |
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"notFound": [
+           |		"$customIdentityId"
+           |	],
+           |	"state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"list": []
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWhenAdminRemoveThatAliasThenUpdateThatIdentityShouldFail(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/set update of that identity fails
+    val request: String =
+      s"""{
+         |	"using": [
+         |		"urn:ietf:params:jmap:core",
+         |		"urn:ietf:params:jmap:submission"
+         |	],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/set",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"update": {
+         |					"$customIdentityId": {
+         |						"name": "NewName1",
+         |						"replyTo": [{
+         |							"name": "Difference Alice",
+         |							"email": "alice2@domain.tld"
+         |						}],
+         |						"bcc": [{
+         |							"name": "Difference David",
+         |							"email": "david2@domain.tld"
+         |						}],
+         |						"textSignature": "Difference text signature",
+         |						"htmlSignature": "<p>Difference html signature</p>"
+         |					}
+         |				}
+         |			},
+         |			"c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"newState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"notUpdated": {
+           |		"$customIdentityId": {
+           |			"type": "notFound",
+           |			"description": "IdentityId($customIdentityId) could not be found"
+           |		}
+           |	}
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndUserUpdateItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+    val serverIdentityId = UUID.nameUUIDFromBytes("bob-alias@domain.tld".getBytes(StandardCharsets.UTF_8))
+
+    // Bob update the default identity of bob-alias@domain.tld
+    `given`
+      .body(
+        s"""{
+           |	"using": [
+           |		"urn:ietf:params:jmap:core",
+           |		"urn:ietf:params:jmap:submission"
+           |	],
+           |	"methodCalls": [
+           |		[
+           |			"Identity/set",
+           |			{
+           |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |				"update": {
+           |					"$serverIdentityId": {
+           |						"name": "NewName1",
+           |						"replyTo": [{
+           |							"name": "Difference Alice",
+           |							"email": "alice2@domain.tld"
+           |						}],
+           |						"bcc": [{
+           |							"name": "Difference David",
+           |							"email": "david2@domain.tld"
+           |						}],
+           |						"textSignature": "Difference text signature",
+           |						"htmlSignature": "<p>Difference html signature</p>"
+           |					}
+           |				}
+           |			},
+           |			"c1"
+           |		]
+           |	]
+           |}""".stripMargin)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get that identity should no longer return
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$serverIdentityId"]
+         |			}, "c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"notFound": [
+           |		"$serverIdentityId"
+           |	],
+           |	"state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"list": []
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndUserUpdateItWhenAdminRemoveThatAliasThenUpdateThatIdentityShouldFail(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+    val serverIdentityId = UUID.nameUUIDFromBytes("bob-alias@domain.tld".getBytes(StandardCharsets.UTF_8))
+
+    // Bob update the default identity of bob-alias@domain.tld
+    `given`
+      .body(
+        s"""{
+           |	"using": [
+           |		"urn:ietf:params:jmap:core",
+           |		"urn:ietf:params:jmap:submission"
+           |	],
+           |	"methodCalls": [
+           |		[
+           |			"Identity/set",
+           |			{
+           |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |				"update": {
+           |					"$serverIdentityId": {
+           |						"name": "NewName1",
+           |						"replyTo": [{
+           |							"name": "Difference Alice",
+           |							"email": "alice2@domain.tld"
+           |						}],
+           |						"bcc": [{
+           |							"name": "Difference David",
+           |							"email": "david2@domain.tld"
+           |						}],
+           |						"textSignature": "Difference text signature",
+           |						"htmlSignature": "<p>Difference html signature</p>"
+           |					}
+           |				}
+           |			},
+           |			"c1"
+           |		]
+           |	]
+           |}""".stripMargin)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/set update of that identity fails
+    val request: String =
+      s"""{
+         |	"using": [
+         |		"urn:ietf:params:jmap:core",
+         |		"urn:ietf:params:jmap:submission"
+         |	],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/set",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"update": {
+         |					"$serverIdentityId": {
+         |						"name": "NewName1",
+         |						"replyTo": [{
+         |							"name": "Difference Alice",
+         |							"email": "alice2@domain.tld"
+         |						}],
+         |						"bcc": [{
+         |							"name": "Difference David",
+         |							"email": "david2@domain.tld"
+         |						}],
+         |						"textSignature": "Difference text signature",
+         |						"htmlSignature": "<p>Difference html signature</p>"
+         |					}
+         |				}
+         |			},
+         |			"c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`

Review comment:
       indent

##########
File path: server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
##########
@@ -1666,5 +1666,318 @@ trait IdentitySetContract {
            |    ]
            |}""".stripMargin)
   }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWithItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get no longer returns the identity
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$customIdentityId"]
+         |			}, "c1"
+         |		]
+         |
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"notFound": [
+           |		"$customIdentityId"
+           |	],
+           |	"state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"list": []
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWhenAdminRemoveThatAliasThenUpdateThatIdentityShouldFail(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/set update of that identity fails
+    val request: String =
+      s"""{
+         |	"using": [
+         |		"urn:ietf:params:jmap:core",
+         |		"urn:ietf:params:jmap:submission"
+         |	],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/set",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"update": {
+         |					"$customIdentityId": {
+         |						"name": "NewName1",
+         |						"replyTo": [{
+         |							"name": "Difference Alice",
+         |							"email": "alice2@domain.tld"
+         |						}],
+         |						"bcc": [{
+         |							"name": "Difference David",
+         |							"email": "david2@domain.tld"
+         |						}],
+         |						"textSignature": "Difference text signature",
+         |						"htmlSignature": "<p>Difference html signature</p>"
+         |					}
+         |				}
+         |			},
+         |			"c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"newState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"notUpdated": {
+           |		"$customIdentityId": {
+           |			"type": "notFound",
+           |			"description": "IdentityId($customIdentityId) could not be found"
+           |		}
+           |	}
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndUserUpdateItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+    val serverIdentityId = UUID.nameUUIDFromBytes("bob-alias@domain.tld".getBytes(StandardCharsets.UTF_8))
+
+    // Bob update the default identity of bob-alias@domain.tld
+    `given`
+      .body(
+        s"""{
+           |	"using": [
+           |		"urn:ietf:params:jmap:core",
+           |		"urn:ietf:params:jmap:submission"
+           |	],
+           |	"methodCalls": [
+           |		[
+           |			"Identity/set",
+           |			{
+           |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |				"update": {
+           |					"$serverIdentityId": {
+           |						"name": "NewName1",
+           |						"replyTo": [{
+           |							"name": "Difference Alice",
+           |							"email": "alice2@domain.tld"
+           |						}],
+           |						"bcc": [{
+           |							"name": "Difference David",
+           |							"email": "david2@domain.tld"
+           |						}],
+           |						"textSignature": "Difference text signature",
+           |						"htmlSignature": "<p>Difference html signature</p>"
+           |					}
+           |				}
+           |			},
+           |			"c1"
+           |		]
+           |	]
+           |}""".stripMargin)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get that identity should no longer return
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$serverIdentityId"]
+         |			}, "c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`

Review comment:
       indent

##########
File path: server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
##########
@@ -1666,5 +1666,318 @@ trait IdentitySetContract {
            |    ]
            |}""".stripMargin)
   }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWithItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get no longer returns the identity
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$customIdentityId"]
+         |			}, "c1"
+         |		]
+         |
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when

Review comment:
       indent

##########
File path: server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
##########
@@ -1666,5 +1666,318 @@ trait IdentitySetContract {
            |    ]
            |}""".stripMargin)
   }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWithItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get no longer returns the identity
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$customIdentityId"]
+         |			}, "c1"
+         |		]
+         |
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`

Review comment:
       indent

##########
File path: server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
##########
@@ -1666,5 +1666,318 @@ trait IdentitySetContract {
            |    ]
            |}""".stripMargin)
   }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWithItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get no longer returns the identity
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$customIdentityId"]
+         |			}, "c1"
+         |		]
+         |
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"notFound": [
+           |		"$customIdentityId"
+           |	],
+           |	"state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"list": []
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWhenAdminRemoveThatAliasThenUpdateThatIdentityShouldFail(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/set update of that identity fails
+    val request: String =
+      s"""{
+         |	"using": [
+         |		"urn:ietf:params:jmap:core",
+         |		"urn:ietf:params:jmap:submission"
+         |	],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/set",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"update": {
+         |					"$customIdentityId": {
+         |						"name": "NewName1",
+         |						"replyTo": [{
+         |							"name": "Difference Alice",
+         |							"email": "alice2@domain.tld"
+         |						}],
+         |						"bcc": [{
+         |							"name": "Difference David",
+         |							"email": "david2@domain.tld"
+         |						}],
+         |						"textSignature": "Difference text signature",
+         |						"htmlSignature": "<p>Difference html signature</p>"
+         |					}
+         |				}
+         |			},
+         |			"c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when

Review comment:
       indent

##########
File path: server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
##########
@@ -1666,5 +1666,318 @@ trait IdentitySetContract {
            |    ]
            |}""".stripMargin)
   }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWithItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get no longer returns the identity
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$customIdentityId"]
+         |			}, "c1"
+         |		]
+         |
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"notFound": [
+           |		"$customIdentityId"
+           |	],
+           |	"state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"list": []
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWhenAdminRemoveThatAliasThenUpdateThatIdentityShouldFail(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/set update of that identity fails
+    val request: String =
+      s"""{
+         |	"using": [
+         |		"urn:ietf:params:jmap:core",
+         |		"urn:ietf:params:jmap:submission"
+         |	],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/set",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"update": {
+         |					"$customIdentityId": {
+         |						"name": "NewName1",
+         |						"replyTo": [{
+         |							"name": "Difference Alice",
+         |							"email": "alice2@domain.tld"
+         |						}],
+         |						"bcc": [{
+         |							"name": "Difference David",
+         |							"email": "david2@domain.tld"
+         |						}],
+         |						"textSignature": "Difference text signature",
+         |						"htmlSignature": "<p>Difference html signature</p>"
+         |					}
+         |				}
+         |			},
+         |			"c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"newState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"notUpdated": {
+           |		"$customIdentityId": {
+           |			"type": "notFound",
+           |			"description": "IdentityId($customIdentityId) could not be found"
+           |		}
+           |	}
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndUserUpdateItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+    val serverIdentityId = UUID.nameUUIDFromBytes("bob-alias@domain.tld".getBytes(StandardCharsets.UTF_8))
+
+    // Bob update the default identity of bob-alias@domain.tld
+    `given`
+      .body(
+        s"""{
+           |	"using": [
+           |		"urn:ietf:params:jmap:core",
+           |		"urn:ietf:params:jmap:submission"
+           |	],
+           |	"methodCalls": [
+           |		[
+           |			"Identity/set",
+           |			{
+           |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |				"update": {
+           |					"$serverIdentityId": {
+           |						"name": "NewName1",
+           |						"replyTo": [{
+           |							"name": "Difference Alice",
+           |							"email": "alice2@domain.tld"
+           |						}],
+           |						"bcc": [{
+           |							"name": "Difference David",
+           |							"email": "david2@domain.tld"
+           |						}],
+           |						"textSignature": "Difference text signature",
+           |						"htmlSignature": "<p>Difference html signature</p>"
+           |					}
+           |				}
+           |			},
+           |			"c1"
+           |		]
+           |	]
+           |}""".stripMargin)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get that identity should no longer return
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$serverIdentityId"]
+         |			}, "c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when

Review comment:
       indent

##########
File path: server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
##########
@@ -1666,5 +1666,318 @@ trait IdentitySetContract {
            |    ]
            |}""".stripMargin)
   }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWithItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get no longer returns the identity
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$customIdentityId"]
+         |			}, "c1"
+         |		]
+         |
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"notFound": [
+           |		"$customIdentityId"
+           |	],
+           |	"state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"list": []
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWhenAdminRemoveThatAliasThenUpdateThatIdentityShouldFail(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/set update of that identity fails
+    val request: String =
+      s"""{
+         |	"using": [
+         |		"urn:ietf:params:jmap:core",
+         |		"urn:ietf:params:jmap:submission"
+         |	],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/set",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"update": {
+         |					"$customIdentityId": {
+         |						"name": "NewName1",
+         |						"replyTo": [{
+         |							"name": "Difference Alice",
+         |							"email": "alice2@domain.tld"
+         |						}],
+         |						"bcc": [{
+         |							"name": "Difference David",
+         |							"email": "david2@domain.tld"
+         |						}],
+         |						"textSignature": "Difference text signature",
+         |						"htmlSignature": "<p>Difference html signature</p>"
+         |					}
+         |				}
+         |			},
+         |			"c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"newState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"notUpdated": {
+           |		"$customIdentityId": {
+           |			"type": "notFound",
+           |			"description": "IdentityId($customIdentityId) could not be found"
+           |		}
+           |	}
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndUserUpdateItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+    val serverIdentityId = UUID.nameUUIDFromBytes("bob-alias@domain.tld".getBytes(StandardCharsets.UTF_8))
+
+    // Bob update the default identity of bob-alias@domain.tld
+    `given`
+      .body(
+        s"""{
+           |	"using": [
+           |		"urn:ietf:params:jmap:core",
+           |		"urn:ietf:params:jmap:submission"
+           |	],
+           |	"methodCalls": [
+           |		[
+           |			"Identity/set",
+           |			{
+           |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |				"update": {
+           |					"$serverIdentityId": {
+           |						"name": "NewName1",
+           |						"replyTo": [{
+           |							"name": "Difference Alice",
+           |							"email": "alice2@domain.tld"
+           |						}],
+           |						"bcc": [{
+           |							"name": "Difference David",
+           |							"email": "david2@domain.tld"
+           |						}],
+           |						"textSignature": "Difference text signature",
+           |						"htmlSignature": "<p>Difference html signature</p>"
+           |					}
+           |				}
+           |			},
+           |			"c1"
+           |		]
+           |	]
+           |}""".stripMargin)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get that identity should no longer return
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$serverIdentityId"]
+         |			}, "c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"notFound": [
+           |		"$serverIdentityId"
+           |	],
+           |	"state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"list": []
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndUserUpdateItWhenAdminRemoveThatAliasThenUpdateThatIdentityShouldFail(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+    val serverIdentityId = UUID.nameUUIDFromBytes("bob-alias@domain.tld".getBytes(StandardCharsets.UTF_8))
+
+    // Bob update the default identity of bob-alias@domain.tld
+    `given`
+      .body(
+        s"""{
+           |	"using": [
+           |		"urn:ietf:params:jmap:core",
+           |		"urn:ietf:params:jmap:submission"
+           |	],
+           |	"methodCalls": [
+           |		[
+           |			"Identity/set",
+           |			{
+           |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |				"update": {
+           |					"$serverIdentityId": {
+           |						"name": "NewName1",
+           |						"replyTo": [{
+           |							"name": "Difference Alice",
+           |							"email": "alice2@domain.tld"
+           |						}],
+           |						"bcc": [{
+           |							"name": "Difference David",
+           |							"email": "david2@domain.tld"
+           |						}],
+           |						"textSignature": "Difference text signature",
+           |						"htmlSignature": "<p>Difference html signature</p>"
+           |					}
+           |				}
+           |			},
+           |			"c1"
+           |		]
+           |	]
+           |}""".stripMargin)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/set update of that identity fails
+    val request: String =
+      s"""{
+         |	"using": [
+         |		"urn:ietf:params:jmap:core",
+         |		"urn:ietf:params:jmap:submission"
+         |	],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/set",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"update": {
+         |					"$serverIdentityId": {
+         |						"name": "NewName1",
+         |						"replyTo": [{
+         |							"name": "Difference Alice",
+         |							"email": "alice2@domain.tld"
+         |						}],
+         |						"bcc": [{
+         |							"name": "Difference David",
+         |							"email": "david2@domain.tld"
+         |						}],
+         |						"textSignature": "Difference text signature",
+         |						"htmlSignature": "<p>Difference html signature</p>"
+         |					}
+         |				}
+         |			},
+         |			"c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when

Review comment:
       indent

##########
File path: server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
##########
@@ -1666,5 +1666,318 @@ trait IdentitySetContract {
            |    ]
            |}""".stripMargin)
   }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWithItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get no longer returns the identity
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$customIdentityId"]
+         |			}, "c1"
+         |		]
+         |
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"notFound": [
+           |		"$customIdentityId"
+           |	],
+           |	"state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"list": []
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndCreateACustomIdentityWhenAdminRemoveThatAliasThenUpdateThatIdentityShouldFail(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // Bob create a new custom identity with bob-alias@domain.tld
+    val customIdentityId = createNewIdentity(UUID.randomUUID().toString, "bob-alias@domain.tld")
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/set update of that identity fails
+    val request: String =
+      s"""{
+         |	"using": [
+         |		"urn:ietf:params:jmap:core",
+         |		"urn:ietf:params:jmap:submission"
+         |	],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/set",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"update": {
+         |					"$customIdentityId": {
+         |						"name": "NewName1",
+         |						"replyTo": [{
+         |							"name": "Difference Alice",
+         |							"email": "alice2@domain.tld"
+         |						}],
+         |						"bcc": [{
+         |							"name": "Difference David",
+         |							"email": "david2@domain.tld"
+         |						}],
+         |						"textSignature": "Difference text signature",
+         |						"htmlSignature": "<p>Difference html signature</p>"
+         |					}
+         |				}
+         |			},
+         |			"c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"newState": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"notUpdated": {
+           |		"$customIdentityId": {
+           |			"type": "notFound",
+           |			"description": "IdentityId($customIdentityId) could not be found"
+           |		}
+           |	}
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndUserUpdateItWhenAdminRemoveThatAliasThenFetchThatIdentityShouldNoLongerReturn(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+    val serverIdentityId = UUID.nameUUIDFromBytes("bob-alias@domain.tld".getBytes(StandardCharsets.UTF_8))
+
+    // Bob update the default identity of bob-alias@domain.tld
+    `given`
+      .body(
+        s"""{
+           |	"using": [
+           |		"urn:ietf:params:jmap:core",
+           |		"urn:ietf:params:jmap:submission"
+           |	],
+           |	"methodCalls": [
+           |		[
+           |			"Identity/set",
+           |			{
+           |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |				"update": {
+           |					"$serverIdentityId": {
+           |						"name": "NewName1",
+           |						"replyTo": [{
+           |							"name": "Difference Alice",
+           |							"email": "alice2@domain.tld"
+           |						}],
+           |						"bcc": [{
+           |							"name": "Difference David",
+           |							"email": "david2@domain.tld"
+           |						}],
+           |						"textSignature": "Difference text signature",
+           |						"htmlSignature": "<p>Difference html signature</p>"
+           |					}
+           |				}
+           |			},
+           |			"c1"
+           |		]
+           |	]
+           |}""".stripMargin)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+
+    // WHEN an admin delete bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).removeUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+
+    // THEN Identity/get that identity should no longer return
+    val request: String =
+      s"""{
+         |	"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:submission"],
+         |	"methodCalls": [
+         |		[
+         |			"Identity/get",
+         |			{
+         |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+         |				"ids": ["$serverIdentityId"]
+         |			}, "c1"
+         |		]
+         |	]
+         |}""".stripMargin
+
+    val response: String = `given`
+      .body(request)
+      .when
+      .post
+      .`then`
+      .statusCode(SC_OK)
+      .contentType(JSON)
+      .extract
+      .body
+      .asString
+
+    assertThatJson(response)
+      .inPath("methodResponses[0][1]")
+      .isEqualTo(
+        s"""{
+           |	"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |	"notFound": [
+           |		"$serverIdentityId"
+           |	],
+           |	"state": "2c9f1b12-b35a-43e6-9af2-0106fb53a943",
+           |	"list": []
+           |}""".stripMargin)
+  }
+
+  @Test
+  def givenServerSetAliasAndUserUpdateItWhenAdminRemoveThatAliasThenUpdateThatIdentityShouldFail(server: GuiceJamesServer): Unit = {
+    // GIVEN bob-alias@domain.tld
+    server.getProbe(classOf[DataProbeImpl]).addUserAliasMapping("bob-alias", "domain.tld", "bob@domain.tld")
+    val serverIdentityId = UUID.nameUUIDFromBytes("bob-alias@domain.tld".getBytes(StandardCharsets.UTF_8))
+
+    // Bob update the default identity of bob-alias@domain.tld
+    `given`
+      .body(
+        s"""{
+           |	"using": [
+           |		"urn:ietf:params:jmap:core",
+           |		"urn:ietf:params:jmap:submission"
+           |	],
+           |	"methodCalls": [
+           |		[
+           |			"Identity/set",
+           |			{
+           |				"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
+           |				"update": {
+           |					"$serverIdentityId": {
+           |						"name": "NewName1",
+           |						"replyTo": [{
+           |							"name": "Difference Alice",
+           |							"email": "alice2@domain.tld"
+           |						}],
+           |						"bcc": [{
+           |							"name": "Difference David",
+           |							"email": "david2@domain.tld"
+           |						}],
+           |						"textSignature": "Difference text signature",
+           |						"htmlSignature": "<p>Difference html signature</p>"
+           |					}
+           |				}
+           |			},
+           |			"c1"
+           |		]
+           |	]
+           |}""".stripMargin)
+      .when
+      .post
+      .`then`

Review comment:
       indent




-- 
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


[GitHub] [james-project] quantranhong1999 commented on a change in pull request #761: JAMES-3534 Identity/set update + delete and Identity/get should fail for identities whose alias is deleted

Posted by GitBox <gi...@apache.org>.
quantranhong1999 commented on a change in pull request #761:
URL: https://github.com/apache/james-project/pull/761#discussion_r758890471



##########
File path: server/data/data-jmap/src/test/scala/org/apache/james/jmap/api/identity/IdentityRepositoryTest.scala
##########
@@ -197,4 +215,17 @@ class IdentityRepositoryTest {
         htmlSignature = HtmlSignature("html 2 signature"),
         mayDelete = MayDeleteIdentity(true)))
   }
+
+  @Test
+  def updateShouldFailWhenEmailNotExists(): Unit = {

Review comment:
       whenAliasNotExists maybe?

##########
File path: server/data/data-jmap/src/test/scala/org/apache/james/jmap/api/identity/IdentityRepositoryTest.scala
##########
@@ -115,6 +115,25 @@ class IdentityRepositoryTest {
       .containsExactlyInAnyOrder(customIdentity)
   }
 
+  @Test
+  def listShouldNotReturnTheIdentityHasEmailNotExists(): Unit = {

Review comment:
       alias maybe?

##########
File path: server/data/data-jmap/src/test/scala/org/apache/james/jmap/api/identity/IdentityRepositoryTest.scala
##########
@@ -132,37 +151,34 @@ class IdentityRepositoryTest {
   }
 
   @Test
-  def updateShouldSuccessWhenCustomExists(): Unit = {
-    when(identityFactory.listIdentities(BOB)).thenReturn(List())
-    val customIdentity: Identity = SMono.fromPublisher(customIdentityDAO.save(BOB, CREATION_REQUEST)).block()
+  def updateShouldSuccessWhenCustomExistsAndEmailExists(): Unit = {

Review comment:
       updateShouldSuccessWhenCustomExistsAndAliasExists maybe?




-- 
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


[GitHub] [james-project] quantranhong1999 edited a comment on pull request #761: JAMES-3534 Identity/set update + delete and Identity/get should fail for identities whose alias is deleted

Posted by GitBox <gi...@apache.org>.
quantranhong1999 edited a comment on pull request #761:
URL: https://github.com/apache/james-project/pull/761#issuecomment-982244179


   > @quantranhong1999 can you issue the fixups for your comments?
   
   https://github.com/apache/james-project/pull/760/commits/b34052b9f543a586c43160912637c088afd5bd99


-- 
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


[GitHub] [james-project] chibenwa commented on a change in pull request #761: [WIP] JAMES-3534 Identity/set update + delete and Identity/get should fail for identities whose alias is deleted

Posted by GitBox <gi...@apache.org>.
chibenwa commented on a change in pull request #761:
URL: https://github.com/apache/james-project/pull/761#discussion_r756551775



##########
File path: server/data/data-jmap/src/test/scala/org/apache/james/jmap/api/identity/CustomIdentityDAOContract.scala
##########
@@ -156,35 +156,7 @@ trait CustomIdentityDAOContract {
       .isEmpty()
   }
 
-  @Test
-  def updateShouldModifyUnderlyingRecord(): Unit = {
-    val identity: Identity = SMono(testee().save(bob,
-      IdentityCreationRequest(name = Some(IdentityName("Bob (custom address)")),
-        email = bob.asMailAddress(),
-        replyTo = Some(List(EmailAddress(Some(EmailerName("My Boss")), new MailAddress("boss@domain.tld")))),
-        bcc = Some(List(EmailAddress(Some(EmailerName("My Boss 2")), new MailAddress("boss2@domain.tld")))),
-        textSignature = Some(TextSignature("text signature")),
-        htmlSignature = Some(HtmlSignature("html signature")))))
-      .block()
-
-    SMono(testee().update(bob, identity.id, IdentityUpdateRequest(
-      name = Some(IdentityNameUpdate(IdentityName("Bob (new name)"))),
-      replyTo = Some(IdentityReplyToUpdate(Some(List(EmailAddress(Some(EmailerName("My Boss (updated)")), new MailAddress("boss-updated@domain.tld")))))),
-      bcc = Some(IdentityBccUpdate(Some(List(EmailAddress(Some(EmailerName("My Boss 2 (updated)")), new MailAddress("boss-updated-2@domain.tld")))))),
-      textSignature = Some(IdentityTextSignatureUpdate(TextSignature("text 2 signature"))),
-      htmlSignature = Some(IdentityHtmlSignatureUpdate(HtmlSignature("html 2 signature"))))))
-      .block()
-
-    assertThat(SFlux(testee().list(bob)).asJava().collectList().block())
-      .containsExactlyInAnyOrder(Identity(id = identity.id,
-        name = IdentityName("Bob (new name)"),
-        email = bob.asMailAddress(),
-        replyTo = Some(List(EmailAddress(Some(EmailerName("My Boss (updated)")), new MailAddress("boss-updated@domain.tld")))),
-        bcc = Some(List(EmailAddress(Some(EmailerName("My Boss 2 (updated)")), new MailAddress("boss-updated-2@domain.tld")))),
-        textSignature = TextSignature("text 2 signature"),
-        htmlSignature = HtmlSignature("html 2 signature"),
-        mayDelete = MayDeleteIdentity(true)))
-  }
+  z

Review comment:
       oups `z` ?




-- 
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


[GitHub] [james-project] quantranhong1999 edited a comment on pull request #761: JAMES-3534 Identity/set update + delete and Identity/get should fail for identities whose alias is deleted

Posted by GitBox <gi...@apache.org>.
quantranhong1999 edited a comment on pull request #761:
URL: https://github.com/apache/james-project/pull/761#issuecomment-982244179


   > @quantranhong1999 can you issue the fixups for your comments?
   
   Moved to https://github.com/apache/james-project/pull/760


-- 
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


[GitHub] [james-project] quantranhong1999 commented on pull request #761: JAMES-3534 Identity/set update + delete and Identity/get should fail for identities whose alias is deleted

Posted by GitBox <gi...@apache.org>.
quantranhong1999 commented on pull request #761:
URL: https://github.com/apache/james-project/pull/761#issuecomment-982244179


   > @quantranhong1999 can you issue the fixups for your comments?
   
   I don't think I can push directly to his repo. Should I move this PR to https://github.com/apache/james-project/pull/760 ?


-- 
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


[GitHub] [james-project] chibenwa commented on pull request #761: JAMES-3534 Identity/set update + delete and Identity/get should fail for identities whose alias is deleted

Posted by GitBox <gi...@apache.org>.
chibenwa commented on pull request #761:
URL: https://github.com/apache/james-project/pull/761#issuecomment-982242437


   @quantranhong1999 can you issue the fixups for your comments?


-- 
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


[GitHub] [james-project] Arsnael commented on pull request #761: JAMES-3534 Identity/set update + delete and Identity/get should fail for identities whose alias is deleted

Posted by GitBox <gi...@apache.org>.
Arsnael commented on pull request #761:
URL: https://github.com/apache/james-project/pull/761#issuecomment-984229604


   Can you rebase to solve conflicts and get rid of the no review commit now that it's merged, and squash your fixups as well? :)


-- 
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