nvflare.private.fed.server.client_manager module¶
- class ClientManager(project_name=None, min_num_clients=2, max_num_clients=10)[source]¶
Bases:
object
Manages client adding and removing.
- Parameters:
project_name – project name
min_num_clients – minimum number of clients allowed.
max_num_clients – maximum number of clients allowed.
- authenticated_client(request, context) Client | None [source]¶
Use SSL certificate for authenticate the client.
- Parameters:
request – client login request Message
context – FL_Context
- Returns:
Client object.
- get_clients()[source]¶
Get the list of registered clients.
- Returns:
client}
- Return type:
A dict of {client_token
- heartbeat(token, client_name, fl_ctx)[source]¶
Update the heartbeat of the client.
- Parameters:
token – client token
client_name – client name
fl_ctx – FLContext
- Returns:
If a new client needs to be created.
- is_from_authorized_client(token)[source]¶
Check if a client is authorized.
- Parameters:
token – client token
- Returns:
True if it is a recognised client
- is_valid_task(task)[source]¶
Check whether the requested task matches the server’s project_name.
- Returns:
True if task name is the same as server’s project name.