test_friendly_rdap_client

Crates.iotest_friendly_rdap_client
lib.rstest_friendly_rdap_client
version0.1.0
sourcesrc
created_at2023-02-14 19:11:09.091755
updated_at2023-02-14 19:11:09.091755
descriptionA fork of the rdap_client crate, with some extra test plumbing.
homepagehttps://github.com/rorymckinley/test_friendly_rdap_client.git
repositoryhttps://github.com/rorymckinley/test_friendly_rdap_client.git
max_upload_size
id785262
size83,214
Rory McKinley (rorymckinley)

documentation

https://docs.rs/test_friendly_rdap_client

README

test_friendly_rdap_client

Async and fast RDAP client and parser for Rust.

Important Note

This is essentially a version of the original rdap_client with a few extra sprinkles to make it a bit easier for me to wire up rdap_client in integration tests.

I initially attempted to keep the code as close to upstream as possible but, unfortunately, crates.io either did not like the way the Cargo.toml was set up or (more likely) I was doing something stupid.

Usage

Add this to your Cargo.toml:

[dependencies]
test_friendly_rdap_client = "0.1"
tokio = "0.2"

and then you can use it like this:

use test_friendly_rdap_client::Client;

#[tokio::main]
async fn main() {
    let client = Client::new();
    let domain_to_check = "nic.cz";
    // Fetch boostrap from IANA.
    let bootstrap = client.fetch_bootstrap().await.unwrap();
    // Find what RDAP server to use for given domain.
    if let Some(servers) = bootstrap.dns.find(&domain_to_check) {
        let response = client.query_domain(&servers[0], domain_to_check).await.unwrap();
        println!("{}", response.handle);
    }
}

Supported standards

Supported extensions

Non standard responses

Not all RDAP servers follows RFC 7483 and then parser cannot parse that responses correctly. If that happend, feel free to open issue with URI that rdap_client could not parse.

Useful articles

Commit count: 60

cargo fmt