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

Enhancement : Enable JWT Access Token Update for PIT Context Manager to Prevent Expiry* #1949

Open
yomduf opened this issue Dec 10, 2024 · 1 comment

Comments

@yomduf
Copy link

yomduf commented Dec 10, 2024

Enhancement Request: Enable JWT Access Token Update for PIT Context Manager to Prevent Expiry

Currently, the context manager for a Point-in-Time (PIT) in Elasticsearch does not allow for the update of JWT access tokens, which can lead to token expiry issues. When using the iterate method to paginate through all data for a given PIT, the underlying Elastic client cannot be updated. This is because the context manager for a PIT creates a new instance of the Search object, which is not accessible in the consuming code.

Reference: Elasticsearch DSL Search Code

As a result, authentication details, such as JWT access tokens, cannot be changed during the iteration process. If a JWT access token expires before the iteration through all data covered by a PIT is complete, the process will fail. This is because a new JWT access token cannot be used without losing the PIT.

This enhancement request seeks to address this limitation by allowing the update of JWT access tokens within the PIT context manager, ensuring seamless data iteration without authentication interruptions.

@miguelgrinberg
Copy link
Collaborator

I'm curious to know how do you handle this for other tasks. Do you catch 401 errors and in the error handler refresh the token and retry? If you can share some code that you use for this it would help me figure out how to best support this in the PIT context manager.

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

No branches or pull requests

2 participants