-
Notifications
You must be signed in to change notification settings - Fork 172
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
Python OAuth client_credentials support #563
Python OAuth client_credentials support #563
Conversation
python/delta_sharing/auth.py
Outdated
# limitations under the License. | ||
# | ||
|
||
from abc import ABC, abstractmethod |
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.
what's abc
and ABC
?
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.
This is a python pattern for making a class abstract in python by importing ABC from the python standard library, we will have access to abstractmethod
annotation etc.
see https://docs.python.org/3/library/abc.html
json = """ | ||
{ | ||
"shareCredentialsVersion": 2, | ||
"type": "persistent_oauth2.0", | ||
"type": "oauth_client_credentials", |
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.
will changing this causing any break on existing traffic?
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.
no, this is already discussed with oracle who introduced this and they are fine with the change as there is no traffic persistent_oauth2.0
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.
Thanks! looks good, could you double check the failure in pre-merge tests?
The current OAuth implementation in the Python client does not reuse access tokens. Instead, it exchanges the client-id and client-secret for a new access token with every request. This behavior increases the load on the tokenEndpoint and introduces unnecessary latency in the request processing.
This PR updates the OAuth implementation to oauth reuse access tokens, aligning the Python client with the OAuth behavior of the Scala client, as detailed in this PR for the Scala client.
For additional context on the usage of auth_provider and its functionality, please refer to the description in the original PR for the Spark client.