Skip to content

Commit 0e5e51a

Browse files
authored
Merge pull request #14 from SamhammerAG/KIT-4148
KIT-4148 unify logging field "request_brand" to "brand"
2 parents 163bbea + f4ccfb5 commit 0e5e51a

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "sag-py-auth-brand"
3-
version = "1.2.1"
3+
version = "1.2.2"
44
description = "Keycloak brand/instance authentication for python projects"
55
authors = ["Samhammer AG"]
66
license = "MIT"

sag_py_auth_brand/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ def __init__(self, issuer: str, audience: str, instance: str, stage: str) -> Non
1212

1313
class BrandLogRecord(LogRecord):
1414
# The original brand of the request
15-
request_brand: str
15+
brand: str

sag_py_auth_brand/request_brand_logging_filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ def __init__(self, name: str = "") -> None:
1111

1212
def filter(self, record: LogRecord) -> bool:
1313
if request_brand := get_request_brand():
14-
record.request_brand = request_brand
14+
record.brand = request_brand
1515

1616
return True

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
setuptools.setup(
1313
name="sag-py-auth-brand",
14-
version="1.2.1",
14+
version="1.2.2",
1515
description="Keycloak brand/instance authentication for python projects",
1616
long_description=LONG_DESCRIPTION,
1717
long_description_content_type="text/markdown",

tests/test_request_brand_logging_filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test__get_field_value__with_brand() -> None:
1818

1919
# Assert
2020
assert log_entry.msg == "A test message"
21-
assert cast(BrandLogRecord, log_entry).request_brand == "myBrand"
21+
assert cast(BrandLogRecord, log_entry).brand == "myBrand"
2222

2323

2424
def test__get_field_value__without_data() -> None:

0 commit comments

Comments
 (0)