fix(ses): omit unknown identities from GetIdentityNotificationAttributes (#1338)

The handler emitted a map entry with an empty <value> for every queried
identity, including ones that were never verified. Real AWS returns an
empty NotificationAttributes map for an unknown identity and drops it
from a mixed query, never an entry with missing fields (verified against
real AWS SES on 2026-06-13). The fabricated empty entry also violated the
response contract, since the entry's value lacked the required
ForwardingEnabled field. The handler now skips identities the service
doesn't know about.
This commit is contained in:
Kenshin Okinaka authored and GitHub committed 2026-06-14 19:25:17 -05:00
1 parent 4ac4e5d34b
commit 234af69bd2
2 files changed
+52 -12

No files matched your search

@@ -8,6 +8,7 @@ import org.junit.jupiter.api.TestMethodOrder;
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
@QuarkusTest
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@@ -327,4 +328,42 @@ class SesIdentityAttributesV1IntegrationTest {
.body(containsString("<HeadersInComplaintNotificationsEnabled>false</HeadersInComplaintNotificationsEnabled>"))
.body(containsString("<HeadersInDeliveryNotificationsEnabled>false</HeadersInDeliveryNotificationsEnabled>"));
}
@Test
@Order(22)
void getIdentityNotificationAttributes_unknownIdentity_omittedFromMap() {
// Real AWS returns an empty NotificationAttributes map for an identity
// that doesn't exist, rather than an entry with empty values
// (verified against real AWS SES on 2026-06-13).
given()
.contentType("application/x-www-form-urlencoded")
.header("Authorization", AUTH)
.formParam("Action", "GetIdentityNotificationAttributes")
.formParam("Identities.member.1", "ghost-notif.floci.test")
.when()
.post("/")
.then()
.statusCode(200)
.body(containsString("GetIdentityNotificationAttributesResponse"))
.body(containsString("<NotificationAttributes></NotificationAttributes>"))
.body(not(containsString("ghost-notif.floci.test")));
}
@Test
@Order(23)
void getIdentityNotificationAttributes_mixedKnownAndUnknown_returnsOnlyKnown() {
// The unknown identity is dropped from the map; the known one stays.
given()
.contentType("application/x-www-form-urlencoded")
.header("Authorization", AUTH)
.formParam("Action", "GetIdentityNotificationAttributes")
.formParam("Identities.member.1", "v1-attrs.floci.test")
.formParam("Identities.member.2", "ghost-notif2.floci.test")
.when()
.post("/")
.then()
.statusCode(200)
.body(containsString("<key>v1-attrs.floci.test</key>"))
.body(not(containsString("ghost-notif2.floci.test")));
}
}