Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Zscaler Python SDK Changelog

## 1.9.44 (September 1 2026)

### Notes

- Python Versions: **v3.9, v3.10, v3.11, v3.12**

### Bug Fixes

* [PR #572](https://github.com/zscaler/zscaler-sdk-python/pull/572) - Fixed AI Guard policy detection requests not being dispatched through the legacy AI Guard client. `execute_policy` and `resolve_and_execute_policy` fell through to the standard OneAPI session and were sent without the AI Guard API key.

## 1.9.43 (August 18 2026)

### Notes

- Python Versions: **v3.9, v3.10, v3.11, v3.12**

### Bug Fixes

* Updated docstrings and examples in ZPA app_connector_group and service_edge_group resources.

## 1.9.42 (August 18 2026)

### Notes
Expand Down
27 changes: 27 additions & 0 deletions docsrc/zs/guides/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,33 @@ Release Notes
Zscaler Python SDK Changelog
----------------------------

1.9.44 (September 1 2026)
---------------------------

Notes
-------

- Python Versions: **v3.9, v3.10, v3.11, v3.12**

Bug Fixes
---------

(`#572 <https://github.com/zscaler/zscaler-sdk-python/pull/572>`_) - Fixed AI Guard policy detection requests not being dispatched through the legacy AI Guard client. `execute_policy` and `resolve_and_execute_policy` fell through to the standard OneAPI session and were sent without the AI Guard API key.

1.9.43 (August 18 2026)
---------------------------

Notes
-------

- Python Versions: **v3.9, v3.10, v3.11, v3.12**

Bug Fixes
---------

* Updated docstrings and examples in ZPA app_connector_group and service_edge_group resources.


1.9.42 (August 18 2026)
---------------------------

Expand Down
586 changes: 297 additions & 289 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "zscaler-sdk-python"
version = "1.9.43"
version = "1.9.44"
description = "Official Python SDK for the Zscaler Products"
authors = ["Zscaler, Inc. <[email protected]>"]
license = "MIT"
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ arrow==1.4.0 ; python_version >= "3.10" and python_version < "4.0"
certifi==2026.7.22 ; python_version >= "3.10" and python_version < "4.0"
cffi==2.1.1 ; python_version >= "3.10" and python_version < "4.0" and platform_python_implementation != "PyPy"
charset-normalizer==3.5.1 ; python_version >= "3.10" and python_version < "4.0"
cryptography==50.0.0 ; python_version >= "3.10" and python_version < "4.0"
cryptography==50.0.1 ; python_version >= "3.10" and python_version < "4.0"
idna==3.19 ; python_version >= "3.10" and python_version < "4.0"
jmespath==1.1.0 ; python_version >= "3.10" and python_version < "4.0"
jwcrypto==1.5.8 ; python_version >= "3.10" and python_version < "4.0"
jwcrypto==1.6.0 ; python_version >= "3.10" and python_version < "4.0"
pycparser==3.0 ; python_version >= "3.10" and python_version < "4.0" and platform_python_implementation != "PyPy" and implementation_name != "PyPy"
pydash==8.0.6 ; python_version >= "3.10" and python_version < "4.0"
pydash==8.1.0 ; python_version >= "3.10" and python_version < "4.0"
pyjwt==2.13.0 ; python_version >= "3.10" and python_version < "4.0"
python-box==7.4.1 ; python_version >= "3.10" and python_version < "4.0"
python-dateutil==2.9.0.post0 ; python_version >= "3.10" and python_version < "4.0"
Expand Down
2 changes: 1 addition & 1 deletion zscaler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
__contributors__ = [
"William Guilherme",
]
__version__ = "1.9.43"
__version__ = "1.9.44"


from zscaler.oneapi_client import Client as ZscalerClient # noqa
21 changes: 21 additions & 0 deletions zscaler/oneapi_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def __init__(
self.use_zia_legacy_client: bool = zia_legacy_client is not None
self.use_zwa_legacy_client: bool = zwa_legacy_client is not None
self.use_ztb_legacy_client: bool = ztb_legacy_client is not None
self.use_aiguard_legacy_client: bool = aiguard_legacy_client is not None

# Set timeout for all HTTP requests
request_timeout: Optional[int] = http_config.get("requestTimeout", None)
Expand Down Expand Up @@ -315,6 +316,26 @@ def send_request(self, request: Dict[str, Any]) -> Tuple[Optional[requests.Respo
}
)

elif self.use_aiguard_legacy_client:
parsed_url = urlparse(request["url"])
path = parsed_url.path
logger.debug(f"Sending request via AI Guard legacy client. Path: {path}")

# The AI Guard helper's send() applies the Bearer API key and
# response-based rate limiting, and returns only the response.
response = self.aiguard_legacy_client.send(
method=request["method"],
path=path,
params=request["params"],
json=request.get("json") or request.get("data"),
headers=request.get("headers"),
)

if response is None:
error_msg = "AI Guard legacy client returned None response"
logger.error(error_msg)
return (None, ValueError(error_msg))

else:
# Standard session
if self._session:
Expand Down
3 changes: 2 additions & 1 deletion zscaler/request_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from http import HTTPStatus
from typing import Any, Dict, Optional, Tuple

from zscaler.aiguard.legacy import LegacyZGuardClientHelper
from zscaler.constants import ONEAPI_GOV_API_BASE_URLS
from zscaler.error_messages import ERROR_MESSAGE_429_MISSING_DATE_X_RESET
from zscaler.errors.response_checker import check_response_for_error
Expand Down Expand Up @@ -43,7 +44,7 @@ def __init__(
zia_legacy_client: LegacyZIAClientHelper = None,
zwa_legacy_client: LegacyZWAClientHelper = None,
ztb_legacy_client: LegacyZTBClientHelper = None,
aiguard_legacy_client=None,
aiguard_legacy_client: LegacyZGuardClientHelper = None,
):
"""
Constructor for Request Executor object for Zscaler SDK Client.
Expand Down
Loading