fix: stop sending accountId implicitly from the page client

The page client no longer resolves accountId from /v1/users/me. accountId is only sent when passed with --account-id, and a 403 for it now raises a clear error telling the user to omit it because the server scopes the listing to the caller's own account.
This commit is contained in:
2026-10-23 19:31:48 +03:00
parent 25569efc80
commit aaa0c99eb2
5 changed files with 27 additions and 21 deletions
+4 -3
View File
@@ -97,11 +97,12 @@ class PointAlarmTest(unittest.TestCase):
self.assertEqual(summary.received, 2)
self.assertEqual(len(service.calls), 1)
def test_forbidden_account_retries_without_it(self) -> None:
def test_forbidden_account_gives_clear_error(self) -> None:
service = FakeService([registration(1)], forbid_account=True)
summary = fetch_pages(service, self.store, account_id="acc")
with self.assertRaisesRegex(ConfigurationError, "--account-id vermeyin"):
fetch_pages(service, self.store, account_id="acc")
summary = fetch_pages(service, self.store, account_id=None)
self.assertEqual(summary.distinct, 1)
self.assertIsNone(service.calls[-1]["account"])
def test_csv_and_txt_output(self) -> None:
fetch_pages(FakeService([registration(1)]), self.store, account_id="acc")