mycognosist / solar

A minimal Secure Scuttlebutt replication node.
Other
22 stars 2 forks source link

Fix replication configuration parsing from TOML file #70

Closed mycognosist closed 1 year ago

mycognosist commented 1 year ago

Addresses https://github.com/mycognosist/solar/issues/69

There were a few bugs bundled together in this one.

I ended up changing the peers field of ReplicationConfig to be a HashMap<String, String> (rather than HashMap<PublicKey, String>). This makes deserialization far simpler. I've added a validation method on ReplicationConfig which is run after the data is deserialized from file. The validation performs a simple check of the peer address and comprehensive checks of the public key.

I also noticed that I was erroneously overwriting the peers replication field with an empty HashMap in solar_cli/src/main.rs (woops). That's fixed now.