diff --git a/clients/client-python/gravitino/auth/default_oauth_to_token_provider.py b/clients/client-python/gravitino/auth/default_oauth_to_token_provider.py index b185f3a3c23..3fb73039568 100644 --- a/clients/client-python/gravitino/auth/default_oauth_to_token_provider.py +++ b/clients/client-python/gravitino/auth/default_oauth_to_token_provider.py @@ -26,7 +26,7 @@ from gravitino.dto.requests.oauth2_client_credential_request import ( OAuth2ClientCredentialRequest, ) -from gravitino.exceptions.gravitino_runtime_exception import GravitinoRuntimeException +from gravitino.exceptions.base import GravitinoRuntimeException CLIENT_CREDENTIALS = "client_credentials" CREDENTIAL_SPLITTER = ":" diff --git a/clients/client-python/gravitino/utils/http_client.py b/clients/client-python/gravitino/utils/http_client.py index d12e09e52fa..89b75d64145 100644 --- a/clients/client-python/gravitino/utils/http_client.py +++ b/clients/client-python/gravitino/utils/http_client.py @@ -150,6 +150,7 @@ def _make_request(self, opener, request, timeout=None) -> Tuple[bool, Response]: return (False, err_resp) + # pylint: disable=too-many-locals def _request( self, method, @@ -224,8 +225,11 @@ def put(self, endpoint, json=None, error_handler=None, **kwargs): return self._request( "put", endpoint, json=json, error_handler=error_handler, **kwargs ) + def post_form(self, endpoint, data=None, error_handler=None, **kwargs): - return self._request("post", endpoint, data=data, error_handler=error_handler **kwargs) + return self._request( + "post", endpoint, data=data, error_handler=error_handler**kwargs + ) def close(self): self._request("close", "/") diff --git a/clients/client-python/tests/unittests/auth/test_simple_auth_provider.py b/clients/client-python/tests/unittests/auth/test_simple_auth_provider.py index d8c10e4671a..45f7c14882c 100644 --- a/clients/client-python/tests/unittests/auth/test_simple_auth_provider.py +++ b/clients/client-python/tests/unittests/auth/test_simple_auth_provider.py @@ -50,3 +50,4 @@ def test_auth_provider(self): token[len(AuthConstants.AUTHORIZATION_BASIC_HEADER) :] ).decode("utf-8") self.assertEqual(f"{user}:dummy", token_string) + os.environ["GRAVITINO_USER"] = ""