Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix requester documentation #702

Merged
merged 3 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions logprep/processor/requester/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
16 changes: 16 additions & 0 deletions tests/unit/processor/requester/test_requester_rule.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pylint: disable=protected-access
# pylint: disable=missing-docstring
import pytest

from logprep.processor.requester.rule import RequesterRule


Expand All @@ -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",
Expand Down
Loading