flwr-nightly 1.23.0.dev20251015__py3-none-any.whl → 1.23.0.dev20251017__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of flwr-nightly might be problematic. Click here for more details.

@@ -41,8 +41,8 @@ class ExitCode:
41
41
 
42
42
  # SuperNode-specific exit codes (300-399)
43
43
  SUPERNODE_REST_ADDRESS_INVALID = 300
44
- SUPERNODE_NODE_AUTH_KEYS_REQUIRED = 301
45
- SUPERNODE_NODE_AUTH_KEYS_INVALID = 302
44
+ # SUPERNODE_NODE_AUTH_KEYS_REQUIRED = 301 --- DELETED ---
45
+ SUPERNODE_NODE_AUTH_KEY_INVALID = 302
46
46
 
47
47
  # SuperExec-specific exit codes (400-499)
48
48
  SUPEREXEC_INVALID_PLUGIN_CONFIG = 400
@@ -105,14 +105,9 @@ EXIT_CODE_HELP = {
105
105
  "When using the REST API, please provide `https://` or "
106
106
  "`http://` before the server address (e.g. `http://127.0.0.1:8080`)"
107
107
  ),
108
- ExitCode.SUPERNODE_NODE_AUTH_KEYS_REQUIRED: (
109
- "Node authentication requires file paths to both "
110
- "'--auth-supernode-private-key' and '--auth-supernode-public-key' "
111
- "to be provided (providing only one of them is not sufficient)."
112
- ),
113
- ExitCode.SUPERNODE_NODE_AUTH_KEYS_INVALID: (
114
- "Node authentication requires elliptic curve private and public key pair. "
115
- "Please ensure that the file path points to a valid private/public key "
108
+ ExitCode.SUPERNODE_NODE_AUTH_KEY_INVALID: (
109
+ "Node authentication requires elliptic curve private key. "
110
+ "Please ensure that the file path points to a valid private key "
116
111
  "file and try again."
117
112
  ),
118
113
  # SuperExec-specific exit codes (400-499)
flwr/server/app.py CHANGED
@@ -71,8 +71,8 @@ from flwr.superlink.artifact_provider import ArtifactProvider
71
71
  from flwr.superlink.auth_plugin import (
72
72
  ControlAuthnPlugin,
73
73
  ControlAuthzPlugin,
74
- get_control_authn_plugins,
75
- get_control_authz_plugins,
74
+ NoOpControlAuthnPlugin,
75
+ NoOpControlAuthzPlugin,
76
76
  )
77
77
  from flwr.superlink.servicer.control import run_control_api_grpc
78
78
 
@@ -93,6 +93,8 @@ P = TypeVar("P", ControlAuthnPlugin, ControlAuthzPlugin)
93
93
  try:
94
94
  from flwr.ee import (
95
95
  add_ee_args_superlink,
96
+ get_control_authn_ee_plugins,
97
+ get_control_authz_ee_plugins,
96
98
  get_control_event_log_writer_plugins,
97
99
  get_ee_artifact_provider,
98
100
  get_fleet_event_log_writer_plugins,
@@ -119,6 +121,26 @@ except ImportError:
119
121
  "No event log writer plugins are currently supported."
120
122
  )
121
123
 
124
+ def get_control_authn_ee_plugins() -> dict[str, type[ControlAuthnPlugin]]:
125
+ """Return all Control API authentication plugins for EE."""
126
+ return {}
127
+
128
+ def get_control_authz_ee_plugins() -> dict[str, type[ControlAuthzPlugin]]:
129
+ """Return all Control API authorization plugins for EE."""
130
+ return {}
131
+
132
+
133
+ def get_control_authn_plugins() -> dict[str, type[ControlAuthnPlugin]]:
134
+ """Return all Control API authentication plugins."""
135
+ ee_dict: dict[str, type[ControlAuthnPlugin]] = get_control_authn_ee_plugins()
136
+ return ee_dict | {AuthnType.NOOP: NoOpControlAuthnPlugin}
137
+
138
+
139
+ def get_control_authz_plugins() -> dict[str, type[ControlAuthzPlugin]]:
140
+ """Return all Control API authorization plugins."""
141
+ ee_dict: dict[str, type[ControlAuthzPlugin]] = get_control_authz_ee_plugins()
142
+ return ee_dict | {AuthzType.NOOP: NoOpControlAuthzPlugin}
143
+
122
144
 
123
145
  # pylint: disable=too-many-branches, too-many-locals, too-many-statements
124
146
  def run_superlink() -> None:
@@ -441,9 +441,18 @@ class InMemoryLinkState(LinkState): # pylint: disable=R0902,R0904
441
441
  return node.public_key
442
442
 
443
443
  def get_node_id_by_public_key(self, public_key: bytes) -> Optional[int]:
444
- """Get `node_id` for the specified `public_key`."""
444
+ """Get `node_id` for the specified `public_key` if it exists and is not
445
+ deleted."""
445
446
  with self.lock:
446
- return self.node_public_key_to_node_id.get(public_key)
447
+ node_id = self.node_public_key_to_node_id.get(public_key)
448
+
449
+ if node_id is None:
450
+ return None
451
+
452
+ node_info = self.nodes[node_id]
453
+ if node_info.status == NodeStatus.DELETED:
454
+ return None
455
+ return node_id
447
456
 
448
457
  # pylint: disable=too-many-arguments,too-many-positional-arguments
449
458
  def create_run(
@@ -151,7 +151,7 @@ class LinkState(CoreState): # pylint: disable=R0904
151
151
 
152
152
  @abc.abstractmethod
153
153
  def get_node_id_by_public_key(self, public_key: bytes) -> Optional[int]:
154
- """Get `node_id` for the specified `public_key`.
154
+ """Get `node_id` for the specified `public_key` if it exists and is not deleted.
155
155
 
156
156
  Parameters
157
157
  ----------
@@ -161,7 +161,8 @@ class LinkState(CoreState): # pylint: disable=R0904
161
161
  Returns
162
162
  -------
163
163
  Optional[int]
164
- The `node_id` associated with the specified `public_key`.
164
+ The `node_id` associated with the specified `public_key` if it exists
165
+ and is not deleted; otherwise, `None`.
165
166
  """
166
167
 
167
168
  @abc.abstractmethod
@@ -785,7 +785,8 @@ class SqliteLinkState(LinkState): # pylint: disable=R0904
785
785
  return cast(bytes, rows[0]["public_key"])
786
786
 
787
787
  def get_node_id_by_public_key(self, public_key: bytes) -> Optional[int]:
788
- """Get `node_id` for the specified `public_key`."""
788
+ """Get `node_id` for the specified `public_key` if it exists and is not
789
+ deleted."""
789
790
  query = "SELECT node_id FROM node WHERE public_key = ? AND status != ?;"
790
791
  rows = self.query(query, (public_key, NodeStatus.DELETED))
791
792
 
@@ -15,41 +15,12 @@
15
15
  """Account auth plugin for ControlServicer."""
16
16
 
17
17
 
18
- from flwr.common.constant import AuthnType, AuthzType
19
-
20
18
  from .auth_plugin import ControlAuthnPlugin, ControlAuthzPlugin
21
19
  from .noop_auth_plugin import NoOpControlAuthnPlugin, NoOpControlAuthzPlugin
22
20
 
23
- try:
24
- from flwr.ee import get_control_authn_ee_plugins, get_control_authz_ee_plugins
25
- except ImportError:
26
-
27
- def get_control_authn_ee_plugins() -> dict[str, type[ControlAuthnPlugin]]:
28
- """Return all Control API authentication plugins for EE."""
29
- return {}
30
-
31
- def get_control_authz_ee_plugins() -> dict[str, type[ControlAuthzPlugin]]:
32
- """Return all Control API authorization plugins for EE."""
33
- return {}
34
-
35
-
36
- def get_control_authn_plugins() -> dict[str, type[ControlAuthnPlugin]]:
37
- """Return all Control API authentication plugins."""
38
- ee_dict: dict[str, type[ControlAuthnPlugin]] = get_control_authn_ee_plugins()
39
- return ee_dict | {AuthnType.NOOP: NoOpControlAuthnPlugin}
40
-
41
-
42
- def get_control_authz_plugins() -> dict[str, type[ControlAuthzPlugin]]:
43
- """Return all Control API authorization plugins."""
44
- ee_dict: dict[str, type[ControlAuthzPlugin]] = get_control_authz_ee_plugins()
45
- return ee_dict | {AuthzType.NOOP: NoOpControlAuthzPlugin}
46
-
47
-
48
21
  __all__ = [
49
22
  "ControlAuthnPlugin",
50
23
  "ControlAuthzPlugin",
51
24
  "NoOpControlAuthnPlugin",
52
25
  "NoOpControlAuthzPlugin",
53
- "get_control_authn_plugins",
54
- "get_control_authz_plugins",
55
26
  ]
@@ -22,10 +22,7 @@ from typing import Optional
22
22
 
23
23
  from cryptography.exceptions import UnsupportedAlgorithm
24
24
  from cryptography.hazmat.primitives.asymmetric import ec
25
- from cryptography.hazmat.primitives.serialization import (
26
- load_ssh_private_key,
27
- load_ssh_public_key,
28
- )
25
+ from cryptography.hazmat.primitives.serialization import load_ssh_private_key
29
26
 
30
27
  from flwr.common import EventType, event
31
28
  from flwr.common.args import try_obtain_root_certificates
@@ -188,12 +185,12 @@ def _parse_args_common(parser: argparse.ArgumentParser) -> None:
188
185
  parser.add_argument(
189
186
  "--auth-supernode-private-key",
190
187
  type=str,
191
- help="The SuperNode's private key (as a path str) to enable authentication.",
188
+ help="Path to the SuperNode's private key to enable authentication.",
192
189
  )
193
190
  parser.add_argument(
194
191
  "--auth-supernode-public-key",
195
192
  type=str,
196
- help="The SuperNode's public key (as a path str) to enable authentication.",
193
+ help="This argument is deprecated and will be removed in a future release.",
197
194
  )
198
195
  parser.add_argument(
199
196
  "--node-config",
@@ -207,12 +204,9 @@ def _parse_args_common(parser: argparse.ArgumentParser) -> None:
207
204
  def _try_setup_client_authentication(
208
205
  args: argparse.Namespace,
209
206
  ) -> Optional[tuple[ec.EllipticCurvePrivateKey, ec.EllipticCurvePublicKey]]:
210
- if not args.auth_supernode_private_key and not args.auth_supernode_public_key:
207
+ if not args.auth_supernode_private_key:
211
208
  return None
212
209
 
213
- if not args.auth_supernode_private_key or not args.auth_supernode_public_key:
214
- flwr_exit(ExitCode.SUPERNODE_NODE_AUTH_KEYS_REQUIRED)
215
-
216
210
  try:
217
211
  ssh_private_key = load_ssh_private_key(
218
212
  Path(args.auth_supernode_private_key).read_bytes(),
@@ -222,23 +216,15 @@ def _try_setup_client_authentication(
222
216
  raise ValueError()
223
217
  except (ValueError, UnsupportedAlgorithm):
224
218
  flwr_exit(
225
- ExitCode.SUPERNODE_NODE_AUTH_KEYS_INVALID,
219
+ ExitCode.SUPERNODE_NODE_AUTH_KEY_INVALID,
226
220
  "Unable to parse the private key file.",
227
221
  )
228
222
 
229
- try:
230
- ssh_public_key = load_ssh_public_key(
231
- Path(args.auth_supernode_public_key).read_bytes()
232
- )
233
- if not isinstance(ssh_public_key, ec.EllipticCurvePublicKey):
234
- raise ValueError()
235
- except (ValueError, UnsupportedAlgorithm):
236
- flwr_exit(
237
- ExitCode.SUPERNODE_NODE_AUTH_KEYS_INVALID,
238
- "Unable to parse the public key file.",
223
+ if args.auth_supernode_public_key:
224
+ log(
225
+ WARN,
226
+ "The `--auth-supernode-public-key` flag is deprecated and will be "
227
+ "removed in a future release. The public key is now derived from the "
228
+ "private key provided by `--auth-supernode-private-key`.",
239
229
  )
240
-
241
- return (
242
- ssh_private_key,
243
- ssh_public_key,
244
- )
230
+ return ssh_private_key, ssh_private_key.public_key()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: flwr-nightly
3
- Version: 1.23.0.dev20251015
3
+ Version: 1.23.0.dev20251017
4
4
  Summary: Flower: A Friendly Federated AI Framework
5
5
  License: Apache-2.0
6
6
  Keywords: Artificial Intelligence,Federated AI,Federated Analytics,Federated Evaluation,Federated Learning,Flower,Machine Learning
@@ -136,7 +136,7 @@ flwr/common/event_log_plugin/__init__.py,sha256=ts3VAL3Fk6Grp1EK_1Qg_V-BfOof9F86
136
136
  flwr/common/event_log_plugin/event_log_plugin.py,sha256=4SkVa1Ic-sPlICJShBuggXmXDcQtWQ1KDby4kthFNF0,2064
137
137
  flwr/common/exit/__init__.py,sha256=8W7xaO1iw0vacgmQW7FTFbSh7csNv6XfsgIlnIbNF6U,978
138
138
  flwr/common/exit/exit.py,sha256=DcXJfbpW1g-pQJqSZmps-1MZydd7T7RaarghIf2e4tU,3636
139
- flwr/common/exit/exit_code.py,sha256=g6g10X85mUlN9seFzXZeMNX8e3f2D290DZiF8p2HBAw,5885
139
+ flwr/common/exit/exit_code.py,sha256=bMkJabvEz1QbtsFJHWGeNTpWm2OZ-h3Q6jGsubWi3-0,5613
140
140
  flwr/common/exit/exit_handler.py,sha256=uzDdWwhKgc1w5csZS52b86kjmEApmDZKwMn_X0zDZZo,2126
141
141
  flwr/common/exit/signal_handler.py,sha256=wqxykrwgmpFzmEMhpnlM7RtO0PnqIvYiSB1qYahZ5Sk,3710
142
142
  flwr/common/grpc.py,sha256=nHnFC7E84pZVTvd6BhcSYWnGd0jf8t5UmGea04qvilM,9806
@@ -249,7 +249,7 @@ flwr/proto/transport_pb2_grpc.py,sha256=vLN3EHtx2aEEMCO4f1Upu-l27BPzd3-5pV-u8wPc
249
249
  flwr/proto/transport_pb2_grpc.pyi,sha256=AGXf8RiIiW2J5IKMlm_3qT3AzcDa4F3P5IqUjve_esA,766
250
250
  flwr/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
251
251
  flwr/server/__init__.py,sha256=LQQHiuL2jy7TpNaKastRdGsexlxSt5ZWAQNVqitDnrY,1598
252
- flwr/server/app.py,sha256=VvetbRhQagGDTM3egm1lqJ3G9nL6LXye6QLtemPRiOU,28848
252
+ flwr/server/app.py,sha256=WTC-0FaPsHIRovQyecqh3iuvuFZgqyMmSBaPMMgoTCM,29798
253
253
  flwr/server/client_manager.py,sha256=5jCGavVli7XdupvWWo7ru3PdFTlRU8IGvHFSSoUVLRs,6227
254
254
  flwr/server/client_proxy.py,sha256=sv0E9AldBYOvc3pusqFh-GnyreeMfsXQ1cuTtxTq_wY,2399
255
255
  flwr/server/compat/__init__.py,sha256=0IsttWvY15qO98_1GyzVC-vR1e_ZPXOdu2qUlOkYMPE,886
@@ -317,10 +317,10 @@ flwr/server/superlink/fleet/vce/backend/backend.py,sha256=cSrHZ5SjCCvy4vI0pgsyjt
317
317
  flwr/server/superlink/fleet/vce/backend/raybackend.py,sha256=cBZYTmfiAsb1HmVUmOQXYLU-UJmJTFWkj1wW4RYRDuc,7218
318
318
  flwr/server/superlink/fleet/vce/vce_api.py,sha256=EU0DLt4njtKelOpOWfQ7zWW45bSVC6K7pPYfHSyOJwM,13332
319
319
  flwr/server/superlink/linkstate/__init__.py,sha256=OtsgvDTnZLU3k0sUbkHbqoVwW6ql2FDmb6uT6DbNkZo,1064
320
- flwr/server/superlink/linkstate/in_memory_linkstate.py,sha256=NLJ4lNdySnAKiraZ3z2xHcc2-4s8DaMCYyOa2bk_pM4,29388
321
- flwr/server/superlink/linkstate/linkstate.py,sha256=hfe8vhRreMb0OqqSHT6ccTGngi62iW5D-WH-sD99eFY,14606
320
+ flwr/server/superlink/linkstate/in_memory_linkstate.py,sha256=0Lcmy4-oPlS2PRa9R0I9Gs5wNHTbx2n0eleLmyai79w,29647
321
+ flwr/server/superlink/linkstate/linkstate.py,sha256=JKgVEPnH2T-nixW3LHp8jR3g4ITAZYNwEoDIWZaUYmQ,14701
322
322
  flwr/server/superlink/linkstate/linkstate_factory.py,sha256=8RlosqSpKOoD_vhUUQPY0jtE3A84GeF96Z7sWNkRRcA,2069
323
- flwr/server/superlink/linkstate/sqlite_linkstate.py,sha256=Lj5MWxjux01w04M8MBhK-kmD-9bvEG9EfFTvn6Zo-FU,47820
323
+ flwr/server/superlink/linkstate/sqlite_linkstate.py,sha256=Qp1HgeOUi8sG7iB__MnsRWztIbgmaEtJkO1cB-0uMpQ,47860
324
324
  flwr/server/superlink/linkstate/utils.py,sha256=IeLh7iGRCHU5MEWOl7iriaSE4L__8GWOa2OleXadK5M,15444
325
325
  flwr/server/superlink/serverappio/__init__.py,sha256=Fy4zJuoccZe5mZSEIpOmQvU6YeXFBa1M4eZuXXmJcn8,717
326
326
  flwr/server/superlink/serverappio/serverappio_grpc.py,sha256=-I7kBbr4w4ZVYwBZoAIle-xHKthFnZrsVfxa6WR8uxA,2310
@@ -406,7 +406,7 @@ flwr/supercore/utils.py,sha256=ebuHMbeA8eXisX0oMPqBK3hk7uVnIE_yiqWVz8YbkpQ,1324
406
406
  flwr/superlink/__init__.py,sha256=GNSuJ4-N6Z8wun2iZNlXqENt5beUyzC0Gi_tN396bbM,707
407
407
  flwr/superlink/artifact_provider/__init__.py,sha256=pgZEcVPKRE874LSu3cgy0HbwSJBIpVy_HxQOmne4PAs,810
408
408
  flwr/superlink/artifact_provider/artifact_provider.py,sha256=Gnlg2M2SOqCruji2B0U3ov68NJWKin9scmnWJTiSnNA,1267
409
- flwr/superlink/auth_plugin/__init__.py,sha256=2INKscgltOxVMGqwuc7YyS2suR0mmBent0F5UA7ToBQ,2111
409
+ flwr/superlink/auth_plugin/__init__.py,sha256=ApYBHnDmtv5gVrnxdFq97zC58O1icqHogK2Dz6o8DVI,1000
410
410
  flwr/superlink/auth_plugin/auth_plugin.py,sha256=mKaR2HanhKHmVrcvGqTUv47ut458QgqVU6enU4myB7Y,3038
411
411
  flwr/superlink/auth_plugin/noop_auth_plugin.py,sha256=BQ1v1jFZen7AHh6Gwr9arElW3e9aAAKgOO4zKikbd_4,3044
412
412
  flwr/superlink/servicer/__init__.py,sha256=ZC-kILcUGeh6IxJsfu24cTzUqIGXmQfEKsGfhsnhBpM,717
@@ -418,7 +418,7 @@ flwr/superlink/servicer/control/control_license_interceptor.py,sha256=T3AzmRt-PP
418
418
  flwr/superlink/servicer/control/control_servicer.py,sha256=8nMbXnO9eUnm-H9nikIbyzMQUx7-qZ74PE0X2if_mDE,21377
419
419
  flwr/supernode/__init__.py,sha256=KgeCaVvXWrU3rptNR1y0oBp4YtXbAcrnCcJAiOoWkI4,707
420
420
  flwr/supernode/cli/__init__.py,sha256=JuEMr0-s9zv-PEWKuLB9tj1ocNfroSyNJ-oyv7ati9A,887
421
- flwr/supernode/cli/flower_supernode.py,sha256=7aBm0z03OU-npVd1onLCvUotyhSvlZLxAnFkGVMhZcw,8670
421
+ flwr/supernode/cli/flower_supernode.py,sha256=bmPpg88Zq7NYMDzyyDwBzeZ6_1f26fD_iDdGw1o_4QQ,8334
422
422
  flwr/supernode/cli/flwr_clientapp.py,sha256=W3tAyqSfeHbPhqBC4Pfo9bsyFdkBKPqdKlhGmeUKwKg,3173
423
423
  flwr/supernode/nodestate/__init__.py,sha256=CyLLObbmmVgfRO88UCM0VMait1dL57mUauUDfuSHsbU,976
424
424
  flwr/supernode/nodestate/in_memory_nodestate.py,sha256=rr_tg7YXhf_seYFipSB59TAfheKPratx3rrvHUOJ80g,7343
@@ -430,7 +430,7 @@ flwr/supernode/servicer/__init__.py,sha256=lucTzre5WPK7G1YLCfaqg3rbFWdNSb7ZTt-ca
430
430
  flwr/supernode/servicer/clientappio/__init__.py,sha256=7Oy62Y_oijqF7Dxi6tpcUQyOpLc_QpIRZ83NvwmB0Yg,813
431
431
  flwr/supernode/servicer/clientappio/clientappio_servicer.py,sha256=nIHRu38EWK-rpNOkcgBRAAKwYQQWFeCwu0lkO7OPZGQ,10239
432
432
  flwr/supernode/start_client_internal.py,sha256=Y9S1-QlO2WP6eo4JvWzIpfaCoh2aoE7bjEYyxNNnlyg,20777
433
- flwr_nightly-1.23.0.dev20251015.dist-info/METADATA,sha256=rmdl6uUZ3CLxWNn1r9f3ADvFaznbjFpRRY0g4y1LzMw,14559
434
- flwr_nightly-1.23.0.dev20251015.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
435
- flwr_nightly-1.23.0.dev20251015.dist-info/entry_points.txt,sha256=hxHD2ixb_vJFDOlZV-zB4Ao32_BQlL34ftsDh1GXv14,420
436
- flwr_nightly-1.23.0.dev20251015.dist-info/RECORD,,
433
+ flwr_nightly-1.23.0.dev20251017.dist-info/METADATA,sha256=-41bk76MoSVb4a5YE0ddm4-QfXNSpcYld226RYb_EHQ,14559
434
+ flwr_nightly-1.23.0.dev20251017.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
435
+ flwr_nightly-1.23.0.dev20251017.dist-info/entry_points.txt,sha256=hxHD2ixb_vJFDOlZV-zB4Ao32_BQlL34ftsDh1GXv14,420
436
+ flwr_nightly-1.23.0.dev20251017.dist-info/RECORD,,