I'm using the official GCP PubSub emulator to test integration locally.
I'd like to send messages via classic curl/postman tools but it is getting complicated because this emulator requires encryption of incoming messages.
For instance, if we send it like this:
curl --location --request POST 'http://localhost:8091/v1/projects/my-project/topics/transactions:publish' \
--header 'Content-Type: application/json' \
--data-raw '{"messages":[{"data":"{\"foo\":\"baz\"}","attributes":{}}]}'
Then, I'm getting 400:
{
"error": {
"code": 400,
"message": "Payload isn't valid for request.",
"status": "INVALID_ARGUMENT"
}
}
due to invalid incoming messages. It requires encryption and if I sniff the encrypted body it works.
But it is overwhelming to encrypt messages running it locally.
In order to disable encryption in GCP I can follow this guide but it is not applicable to local emulators run - there is no GCP environment or I don't know how to do it.
Are there any options to disable emulator decryption? If not where to report it, there is no GitHub project for this.