EPP (by Ultraspeed)

The EPP gem provides basic functionality for connecting and making requests on EPP (Extensible Provisioning Protocol) servers. Currently, major providers Centralnic and Nominet have been tested.

Installation

You can install this gem with:

$ sudo gem sources -a http://gems.github.com
$ sudo gem install ultraspeed-epp

Then, you can require it in your Ruby app:

require "epp"

If you’re using Rails, add the following line to your Rails config/environment.rb:

config.gem "ultraspeed-epp", :lib => "epp", :source => "http://gems.github.com"

Once you do that, you can install the gem by typing sudo rake gems:install.

Example Usage

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 this however you’d like. The process is as follows:

  • Connect to EPP server, get the <greeting> frame

  • Send a standard <login> request

  • Send your request

  • Send a standard <logout> request

  • Disconnect the socket from the server

The EPP server 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.

Bugs/Issues

Please report all issues using the GitHub issue tracker at:

github.com/ultraspeed/epp/issues

Credit

Author

Josh Delsman at Ultraspeed (twitter.com/voxxit)

Inspired from

labs.centralnic.com/Net_EPP_Client.php

License

The MIT License

Copyright © 2009 Josh Delsman (Ultraspeed)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.