Skip to content

v0.11.0

Latest

Choose a tag to compare

@mariotoffia mariotoffia released this 18 Feb 20:38
· 1 commit to main since this release

What's Changed

Deterministic HMAC Signing Key for Receipt Handle Verification

Previously, the HMAC signing key used for receipt handle verification was generated randomly per queue instance. This meant that if the queue instance was recreated (process restart, different consumer, scaling event), the new instance could not verify receipt handles signed by the previous instance, making message acknowledgment (delete) impossible.

Changes:

  • Default signing key is now deterministic — receipt handles work across queue instances out of the box without any configuration
  • Added UseSigningKey(key []byte) Queue to the Queue interface for providing a custom secret key (recommended for production)
  • Added MinSigningKeyLength constant (32 bytes) and ErrSigningKeyTooShort sentinel error
  • Key validation is deferred to operation time, consistent with existing UseTable/UseQueueName/UseClientID pattern

Usage with custom key:

queue := dynamodbqueue.New(cfg, 0).
    UseTable("my-table").
    UseQueueName("my-queue").
    UseClientID("consumer-1").
    UseSigningKey([]byte("your-32-byte-secret-key-here!!!!"))

Other

  • CI badge fix
  • CI test configuration improvements

Full Changelog: v0.10.2...v0.11.0