-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat: add validation for SNS batch entry IDs and corresponding tests #13556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add validation for SNS batch entry IDs and corresponding tests #13556
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your second contribution!
The change looks good in principle! But same issue as #13554, we require our tests to be validated against AWS, and it doesn't seem to be the case here. Could you please run them and push the changes?
Also, as a side note, we currently have a in progress re-implementation of SNS in the v2 module of the sns service, it might be good to port this validation logic there too. 👍
Let me know if you have any problem, and thanks again, this looks good!
edit: forgot to add to both PR, it is holidays season here and we might have some delay in reviewing your changes, and might come back to it in January.
|
forgot about v2 part in the earlier commit, I've ported the validation logic to the v2 provider in this last commit. The same test passes for both v1 and v2 (verified with PROVIDER_OVERRIDE_SNS=v2). |
bentsku
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for addressing the comments and sorry for the delay in reviewing due to the holidays!
Congratulations on the contribution, and welcome to the list of contributors!
Motivation
Fixes #13526
SNS
publish_batchwas not validating batch entry IDs according to AWS specifications. AWS requires entry IDs to:Currently, LocalStack accepts invalid IDs like
"message.id"(contains dot) or IDs exceeding 80 characters, which AWS rejects withInvalidBatchEntryIderrors.Changes
BATCH_ENTRY_ID_REGEXconstant to validate ID character patternvalidate_batch_entry_id()function with length and pattern validationpublish_batch()method after duplicate ID checkInvalidBatchEntryIdExceptionwith appropriate error messages matching AWS behaviorTests
test_publish_batch_invalid_entry_id_simple(LocalStack-only test) - validates basic functionalitytest_publish_batch_invalid_entry_id(AWS-validated snapshot test) - ensures AWS parityRelated
Remaining validation gaps identified during implementation (to be addressed in separate issues):