-
Notifications
You must be signed in to change notification settings - Fork 363
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
HL Python SDK: Fix Client SSL configuration #7516
Conversation
♻️ PR Preview d1261af has been successfully destroyed since this PR has been closed. 🤖 By surge-preview |
if verify_ssl is not None: | ||
self.verify_ssl = verify_ssl | ||
if proxy is not None: | ||
self.proxy = proxy |
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.
if verify_ssl is not None: | |
self.verify_ssl = verify_ssl | |
if proxy is not None: | |
self.proxy = proxy | |
if verify_ssl: | |
self.verify_ssl = verify_ssl | |
if proxy: | |
self.proxy = proxy |
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.
@idanovo Thanks, note that this is a common mistake in python:
if verify_ssl
will return False if verify_ssl
is None
or False
.
In this case we want to assign the values only if they are not None (i.e. passed explicitly) whether they are True or False, and if not passed (or None) fallback to the client default settings.
In general the convention in python is to always use is not None
to avoid logical mistakes when checking if value exists.
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
Thanks!
Closes #7513
Change Description
Propagate ssl configuration properly to the lakeFS client
Background
The lakeFS configuration is updated dynamically, but unfortunately once the client is initialized, it initializes the underlying RESTClient with the initial values.
This in addition to the fact that the auto generated configuration class does not provide passing the ssl state and proxy configurations.
Bug Fix
ClientConfig to inherit from SDK Configuration class, and load the additional configuration on it.
Updated documentation accordingly
Testing Details
Added sanity test