Skip to content

Commit 7ad6fc6

Browse files
authored
Merge pull request #102 from icann/dev
Dev
2 parents 6783f9a + c4f7eab commit 7ad6fc6

File tree

10 files changed

+201
-352
lines changed

10 files changed

+201
-352
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ members = [
88
resolver = "2"
99

1010
[workspace.package]
11-
version = "0.0.20"
11+
version = "0.0.21"
1212
edition = "2021"
1313
license = "MIT OR Apache-2.0"
1414
repository = "https://github.com/icann/icann-rdap"

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,19 @@ About
1212

1313
This repository hosts 4 separate packages (i.e. Rust crates):
1414

15-
* [icann-rdap-cli](icann-rdap-cli/README.md) is the Command Line Interface client. This package produces an executable binary.
16-
* [icann-rdap-client](icann-rdap-client/README.md) is a library handling making RDAP requests.
17-
* [icann-rdap-common](icann-rdap-common/README.md) is a library of RDAP structures.
15+
* [icann-rdap-cli](icann-rdap-cli/README.md) is the Command Line Interface client and testing tool.
16+
* [icann-rdap-client](icann-rdap-client/README.md) is a Rust library handling making RDAP requests.
17+
* [icann-rdap-common](icann-rdap-common/README.md) is a Rust library of RDAP structures.
1818
* [icann-rdap-srv](icann-rdap-srv/README.md) is a simple, in-memory RDAP server. This package produces multiple executable binaries.
1919

20+
![Example of rdap command](https://github.com/icann/icann-rdap/wiki/images/rdap_command.png)
21+
22+
Installation and Usage
23+
----------------------
24+
25+
See the [project wiki](https://github.com/icann/icann-rdap/wiki) for information on installation
26+
and usage of this software.
27+
2028
License
2129
-------
2230

icann-rdap-cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ An RDAP Command Line Interface client.
1010

1111
[dependencies]
1212

13-
icann-rdap-client = { version = "0.0.20", path = "../icann-rdap-client" }
14-
icann-rdap-common = { version = "0.0.20", path = "../icann-rdap-common" }
13+
icann-rdap-client = { version = "0.0.21", path = "../icann-rdap-client" }
14+
icann-rdap-common = { version = "0.0.21", path = "../icann-rdap-common" }
1515

1616
anyhow.workspace = true
1717
clap.workspace = true

icann-rdap-cli/README.md

Lines changed: 10 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,152 +1,24 @@
11
ICANN RDAP CLI
22
==============
33

4+
This package consists of the following commands:
5+
* The [`rdap`](https://github.com/icann/icann-rdap/wiki/RDAP-command) command is a general-purpose RDAP command line client.
6+
* The [`rdap-test`](https://github.com/icann/icann-rdap/wiki/RDAP-TEST-command) command is a testing tool for RDAP.
7+
8+
![Example of rdap command](https://github.com/icann/icann-rdap/wiki/images/rdap_command.png)
9+
410
This is a command-line interface (CLI) client for the Registration Data Access Protocol (RDAP) written and sponsored
511
by the Internet Corporation for Assigned Names and Numbers [(ICANN)](https://www.icann.org).
612
RDAP is standard of the [IETF](https://ietf.org/), and extensions
713
to RDAP are a current work activity of the IETF's [REGEXT working group](https://datatracker.ietf.org/wg/regext/documents/).
814
More information on ICANN's role in RDAP can be found [here](https://www.icann.org/rdap).
915
General information on RDAP can be found [here](https://rdap.rcode3.com/).
1016

11-
Installing the RDAP Client
12-
--------------------------
13-
14-
### Pre-Built Binaries
15-
16-
Pre-built binaries are available for most mainstream systems: x86_64 and Arm 64bit for Linux GNU systems, x86_64 and Arm 64bit
17-
macOS, and x86_64 for Windows. You may find the pre-built binaries on the [Releases](https://github.com/icann/icann-rdap/releases)
18-
page.
19-
20-
For non-Ubuntu Linux, compiling from crates.io or source (both are easy) is recommended to avoid issues with dynamic linking to OpenSSL.
21-
22-
### Compiling from crates.io
23-
24-
If you have [Rust](https://www.rust-lang.org/) installed on your system, then compiling from source is
25-
very straightforward. If you do not have Rust installed on your system, it is usually very easy to do:
26-
see [Rustup](https://rustup.rs/).
27-
28-
If you are on a Linux system, you will need OpenSSL development files. For Debian and Ubuntu, this is
29-
usually done via `apt install pkg-config libssl-dev`. For other Linux systems, consult your packaging
30-
documentation.
31-
32-
For macOS and Windows, the native TLS libraries are used, and there are no steps needed to install them.
33-
34-
To build and install: `cargo install icann-rdap-cli`.
35-
36-
### Compiling from Source
37-
38-
If you have [Rust](https://www.rust-lang.org/) installed on your system, then compiling from source is
39-
very straightforward. If you do not have Rust installed on your system, it is usually very easy to do:
40-
see [Rustup](https://rustup.rs/).
41-
42-
If you are on a Linux system, you will need OpenSSL development files. For Debian and Ubuntu, this is
43-
usually done via `apt install pkg-config libssl-dev`. For other Linux systems, consult your packaging
44-
documentation.
45-
46-
For macOS and Windows, the native TLS libraries are used, and there are no steps needed to install them.
47-
48-
Run the tests: `cargo test`
49-
50-
Then build the software: `cargo build --release`. The 'rdap' executable binary will be available in the `target/release` directory.
51-
52-
Using the RDAP Client
53-
---------------------
54-
55-
The basic usage is `rdap XXX` where XXX is a domain name, IP address, AS number, etc...
56-
57-
For more advanced usage, run `rdap --help` which should yield the extensive help guide.
58-
59-
Paging Output
60-
-------------
61-
62-
The client has a built-in (embedded) pager. Use of this pager is controlled via the `RDAP_PAGING`
63-
environment variable and the `-P` command argument.
64-
65-
It takes three values:
66-
67-
* "embedded" - use the built-in pager
68-
* "auto" - use the built-in pager if the program is being run from a terminal
69-
* "none" - use no paging
70-
71-
For example, `-P embedded` will default to using the built-in pager.
72-
73-
By default, the client will not use a pager.
74-
75-
When set to "auto", the client determines if a pager is appropriate.
76-
This is done by attempting to determine if the terminal is interactive or not. If the terminal
77-
is not interactive, paging will be turned off otherwise it will be on.
78-
79-
Output Format
80-
-------------
81-
82-
By default, the client will attempt to determine the output format of the information. If it determines the shell
83-
is interactive, output will be in `rendered-markdown`. Otherwise, the output will be JSON.
84-
85-
You can explicitly control this behavior using the `-O` command argument or the `RDAP_OUTPUT` environment variable
86-
(see below).
87-
88-
Directing Queries To A Specific Server
89-
--------------------------------------
90-
91-
By default, the client will use the RDAP bootstrap files provided by IANA to determine the authoritative server
92-
for the information being requested. These IANA files have the "base URLs" for the RDAP servers.
93-
94-
You can override this behavior by either specifying a base "object tag" from the IANA object tags registry or with
95-
an explicit URL.
96-
97-
An object tag can be specified with the `-b` command argument or the `RDAP_BASE` environment variable (see below).
98-
For example, `-b arin` will direct the client to find the ARIN server in the RDAP object tag registry.
99-
100-
An explicit base URL can be specified using the `-B` command or the `RDAP_BASE_URL` environment variable.
101-
102-
Caching
103-
-------
104-
105-
By default, the client will cache data based on the request URL and "self" links provided in the RDAP results.
106-
107-
This can be turned off with the `-N` command parameter or by setting the `RDAP_NO_CACHE` environment variable to "true".
108-
109-
Logging
110-
-------
111-
112-
The client logs errors, warning, and other information on its processing. This can be controlled with the
113-
`--log-level` command argument or the `RDAP_LOG` environment variable.
114-
115-
Secure Connections
116-
------------------
117-
118-
By default, the client will use secure connections. The following arguments and environment variables can be used
119-
to modify this behavior:
120-
121-
* `-T` or `RDAP_ALLOW_HTTP` : RDAP servers should be using HTTPS. When given or set to true, HTTP will be allowed.
122-
* `-K` or `RDAP_ALLOW_INVALID_HOST_NAMES` : Allows HTTPS connections in which the host name does not match the certificate.
123-
* `-I` or `RDAP_ALLOW_INVALID_CERTIFICATES` : Allows HTTPS connections in which the TLS certificate is invalid.
124-
125-
Configuration
126-
-------------
127-
128-
Configuration of this program may be set using environment variables or
129-
using an environment variables configuration file in the configuration
130-
directory of this program. An example is automatically written to the
131-
configuration directory. This configuraiton file may be customized by
132-
uncommenting out the provided environment variable settings.
133-
134-
The location of the configuration file is platform dependent.
135-
136-
On Linux, this file is located at $XDG_CONFIG_HOME/rdap/rdap.env or
137-
$HOME/.config/rdap/rdap.env.
138-
139-
On macOS, this file is located at
140-
$HOME/Library/Application Support/rdap/rdap.env.
141-
142-
On Windows, this file is located at
143-
{FOLDERID_RoamingAppData}\rdap\config\rdap.env.
144-
145-
Resetting
146-
---------
17+
Installation and Usage
18+
----------------------
14719

148-
Use the `--reset` argument to reset all client state. This will remove the RDAP and IANA caches and
149-
reset the `rdap.env` file (see above) to the default.
20+
See the [project wiki](https://github.com/icann/icann-rdap/wiki) for information on installation
21+
and usage of this software.
15022

15123

15224
License

icann-rdap-cli/src/rt/exec.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub async fn execute_tests<'a, BS: BootstrapStore>(
9393
QueryType::Url(url) => url.to_owned(),
9494
_ => {
9595
let base_url = qtype_to_bootstrap_url(&bs_client, bs, value, |reg| {
96-
debug!("Fetching IANA registry {} for value {value}", reg.url())
96+
info!("Fetching IANA registry {} for value {value}", reg.url())
9797
})
9898
.await?;
9999
value.query_url(&base_url)?
@@ -102,12 +102,13 @@ pub async fn execute_tests<'a, BS: BootstrapStore>(
102102
// if they URL to test is a referral
103103
if options.chase_referral {
104104
let client = create_client(client_config)?;
105+
info!("Fetching referral from {query_url}");
105106
let response_data = rdap_url_request(&query_url, &client).await?;
106107
query_url = get_related_links(&response_data.rdap)
107108
.first()
108109
.ok_or(TestExecutionError::NoReferralToChase)?
109110
.to_string();
110-
debug!("Chasing referral {query_url}");
111+
info!("Referral is {query_url}");
111112
}
112113

113114
let parsed_url = Url::parse(&query_url)?;
@@ -132,6 +133,7 @@ pub async fn execute_tests<'a, BS: BootstrapStore>(
132133
let mut test_run = TestRun::new_v4(vec![], v4, port);
133134
if !options.skip_v4 && more_runs {
134135
let client = create_client_with_addr(client_config, host, test_run.socket_addr)?;
136+
info!("Sending request to {}", test_run.socket_addr);
135137
let rdap_response = rdap_url_request(&query_url, &client).await;
136138
test_run = test_run.end(rdap_response, options);
137139
}
@@ -144,6 +146,7 @@ pub async fn execute_tests<'a, BS: BootstrapStore>(
144146
.origin(HeaderValue::from_str(&options.origin_value)?)
145147
.build();
146148
let client = create_client_with_addr(&client_config, host, test_run.socket_addr)?;
149+
info!("Sending request to {}", test_run.socket_addr);
147150
let rdap_response = rdap_url_request(&query_url, &client).await;
148151
test_run = test_run.end(rdap_response, options);
149152
}
@@ -159,6 +162,7 @@ pub async fn execute_tests<'a, BS: BootstrapStore>(
159162
let mut test_run = TestRun::new_v6(vec![], v6, port);
160163
if !options.skip_v6 && more_runs {
161164
let client = create_client_with_addr(client_config, host, test_run.socket_addr)?;
165+
info!("Sending request to {}", test_run.socket_addr);
162166
let rdap_response = rdap_url_request(&query_url, &client).await;
163167
test_run = test_run.end(rdap_response, options);
164168
}
@@ -171,6 +175,7 @@ pub async fn execute_tests<'a, BS: BootstrapStore>(
171175
.origin(HeaderValue::from_str(&options.origin_value)?)
172176
.build();
173177
let client = create_client_with_addr(&client_config, host, test_run.socket_addr)?;
178+
info!("Sending request to {}", test_run.socket_addr);
174179
let rdap_response = rdap_url_request(&query_url, &client).await;
175180
test_run = test_run.end(rdap_response, options);
176181
}

icann-rdap-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ An RDAP client library.
1010

1111
[dependencies]
1212

13-
icann-rdap-common = { version = "0.0.20", path = "../icann-rdap-common" }
13+
icann-rdap-common = { version = "0.0.21", path = "../icann-rdap-common" }
1414

1515
buildstructor.workspace = true
1616
cidr.workspace = true

0 commit comments

Comments
 (0)