From 495b3ec770e7abd95db83c3f220ea148903807e2 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Thu, 8 Feb 2024 10:09:28 +0100 Subject: [PATCH] API: Log ID of revoked device connection --- src/pretix/api/auth/device.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pretix/api/auth/device.py b/src/pretix/api/auth/device.py index de864e41e5..ac09de1598 100644 --- a/src/pretix/api/auth/device.py +++ b/src/pretix/api/auth/device.py @@ -19,6 +19,8 @@ # You should have received a copy of the GNU Affero General Public License along with this program. If not, see # . # +import logging + from django.contrib.auth.models import AnonymousUser from django_scopes import scopes_disabled from rest_framework import exceptions @@ -29,6 +31,8 @@ from pretix.api.auth.devicesecurity import ( ) from pretix.base.models import Device +logger = logging.getLogger(__name__) + class DeviceTokenAuthentication(TokenAuthentication): model = Device @@ -46,6 +50,7 @@ class DeviceTokenAuthentication(TokenAuthentication): raise exceptions.AuthenticationFailed('Device has not been initialized.') if device.revoked: + logging.warning(f'Connection attempt of revoked device {device.pk}.') raise exceptions.AuthenticationFailed('Device access has been revoked.') return AnonymousUser(), device