From 0bf03afb4f82167502b2da5949c652e05d18899f Mon Sep 17 00:00:00 2001 From: Innovation Date: Fri, 29 Mar 2024 10:14:17 -0500 Subject: [PATCH] Enforce authentication by UUID. Untested as I ran out of time. --- src/nightserver.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/nightserver.py b/src/nightserver.py index 342a0ce..498c4cf 100644 --- a/src/nightserver.py +++ b/src/nightserver.py @@ -218,7 +218,16 @@ def resetCyberwareMalfunction(): return 'Not Implemented', 501 def authenticate(uuid, endpoint): - return true + for c in cyberware: # UUID Match + if c['uuid'] == uuid: + requestedHardware = c + break + + for e in requestedHardware['canSet']: # Endpoint match + if e == endpoint: + return True + return False + @app.route('/') def uiindex():