Skip to content

Add SigV4 event stream empty-frame signing#692

Merged
jonathan343 merged 3 commits intodevelopfrom
fix-empty-event-sigining
May 4, 2026
Merged

Add SigV4 event stream empty-frame signing#692
jonathan343 merged 3 commits intodevelopfrom
fix-empty-event-sigining

Conversation

@jonathan343
Copy link
Copy Markdown
Contributor

Related Issue: awslabs/aws-sdk-python#46
Related PR: #691

Summary

Adds AsyncEventSigner.sign_empty for producing SigV4-signed Amazon Event Stream terminator frames with zero-byte payloads.

Details

Normal event signing wraps an encoded event message as the payload. Some AWS event stream services require a final signed empty frame before the HTTP body stream closes, which must use an actual zero-byte payload instead.

This keeps normal sign() behavior unchanged and shares the common signing logic through a private helper.

Testing

I ported a modified version #691 that calls sign_empty before closing the stream and confirmed that the simple_file.py script ran successfully with just a stream.close() following the completion of sending all audio chunks.

  • Added coverage for normal event signing payload wrapping
  • Added coverage for signed empty-frame payload behavior

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Add AsyncEventSigner.sign_empty for SigV4-signed Amazon Event Stream
terminator frames with zero-byte payloads.

Share the common signing flow between normal event messages and empty
terminator payloads, and cover both behaviors with tests.
@jonathan343 jonathan343 requested a review from a team as a code owner May 4, 2026 19:13
Comment thread packages/aws-sdk-signers/src/aws_sdk_signers/signers.py
Comment thread packages/aws-sdk-signers/src/aws_sdk_signers/signers.py
SamRemis
SamRemis previously approved these changes May 4, 2026
alexgromero
alexgromero previously approved these changes May 4, 2026
@jonathan343 jonathan343 dismissed stale reviews from alexgromero and SamRemis via 779d455 May 4, 2026 20:03
@jonathan343 jonathan343 merged commit 9b28c3a into develop May 4, 2026
9 checks passed
@jonathan343 jonathan343 deleted the fix-empty-event-sigining branch May 4, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants