-
Notifications
You must be signed in to change notification settings - Fork 473
fix ssl deactivation from catalog properties #2985 #3012
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,7 @@ | |
| NoSuchViewError, | ||
| OAuthError, | ||
| ServerError, | ||
| TableAlreadyExistsError, | ||
| TableAlreadyExistsError, ValidationError, | ||
| ) | ||
| from pyiceberg.io import load_file_io | ||
| from pyiceberg.partitioning import PartitionField, PartitionSpec | ||
|
|
@@ -1641,6 +1641,29 @@ def test_update_namespace_properties_invalid_namespace(rest_mock: Mocker) -> Non | |
| assert "Empty namespace identifier" in str(e.value) | ||
|
|
||
|
|
||
| def test_with_disabled_ssl_ca_bundle(rest_mock: Mocker) -> None: | ||
| from pydantic import ValidationError | ||
|
MenelikV marked this conversation as resolved.
Outdated
|
||
| def ssl_check_callback(req, _): | ||
| if req.verify: | ||
| raise AssertionError("SSL verification is still enabled") | ||
| # Given | ||
| rest_mock.get( | ||
| f"{TEST_URI}v1/config", | ||
| json=ssl_check_callback, | ||
| status_code=200, | ||
| ) | ||
| # Given | ||
| catalog_properties = { | ||
| "uri": TEST_URI, | ||
| "token": TEST_TOKEN, | ||
| "ssl": { | ||
| "cabundle": False, | ||
| } | ||
| } | ||
| with pytest.raises(ValidationError) as _: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should directly assert that session.verify is False for extra confidence here. Then we could just do something like the following without the callback logic catalog = RestCatalog("rest", **{
"uri": TEST_URI,
"token": TEST_TOKEN,
"ssl": {"cabundle": False},
})
assert catalog._session.verify is False
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, works for me. |
||
| RestCatalog("rest", **catalog_properties) | ||
|
|
||
|
|
||
| def test_request_session_with_ssl_ca_bundle(monkeypatch: pytest.MonkeyPatch) -> None: | ||
| # Given | ||
| catalog_properties = { | ||
|
|
||
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.
Nit: