From 96cb8d4afd14912ed316eb41d6a6cc118a1fef45 Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Mon, 20 Apr 2020 13:11:16 +0200 Subject: [PATCH] Adds user_id to ExtendedAppointment after authentication The ExtendedAppointment is passed to the Watcher without user_id, since the user is not yet authenticated. The Watcher has to add the user_id to the ExtendedAppointment after the user is authenticated. --- teos/watcher.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/teos/watcher.py b/teos/watcher.py index 16a5af4..f3a6568 100644 --- a/teos/watcher.py +++ b/teos/watcher.py @@ -124,6 +124,8 @@ class Watcher: raise AppointmentLimitReached(message) user_id = self.gatekeeper.authenticate_user(appointment.serialize(), signature) + # The user_id needs to be added to the ExtendedAppointment once the former has been authenticated + appointment.user_id = user_id # The uuids are generated as the RIPMED160(locator||user_pubkey). # If an appointment is requested by the user the uuid can be recomputed and queried straightaway (no maps).