binoua commited on
Commit
a35e3b6
1 Parent(s): 46dab14

chore: using a database for keys

Browse files
Files changed (2) hide show
  1. handler.py +1 -0
  2. play_with_endpoint.py +1 -0
handler.py CHANGED
@@ -52,6 +52,7 @@ class EndpointHandler:
52
  elif method == "inference":
53
 
54
  uid = data.pop("uid", data)
 
55
 
56
  # Get inputs
57
  encrypted_inputs = from_json(data.pop("encrypted_inputs", data))
 
52
  elif method == "inference":
53
 
54
  uid = data.pop("uid", data)
55
+ assert uid in self.key_database.keys()
56
 
57
  # Get inputs
58
  encrypted_inputs = from_json(data.pop("encrypted_inputs", data))
play_with_endpoint.py CHANGED
@@ -53,6 +53,7 @@ payload = {
53
  "method": "save_key",
54
  }
55
 
 
56
  uid = query(payload)
57
 
58
  # Test the handler
 
53
  "method": "save_key",
54
  }
55
 
56
+ print("Storing the key in the database")
57
  uid = query(payload)
58
 
59
  # Test the handler