Files
floci/docs
Salil Chincholikar c0b2b299b0 feat(sns): sign deliveries with a served RSA certificate like AWS (#5189)
* feat(sns): sign deliveries with a served RSA certificate like AWS

Replace the EXAMPLE Signature and SigningCertURL placeholders with real
signatures over the documented canonical string. Notifications and
subscription confirmations delivered to HTTP/HTTPS endpoints, Lambda
records and non-raw SQS envelopes are signed with SHA1withRSA, or
SHA256withRSA when the topic sets SignatureVersion to 2.

The RSA 2048 key and its self-signed certificate are kept in SNS storage
and the certificate is served at
/_aws/sns/SimpleNotificationService-<fingerprint>.pem, so a new key always
gets a new URL. The SQS envelope now carries UnsubscribeURL and the Lambda
record a real UnsubscribeUrl, as on AWS.

* fix(sns): drop a delivery when signing fails and regenerate the key on reset

A signing failure in the Lambda, SQS and HTTP builders was caught with the JSON
fallback and delivered an empty placeholder as if it had succeeded. Only a JSON
serialization error falls back now; a signing failure fails that delivery.

SnsMessageSigner is now Resettable: a reset drops the cached key instead of
writing it back to the cleared store, so the next delivery generates a new one.

* style(sns): sort SnsService imports

* refactor(sns): build the SQS envelope with the builder Firehose uses

buildSnsSqsEnvelope duplicated buildSnsEnvelope apart from the signature and UnsubscribeURL. buildSnsEnvelope now takes the subscription ARN and signature version and adds both only when a subscription is given, so SQS and Firehose share one builder again.
2026-10-06 22:50:56 -04:00
..
2026-03-15 17:43:56 -05:00