Question: How do I decode the body from /_fakecloud/sqs/messages ?
The GET /_fakecloud/sqs/messages endpoint returns a list of queued SQS messages, but the body of each message is base64. Decoding the base64 seems to result in some undocumented binary data. What is this data? How do we get the original message contents?
@mondegreengames I'm not the maintainer, so take this with a grain of salt, but as far as I can tell the introspection endpoint returns the message body as an encrypted blob that cannot be decrypted. You'll need to use the AWS SDK or CLI ReceiveMessage call to get the decrypted message body. I think the introspection endpoint just allows you to see that a message was put on the queue, but not what the message actually is.
Thanks for the report, and thanks @freakinhippie, that's right.
The data is ciphertext. AWS has turned on SSE-SQS by default for new queues since 2023, and fakecloud does the same, so each body is stored encrypted under alias/aws/sqs. /_fakecloud/sqs/messages was returning that stored form, which isn't useful for a test-and-debug endpoint. ReceiveMessage decrypts, which is why the SDK and CLI show your original body.
That was a mistake on our side. Tracking the fix in #2760: body will return the plaintext, and a new storedBody field will carry the at-rest form for anyone checking encryption. Until then, create queues with SqsManagedSseEnabled=false to get plaintext from introspection.