Skip to content
Merged
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ def redact_extra(cls, v: str | None) -> str | None:
redacted_dict = redact(extra_dict)
return json.dumps(redacted_dict)
except json.JSONDecodeError:
# we can't redact fields in an unstructured `extra`
return v
# Do not return un-redacted extra because this could cause sensitive information to be exposed.
# This code path should never been hit as ``Connection._validate_extra`` sure that ``extra`` is
# always a valid JSON string. We add this safeguard just in case and to make the coupling
# explicit.
raise ValueError(
"This code path should never happen as persisted Connections (DB layer) should always enforce `extra` as a JSON string."
)


class ConnectionCollectionResponse(BaseModel):
Expand Down
Loading