From b005acda1fea2d59651d3534d59127230c34a9f2 Mon Sep 17 00:00:00 2001 From: Mandar Patil Date: Fri, 6 Dec 2024 17:10:37 -0800 Subject: [PATCH] icloudpy version bump to 0.7.0 (#277) * icloudpy version bump to 0.7.0 * Fixes for failing tests * Update requirements.txt --- requirements.txt | 4 ++-- tests/data/__init__.py | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 6aef354d..0642029f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -icloudpy==0.6.0 +icloudpy==0.7.0 ruamel.yaml==0.18.6 python-magic==0.4.27 -requests~=2.28.1 +requests~=2.32.3 diff --git a/tests/data/__init__.py b/tests/data/__init__.py index 6a446aad..33dc386b 100644 --- a/tests/data/__init__.py +++ b/tests/data/__init__.py @@ -55,6 +55,16 @@ # Data AUTH_OK = {"authType": "hsa2"} +SRP_INIT_OK = { + "iteration": 20433, + "salt": "0samK84bcBmkVsswOpZbZg==", + "protocol": "s2k", + "b": "STVHcWTN9YOYn4IgtIJ6UPdPbvzvL+zza/l+6yUHUtdEyxwzpB78y8wqZ8QWSbVqjBcpl32iEA4T3nYp0LWZ5hD3r3yIJFloXvX0kpBJkr\ + +Nh8EfHuW1V50A8riH6VWyuJ8m3JmOO7/xkNgP7je8GMpt/5f/7qE3AOj73e3JR0fzQ7IopdU0tlyVX0tD7T6wCyHS52GJWDdq1I2bgzurIK2\ + /ZjR/Hwzd/67oFQPtKQgjrSRaKo5MJEfDP7C9wOlXsZqbb7igX6PeZRWrfl+iQFaA/FVeWSngB07ja3wOryY9GsYO06ELGOaQ+MpsT7mouqrGT\ + fOJ0OMh9EgrkJEM6w==", + "c": "e-1be-8746c235-b41c-11ef-bd17-c780acb4fe15:PRN", +} ZONES_LIST_WORKING = { "zones": [ { @@ -3744,8 +3754,10 @@ def request(self, method, url, **kwargs): if self.service.auth_endpoint in url: if "signin" in url and method == "POST": - if data.get("accountName") not in VALID_USERS or data.get("password") != VALID_PASSWORD: + if data.get("accountName") not in VALID_USERS: self._raise_error(None, "Unknown reason") + if url.endswith("/init"): + return ResponseMock(SRP_INIT_OK) if data.get("accountName") == REQUIRES_2FA_USER: self.service.session_data["session_token"] = REQUIRES_2FA_TOKEN return ResponseMock(AUTH_OK)