Originally *EPP v1.3.1* by Ultraspeed. This fork is maintained by Estonian Internet (.ee). Current release: see VERSION or RubyGems.
The EPP gem provides basic functionality for connecting and making requests on EPP (Extensible Provisioning Protocol) servers. It has been fully tested against the RFC 5730 & 5734 specification.
Currently, major providers Centralnic and Nominet have been integrated using this gem. CoCCA is currently in testing.
You can install this gem with:
$ gem install epp
Then, you can require it in your Ruby/Rails app:
require "epp"
If you’re using Rails, configure your gem in the following file:
# Rails 3 - Gemfile gem "epp"
First, you must initialize an Epp::Server object to use. This requires the EPP server address, tag/username and password:
server = Epp::Server.new( :server => "testbed-epp.nominet.org.uk", :tag => "TESTING", :password => "testing" )
If no port is specified, it will be assumed that you will be using port 700.
You would then make an XML request to the server.
xml = "<?xml ... </epp>" response = server.request(xml)
You can build request XML however you’d like; outgoing frames use libxml-ruby, and login/logout responses are parsed with Nokogiri. The process is as follows:
-
Connect to EPP server and receive the <greeting> frame
-
Send a standard <login> request
-
Send your request
-
Send a standard <logout> request
-
Disconnect the socket from the server
The EPP module would then return the XML response as a string. In this example, the response XML would be set equal to response for your usage.
Once the request is complete, it will automatically close the connection. For simplicity purposes, this plug-in will not use a persistent connection to the EPP server. This may change in future releases, as some registries require that persistent connections be supported. Please open a GitHub issue if you want to collaborate on that.
From this gem’s directory (the one that contains the Dockerfile):
$ docker build -t epp-gem . $ docker run --rm epp-gem
The image uses Ruby 3.0.3 (same as the registry app), installs XML development headers for libxml-ruby, runs +bundle install+, then +bundle exec rake test+.
To re-run tests after changing only Ruby sources (reuse gems from the image):
$ docker run --rm -v "$PWD":/gem -w /gem epp-gem bundle exec rake test
Rebuild the image when Gemfile, epp.gemspec, or Ruby version changes.
Install XML build prerequisites for libxml-ruby (e.g. libxml2-dev and libxslt1-dev on Debian), then:
$ bundle install $ bundle exec rake test
Please report all issues using the GitHub issue tracker at:
github.com/internetee/epp/issues
-
Original author: Josh Delsman (twitter.com/voxxit), Ultraspeed
-
Current maintainer (this fork): Sergei Tsõganov, Estonian Internet (.ee) — [email protected]
-
Inspired from: labs.centralnic.com/Net_EPP_Client.php
See the LICENSE file.