]> git.ipfire.org Git - ipfire.org.git/commitdiff
dbl: Use a HTTP header to impersonate users
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 2 Mar 2026 17:44:52 +0000 (17:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 2 Mar 2026 17:44:52 +0000 (17:44 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/dbl.py

index 63e1e06ccce686742f45c1c232dff92e69f5ca44..a196bea4aef14a8da196ef8fbdb5f6fd0757b47d 100644 (file)
@@ -238,10 +238,14 @@ class List(Model):
                if isinstance(reported_by, accounts.Account):
                        reported_by = reported_by.uid
 
+               # Compose the headers
+               headers = {
+                       "X-Impersonated-Uid" : reported_by,
+               }
+
                # Compose the request body
                body = {
                        "name"        : name,
-                       "reported_by" : reported_by,
                        "comment"     : comment,
                        "block"       : block
                }