From 611c738278cece69ab6d3be09216cb7d48a5f247 Mon Sep 17 00:00:00 2001 From: CodeMash Date: Sun, 27 Sep 2026 09:57:25 +0300 Subject: [PATCH] fix(push)!: remove the managed-app push methods the gateway never served The gateway removed POST /notifications/push/integrations/app/request (a stub that always answered "temporarily unavailable") and the two managed-app routes that were commented out (norbix gateway audit/push 8872b92eb). - hub.notifications: register_code_mash_app_push_integration, check_integration_availability and test_code_mash_ios_app_integration removed (sync and async) - tests: the push route table loses the row (39 -> 38); the two shape tests for the removed methods go with them - docs: the notifications table row and the push "Known gaps" section removed references/hub_dtos.py is left as it is: a raw 2026-09-04 export that no code imports; refreshing it is a separate chore. BREAKING CHANGE: the three managed-app push methods are gone. Co-Authored-By: Claude Opus 5.5 --- docs/hub/notifications.md | 1 - docs/hub/push.md | 7 --- src/norbix_python/hub/notifications.py | 78 -------------------------- tests/hub/test_notifications.py | 35 ------------ tests/hub/test_push.py | 15 ++--- 5 files changed, 4 insertions(+), 132 deletions(-) diff --git a/docs/hub/notifications.md b/docs/hub/notifications.md index 54a87b1..f345166 100644 --- a/docs/hub/notifications.md +++ b/docs/hub/notifications.md @@ -70,7 +70,6 @@ Access with `norbix.hub.notifications`. | `save_push_integration` | `POST` | `/{version}/notifications/push/integrations` | `project` | | `set_push_integration_as_default` | `PUT` | `/{version}/notifications/push/integrations/{Id}/default` | `project` | | `test_push_integration` | `POST` | `/{version}/notifications/push/integrations/test` | `project` | -| `register_code_mash_app_push_integration` | `POST` | `/{version}/notifications/push/integrations/app/request` | `account` | | `register_device` | `POST` | `/{version}/notifications/push/devices` | `project` | | `get_push_disable_dependencies` | `GET` | `/{version}/notifications/push/disable-dependencies` | `project` | | `get_push_settings` | `GET` | `/{version}/notifications/push/settings` | `project` | diff --git a/docs/hub/push.md b/docs/hub/push.md index ebdf6af..b8d3c80 100644 --- a/docs/hub/push.md +++ b/docs/hub/push.md @@ -101,10 +101,3 @@ owner: ```python device = client.hub.notifications.get_push_device("pnd_123") ``` - -## Known gaps - -| what | why | -|---|---| -| `check_integration_availability` and the CodeMash-app test call | they point at gateway routes that are commented out, so they are not callable. | -| `get_push_campaign_message` | the gateway route declares an `{id}` token that no request field matches, so the endpoint is unreliable until that is fixed. | diff --git a/src/norbix_python/hub/notifications.py b/src/norbix_python/hub/notifications.py index 2b62774..7b448a1 100644 --- a/src/norbix_python/hub/notifications.py +++ b/src/norbix_python/hub/notifications.py @@ -893,19 +893,6 @@ def test_push_integration(self, *, timeout: float | None = None, bearer_token: s bearer_token=bearer_token, ) - def register_code_mash_app_push_integration(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: - """POST /{version}/notifications/push/integrations/app/request""" - return self._transport.send( - target="hub", - path="/{version}/notifications/push/integrations/app/request", - method="POST", - path_params={}, - request=request, - scope="account", - timeout=timeout, - bearer_token=bearer_token, - ) - def register_device(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: """POST /{version}/notifications/push/devices""" return self._transport.send( @@ -1274,32 +1261,6 @@ def preview_push_notification(self, *, timeout: float | None = None, bearer_toke bearer_token=bearer_token, ) - def check_integration_availability(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: - """POST /{version}/notifications/push/integrations/app/check""" - return self._transport.send( - target="hub", - path="/{version}/notifications/push/integrations/app/check", - method="POST", - path_params={}, - request=request, - scope="project", - timeout=timeout, - bearer_token=bearer_token, - ) - - def test_code_mash_ios_app_integration(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: - """POST /{version}/notifications/push/integrations/test/codemash-app""" - return self._transport.send( - target="hub", - path="/{version}/notifications/push/integrations/test/codemash-app", - method="POST", - path_params={}, - request=request, - scope="project", - timeout=timeout, - bearer_token=bearer_token, - ) - def get_push_settings(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: """GET /{version}/notifications/push/settings""" return self._transport.send( @@ -2631,19 +2592,6 @@ async def test_push_integration(self, *, timeout: float | None = None, bearer_to bearer_token=bearer_token, ) - async def register_code_mash_app_push_integration(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: - """POST /{version}/notifications/push/integrations/app/request""" - return await self._transport.send( - target="hub", - path="/{version}/notifications/push/integrations/app/request", - method="POST", - path_params={}, - request=request, - scope="account", - timeout=timeout, - bearer_token=bearer_token, - ) - async def register_device(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: """POST /{version}/notifications/push/devices""" return await self._transport.send( @@ -3012,32 +2960,6 @@ async def preview_push_notification(self, *, timeout: float | None = None, beare bearer_token=bearer_token, ) - async def check_integration_availability(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: - """POST /{version}/notifications/push/integrations/app/check""" - return await self._transport.send( - target="hub", - path="/{version}/notifications/push/integrations/app/check", - method="POST", - path_params={}, - request=request, - scope="project", - timeout=timeout, - bearer_token=bearer_token, - ) - - async def test_code_mash_ios_app_integration(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: - """POST /{version}/notifications/push/integrations/test/codemash-app""" - return await self._transport.send( - target="hub", - path="/{version}/notifications/push/integrations/test/codemash-app", - method="POST", - path_params={}, - request=request, - scope="project", - timeout=timeout, - bearer_token=bearer_token, - ) - async def get_push_settings(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any: """GET /{version}/notifications/push/settings""" return await self._transport.send( diff --git a/tests/hub/test_notifications.py b/tests/hub/test_notifications.py index b9cc9d7..6b2e253 100644 --- a/tests/hub/test_notifications.py +++ b/tests/hub/test_notifications.py @@ -73,7 +73,6 @@ def test_hub_notifications_module_surface() -> None: assert callable(module.save_push_integration) assert callable(module.set_push_integration_as_default) assert callable(module.test_push_integration) - assert callable(module.register_code_mash_app_push_integration) assert callable(module.register_device) @@ -539,22 +538,6 @@ def test_hub_notifications_test_push_integration_request_shape() -> None: assert transport.last_request is not None assert transport.last_request['url'].startswith('https://') -def test_hub_notifications_register_code_mash_app_push_integration_request_shape() -> None: - client, transport = make_client(account_id='acc-1') - client.hub.notifications.register_code_mash_app_push_integration() - assert transport.last_request['method'] == 'POST' - assert transport.last_request is not None - assert transport.last_request['url'].startswith('https://') - -def test_hub_notifications_register_code_mash_app_push_integration_requires_account_scope() -> None: - client = Norbix(project_id='p1', bearer_token='token') - try: - client.hub.notifications.register_code_mash_app_push_integration() - except NorbixError as exc: - assert exc.code == 'NORBIX_ACCOUNT_SCOPE_REQUIRED' - else: - raise AssertionError('Expected account scope error') - def test_hub_notifications_register_device_request_shape() -> None: client, transport = make_client(account_id=None) client.hub.notifications.register_device() @@ -589,8 +572,6 @@ def test_hub_notifications_new_endpoints_surface() -> None: assert callable(module.get_push_campaign_batch_notifications) assert callable(module.get_push_campaign_batch_notification) assert callable(module.get_push_campaign_statistics) - assert callable(module.check_integration_availability) - assert callable(module.test_code_mash_ios_app_integration) assert callable(module.get_push_settings) assert callable(module.get_sms_campaigns) assert callable(module.create_sms_campaign) @@ -811,22 +792,6 @@ def test_hub_notifications_get_push_campaign_statistics_request_shape() -> None: assert transport.last_request['url'].startswith('https://') -def test_hub_notifications_check_integration_availability_request_shape() -> None: - client, transport = make_client(account_id=None) - client.hub.notifications.check_integration_availability() - assert transport.last_request['method'] == 'POST' - assert transport.last_request is not None - assert transport.last_request['url'].startswith('https://') - - -def test_hub_notifications_test_code_mash_ios_app_integration_request_shape() -> None: - client, transport = make_client(account_id=None) - client.hub.notifications.test_code_mash_ios_app_integration() - assert transport.last_request['method'] == 'POST' - assert transport.last_request is not None - assert transport.last_request['url'].startswith('https://') - - def test_hub_notifications_get_push_settings_request_shape() -> None: client, transport = make_client(account_id=None) client.hub.notifications.get_push_settings() diff --git a/tests/hub/test_push.py b/tests/hub/test_push.py index 0a9711f..f84ba1b 100644 --- a/tests/hub/test_push.py +++ b/tests/hub/test_push.py @@ -13,7 +13,7 @@ The generated test file asserts each push method's verb and that the URL is https. This file adds the two things it cannot see: the fully-resolved path of -every one of the 39 push routes, and the polymorphic bodies that the server +every one of the 38 push routes, and the polymorphic bodies that the server routes on. Only the Fake provider is used for a send path — it is the sandbox that accepts @@ -89,12 +89,6 @@ f"{BASE}/integrations/confirm-human-delivery", lambda m: m.confirm_push_integration_human_delivery(), ), - ( - "register_code_mash_app_push_integration", - "POST", - f"{BASE}/integrations/app/request", - lambda m: m.register_code_mash_app_push_integration(), - ), # templates ("get_push_templates", "GET", f"{BASE}/templates", lambda m: m.get_push_templates()), ("create_push_template", "POST", f"{BASE}/templates", lambda m: m.create_push_template()), @@ -221,8 +215,7 @@ def test_push_endpoint_hits_the_expected_route( name: str, verb: str, path: str, call: Callable[[Any], Any] ) -> None: - # register_code_mash_app_push_integration is account-scoped, so the client - # needs an account id; the rest ignore it. + # The client carries an account id; project-scoped routes ignore it. client, transport = make_client(account_id="acct_1") call(client.hub.notifications) @@ -234,8 +227,8 @@ def test_push_endpoint_hits_the_expected_route( def test_push_surface_size() -> None: - """39 live push routes. A new one changes this count, so it cannot arrive untested.""" - assert len(PUSH_CASES) == 39 + """38 live push routes. A new one changes this count, so it cannot arrive untested.""" + assert len(PUSH_CASES) == 38 def test_push_call_sends_auth_and_project_headers() -> None: