fix(sqs): handle '*' selector in MessageAttributeNames (#7515)

The '*' selector was missing from SqsMessageAttributeSelector.includes(),
so ReceiveMessage with MessageAttributeNames: ["*"] returned no
message attributes. AWS treats '*' the same as 'All' and '.*'.

- Add '*' to the includes() check
- Add '*' to the test loop that already covers 'All' and '.*'

Closes #7503

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
This commit is contained in:
Matheus Oliveira authored and GitHub committed 2026-11-04 16:41:37 -04:00
1 parent 0c3af7dc4b
commit 7b3f5812e2
2 files changed
+2 -2

No files matched your search

@@ -26,7 +26,7 @@ final class SqsMessageAttributeSelector {
}
private static boolean includes(Set<String> requestedNames, String name) {
if (requestedNames.contains("All") || requestedNames.contains(".*") || requestedNames.contains(name)) {
if (requestedNames.contains("All") || requestedNames.contains("*") || requestedNames.contains(".*") || requestedNames.contains(name)) {
return true;
}
for (String requestedName : requestedNames) {
@@ -419,7 +419,7 @@ class SqsJsonProtocolTest {
.body("Messages[0].MessageAttributes", not(hasKey("secret")))
.body("Messages[0].MD5OfMessageAttributes", equalTo("46db9885b8f221ea04082f03e3a63d14"));
for (String allSelector : new String[]{"All", ".*"}) {
for (String allSelector : new String[]{"All", ".*", "*"}) {
given()
.contentType(CONTENT_TYPE)
.header("X-Amz-Target", "AmazonSQS.ReceiveMessage")