Skip to content

Commit

Permalink
feat: add -k option and some optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebedthan committed Apr 28, 2024
1 parent 128a185 commit bd086be
Show file tree
Hide file tree
Showing 9 changed files with 401 additions and 137 deletions.
190 changes: 188 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xgt"
version = "0.1.0"
version = "0.3.0"
edition = "2021"
authors = ["Anicet Ebou <anicet.ebou@gmail.com>"]
description = "xgt enables efficient querying and parsing of GTDB data"
Expand All @@ -14,7 +14,8 @@ anyhow = "1.0.69"
clap = "4.1.8"
serde = { version ="1.0.153", features = ["derive"] }
serde_json = "1.0.94"
ureq = { version = "2.6.2", features = ["json"] }
ureq = { version = "2.6.2", features = ["json", "native-tls"] }
native-tls = "0.2"

[dev-dependencies]
mockito = "1.0.2"
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ xgt taxon --search --partial g__Escherichia

Full help is available from `xgt --help`.

## Certificate verification

`xgt` through `ureq` performs peer SSL certificate verification by default.
To tell `xgt` to _not_ verify the peer, use `-k/--insecure` option.
Currently (as of Apr 28, 2024), you should add this options to your command to get the desired result as the GTDB API have a certificate issue.


### Minimum supported Rust version
`xgt` minimum [Rust](https://www.rust-lang.org/) version is 1.70.0.
Expand Down
21 changes: 21 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ pub fn build_app() -> Command {
.long("type")
.action(ArgAction::SetTrue)
.help("Search NCBI type material only"),
)
.arg(
Arg::new("insecure")
.short('k')
.long("insecure")
.help("Disable SSL certificate verification")
.action(ArgAction::SetTrue),
),
)
.subcommand(
Expand Down Expand Up @@ -131,6 +138,13 @@ pub fn build_app() -> Command {
.help("Output raw JSON")
.value_name("FILE")
.value_parser(is_existing),
)
.arg(
Arg::new("insecure")
.short('k')
.long("insecure")
.help("Disable SSL certificate verification")
.action(ArgAction::SetTrue),
),
)
.subcommand(
Expand Down Expand Up @@ -198,6 +212,13 @@ pub fn build_app() -> Command {
.long("reps")
.action(ArgAction::SetTrue)
.help("Set taxon V genomes search to lookup reps seqs only"),
)
.arg(
Arg::new("insecure")
.short('k')
.long("insecure")
.help("Disable SSL certificate verification")
.action(ArgAction::SetTrue),
),
)
}
Expand Down
Loading

0 comments on commit bd086be

Please sign in to comment.