mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-21 18:40:39 +08:00
cli: reject rad id proposals that do not verify
To ensure that the `rad id` command does not modify the project payload without it being able to be deserialized into the `Project` type, the command performs this check throught the `project` method, and returns an error if this fails. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
@@ -390,6 +390,11 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
|
||||
anyhow::bail!("payload `{id}` not found in identity document");
|
||||
}
|
||||
}
|
||||
// Verify that the project payload can still be parsed into the
|
||||
// `Project` type.
|
||||
if let Err(e) = proposal.project() {
|
||||
anyhow::bail!("failed to verify `xyz.radicle.project`, failed with {e}",);
|
||||
}
|
||||
proposal
|
||||
};
|
||||
if proposal == current.doc {
|
||||
|
||||
Reference in New Issue
Block a user