Skip to content

Commit 5203da2

Browse files
update radixtarget
1 parent 62b36f6 commit 5203da2

5 files changed

Lines changed: 17 additions & 11 deletions

File tree

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cloudcheck"
3-
version = "8.1.3"
3+
version = "8.2.0"
44
edition = "2024"
55
description = "CloudCheck is a simple Rust tool to check whether an IP address or hostname belongs to a cloud provider."
66
license = "GPL-3.0"
@@ -13,7 +13,7 @@ reqwest = { version = "0.12", features = ["json"] }
1313
openssl = { version = "0.10", features = ["vendored"] }
1414
pyo3 = { version = "0.27", optional = true }
1515
pyo3-async-runtimes = { version = "0.27", features = ["tokio-runtime"], optional = true }
16-
radixtarget = "4.1"
16+
radixtarget = "4.2"
1717

1818
[features]
1919
default = []

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "cloudcheck"
7-
version = "8.1.3"
7+
version = "8.2.0"
88
description = "Detailed database of cloud providers. Instantly look up a domain or IP address"
99
readme = "README.md"
1010
requires-python = ">=3.9"

src/lib.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use tokio::sync::OnceCell;
99
#[cfg(feature = "py")]
1010
mod python;
1111

12-
const CLOUDCHECK_SIGNATURE_URL: &str = "https://raw.githubusercontent.com/blacklanternsecurity/cloudcheck/refs/heads/cloudcheck-v8/cloud_providers_v2.json";
12+
const CLOUDCHECK_SIGNATURE_URL: &str = "https://raw.githubusercontent.com/blacklanternsecurity/cloudcheck/refs/heads/stable/cloud_providers_v2.json";
1313

1414
#[derive(Debug, Clone, Serialize, Deserialize)]
1515
pub struct CloudProvider {
@@ -104,7 +104,7 @@ impl CloudCheck {
104104
let providers_data: HashMap<String, ProviderData> =
105105
serde_json::from_str(&json_data)?;
106106

107-
let mut radix = RadixTarget::new(&[], ScopeMode::Normal);
107+
let mut radix = RadixTarget::new(&[], ScopeMode::Normal)?;
108108
let mut providers_map: HashMap<String, Vec<CloudProvider>> = HashMap::new();
109109

110110
for (_, provider) in providers_data {
@@ -116,7 +116,10 @@ impl CloudCheck {
116116
for cidr in provider.cidrs {
117117
let normalized = match radix.get(&cidr) {
118118
Some(n) => n,
119-
None => radix.insert(&cidr).unwrap(),
119+
None => match radix.insert(&cidr)? {
120+
Some(n) => n,
121+
None => continue,
122+
},
120123
};
121124
providers_map
122125
.entry(normalized.clone())
@@ -127,7 +130,10 @@ impl CloudCheck {
127130
for domain in provider.domains {
128131
let normalized = match radix.get(&domain) {
129132
Some(n) => n,
130-
None => radix.insert(&domain).unwrap(),
133+
None => match radix.insert(&domain)? {
134+
Some(n) => n,
135+
None => continue,
136+
},
131137
};
132138
providers_map
133139
.entry(normalized.clone())

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)