mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
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:
1 parent
4ac4e5d34b
commit
234af69bd2
2 files changed
+52
-12
No files matched your search
@@ -267,21 +267,22 @@ public class SesQueryHandler {
|
||||
var xml = new XmlBuilder().start("NotificationAttributes");
|
||||
for (String identityValue : identities) {
|
||||
Identity identity = sesService.getIdentityNotificationAttributes(identityValue, region);
|
||||
if (identity == null) {
|
||||
continue;
|
||||
}
|
||||
xml.start("entry");
|
||||
xml.elem("key", identityValue);
|
||||
xml.start("value");
|
||||
if (identity != null) {
|
||||
xml.elem("BounceTopic", identity.getNotificationAttributes().getOrDefault("BounceTopic", ""));
|
||||
xml.elem("ComplaintTopic", identity.getNotificationAttributes().getOrDefault("ComplaintTopic", ""));
|
||||
xml.elem("DeliveryTopic", identity.getNotificationAttributes().getOrDefault("DeliveryTopic", ""));
|
||||
xml.elem("ForwardingEnabled", String.valueOf(identity.isFeedbackForwardingEnabled()));
|
||||
xml.elem("HeadersInBounceNotificationsEnabled",
|
||||
String.valueOf(identity.getHeadersInNotificationsEnabled().getOrDefault("Bounce", false)));
|
||||
xml.elem("HeadersInComplaintNotificationsEnabled",
|
||||
String.valueOf(identity.getHeadersInNotificationsEnabled().getOrDefault("Complaint", false)));
|
||||
xml.elem("HeadersInDeliveryNotificationsEnabled",
|
||||
String.valueOf(identity.getHeadersInNotificationsEnabled().getOrDefault("Delivery", false)));
|
||||
}
|
||||
xml.elem("BounceTopic", identity.getNotificationAttributes().getOrDefault("BounceTopic", ""));
|
||||
xml.elem("ComplaintTopic", identity.getNotificationAttributes().getOrDefault("ComplaintTopic", ""));
|
||||
xml.elem("DeliveryTopic", identity.getNotificationAttributes().getOrDefault("DeliveryTopic", ""));
|
||||
xml.elem("ForwardingEnabled", String.valueOf(identity.isFeedbackForwardingEnabled()));
|
||||
xml.elem("HeadersInBounceNotificationsEnabled",
|
||||
String.valueOf(identity.getHeadersInNotificationsEnabled().getOrDefault("Bounce", false)));
|
||||
xml.elem("HeadersInComplaintNotificationsEnabled",
|
||||
String.valueOf(identity.getHeadersInNotificationsEnabled().getOrDefault("Complaint", false)));
|
||||
xml.elem("HeadersInDeliveryNotificationsEnabled",
|
||||
String.valueOf(identity.getHeadersInNotificationsEnabled().getOrDefault("Delivery", false)));
|
||||
xml.end("value");
|
||||
xml.end("entry");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user