Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cloudflare api to fix removed field #60

Merged
merged 2 commits into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions Cargo.lock

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

99 changes: 24 additions & 75 deletions Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ rec {
features = {
"default" = [ "std" ];
};
resolvedDefaultFeatures = [ "alloc" "default" "std" ];
resolvedDefaultFeatures = [ "alloc" ];
};
"base64 0.21.4" = rec {
crateName = "base64";
Expand Down Expand Up @@ -660,7 +660,7 @@ rec {
"winapi" = [ "windows-targets" ];
"windows-targets" = [ "dep:windows-targets" ];
};
resolvedDefaultFeatures = [ "alloc" "android-tzdata" "clock" "default" "iana-time-zone" "js-sys" "oldtime" "serde" "std" "wasm-bindgen" "wasmbind" "winapi" "windows-targets" ];
resolvedDefaultFeatures = [ "alloc" "android-tzdata" "clock" "iana-time-zone" "js-sys" "serde" "std" "wasm-bindgen" "wasmbind" "winapi" "windows-targets" ];
};
"clap" = rec {
crateName = "clap";
Expand Down Expand Up @@ -808,38 +808,24 @@ rec {
};
"cloudflare" = rec {
crateName = "cloudflare";
version = "0.10.1";
version = "0.12.0";
edition = "2018";
workspace_member = null;
src = pkgs.fetchgit {
url = "https://github.com/jcgruenhage/cloudflare-rs.git";
rev = "02397fc4211886548a31a0731b240f2e17309de4";
sha256 = "0njiqhsyxgl8064maj8shagvkamf6rb89k5wgxqkh47q1l0vi580";
url = "https://github.com/Wyn-Price/cloudflare-rs.git";
rev = "a6179f8b3b520b17788f39fcd5f103e81a87a890";
sha256 = "1myga8ys6i35qnwg16kcc212b8r0acpi8wyhmcvzk0vvffcbkw7k";
};
authors = [
"Areg Harutyunyan <[email protected]>"
"Noah Kennedy <[email protected]>"
"Jeff Hiner <[email protected]>"
];
dependencies = [
{
name = "anyhow";
packageId = "anyhow";
}
{
name = "async-trait";
packageId = "async-trait";
}
{
name = "base64";
packageId = "base64 0.13.1";
}
{
name = "cfg-if";
packageId = "cfg-if";
}
{
name = "chrono";
packageId = "chrono";
features = [ "serde" ];
usesDefaultFeatures = false;
features = [ "clock" "serde" "std" "wasmbind" ];
}
{
name = "http";
Expand All @@ -853,7 +839,7 @@ rec {
name = "reqwest";
packageId = "reqwest";
usesDefaultFeatures = false;
features = [ "json" "blocking" ];
features = [ "json" ];
}
{
name = "serde";
Expand All @@ -865,12 +851,17 @@ rec {
packageId = "serde_json";
}
{
name = "serde_qs";
packageId = "serde_qs";
name = "serde_urlencoded";
packageId = "serde_urlencoded";
}
{
name = "serde_with";
packageId = "serde_with";
features = [ "base64" ];
}
{
name = "thiserror";
packageId = "thiserror";
}
{
name = "url";
Expand All @@ -879,12 +870,14 @@ rec {
{
name = "uuid";
packageId = "uuid";
features = [ "serde" "v4" ];
features = [ "serde" ];
}
];
features = {
"blocking" = [ "reqwest/blocking" ];
"default" = [ "default-tls" ];
"default-tls" = [ "reqwest/default-tls" ];
"mockito" = [ "dep:mockito" ];
"rustls-tls" = [ "reqwest/rustls-tls" ];
};
resolvedDefaultFeatures = [ "default" "default-tls" ];
Expand Down Expand Up @@ -4062,7 +4055,7 @@ rec {
"wasm-streams" = [ "dep:wasm-streams" ];
"webpki-roots" = [ "dep:webpki-roots" ];
};
resolvedDefaultFeatures = [ "__tls" "blocking" "default-tls" "hyper-tls" "json" "native-tls-crate" "serde_json" "tokio-native-tls" ];
resolvedDefaultFeatures = [ "__tls" "default-tls" "hyper-tls" "json" "native-tls-crate" "serde_json" "tokio-native-tls" ];
};
"rustc-demangle" = rec {
crateName = "rustc-demangle";
Expand Down Expand Up @@ -4414,44 +4407,6 @@ rec {
};
resolvedDefaultFeatures = [ "alloc" "default" "std" ];
};
"serde_qs" = rec {
crateName = "serde_qs";
version = "0.10.1";
edition = "2018";
sha256 = "1yhsx3b1g1ccdzpkbfrh0vnrh2wirb575bm14cwk7zm25hg3zb4c";
authors = [
"Sam Scott <[email protected]>"
];
dependencies = [
{
name = "percent-encoding";
packageId = "percent-encoding";
}
{
name = "serde";
packageId = "serde";
}
{
name = "thiserror";
packageId = "thiserror";
}
];
features = {
"actix-web2" = [ "dep:actix-web2" ];
"actix-web3" = [ "dep:actix-web3" ];
"actix-web4" = [ "dep:actix-web4" ];
"actix2" = [ "actix-web2" "futures" ];
"actix3" = [ "actix-web3" "futures" ];
"actix4" = [ "actix-web4" "futures" ];
"axum" = [ "axum-framework" "futures" ];
"axum-framework" = [ "dep:axum-framework" ];
"futures" = [ "dep:futures" ];
"tracing" = [ "dep:tracing" ];
"warp" = [ "futures" "tracing" "warp-framework" ];
"warp-framework" = [ "dep:warp-framework" ];
};
resolvedDefaultFeatures = [ "default" ];
};
"serde_urlencoded" = rec {
crateName = "serde_urlencoded";
version = "0.7.1";
Expand Down Expand Up @@ -4565,7 +4520,7 @@ rec {
"std" = [ "alloc" "serde/std" "chrono_0_4?/clock" "chrono_0_4?/std" "indexmap_1?/std" "time_0_3?/serde-well-known" "time_0_3?/std" ];
"time_0_3" = [ "dep:time_0_3" ];
};
resolvedDefaultFeatures = [ "alloc" "default" "macros" "std" ];
resolvedDefaultFeatures = [ "alloc" "base64" "default" "macros" "std" ];
};
"serde_with_macros" = rec {
crateName = "serde_with_macros";
Expand Down Expand Up @@ -5820,12 +5775,6 @@ rec {
"Hunar Roop Kahlon<[email protected]>"
];
dependencies = [
{
name = "getrandom";
packageId = "getrandom";
rename = "getrandom";
optional = true;
}
{
name = "serde";
packageId = "serde";
Expand Down Expand Up @@ -5860,7 +5809,7 @@ rec {
"wasm-bindgen" = [ "dep:wasm-bindgen" ];
"zerocopy" = [ "dep:zerocopy" ];
};
resolvedDefaultFeatures = [ "default" "getrandom" "rng" "serde" "std" "v4" ];
resolvedDefaultFeatures = [ "default" "serde" "std" ];
};
"vcpkg" = rec {
crateName = "vcpkg";
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ log = "0.4.8"
pretty_env_logger = "0.5.0"
public-ip = "^0.2"
tokio = { version = "^1", features = ["rt-multi-thread", "macros"] }
cloudflare = "^0.10"
cloudflare = "^0.12"
anyhow = "^1"
clap-verbosity-flag = "^2.0"
local-ip-address = "^0.5.0"
Expand All @@ -19,7 +19,7 @@ version = "^4.4"
features = ["wrap_help", "derive", "env"]

[patch.crates-io]
cloudflare = { git = "https://github.com/jcgruenhage/cloudflare-rs.git", branch = "make-owner-fields-optional" }
cloudflare = { git = "https://github.com/Wyn-Price/cloudflare-rs.git", branch = "wyn/zone-details" }
public-ip = { git = "https://github.com/jcgruenhage/rust-public-ip.git", branch = "cloudflare-provider" }

[profile.release]
Expand Down
4 changes: 2 additions & 2 deletions crate-hashes.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"cloudflare 0.10.1 (git+https://github.com/jcgruenhage/cloudflare-rs.git?branch=make-owner-fields-optional#02397fc4211886548a31a0731b240f2e17309de4)": "0njiqhsyxgl8064maj8shagvkamf6rb89k5wgxqkh47q1l0vi580",
"public-ip 0.2.2 (git+https://github.com/jcgruenhage/rust-public-ip.git?branch=cloudflare-provider#f0f0e68aebf9d796deaa3af04c8c6d4df3c515fe)": "0djzfp08rja39hyh9z9q180s4nycbixh5f19nglp78q087vn2dqc"
"git+https://github.com/Wyn-Price/cloudflare-rs.git?branch=wyn%2Fzone-details#[email protected]": "1myga8ys6i35qnwg16kcc212b8r0acpi8wyhmcvzk0vvffcbkw7k",
"git+https://github.com/jcgruenhage/rust-public-ip.git?branch=cloudflare-provider#[email protected]": "0djzfp08rja39hyh9z9q180s4nycbixh5f19nglp78q087vn2dqc"
}
4 changes: 2 additions & 2 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ pub fn get_client(cli: &Cli) -> Result<Client> {
Err(anyhow::anyhow!("No valid credentials passed"))
}?;

Client::new(
Ok(Client::new(
credentials,
HttpApiClientConfig::default(),
Environment::Production,
)
)?)
}
5 changes: 1 addition & 4 deletions src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ use cloudflare::{
},
zone::{ListZones, ListZonesParams},
},
framework::{
async_api::{ApiClient, Client},
SearchMatch,
},
framework::{async_api::Client, SearchMatch},
};
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
use std::sync::Arc;
Expand Down
2 changes: 1 addition & 1 deletion src/ip.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::dns::{Fqdn, Requests, ZoneId};
use anyhow::Result;
use cloudflare::endpoints::dns::{DnsContent, DnsRecord};
use cloudflare::framework::async_api::{ApiClient, Client};
use cloudflare::framework::async_api::Client;
use local_ip_address as local;
use public_ip::{http, Version};
use std::net::IpAddr;
Expand Down