fix(sns): support SubscriptionConfirmation and UnsubscribeConfirmation message types#1102
Open
fix(sns): support SubscriptionConfirmation and UnsubscribeConfirmation message types#1102
Conversation
…n message types The SnsMessage and SnsMessageObj structs were failing to deserialize SubscriptionConfirmation and UnsubscribeConfirmation SNS messages because: 1. `unsubscribe_url` was required (String) but these message types don't have it 2. `subscribe_url` and `token` fields were missing entirely This fix: - Makes `unsubscribe_url` optional (Option<String>) since it's only present in Notification messages - Adds `subscribe_url` field (Option<String>) for confirmation messages - Adds `token` field (Option<String>) for confirmation messages All fields use #[serde(default)] to handle missing fields gracefully. Fixes aws#966 Signed-off-by: abhu85 <151518127+abhu85@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix
SnsMessageandSnsMessageObjstructs failing to deserializeSubscriptionConfirmationandUnsubscribeConfirmationSNS message types.Root Cause:
The structs were designed only for
Notificationmessages:unsubscribe_urlwas a requiredString, but this field is only present in Notification messagessubscribe_urlandtokenfields (present in confirmation messages) were missing entirelyFix:
unsubscribe_urloptional (Option<String>) with#[serde(default)]subscribe_urlfield (Option<String>) for SubscriptionConfirmation/UnsubscribeConfirmation messagestokenfield (Option<String>) for confirmation messagesSnsMessageandSnsMessageObj<T>structsSNS Message Type Field Presence
unsubscribe_urlsubscribe_urltokenTest Plan
example-sns-subscription-confirmation.jsonwith real SubscriptionConfirmation payloadmy_example_sns_subscription_confirmationtest verifying:subscribe_urlandtokenfields are correctly populatedunsubscribe_urlisNonefor confirmation messagesmy_example_sns_notification_has_unsubscribe_urltest verifying:unsubscribe_urlisSomefor Notification messagessubscribe_urlandtokenareNonefor Notification messagesBreaking Change Notice
This is a breaking change for code that directly accesses
unsubscribe_url:Fixes #966
Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com