Skip to main content

Crate rdapify

Crate rdapify 

Source
Expand description

§rdapify

A unified, secure, high-performance RDAP client library for Rust.

§Features

  • 5 query types: domain, IP, ASN, nameserver, entity
  • SSRF protection built-in — blocks private / loopback / link-local addresses
  • IANA Bootstrap (RFC 9224) — automatically discovers the correct RDAP server
  • In-memory cache — reduces redundant network calls
  • Exponential back-off retries for transient failures
  • Normalised responses — consistent structure regardless of the RDAP server

§Quick start

use rdapify::RdapClient;

#[tokio::main]
async fn main() -> rdapify::error::Result<()> {
    let client = RdapClient::new()?;

    let domain = client.domain("example.com").await?;
    println!("Registrar: {:?}", domain.registrar);
    println!("Expires:   {:?}", domain.expiration_date());

    let ip = client.ip("8.8.8.8").await?;
    println!("Country: {:?}", ip.country);

    let asn = client.asn("AS15169").await?;
    println!("AS Name: {:?}", asn.name);

    let ns = client.nameserver("ns1.google.com").await?;
    println!("IPv4: {:?}", ns.ip_addresses.v4);

    let entity = client.entity("ARIN-HN-1", "https://rdap.arin.net/registry").await?;
    println!("Handle: {:?}", entity.handle);

    Ok(())
}

Re-exports§

pub use error::RdapError;
pub use error::Result;
pub use types::AsnResponse;
pub use types::AvailabilityResult;
pub use types::DomainResponse;
pub use types::EntityResponse;
pub use types::IpResponse;
pub use types::IpVersion;
pub use types::NameserverIpAddresses;
pub use types::NameserverResponse;
pub use types::RdapEntity;
pub use types::RdapEvent;
pub use types::RdapRemark;
pub use types::RdapRole;
pub use types::RdapStatus;
pub use types::RegistrarSummary;
pub use types::ResponseMeta;
pub use cache::CacheConfig;
pub use cache::MemoryCache;
pub use http::FetcherConfig;
pub use http::Normalizer;
pub use security::SsrfConfig;
pub use security::SsrfGuard;
pub use stream::AsnEvent;
pub use stream::DomainEvent;
pub use stream::IpEvent;
pub use stream::NameserverEvent;
pub use stream::StreamConfig;

Modules§

bootstrap
IANA Bootstrap server discovery (RFC 9224).
cache
Response cache layer.
error
Error types for the rdapify library.
http
HTTP layer: fetcher and response normaliser.
security
Security primitives: SSRF protection.
stream
Async streaming API for batch RDAP queries.
types
Public RDAP response types.

Structs§

ClientConfig
Configuration for RdapClient.
RdapClient
The main RDAP client.