flwr-nightly 1.23.0.dev20251009__py3-none-any.whl → 1.23.0.dev20251010__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.
@@ -21,6 +21,7 @@ from pathlib import Path
21
21
  from typing import Annotated, Optional
22
22
 
23
23
  import typer
24
+ from cryptography.exceptions import UnsupportedAlgorithm
24
25
  from cryptography.hazmat.primitives import serialization
25
26
  from cryptography.hazmat.primitives.asymmetric import ec
26
27
  from rich.console import Console
@@ -32,6 +33,7 @@ from flwr.cli.config_utils import (
32
33
  validate_federation_in_project_config,
33
34
  )
34
35
  from flwr.common.constant import FAB_CONFIG_FILE, CliOutputFormat
36
+ from flwr.common.exit import ExitCode, flwr_exit
35
37
  from flwr.common.logger import print_json_error, redirect_output, restore_output
36
38
  from flwr.proto.control_pb2 import ( # pylint: disable=E0611
37
39
  CreateNodeCliRequest,
@@ -163,7 +165,7 @@ def try_load_public_key(public_key_path: Path) -> bytes:
163
165
 
164
166
  with open(public_key_path, "rb") as key_file:
165
167
  try:
166
- public_key = serialization.load_pem_public_key(key_file.read())
168
+ public_key = serialization.load_ssh_public_key(key_file.read())
167
169
 
168
170
  if not isinstance(public_key, ec.EllipticCurvePublicKey):
169
171
  raise ValueError(f"Not an EC public key, got {type(public_key)}")
@@ -174,11 +176,9 @@ def try_load_public_key(public_key_path: Path) -> bytes:
174
176
  f"EC curve {public_key.curve.name} is not an approved NIST curve"
175
177
  )
176
178
 
177
- except ValueError as err:
178
- typer.secho(
179
- f"❌ Unable to load public key from '{public_key_path}': {err}",
180
- fg=typer.colors.RED,
181
- bold=True,
179
+ except (ValueError, UnsupportedAlgorithm) as err:
180
+ flwr_exit(
181
+ ExitCode.FLWRCLI_NODE_AUTH_PUBLIC_KEY_INVALID,
182
+ str(err),
182
183
  )
183
- raise typer.Exit(code=1) from err
184
184
  return public_key_to_bytes(public_key)
@@ -47,6 +47,9 @@ class ExitCode:
47
47
  # SuperExec-specific exit codes (400-499)
48
48
  SUPEREXEC_INVALID_PLUGIN_CONFIG = 400
49
49
 
50
+ # FlowerCLI-specific exit codes (500-599)
51
+ FLWRCLI_NODE_AUTH_PUBLIC_KEY_INVALID = 500
52
+
50
53
  # Common exit codes (600-699)
51
54
  COMMON_ADDRESS_INVALID = 600
52
55
  COMMON_MISSING_EXTRA_REST = 601
@@ -116,6 +119,13 @@ EXIT_CODE_HELP = {
116
119
  ExitCode.SUPEREXEC_INVALID_PLUGIN_CONFIG: (
117
120
  "The YAML configuration for the SuperExec plugin is invalid."
118
121
  ),
122
+ # FlowerCLI-specific exit codes (500-599)
123
+ ExitCode.FLWRCLI_NODE_AUTH_PUBLIC_KEY_INVALID: (
124
+ "Node authentication requires a valid elliptic curve public key in the "
125
+ "SSH format and following a NIST standard elliptic curve (e.g. SECP384R1). "
126
+ "Please ensure that the file path points to a valid public key "
127
+ "file and try again."
128
+ ),
119
129
  # Common exit codes (600-699)
120
130
  ExitCode.COMMON_ADDRESS_INVALID: (
121
131
  "Please provide a valid URL, IPv4 or IPv6 address."
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: flwr-nightly
3
- Version: 1.23.0.dev20251009
3
+ Version: 1.23.0.dev20251010
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
@@ -87,7 +87,7 @@ flwr/cli/run/__init__.py,sha256=RPyB7KbYTFl6YRiilCch6oezxrLQrl1kijV7BMGkLbA,790
87
87
  flwr/cli/run/run.py,sha256=ED1mDmO1PnSAgtVOrCeWwzwPm6t3aFYSs3Rh36BJzqk,8161
88
88
  flwr/cli/stop.py,sha256=W7ynTYLm0-_1nC5Il4IaZTji6A3GCCm_0R-HQUudAsI,4988
89
89
  flwr/cli/supernode/__init__.py,sha256=DVrTcyCg9NFll6glPLAAA6WPi7boxu6pFY_PRqIyHMk,893
90
- flwr/cli/supernode/create.py,sha256=SVnjJYzaY3AYriulstl95Na_Wk-Mc6o4DscXjuj_jFs,6358
90
+ flwr/cli/supernode/create.py,sha256=9KvRO0IrZa4jw0sypAYxFlzzpjmnzf1KW71b-ySxeuI,6383
91
91
  flwr/cli/supernode/delete.py,sha256=SmeKpvVtly8iisNpzJ-MNY-fe0gH2jwwilJs_NMo7do,4528
92
92
  flwr/cli/supernode/ls.py,sha256=exeu-9fpkh27k2oyYNNT7uDhHgf8dlX0TR6WwMV8KIQ,8538
93
93
  flwr/cli/utils.py,sha256=66RqZdF0DKsqmR4ZqE9zZ1bX6opdxD2U50GV41WQDoY,14864
@@ -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=Xa1NFGny2cefZ62kZZOfT8eii__PolMWCHxYmxoSQ2s,5416
139
+ flwr/common/exit/exit_code.py,sha256=g6g10X85mUlN9seFzXZeMNX8e3f2D290DZiF8p2HBAw,5885
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
@@ -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.dev20251009.dist-info/METADATA,sha256=nMVwZLSs8j0TOeit4rAO1115tiDWlzUzILtD3m5UvAQ,14559
434
- flwr_nightly-1.23.0.dev20251009.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
435
- flwr_nightly-1.23.0.dev20251009.dist-info/entry_points.txt,sha256=hxHD2ixb_vJFDOlZV-zB4Ao32_BQlL34ftsDh1GXv14,420
436
- flwr_nightly-1.23.0.dev20251009.dist-info/RECORD,,
433
+ flwr_nightly-1.23.0.dev20251010.dist-info/METADATA,sha256=HtYyoP2UzTQPv3_ixhl6ZPE6VLR2UhzoiWLCspZ9qCM,14559
434
+ flwr_nightly-1.23.0.dev20251010.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
435
+ flwr_nightly-1.23.0.dev20251010.dist-info/entry_points.txt,sha256=hxHD2ixb_vJFDOlZV-zB4Ao32_BQlL34ftsDh1GXv14,420
436
+ flwr_nightly-1.23.0.dev20251010.dist-info/RECORD,,