diff --git a/CHANGELOG.md b/CHANGELOG.md index 11bc25b..cfe4b08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 3.6.3 + +### Fixed: `settings.integration_events()` requested the wrong path + +- `settings.integration_events()` now calls + `GET orgs/{org_slug}/settings/integrations/{integration_id}/events`. It + previously requested the integration's own path, which has no `GET` route, + so the method always failed. It needs the `integration:list` scope. + ## 3.6.2 ### Fixed: reject retired API credentials before use diff --git a/socketdev/settings/__init__.py b/socketdev/settings/__init__.py index 1ba8724..cfc4514 100644 --- a/socketdev/settings/__init__.py +++ b/socketdev/settings/__init__.py @@ -115,7 +115,7 @@ def integration_events(self, org_slug: str, integration_id: str) -> dict: org_slug: Organization slug integration_id: Integration ID """ - path = f"orgs/{org_slug}/settings/integrations/{integration_id}" + path = f"orgs/{org_slug}/settings/integrations/{integration_id}/events" response = self.api.do_request(path=path) if response.status_code == 200: diff --git a/socketdev/version.py b/socketdev/version.py index 4f82193..6a45bf5 100644 --- a/socketdev/version.py +++ b/socketdev/version.py @@ -1 +1 @@ -__version__ = "3.6.2" +__version__ = "3.6.3" diff --git a/tests/unit/test_all_endpoints_unit.py b/tests/unit/test_all_endpoints_unit.py index 7e0d36b..fc79a25 100644 --- a/tests/unit/test_all_endpoints_unit.py +++ b/tests/unit/test_all_endpoints_unit.py @@ -736,6 +736,20 @@ def test_settings_get_unit(self): self.assertEqual(call_args[0][0], "GET") self.assertIn("/orgs/test-org/settings", call_args[0][1]) + def test_settings_integration_events_unit(self): + """Test integration events retrieval.""" + expected_data = {"results": [{"id": "event-1"}]} + self._mock_response(expected_data) + + result = self.sdk.settings.integration_events("test-org", "integration-1") + + self.assertEqual(result, expected_data) + call_args = self.mock_requests.request.call_args + self.assertEqual(call_args[0][0], "GET") + self.assertTrue( + call_args[0][1].endswith("/orgs/test-org/settings/integrations/integration-1/events") + ) + # Triage endpoints def test_triage_list_alert_triage_unit(self): """Test alert triage listing."""