aboutsummaryrefslogtreecommitdiffstats
path: root/adenosine-cli/src/bin/adenosine.rs
diff options
context:
space:
mode:
Diffstat (limited to 'adenosine-cli/src/bin/adenosine.rs')
-rw-r--r--adenosine-cli/src/bin/adenosine.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/adenosine-cli/src/bin/adenosine.rs b/adenosine-cli/src/bin/adenosine.rs
index e5537df..e2f6994 100644
--- a/adenosine-cli/src/bin/adenosine.rs
+++ b/adenosine-cli/src/bin/adenosine.rs
@@ -239,6 +239,9 @@ enum Command {
nsid: Nsid,
/// Set of query parameters and body fields for the request
fields: Vec<ArgField>,
+ /// Whether to authenticate
+ #[structopt(long)]
+ auth: bool
},
/// Manage user account and sessions
@@ -506,13 +509,16 @@ fn run(opt: Opt) -> Result<()> {
ref method,
ref nsid,
ref fields,
+ auth,
} => {
+ if auth == true {
+ require_auth_did(&opt, &mut xrpc_client)?;
+ }
update_params_from_fields(fields, &mut params);
let body = value_from_fields(fields.clone());
match method {
XrpcMethod::Get => xrpc_client.get(nsid, Some(params))?,
XrpcMethod::Post => {
- require_auth_did(&opt, &mut xrpc_client)?;
xrpc_client.post(nsid, Some(params), Some(body))?
}
}