mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-08 01:43:17 +00:00
🩹(backend) ignore non-recording uploads in storage webhook handler
With the introduction of background file uploads, a misconfigured MinIO webhook could trigger the storage hook endpoint for unrelated files. While the dev setup now filters events via the MinIO lifecycle configuration, add a safeguard at the application level. Enforce a stricter filepath regex when parsing storage hook events and ignore files outside the recording output directory. Return a clean 200 response to acknowledge the webhook while avoiding unnecessary processing.
This commit is contained in:
@@ -38,6 +38,7 @@ from core.recording.enums import FileExtension
|
||||
from core.recording.event.authentication import StorageEventAuthentication
|
||||
from core.recording.event.exceptions import (
|
||||
InvalidBucketError,
|
||||
InvalidFilepathError,
|
||||
InvalidFileTypeError,
|
||||
ParsingEventDataError,
|
||||
)
|
||||
@@ -761,6 +762,11 @@ class RecordingViewSet(
|
||||
except InvalidBucketError as e:
|
||||
raise drf_exceptions.PermissionDenied("Invalid bucket specified") from e
|
||||
|
||||
except InvalidFilepathError as e:
|
||||
return drf_response.Response(
|
||||
{"message": f"Ignore this filepath, {e}"},
|
||||
)
|
||||
|
||||
except InvalidFileTypeError as e:
|
||||
return drf_response.Response(
|
||||
{"message": f"Ignore this file type, {e}"},
|
||||
|
||||
Reference in New Issue
Block a user