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

Add sts_token_buffer_time parameter to transport options #2216

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eisichenko
Copy link

@eisichenko eisichenko commented Jan 5, 2025

Linked Issue: #2217

During development, I've encountered an issue where Kombu does not currently provide an option to generate an STS token before its expiration time. This can lead to errors such as:

Request HTTP Error HTTP 403 Forbidden (b'{"__type":"com.amazon.coral.service#ExpiredTokenException","message":"The security token included in the request is expired"}')

Such errors occur when the session token expires, which can cause the consumer channel to close when working with Celery.

This PR introduces a new optional parameter sts_token_buffer_time which defaults to 0, preserving the previous behavior. When provided, this attribute allows the STS token to be generated earlier by the specified buffer time seconds (sts_token_buffer_time), helping to prevent ExpiredTokenException errors.

@eisichenko eisichenko force-pushed the feature/sts-token-generate-buffer-time branch 7 times, most recently from b45c6c8 to 54ac9db Compare January 5, 2025 15:32
@eisichenko eisichenko changed the title Add sts_token_buffer_time Parameter to Transport Options Add sts_token_buffer_time parameter to transport options Jan 5, 2025
Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

you need to rebase the PR to fix merge conflict as we got a new PR merged 83b296f . also the pr will need proper unit tests

Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.51%. Comparing base (a0175b0) to head (e00da33).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2216   +/-   ##
=======================================
  Coverage   81.50%   81.51%           
=======================================
  Files          77       77           
  Lines        9524     9529    +5     
  Branches     1152     1153    +1     
=======================================
+ Hits         7763     7768    +5     
  Misses       1569     1569           
  Partials      192      192           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eisichenko eisichenko force-pushed the feature/sts-token-generate-buffer-time branch from 54ac9db to 488993c Compare January 14, 2025 11:32
@eisichenko eisichenko force-pushed the feature/sts-token-generate-buffer-time branch from 488993c to e00da33 Compare January 14, 2025 12:23
@eisichenko eisichenko requested a review from auvipy January 14, 2025 12:24
@eisichenko
Copy link
Author

you need to rebase the PR to fix merge conflict as we got a new PR merged 83b296f . also the pr will need proper unit tests

@auvipy merge conflicts are resolved and tests are implemented. Thanks for the response!

@auvipy
Copy link
Member

auvipy commented Jan 14, 2025

I started the CI. So lets see

@eisichenko
Copy link
Author

I started the CI. So lets see

@auvipy all checks are passed

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

we have to wait for the next release until we merge this, so please have some patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants