Add SigV4 event stream empty-frame signing#692
Merged
jonathan343 merged 3 commits intodevelopfrom May 4, 2026
Merged
Conversation
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.
SamRemis
reviewed
May 4, 2026
SamRemis
reviewed
May 4, 2026
SamRemis
previously approved these changes
May 4, 2026
alexgromero
previously approved these changes
May 4, 2026
SamRemis
approved these changes
May 4, 2026
This was referenced May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue: awslabs/aws-sdk-python#46
Related PR: #691
Summary
Adds
AsyncEventSigner.sign_emptyfor 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_emptybefore closing the stream and confirmed that the simple_file.py script ran successfully with just astream.close()following the completion of sending all audio chunks.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.