Go to file
Dirkjan Ochtman 14ffc8db01 Change MessageAck message_id to be a &str
While all the examples in RFC 5730 use numbers, there is nothing
normative in section 2.9.2.3 that constrains msgID to be a number.
And if we look at the XML Schema, we find that msgID is defined
to be of type `token`, which seems to be defined as a string
that does not contain line feeds, carriage returns, tabs, leading
or trailing spaces or multiple spaces.

While we might define a more specific token type in the future,
for now sticking with just &str seems reasonable and this also
matches the type for `MessageQueue::id`.
2022-08-05 02:22:54 +08:00
src Change MessageAck message_id to be a &str 2022-08-05 02:22:54 +08:00
tests Add test for dropping request future 2022-03-14 23:41:41 +08:00
.drone.yml update doc and release 0.4 2022-07-26 14:49:37 +08:00
.gitignore update doc and release 0.4 2022-07-26 14:49:37 +08:00
Cargo.toml update doc and release 0.4 2022-07-26 14:49:37 +08:00
LICENSE added MIT licence 2021-07-27 01:51:28 +08:00
README.md update doc and release 0.4 2022-07-26 14:49:37 +08:00

README.md

EPP (Extensible Provisioning Protocol) Library for Domain Registration and Management

Build Documentation

Description

epp-client is a client library written in Rust for Internet domain registration and management for domain registrars.

It supports the following basic Domain, Contact, Host, and Message management calls, with plans to add more calls and other EPP extensions in the future, and to eventually be RFC compliant with the EPP protocol.

  • Domain Check

  • Domain Create

  • Domain Info

  • Domain Update

  • Domain Delete

  • Domain Renew

  • Domain Transfer

  • Contact Check

  • Contact Create

  • Contact Info

  • Contact Update

  • Contact Delete

  • Host Check

  • Host Create

  • Host Info

  • Host Update

  • Host Delete

  • Message Poll

  • Message Ack

  • RGP Restore Request

  • RGP Restore Report

Usage

Just add the following to your project's Cargo.toml

epp-client = "0.4"

Operation

You can create a mut variable of type EppClient with the domain registry config.

use std::net::ToSocketAddrs;
use std::time::Duration;

use epp_client::EppClient;
use epp_client::domain::DomainCheck;
use epp_client::login::Login;

#[tokio::main]
async fn main() {
    // Create an instance of EppClient
    let host = "example.com";
    let addr = (host, 700).to_socket_addrs().unwrap().next().unwrap();
    let timeout = Duration::from_secs(5);
    let mut client = match EppClient::connect("registry_name".to_string(), addr, host, None, timeout).await {
        Ok(client) => client,
        Err(e) => panic!("Failed to create EppClient: {}",  e)
    };

    let login = Login::new("username", "password", None);
    client.transact(&login, "transaction-id").await.unwrap();

    // Execute an EPP Command against the registry with distinct request and response objects
    let domain_check = DomainCheck { domains: &["eppdev.com", "eppdev.net"] };
    let response = client.transact(&domain_check, "transaction-id").await.unwrap();

    response.res_data.unwrap().list
        .iter()
        .for_each(|chk| println!("Domain: {}, Available: {}", chk.id, chk.available));
}

The output would look like this:

Domain: eppdev.com, Available: 1
Domain: eppdev.net, Available: 1

Request

Currently I don't have access to a registry's OT&E account to do extensive testing. I am using hexonet's EPP Gateway for testing, but access to a registry's OT&E account would be very helpful, so if anyone could help me out with one I would be very grateful!