File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5858 " Shamir" ,
5959 " Shor's" ,
6060 " Starlette" ,
61+ " unregistration" ,
6162 " urandom" ,
6263 " Uvicorn" ,
6364 " venv"
Original file line number Diff line number Diff line change @@ -20,11 +20,6 @@ TODO: Make sure key has unique key UUID
2020
2121TODO: Key initiator: Select N peer hub (initially: all peer hubs)
2222
23- TODO: Have client unregister itself from all hubs when it shuts down.
24- The API call should use the DELETE method.
25- Shutting down should not cause the client to unregister itself; make unregistration
26- an explicit option.
27-
2823TODO: Allow a client to register itself again (after a restart). Done; just need to test.
2924
3025TODO: Add statistics management API and topology command to query it.
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ async def lifespan(_app: fastapi.FastAPI):
4747 """
4848 _CLIENT .start_all_peer_hubs ()
4949 yield
50- # TODO: Unregister (attempt without retry or very limited)
50+ # We currently do not have any shutdown actions.
5151
5252
5353_APP = fastapi .FastAPI (lifespan = lifespan )
Original file line number Diff line number Diff line change @@ -124,13 +124,6 @@ def start_all_peer_hubs(self) -> None:
124124 for peer_hub in self ._peer_hubs :
125125 peer_hub .start_register_task ()
126126
127- async def unregister_from_all_peer_hubs (self ) -> None :
128- """
129- Unregister from all peer hubs.
130- """
131- for peer_hub in self ._peer_hubs :
132- await peer_hub .unregister ()
133-
134127 async def scatter_key_amongst_peer_hubs (self , key : UserKey ) -> None :
135128 """
136129 Split the key into key shares, and send each key share to a peer hub.
Original file line number Diff line number Diff line change @@ -148,12 +148,6 @@ async def attempt_registration(self) -> bool:
148148 self ._registered = True
149149 return True
150150
151- async def unregister (self ) -> None :
152- """
153- Unregister this client from the peer hub.
154- """
155- # TODO: Implement this and call it from somewhere
156-
157151 def start_request_psrd_task_if_needed (self ) -> None :
158152 """
159153 Start request PSRD task(s) if needed.
Original file line number Diff line number Diff line change @@ -1054,4 +1054,11 @@ been made including:
10541054
10551055 * The ` POST ` method for the ` Get key with key IDs ` interface is not supported.
10561056
1057- * Error handling is not as robust as it should be.
1057+ * Error handling is not as robust as it should be.
1058+
1059+ ### Unregistration
1060+
1061+ When a client starts, it registers itself with all hubs, using the PUT registration API.
1062+ Currently, client never unregister.
1063+ We can add an unregistration mechanism by adding a DELETE registration API and calling it
1064+ when a client shuts down orderly.
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ def stop_topology(self):
196196 """
197197 Stop all nodes.
198198 """
199- # Stop the clients first, so that they can cleanly unregister from the hubs.
199+ # Stop the clients first, in case we implement unregistration at some point
200200 for node in self .selected_nodes (reverse_order = True ):
201201 self .stop_node (node )
202202 self .wait_for_selected_nodes_stopped ()
You can’t perform that action at this time.
0 commit comments