cli: improve rad id allow list UX
The previous implementation of using the --allow option in rad id update would be an absolute list, rather than additive. That is, if
there were existing DIDs not passed in via --allow then they would
be remove.
Change this behaviour to check the existing value of the document’s
allow list, and add to it if --allow is specified.
To enable the user to also remove a DID, the --disallow option is
also added.
The correct usage of these options is improved by checking the
validity of the --visibility option being used, the current state of
the repository’s privacy, and the use of the --allow and
--disallow options.
3 files changed
+206
-9
6f91f2fb
→
f26be552
added radicle-cli/examples/rad-id-private.md
@@ -0,0 +1,101 @@
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
modified radicle-cli/src/commands/id.rs
@@ -1,3 +1,5 @@
| + | |
| + | |
|
|
|
|
|
@@ -32,7 +34,8 @@ Usage
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -59,7 +62,9 @@ pub enum Operation {
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -83,6 +88,29 @@ pub enum Operation {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -114,7 +142,9 @@ impl Args for Options {
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -172,11 +202,12 @@ impl Args for Options {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -244,6 +275,8 @@ impl Args for Options {
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -349,12 +382,51 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified radicle-cli/tests/commands.rs
@@ -717,6 +717,30 @@ fn rad_id_unknown_field() {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|