From ca31f38193fe4aaf09d0475c1ae5bdef33fbb9f2 Mon Sep 17 00:00:00 2001 From: ppigazzini Date: Sat, 4 May 2024 13:05:16 +0200 Subject: [PATCH] Skip vtjson validation for withelisted users --- server/fishtest/api.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/server/fishtest/api.py b/server/fishtest/api.py index f82748da51..dc72b180e0 100644 --- a/server/fishtest/api.py +++ b/server/fishtest/api.py @@ -127,10 +127,16 @@ def validate_request(self, api): self.validate_username_password(api) # Is the request syntactically correct? - try: - validate_request(self.request_body) - except ValidationError as e: - self.handle_error(str(e)) + whitelisted_users = ( + "user00", + "vdv", + ) + username = self.request_body["worker_info"]["username"] + if username not in whitelisted_users: + try: + validate_request(self.request_body) + except ValidationError as e: + self.handle_error(str(e)) # is a supplied run_id correct? if "run_id" in self.request_body: