Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(evenstream-handler-node): add system clock offset to event signing streams #6227

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented Jun 26, 2024

addresses #6217

Description

Add system clock offset to dates in event signing streams

Testing

manual testing with https://github.com/esauerbo/rekognition-sdk-repro/tree/clockSkew, updated unit tests

@kuhe kuhe requested a review from a team as a code owner June 26, 2024 15:52
@kuhe kuhe force-pushed the fix/stream-clock-offset branch 3 times, most recently from 1745389 to 79ef154 Compare June 26, 2024 16:23

constructor(options: EventStreamPayloadHandlerOptions) {
this.messageSigner = options.messageSigner;
this.eventStreamCodec = new EventStreamCodec(options.utf8Encoder, options.utf8Decoder);
this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the offset is converted to a provider because the offset must be read at the time of signing and not at the time of initialization.

the offset may have been corrected at some point in the client lifecycle, necessitating a live check of the number value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this won't work immediately because during config resolution we keep copying the object for whatever reason

@kuhe kuhe merged commit 4687f53 into aws:main Jun 26, 2024
5 checks passed
@kuhe kuhe deleted the fix/stream-clock-offset branch June 26, 2024 17:05
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants