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

HL Python SDK: Fix Client SSL configuration #7516

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

N-o-Z
Copy link
Member

@N-o-Z N-o-Z commented Feb 26, 2024

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

@N-o-Z N-o-Z added bug Something isn't working area/sdk/python exclude-changelog PR description should not be included in next release changelog python-sdk-changelog labels Feb 26, 2024
@N-o-Z N-o-Z requested review from idanovo and guy-har February 26, 2024 11:44
@N-o-Z N-o-Z self-assigned this Feb 26, 2024
Copy link

github-actions bot commented Feb 26, 2024

♻️ PR Preview d1261af has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

Copy link

E2E Test Results - DynamoDB Local - Local Block Adapter

10 passed

Comment on lines +54 to +57
if verify_ssl is not None:
self.verify_ssl = verify_ssl
if proxy is not None:
self.proxy = proxy
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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

Copy link
Member Author

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.

Copy link
Contributor

@idanovo idanovo left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks!

@N-o-Z N-o-Z merged commit e362578 into master Feb 26, 2024
44 checks passed
@N-o-Z N-o-Z deleted the fix/python-ssl-configuration-7513 branch February 26, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sdk/python bug Something isn't working exclude-changelog PR description should not be included in next release changelog python-sdk-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verify SSL False not applying - Python SDK
2 participants