Rename sq network lookup to fetch, align network commands.
- Fixes #157.
This commit is contained in:
parent
6a4f32e493
commit
59b0b2a543
@ -4,7 +4,7 @@ use clap::{Parser, Subcommand};
|
||||
|
||||
pub mod dane;
|
||||
pub mod keyserver;
|
||||
pub mod lookup;
|
||||
pub mod fetch;
|
||||
pub mod wkd;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
@ -28,7 +28,7 @@ pub struct Command {
|
||||
|
||||
#[derive(Debug, Subcommand)]
|
||||
pub enum Subcommands {
|
||||
Lookup(lookup::Command),
|
||||
Fetch(fetch::Command),
|
||||
Keyserver(keyserver::Command),
|
||||
Wkd(wkd::Command),
|
||||
Dane(dane::Command),
|
||||
|
@ -23,7 +23,7 @@ pub struct Command {
|
||||
#[derive(Debug, Subcommand)]
|
||||
pub enum Subcommands {
|
||||
Generate(GenerateCommand),
|
||||
Get(GetCommand),
|
||||
Fetch(FetchCommand),
|
||||
}
|
||||
|
||||
#[derive(Debug, Args)]
|
||||
@ -91,15 +91,15 @@ pub struct GenerateCommand {
|
||||
|
||||
#[derive(Debug, Args)]
|
||||
#[clap(
|
||||
about = "Looks up certificates using DANE",
|
||||
about = "Retrieves certificates using DANE",
|
||||
long_about =
|
||||
"Looks up certificates using DANE
|
||||
"Retrieves certificates using DANE
|
||||
|
||||
By default, any returned certificates are stored in the local
|
||||
certificate store. This can be overridden by using `--output`
|
||||
option.
|
||||
|
||||
When a certificate is downloaded using DANE, and imported into the
|
||||
When a certificate is retrieved using DANE, and imported into the
|
||||
local certificate store, any User IDs with the email address that was
|
||||
looked up are certificated with a local DANE-specific key. That proxy
|
||||
certificate is in turn certified as a minimally trusted CA (trust
|
||||
@ -108,7 +108,7 @@ is trusted can be tuned using `sq link add` or `sq link retract`
|
||||
in the usual way.
|
||||
"
|
||||
)]
|
||||
pub struct GetCommand {
|
||||
pub struct FetchCommand {
|
||||
#[clap(
|
||||
value_name = "ADDRESS",
|
||||
required = true,
|
||||
|
@ -7,10 +7,10 @@ use super::keyserver::DEFAULT_KEYSERVERS;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[clap(
|
||||
name = "lookup",
|
||||
about = "Searches for certificates using all supported network services.",
|
||||
name = "fetch",
|
||||
about = "Retrieves certificates using all supported network services",
|
||||
long_about =
|
||||
"Searches for certificates using all supported network services.
|
||||
"Retrieves certificates using all supported network services
|
||||
|
||||
By default, any returned certificates are stored in the local
|
||||
certificate store. This can be overridden by using `--output`
|
@ -39,21 +39,21 @@ pub struct Command {
|
||||
|
||||
#[derive(Debug, Subcommand)]
|
||||
pub enum Subcommands {
|
||||
Get(GetCommand),
|
||||
Send(SendCommand),
|
||||
Fetch(FetchCommand),
|
||||
Publish(PublishCommand),
|
||||
}
|
||||
|
||||
#[derive(Debug, Args)]
|
||||
#[clap(
|
||||
about = "Retrieves a certificate",
|
||||
about = "Retrieves certificates from key servers",
|
||||
long_about =
|
||||
"Retrieves a certificate from a keyserver.
|
||||
"Retrieves certificates from key servers
|
||||
|
||||
By default, any returned certificates are stored in the local
|
||||
certificate store. This can be overridden by using `--output`
|
||||
option.
|
||||
|
||||
When a certificate is downloaded from a verifying keyserver
|
||||
When a certificate is retrieved from a verifying keyserver
|
||||
(currently, this is limited to a list of known servers:
|
||||
keys.openpgp.org, keys.mailvelope.com, and mail-api.proton.me), and
|
||||
imported into the local certificate store, the User IDs are also
|
||||
@ -64,7 +64,7 @@ trusted can be tuned using `sq link add` or `sq link retract` in
|
||||
the usual way.
|
||||
"
|
||||
)]
|
||||
pub struct GetCommand {
|
||||
pub struct FetchCommand {
|
||||
#[clap(
|
||||
help = FileOrCertStore::HELP_OPTIONAL,
|
||||
long,
|
||||
@ -90,14 +90,14 @@ pub struct GetCommand {
|
||||
|
||||
#[derive(Debug, Args)]
|
||||
#[clap(
|
||||
about = "Sends a key",
|
||||
about = "Publishes certificates",
|
||||
)]
|
||||
pub struct SendCommand {
|
||||
pub struct PublishCommand {
|
||||
#[clap(
|
||||
long,
|
||||
help = "Requires that all send operations succeed \
|
||||
help = "Requires that all publish operations succeed \
|
||||
and return an error otherwise. \
|
||||
By default we only require that one send \
|
||||
By default we only require that one publish \
|
||||
operation succeeds.",
|
||||
)]
|
||||
pub require_all: bool,
|
||||
|
@ -22,7 +22,7 @@ pub struct Command {
|
||||
#[derive(Debug, Subcommand)]
|
||||
pub enum Subcommands {
|
||||
Generate(GenerateCommand),
|
||||
Get(GetCommand),
|
||||
Fetch(FetchCommand),
|
||||
DirectUrl(DirectUrlCommand),
|
||||
Url(UrlCommand),
|
||||
}
|
||||
@ -53,15 +53,15 @@ pub struct DirectUrlCommand {
|
||||
|
||||
#[derive(Debug, Args)]
|
||||
#[clap(
|
||||
about = "Looks up certificates in a Web Key Directory",
|
||||
about = "Retrieves certificates from a Web Key Directory",
|
||||
long_about =
|
||||
"Looks up certificates in a Web Key Directory
|
||||
"Retrieves certificates from a Web Key Directory
|
||||
|
||||
By default, any returned certificates are stored in the local
|
||||
certificate store. This can be overridden by using `--output`
|
||||
option.
|
||||
|
||||
When a certificate is downloaded from a WKD, and imported into the
|
||||
When a certificate is retrieved from a WKD, and imported into the
|
||||
local certificate store, any User IDs with the email address that was
|
||||
looked up are certificated with a local WKD-specific key. That proxy
|
||||
certificate is in turn certified as a minimally trusted CA (trust
|
||||
@ -70,7 +70,7 @@ is trusted can be tuned using `sq link add` or `sq link retract`
|
||||
in the usual way.
|
||||
"
|
||||
)]
|
||||
pub struct GetCommand {
|
||||
pub struct FetchCommand {
|
||||
#[clap(
|
||||
value_name = "ADDRESS",
|
||||
required = true,
|
||||
|
@ -61,8 +61,8 @@ pub fn dispatch(config: Config, c: cli::network::Command)
|
||||
{
|
||||
use cli::network::Subcommands;
|
||||
match c.subcommand {
|
||||
Subcommands::Lookup(command) =>
|
||||
dispatch_lookup(config, command),
|
||||
Subcommands::Fetch(command) =>
|
||||
dispatch_fetch(config, command),
|
||||
|
||||
Subcommands::Keyserver(command) =>
|
||||
dispatch_keyserver(config, command),
|
||||
@ -551,8 +551,8 @@ impl Response {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn dispatch_lookup(config: Config, c: cli::network::lookup::Command)
|
||||
-> Result<()>
|
||||
pub fn dispatch_fetch(config: Config, c: cli::network::fetch::Command)
|
||||
-> Result<()>
|
||||
{
|
||||
let default_servers = default_keyservers_p(&c.servers);
|
||||
let servers = c.servers.iter().map(
|
||||
@ -688,7 +688,7 @@ pub fn dispatch_keyserver(config: Config, c: cli::network::keyserver::Command)
|
||||
|
||||
use crate::cli::network::keyserver::Subcommands::*;
|
||||
match c.subcommand {
|
||||
Get(c) => rt.block_on(async {
|
||||
Fetch(c) => rt.block_on(async {
|
||||
let queries = Query::parse(&c.query)?;
|
||||
|
||||
let mut requests = tokio::task::JoinSet::new();
|
||||
@ -714,7 +714,7 @@ pub fn dispatch_keyserver(config: Config, c: cli::network::keyserver::Command)
|
||||
config, c.output, c.binary, requests, default_servers).await?;
|
||||
Result::Ok(())
|
||||
})?,
|
||||
Send(c) => rt.block_on(async {
|
||||
Publish(c) => rt.block_on(async {
|
||||
let mut input = c.input.open()?;
|
||||
let cert = Arc::new(Cert::from_reader(&mut input).
|
||||
context("Malformed key")?);
|
||||
@ -802,7 +802,7 @@ pub fn dispatch_wkd(config: Config, c: cli::network::wkd::Command) -> Result<()>
|
||||
WkdUrlVariant::Direct, advanced, direct)?;
|
||||
output.write(config.output_format, &mut std::io::stdout())?;
|
||||
},
|
||||
Get(c) => rt.block_on(async {
|
||||
Fetch(c) => rt.block_on(async {
|
||||
let queries = Query::parse_addresses(&c.addresses)?;
|
||||
let mut requests = tokio::task::JoinSet::new();
|
||||
queries.into_iter().for_each(|query| {
|
||||
@ -895,7 +895,7 @@ pub fn dispatch_dane(config: Config, c: cli::network::dane::Command) -> Result<(
|
||||
}
|
||||
}
|
||||
},
|
||||
Get(c) => rt.block_on(async {
|
||||
Fetch(c) => rt.block_on(async {
|
||||
let queries = Query::parse_addresses(&c.addresses)?;
|
||||
let mut requests = tokio::task::JoinSet::new();
|
||||
queries.into_iter().for_each(|query| {
|
||||
|
Loading…
Reference in New Issue
Block a user