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
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# CHANGELOG
## Version 0.61.5 (April 2026)

**Released**: April 22, 2026

This release fixes a bug in the `Privileges` class initialization.

---

### BUG FIXES

#### **Privileges Initialization**
Fixed `Privileges.__init__()` to correctly handle lists containing `_Privilege` instances in addition to dicts. Previously, passing already-instantiated `_Privilege` objects would cause initialization errors.

---

## Version 0.61.4 (April 2026)

**Released**: April 1, 2026
Expand Down
2 changes: 1 addition & 1 deletion mist_openapi
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "mistapi"
version = "0.61.4"
version = "0.61.5"
authors = [{ name = "Thomas Munzer", email = "tmunzer@juniper.net" }]
description = "Python package to simplify the Mist System APIs usage"
keywords = ["Mist", "Juniper", "API"]
Expand Down
7 changes: 5 additions & 2 deletions src/mistapi/__models/privilege.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ def get(self, key: str, default: Any | None = None) -> Any:


class Privileges:
def __init__(self, privileges: list[dict]) -> None:
def __init__(self, privileges: list[dict | _Privilege]) -> None:
self.privileges: list[_Privilege] = []
for privilege in privileges:
self.privileges.append(_Privilege(privilege))
if isinstance(privilege, _Privilege):
self.privileges.append(privilege)
else:
self.privileges.append(_Privilege(privilege))

def __iter__(self) -> Iterator[_Privilege]:
"""Return an iterator over the privileges."""
Expand Down
2 changes: 1 addition & 1 deletion src/mistapi/__version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.61.4"
__version__ = "0.61.5"
__author__ = "Thomas Munzer <tmunzer@juniper.net>"
16 changes: 15 additions & 1 deletion src/mistapi/api/v1/orgs/secintelprofiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
from mistapi.__api_response import APIResponse as _APIResponse


def listOrgSecIntelProfiles(mist_session: _APISession, org_id: str) -> _APIResponse:
def listOrgSecIntelProfiles(
mist_session: _APISession,
org_id: str,
limit: int | None = None,
page: int | None = None,
) -> _APIResponse:
"""
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/orgs/secintel-profiles/list-org-sec-intel-profiles

Expand All @@ -27,6 +32,11 @@ def listOrgSecIntelProfiles(mist_session: _APISession, org_id: str) -> _APIRespo
-----------
org_id : str

QUERY PARAMS
------------
limit : int, default: 100
page : int, default: 1

RETURN
-----------
mistapi.APIResponse
Expand All @@ -35,6 +45,10 @@ def listOrgSecIntelProfiles(mist_session: _APISession, org_id: str) -> _APIRespo

uri = f"/api/v1/orgs/{org_id}/secintelprofiles"
query_params: dict[str, str] = {}
if limit:
query_params["limit"] = str(limit)
if page:
query_params["page"] = str(page)
resp = mist_session.mist_get(uri=uri, query=query_params)
return resp

Expand Down
4 changes: 2 additions & 2 deletions src/mistapi/api/v1/sites/sle.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@deprecation.deprecated(
deprecated_in="0.59.2",
removed_in="0.65.0",
current_version="0.61.4",
current_version="0.61.5",
details="function replaced with getSiteSleClassifierSummaryTrend",
)
def getSiteSleClassifierDetails(
Expand Down Expand Up @@ -690,7 +690,7 @@ def listSiteSleImpactedWirelessClients(
@deprecation.deprecated(
deprecated_in="0.59.2",
removed_in="0.65.0",
current_version="0.61.4",
current_version="0.61.5",
details="function replaced with getSiteSleSummaryTrend",
)
def getSiteSleSummary(
Expand Down
10 changes: 7 additions & 3 deletions tests/unit/test_websocket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,9 @@ def test_zero_max_reconnect_backoff_raises(self, mock_session) -> None:
_MistWebsocket(mock_session, channels=["/ch"], max_reconnect_backoff=0)

def test_max_reconnect_backoff_none_allowed(self, mock_session) -> None:
client = _MistWebsocket(mock_session, channels=["/ch"], max_reconnect_backoff=None)
client = _MistWebsocket(
mock_session, channels=["/ch"], max_reconnect_backoff=None
)
assert client._max_reconnect_backoff is None


Expand Down Expand Up @@ -1058,10 +1060,12 @@ def fake_run_forever(**kwargs):
# Without the cap, later delays would grow via exponential backoff
# (e.g., 0.01, 0.02, 0.04, 0.08, 0.16). Verify the cap was actually
# needed by checking that at least one uncapped delay would exceed it.
uncapped = [0.01 * (2 ** i) for i in range(len(observed_delays))]
uncapped = [0.01 * (2**i) for i in range(len(observed_delays))]
assert any(d > cap for d in uncapped), "cap was never exercised"

def test_delay_uncapped_when_max_reconnect_backoff_is_none(self, mock_session) -> None:
def test_delay_uncapped_when_max_reconnect_backoff_is_none(
self, mock_session
) -> None:
"""Without max_reconnect_backoff, delays grow without bound."""
client = self._make_client(
mock_session,
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading