chore: using a database for keys
Browse files- handler.py +1 -0
- 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
|