diff --git a/pyproject.toml b/pyproject.toml index 1c13bbb9c..48351e60a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires-python = ">=3.11" dependencies = [ "uipath>=2.10.19, <2.11.0", "uipath-core>=0.5.2, <0.6.0", - "uipath-platform>=0.0.27, <0.1.0", + "uipath-platform>=0.1.1, <0.2.0", "uipath-runtime>=0.9.1, <0.10.0", "langgraph>=1.0.0, <2.0.0", "langchain-core>=1.2.11, <2.0.0", diff --git a/src/uipath_langchain/chat/bedrock.py b/src/uipath_langchain/chat/bedrock.py index 7c5666c09..c02408cb0 100644 --- a/src/uipath_langchain/chat/bedrock.py +++ b/src/uipath_langchain/chat/bedrock.py @@ -7,7 +7,7 @@ from langchain_core.messages import BaseMessage from langchain_core.outputs import ChatGenerationChunk, ChatResult from tenacity import AsyncRetrying, Retrying -from uipath.platform.common import EndpointManager, resource_override +from uipath.platform.common import EndpointManager, is_ssl_verification_disabled, resource_override from .http_client import build_uipath_headers, resolve_gateway_url from .http_client.header_capture import HeaderCapture @@ -108,10 +108,15 @@ def _unsigned_config(self, **overrides): **overrides, ) + def _get_verify(self) -> bool: + """Return False when SSL verification is disabled, True otherwise.""" + return not is_ssl_verification_disabled() + def get_client(self): session = self._build_session() client = session.client( "bedrock-runtime", + verify=self._get_verify(), config=self._unsigned_config( retries={"total_max_attempts": 1}, read_timeout=300, @@ -129,6 +134,7 @@ def get_bedrock_client(self): session = self._build_session() return session.client( "bedrock", + verify=self._get_verify(), config=self._unsigned_config(), ) diff --git a/tests/chat/test_bedrock.py b/tests/chat/test_bedrock.py index e4b15431f..f681572a1 100644 --- a/tests/chat/test_bedrock.py +++ b/tests/chat/test_bedrock.py @@ -97,6 +97,57 @@ def test_uipath_chat_bedrock_init_does_not_trigger_credential_resolution( ) +class TestSslVerification: + def test_get_client_verifies_ssl_by_default(self): + passthrough = AwsBedrockCompletionsPassthroughClient( + model="anthropic.claude-haiku-4-5-20251001", + token="test-token", + api_flavor="converse", + ) + client = passthrough.get_client() + assert client.meta.endpoint_url.startswith("https") + assert client._endpoint.http_session._verify is True + + def test_get_bedrock_client_verifies_ssl_by_default(self): + passthrough = AwsBedrockCompletionsPassthroughClient( + model="anthropic.claude-haiku-4-5-20251001", + token="test-token", + api_flavor="converse", + ) + client = passthrough.get_bedrock_client() + assert client._endpoint.http_session._verify is True + + @patch.dict(os.environ, {"UIPATH_DISABLE_SSL_VERIFY": "true"}) + def test_get_client_disables_ssl_when_env_set(self): + passthrough = AwsBedrockCompletionsPassthroughClient( + model="anthropic.claude-haiku-4-5-20251001", + token="test-token", + api_flavor="converse", + ) + client = passthrough.get_client() + assert client._endpoint.http_session._verify is False + + @patch.dict(os.environ, {"UIPATH_DISABLE_SSL_VERIFY": "true"}) + def test_get_bedrock_client_disables_ssl_when_env_set(self): + passthrough = AwsBedrockCompletionsPassthroughClient( + model="anthropic.claude-haiku-4-5-20251001", + token="test-token", + api_flavor="converse", + ) + client = passthrough.get_bedrock_client() + assert client._endpoint.http_session._verify is False + + @patch.dict(os.environ, {"UIPATH_DISABLE_SSL_VERIFY": "1"}) + def test_get_client_disables_ssl_with_numeric_value(self): + passthrough = AwsBedrockCompletionsPassthroughClient( + model="anthropic.claude-haiku-4-5-20251001", + token="test-token", + api_flavor="converse", + ) + client = passthrough.get_client() + assert client._endpoint.http_session._verify is False + + class TestConvertFileBlocksToAnthropicDocuments: def test_converts_pdf_file_block_to_document(self): messages: list[BaseMessage] = [ diff --git a/uv.lock b/uv.lock index 4afd3fe2b..0e2ecf6f4 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 3 +revision = 2 requires-python = ">=3.11" resolution-markers = [ "python_full_version >= '3.14'", @@ -3289,7 +3289,7 @@ wheels = [ [[package]] name = "uipath" -version = "2.10.19" +version = "2.10.20" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "applicationinsights" }, @@ -3312,23 +3312,23 @@ dependencies = [ { name = "uipath-platform" }, { name = "uipath-runtime" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/5b/0d/75c5d1f531be94c704c58a1e08fba2ea5190680f306679a56973d78cc189/uipath-2.10.19.tar.gz", hash = "sha256:79cab23a002d76e4a505625f3cb914222fd8f14752d872fde6d9177ff21f790f", size = 2461741, upload-time = "2026-03-18T16:27:25.559Z" } +sdist = { url = "https://files.pythonhosted.org/packages/0d/a9/5cb03edbbc142d01832be701e80d11acfd3c178a71c4f58d4b49d93ed793/uipath-2.10.20.tar.gz", hash = "sha256:985c7931f65fb70c507145a3395a470a161840c3639f51d1164f8baa70be6147", size = 2461734, upload-time = "2026-03-19T06:53:31.225Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/1d/73/c602a896d95ea2b468e6a5f82a66bf484a973a5826fec931d9c92e80d6c8/uipath-2.10.19-py3-none-any.whl", hash = "sha256:071aa44565fc126ac76f9222b38c774ea71385f6631cffffbc859056eb95e067", size = 358660, upload-time = "2026-03-18T16:27:23.424Z" }, + { url = "https://files.pythonhosted.org/packages/29/b8/1b7e573381ad017010a580399f0c98e8316519a4aaee2668456b0ba7f0f5/uipath-2.10.20-py3-none-any.whl", hash = "sha256:551600dcf4baeaec6c3cbe83651a43f973376554e57f1ce5f762265bef37afc0", size = 358660, upload-time = "2026-03-19T06:53:29.316Z" }, ] [[package]] name = "uipath-core" -version = "0.5.6" +version = "0.5.7" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "opentelemetry-instrumentation" }, { name = "opentelemetry-sdk" }, { name = "pydantic" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ea/8a/d129d33a81865f99d9134391a52f8691f557d95a18a38df4d88917b3e235/uipath_core-0.5.6.tar.gz", hash = "sha256:bebaf2e62111e844739e4f4e4dc47c48bac93b7e6fce6754502a9f4979c41888", size = 112659, upload-time = "2026-03-04T18:04:42.963Z" } +sdist = { url = "https://files.pythonhosted.org/packages/cd/67/cea2367246d8332bbcc4a4410a7287824d89a6b23795ef1a238f215c1c55/uipath_core-0.5.7.tar.gz", hash = "sha256:977b00a80dd38cd6abd49329861c6155f523079d0645341fead9e5cb195cdd9d", size = 112660, upload-time = "2026-03-13T16:32:31.136Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/54/8f/77ab712518aa2a8485a558a0de245ac425e07fd8b74cfa8951550f0aea63/uipath_core-0.5.6-py3-none-any.whl", hash = "sha256:4a741fc760605165b0541b3abb6ade728bfa386e000ace00054bc43995720e5b", size = 42047, upload-time = "2026-03-04T18:04:41.606Z" }, + { url = "https://files.pythonhosted.org/packages/27/a9/37c9f603dd6ba72e8c6fab9fc0c0d6f2aebe78280e831138917671c255ce/uipath_core-0.5.7-py3-none-any.whl", hash = "sha256:ab42306028245d333b2e08e6a8bbf5cffe00caf7a5cb5d7aa40f05e698173ed2", size = 42045, upload-time = "2026-03-13T16:32:29.823Z" }, ] [[package]] @@ -3425,7 +3425,7 @@ dev = [ [[package]] name = "uipath-platform" -version = "0.0.28" +version = "0.0.29" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "httpx" }, @@ -3435,9 +3435,9 @@ dependencies = [ { name = "truststore" }, { name = "uipath-core" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/5a/83/b16f3b4956ec3e77187c9127c0cfa0a46edfc962f6fa6e937f335185bcbb/uipath_platform-0.0.28.tar.gz", hash = "sha256:6f2ce0785c4a046784c27588e1288f119ff8bbdaee9f5b8bb932dc89f7a5540b", size = 283924, upload-time = "2026-03-18T16:26:05.925Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e5/d3/2d812c9e0afc93617d3e693082b67714bbdca73a5272ee1f8dc469aee7e8/uipath_platform-0.0.29.tar.gz", hash = "sha256:ccf60aa1821979f19774dd22cca02165a6e1e2af57df79481e7cc650c744815f", size = 283998, upload-time = "2026-03-19T06:52:29.583Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/65/07/dc956e18ad9305d7dd7fb48f9eba1868111f613d16e3d6393c80ca1ad5ce/uipath_platform-0.0.28-py3-none-any.whl", hash = "sha256:f94a8b729e6ab59d522b6d28cb7851d34d00a538418458fcf8272c75b72b33d7", size = 175623, upload-time = "2026-03-18T16:26:04.252Z" }, + { url = "https://files.pythonhosted.org/packages/d3/a5/5395825f3901889a388265a85f47f8320288e25e97d1ac794ca94f740415/uipath_platform-0.0.29-py3-none-any.whl", hash = "sha256:03097fa75bf938ad48a2e53674e2f63701c78c56891d43fe3e8c6298563ca9bc", size = 175728, upload-time = "2026-03-19T06:52:28.062Z" }, ] [[package]]