Skip to content

Commit 94df69d

Browse files
committed
Request the events path in settings.integration_events()
The method requested orgs/{org}/settings/integrations/{id}, which has no GET route, so it always failed. The events listing lives under /events and checks integration:list.
1 parent 809722c commit 94df69d

4 files changed

Lines changed: 25 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 3.6.3
4+
5+
### Fixed: `settings.integration_events()` requested the wrong path
6+
7+
- `settings.integration_events()` now calls
8+
`GET orgs/{org_slug}/settings/integrations/{integration_id}/events`. It
9+
previously requested the integration's own path, which has no `GET` route,
10+
so the method always failed. It needs the `integration:list` scope.
11+
312
## 3.6.2
413

514
### Fixed: reject retired API credentials before use

‎socketdev/settings/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def integration_events(self, org_slug: str, integration_id: str) -> dict:
115115
org_slug: Organization slug
116116
integration_id: Integration ID
117117
"""
118-
path = f"orgs/{org_slug}/settings/integrations/{integration_id}"
118+
path = f"orgs/{org_slug}/settings/integrations/{integration_id}/events"
119119
response = self.api.do_request(path=path)
120120

121121
if response.status_code == 200:

‎socketdev/version.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.6.2"
1+
__version__ = "3.6.3"

‎tests/unit/test_all_endpoints_unit.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,20 @@ def test_settings_get_unit(self):
736736
self.assertEqual(call_args[0][0], "GET")
737737
self.assertIn("/orgs/test-org/settings", call_args[0][1])
738738

739+
def test_settings_integration_events_unit(self):
740+
"""Test integration events retrieval."""
741+
expected_data = {"results": [{"id": "event-1"}]}
742+
self._mock_response(expected_data)
743+
744+
result = self.sdk.settings.integration_events("test-org", "integration-1")
745+
746+
self.assertEqual(result, expected_data)
747+
call_args = self.mock_requests.request.call_args
748+
self.assertEqual(call_args[0][0], "GET")
749+
self.assertTrue(
750+
call_args[0][1].endswith("/orgs/test-org/settings/integrations/integration-1/events")
751+
)
752+
739753
# Triage endpoints
740754
def test_triage_list_alert_triage_unit(self):
741755
"""Test alert triage listing."""

0 commit comments

Comments
 (0)