From 8788febaf0696fcee0118a02631428edcc3a78ce Mon Sep 17 00:00:00 2001 From: ekneg54 Date: Fri, 8 Nov 2024 10:23:42 +0100 Subject: [PATCH 1/2] fix example and check it in a test --- logprep/processor/requester/rule.py | 3 +-- .../processor/requester/test_requester_rule.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/logprep/processor/requester/rule.py b/logprep/processor/requester/rule.py index c5b86fa3b..0ba2fb0ac 100644 --- a/logprep/processor/requester/rule.py +++ b/logprep/processor/requester/rule.py @@ -16,9 +16,8 @@ requester: url: https://internal.cmdb.local/api/v1/locations method: POST - content_type: application/json target_field: cmdb.location - header: + headers: Authorization: Bearer askdfjpiowejf283u9r json: hostname: ${message.hostname} diff --git a/tests/unit/processor/requester/test_requester_rule.py b/tests/unit/processor/requester/test_requester_rule.py index 1c7ebdbf3..e8973b126 100644 --- a/tests/unit/processor/requester/test_requester_rule.py +++ b/tests/unit/processor/requester/test_requester_rule.py @@ -1,6 +1,7 @@ # pylint: disable=protected-access # pylint: disable=missing-docstring import pytest + from logprep.processor.requester.rule import RequesterRule @@ -16,6 +17,21 @@ def test_create_from_dict_returns_requester_rule(self): @pytest.mark.parametrize( ["rule", "error", "message"], [ + ( + { + "filter": "domain", + "requester": { + "url": "https://internal.cmdb.local/api/v1/locations", + "method": "POST", + "target_field": "cmdb.location", + "headers": {"Authorization": "Bearer askdfjpiowejf283u9r"}, + "json": {"hostname": "${message.hostname}"}, + }, + "description": "...", + }, + None, + None, + ), ( { "filter": "message", From 20c6edb8f91a2b9db8a2775ac2855e2cbc129f98 Mon Sep 17 00:00:00 2001 From: dtrai2 Date: Thu, 14 Nov 2024 11:37:18 +0100 Subject: [PATCH 2/2] add entry to CHANGELOG.md --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c6620e4e..ec1771dc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,12 @@ ### Breaking ### Features ### Improvements + +* fix `requester` documentation + ### Bugfix -- fix `confluent_kafka.store_offsets` if `last_valid_record` is `None`, can happen if a rebalancing happens +* fix `confluent_kafka.store_offsets` if `last_valid_record` is `None`, can happen if a rebalancing happens before the first message was pulled. ## 14.0.0