(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

@@ -50,6 +50,9 @@ class StorageEventAuthentication(BaseAuthentication):
if not settings.RECORDING_ENABLE_STORAGE_EVENT_AUTH:
return MachineUser(), None
if not settings.RECORDING_ENABLE_STORAGE_EVENT_AUTH:
return MachineUser(), None
required_token = settings.RECORDING_STORAGE_EVENT_TOKEN
if not required_token:
if settings.RECORDING_ENABLE_STORAGE_EVENT_AUTH: