(backend) offer an endpoint to save recording

I've protected this endpoint with a feature flag, and an authentication
class, as it will be exposed on the public internet.

I've tried to keep the viewset logic as minimal as possible, I've
to ship smth and will continue iterating on this piece of code.

At some point, abstracting webhook endpoint and authentication class
might be beneficial for the project. YAGNI as of today.
This commit is contained in:
lebaudantoine
2024-11-08 17:01:25 +01:00
committed by aleb_the_flash
parent e11bdc6d28
commit 7afa165013
5 changed files with 273 additions and 0 deletions

View File

@@ -109,3 +109,13 @@ class IsRecordingEnabled(permissions.BasePermission):
def has_permission(self, request, view):
"""Determine if access is allowed based on settings."""
return settings.RECORDING_ENABLE
class IsStorageEventEnabled(permissions.BasePermission):
"""Check if the storage event feature is enabled."""
message = "Access denied, storage event is disabled."
def has_permission(self, request, view):
"""Determine if access is allowed based on settings."""
return settings.RECORDING_STORAGE_EVENT_ENABLE