diff options
| -rw-r--r-- | src/federation/party.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/federation/party.rs b/src/federation/party.rs index cb9eb54..e3923a6 100644 --- a/src/federation/party.rs +++ b/src/federation/party.rs @@ -8,8 +8,8 @@ //! FILE`, from the file the store's swarm starts from, for a party that never voted in //! it: the record casts on every version, the first too; //! * `write PATH VALUE`: writes `VALUE` (JSON) at `PATH`; -//! * `keys KEY...`, `nodes NODE...`: writes the party's key set (`authorized_keys` lines) -//! or node list (node IDs); +//! * `keys KEY...`, `nodes NODE...`: writes the party's key set (`authorized_keys` lines, +//! each one argument, their comments left out) or node list (node IDs); //! * `propose FILE`: proposes the version `FILE` holds (JSON); //! * `vote PROPOSAL yes|no`: votes on the proposal of hash `PROPOSAL` on the current //! version, by the record; with `--through`, through the node that votes for the @@ -273,7 +273,15 @@ pub(crate) async fn main() -> Result<()> { .await } ("keys", sub) => { - let keys: Vec<String> = strings(sub, "keys"); + // As the federation spells a key: without the line's comment. + let keys = strings(sub, "keys") + .iter() + .map(|line| { + PublicKey::parse(line) + .map(|key| key.line()) + .map_err(|why| anyhow!("{line:?}: {why}")) + }) + .collect::<Result<Vec<String>>>()?; sign(&node, &signer, &mut record, &path, event::keys(&keys)).await } ("nodes", sub) => { |
