Skip to main content

Crate internetdata

Crate internetdata 

Source
Expand description

The official Rust client library for the InternetData API: the licensed IP intelligence databases, their metadata and their checksums.

Start with Client::builder and an API key carrying the db.download scope. Every database published today is licensed, so a keyless client is answered 401 - the key is nevertheless OPTIONAL, and a client built without one sends no Authorization header at all. There is no per-address lookup here: the database catalog and the files behind it are reached through Client::database, and the OAuth sign-in, by device flow or by authorization code, through Client::oauth.

let client = internetdata::Client::builder().api_key("your-api-key").build()?;

for database in client.database().list().await? {
    println!("{}: {}", database.base, database.standing);
}

§Async only

Everything here is async on tokio, and there is no blocking facade. reqwest::blocking builds its own runtime and PANICS when constructed inside one, so a facade would fail for exactly the callers most likely to reach for it. A caller with no runtime writes the three lines that make the cost visible:

let runtime = tokio::runtime::Runtime::new()?;
let client = internetdata::Client::builder().api_key("your-api-key").build()?;
let databases = runtime.block_on(client.database().list())?;

Structs§

AuthorizationUrlOptions
What OauthApi::authorization_url_with asks for. A value left unset, or set empty, is left out of the URL rather than sent empty.
Checksums
ChecksumsResponse
Client
A client for the InternetData API.
ClientBuilder
Builds a Client. With nothing set it talks to production with no key, which every endpoint published today answers 401 to.
Database
Database : One database FAMILY, with your organization’s license beside it. A license covers the family, while a download names a specific version, so the ids passed to download and checksum come from versions.
DatabaseApi
The database catalog and its downloads, which is the whole of InternetData’s public surface.
DatabaseMetadata
DatabaseMetadata : The build document written by the exporter, served through unchanged.
DatabaseMetadataColumn
DatabaseVersion
DeviceAuthorization
A device sign-in that has started and is waiting for the person.
DeviceAuthorizationOptions
What OauthApi::device_authorization_with asks for. A value left unset, or set empty, is left out of the request rather than sent empty.
Download
Download : One download ATTEMPT, refusals included.
OauthApi
The OAuth authorization server behind the API: the device flow, the authorization code flow with PKCE, token refresh and revocation.
OauthErrorResponse
What the authorization server said when it refused.
OauthMetadata
The authorization server’s discovery document (RFC 8414).
OauthOptions
One call’s overrides for an OauthApi method.
Pkce
One sign-in’s PKCE pair, from OauthApi::create_pkce: challenge goes into the authorization URL, verifier only to the exchange. Debug leaves the verifier out.
TokenResponse
What a successful token exchange hands over.

Enums§

DatabaseFormat
DatabaseFormat : A file format a database version is published in. A file format a database version is published in.
Error
What every failure from this crate is.
ErrorKind
Why a request failed.
LicenseType
What your license permits you to do with the data. Null when there is no license, which is every family with standing unlicensed.
OauthError
What every OauthApi call fails with.
Outcome
Standing
Standing : Where your license for a database family stands today. licensed is a live grant, expired one whose term has ended, and unlicensed a database published but never bought. An Open database (open) downloads whatever this says. Where your license for a database family stands today. licensed is a live grant, expired one whose term has ended, and unlicensed a database published but never bought. An Open database (open) downloads whatever this says.

Constants§

DEFAULT_BASE_URL
The production API. Override it with ClientBuilder::base_url.