Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion sag_py_auth_brand/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def __init__(self, issuer: str, audience: str, instance: str, stage: str) -> Non

class BrandLogRecord(LogRecord):
# The original brand of the request
request_brand: str
brand: str
2 changes: 1 addition & 1 deletion sag_py_auth_brand/request_brand_logging_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ def __init__(self, name: str = "") -> None:

def filter(self, record: LogRecord) -> bool:
if request_brand := get_request_brand():
record.request_brand = request_brand
record.brand = request_brand

return True
2 changes: 1 addition & 1 deletion tests/test_request_brand_logging_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test__get_field_value__with_brand() -> None:

# Assert
assert log_entry.msg == "A test message"
assert cast(BrandLogRecord, log_entry).request_brand == "myBrand"
assert cast(BrandLogRecord, log_entry).brand == "myBrand"


def test__get_field_value__without_data() -> None:
Expand Down