Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: reject `rad id` proposals that do not verify
Fintan Halpenny committed 2 years ago
commit cb2cbf014a123a1cd0cd0f188f093e014f93647b
parent 11a1bca0fc97dbc93653e53f0e33e7883f9cb637
2 files changed +12 -0
modified radicle-cli/examples/rad-id-update-delete-field.md
@@ -69,3 +69,10 @@ $ rad id update --title "Delete field" --description "Delete 'web'" --payload xy
   "threshold": 1
 }
```
+

+
Note that we cannot delete mandatory fields:
+

+
``` (fails)
+
$ rad id update --title "Delete default branch" --payload xyz.radicle.project defaultBranch null
+
✗ Error: failed to verify `xyz.radicle.project`, failed with json: missing field `defaultBranch`
+
```
modified radicle-cli/src/commands/id.rs
@@ -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 {