-
Notifications
You must be signed in to change notification settings - Fork 181
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
Improvement python delta-sharing client: convert expires_in as string to int, if returned as string #628
Merged
moderakh
merged 11 commits into
delta-io:main
from
moderakh:moderakh/allow-parsing-expires-in-from-string
Dec 30, 2024
Merged
Improvement python delta-sharing client: convert expires_in as string to int, if returned as string #628
moderakh
merged 11 commits into
delta-io:main
from
moderakh:moderakh/allow-parsing-expires-in-from-string
Dec 30, 2024
Conversation
This file contains 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
moderakh
changed the title
Handle expires_in as string or int in OAuth token exchange
Bugfix: Handle expires_in as string or int in OAuth token exchange
Dec 29, 2024
moderakh
changed the title
Bugfix: Handle expires_in as string or int in OAuth token exchange
Bugfix: Handle expires_in as string if returned as string
Dec 30, 2024
moderakh
changed the title
Bugfix: Handle expires_in as string if returned as string
Bugfix: convert expires_in as string to int, if returned as string
Dec 30, 2024
moderakh
changed the title
Bugfix: convert expires_in as string to int, if returned as string
Bugfix: convert expires_in as string to int, if returned as string in python client
Dec 30, 2024
moderakh
changed the title
Bugfix: convert expires_in as string to int, if returned as string in python client
Bugfix python delta-sharing client: convert expires_in as string to int, if returned as string
Dec 30, 2024
moderakh
changed the title
Bugfix python delta-sharing client: convert expires_in as string to int, if returned as string
Improvement python delta-sharing client: convert expires_in as string to int, if returned as string
Dec 30, 2024
charlenelyu-db
approved these changes
Dec 30, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
moderakh
added a commit
to moderakh/delta-sharing
that referenced
this pull request
Dec 30, 2024
… to int, if returned as string (delta-io#628) **TL;DR:** This PR enhances the OAuth client to support cases where the expires_in field in the token response is returned as a string instead of an integer. While the OAuth 2.0 specification mandates that expires_in should be an integer [RFC 6749 Section 4.1.4](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.4), some OAuth servers return it as a string, leading to potential compatibility issues. Certain OAuth implementations deviate from the standard and return expires_in as a string, e.g.: ``` { "access_token": "example-token", "expires_in": "3600", // Returned as a string "token_type": "Bearer" } ``` This causes failures when the client expects the field to always be an integer. Solution This PR updates the token parsing logic to: 1. Check the type of the expires_in field. 2. Convert the value to an integer if it is provided as a string. 3. Maintain backward compatibility with the standard integer format.
moderakh
added a commit
that referenced
this pull request
Dec 30, 2024
… to int, if returned as string (#628) (#630) This PR cherry picks #628 to python-branch-1.3 **TL;DR:** This PR enhances the OAuth client to support cases where the expires_in field in the token response is returned as a string instead of an integer. While the OAuth 2.0 specification mandates that expires_in should be an integer [RFC 6749 Section 4.1.4](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.4), some OAuth servers return it as a string, leading to potential compatibility issues. Certain OAuth implementations deviate from the standard and return expires_in as a string, e.g.: ``` { "access_token": "example-token", "expires_in": "3600", // Returned as a string "token_type": "Bearer" } ``` This causes failures when the client expects the field to always be an integer. Solution This PR updates the token parsing logic to: 1. Check the type of the expires_in field. 2. Convert the value to an integer if it is provided as a string. 3. Maintain backward compatibility with the standard integer format.
moderakh
added a commit
that referenced
this pull request
Dec 31, 2024
…to int, if returned as string (#631) TL;DR This PR improves oauth-client in spark-client to support parsing expires_in as string similar to the changes for the python client: #628 Detail: This PR enhances the OAuth client to support cases where the expires_in field in the token response is returned as a string instead of an integer. While the OAuth 2.0 specification mandates that expires_in should be an integer [RFC 6749 Section 4.1.4](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.4), some OAuth servers return it as a string, leading to potential compatibility issues. Certain OAuth implementations deviate from the standard and return expires_in as a string, e.g.: ``` { "access_token": "example-token", "expires_in": "3600", // Returned as a string "token_type": "Bearer" } ``` This causes failures when the client expects the field to always be an integer. Solution This PR updates the token parsing logic to: 1. Check the type of the expires_in field. 2. Convert the value to an integer if it is provided as a string. 3. Maintain backward compatibility with the standard integer format.
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.
TL;DR: This PR enhances the OAuth client to support cases where the expires_in field in the token response is returned as a string instead of an integer. While the OAuth 2.0 specification mandates that expires_in should be an integer RFC 6749 Section 4.1.4, some OAuth servers return it as a string, leading to potential compatibility issues.
Certain OAuth implementations deviate from the standard and return expires_in as a string, e.g.:
This causes failures when the client expects the field to always be an integer.
Solution
This PR updates the token parsing logic to:
1. Check the type of the expires_in field.
2. Convert the value to an integer if it is provided as a string.
3. Maintain backward compatibility with the standard integer format.