From 1fd97676fbeea56c7cb0de65c3f12c96029bd0cd Mon Sep 17 00:00:00 2001 From: "vladyslav.guriev" Date: Tue, 7 Nov 2023 15:35:29 +0200 Subject: [PATCH] Fix comments --- CHANGELOG.md | 6 ++++++ pyproject.toml | 2 +- sekoia_automation/connector/__init__.py | 2 +- tests/connectors/test_connector.py | 11 +++++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93543c5..f252524 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.6.3] - 2023-11-07 + +### Fixed + +- Add property to connector with `User-Agent` header to third party services + ## [1.6.2] - 2023-11-06 ### Fixed diff --git a/pyproject.toml b/pyproject.toml index a45afe2..41a62f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "sekoia-automation-sdk" -version = "1.6.2" +version = "1.6.3" description = "SDK to create Sekoia.io playbook modules" license = "MIT" readme = "README.md" diff --git a/sekoia_automation/connector/__init__.py b/sekoia_automation/connector/__init__.py index c5a0c75..eefab21 100644 --- a/sekoia_automation/connector/__init__.py +++ b/sekoia_automation/connector/__init__.py @@ -102,7 +102,7 @@ def _connector_user_agent(self) -> str: return f"sekoiaio-connector-{self.configuration.intake_key}" @cached_property - def _http_default_headers(self) -> dict[str, str]: + def http_default_headers(self) -> dict[str, str]: """ Contains dict of predefined headers. diff --git a/tests/connectors/test_connector.py b/tests/connectors/test_connector.py index 67c49bd..7e85f1a 100644 --- a/tests/connectors/test_connector.py +++ b/tests/connectors/test_connector.py @@ -36,6 +36,17 @@ def test_connector(storage, mocked_trigger_logs): test_connector.stop() +def test_check_http_default_headers(test_connector): + test_connector.module._manifest = { + "slug": "dummyslug", + "version": "dummyversion", + } + + assert test_connector.http_default_headers == { + "User-Agent": "sekoiaio-connector/dummyslug-dummyversion" + } + + def test_forward_events(test_connector): test_connector.forward_events(events=EVENTS) test_connector.send_event.assert_called_once()