mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-08 09:46:29 +00:00
Bump sentry-sdk from 2.26.1 to 2.27.0 (#5842)
* Bump sentry-sdk from 2.26.1 to 2.27.0 Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 2.26.1 to 2.27.0. - [Release notes](https://github.com/getsentry/sentry-python/releases) - [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-python/compare/2.26.1...2.27.0) --- updated-dependencies: - dependency-name: sentry-sdk dependency-version: 2.27.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Make use of new typing hints in filter.py * Avoid creating unnecessary empty dict --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Stefan Agner <stefan@agner.ch>
This commit is contained in:
parent
6116425265
commit
0e55e6e67b
@ -23,7 +23,7 @@ pyudev==0.24.3
|
||||
PyYAML==6.0.2
|
||||
requests==2.32.3
|
||||
securetar==2025.2.1
|
||||
sentry-sdk==2.26.1
|
||||
sentry-sdk==2.27.0
|
||||
setuptools==79.0.1
|
||||
voluptuous==0.15.2
|
||||
dbus-fast==2.44.1
|
||||
|
@ -3,9 +3,11 @@
|
||||
import ipaddress
|
||||
import os
|
||||
import re
|
||||
from typing import cast
|
||||
|
||||
from aiohttp import hdrs
|
||||
import attr
|
||||
from sentry_sdk.types import Event, Hint
|
||||
|
||||
from ..const import DOCKER_NETWORK_MASK, HEADER_TOKEN, HEADER_TOKEN_OLD, CoreState
|
||||
from ..coresys import CoreSys
|
||||
@ -39,7 +41,7 @@ def sanitize_url(url: str) -> str:
|
||||
return f"{match.group(1)}{host}{match.group(3)}"
|
||||
|
||||
|
||||
def filter_data(coresys: CoreSys, event: dict, hint: dict) -> dict:
|
||||
def filter_data(coresys: CoreSys, event: Event, hint: Hint) -> Event | None:
|
||||
"""Filter event data before sending to sentry."""
|
||||
# Ignore some exceptions
|
||||
if "exc_info" in hint:
|
||||
@ -53,6 +55,7 @@ def filter_data(coresys: CoreSys, event: dict, hint: dict) -> dict:
|
||||
|
||||
event.setdefault("extra", {}).update({"os.environ": dict(os.environ)})
|
||||
event.setdefault("user", {}).update({"id": coresys.machine_id})
|
||||
if coresys.machine:
|
||||
event.setdefault("tags", {}).update(
|
||||
{
|
||||
"machine": coresys.machine,
|
||||
@ -122,11 +125,11 @@ def filter_data(coresys: CoreSys, event: dict, hint: dict) -> dict:
|
||||
}
|
||||
)
|
||||
|
||||
if event.get("request"):
|
||||
if event["request"].get("url"):
|
||||
event["request"]["url"] = sanitize_url(event["request"]["url"])
|
||||
if request := event.get("request"):
|
||||
if request.get("url"):
|
||||
request["url"] = sanitize_url(cast(str, request["url"]))
|
||||
|
||||
headers = event["request"].get("headers", {})
|
||||
if headers := cast(dict, request.get("headers")):
|
||||
if hdrs.REFERER in headers:
|
||||
headers[hdrs.REFERER] = sanitize_url(headers[hdrs.REFERER])
|
||||
if HEADER_TOKEN in headers:
|
||||
|
Loading…
x
Reference in New Issue
Block a user