mirror of
https://github.com/internetee/epp_proxy.git
synced 2025-08-15 03:53:48 +02:00
Send frame as request paramater as well
Here's what happens: When a client sends simple command without any values in XML, registry can drop the `raw_frame` parameter completely. If so, it relies on `frame` parameter being passed on to create XML document. https://github.com/internetee/registry/blame/ad823391b75509d5be20ee6ef217aa4f35a4c994/lib/epp_constraint.rb#L14 Fix involves sending the XML string twice, as `frame` and `raw_frame`, the same as `mod_epp` did.
This commit is contained in:
parent
f00a17b89f
commit
e99733aaf0
5 changed files with 36 additions and 16 deletions
15
EXAMPLES.md
15
EXAMPLES.md
|
@ -23,6 +23,14 @@ Login
|
||||||
</command>
|
</command>
|
||||||
</epp>
|
</epp>
|
||||||
|
|
||||||
|
Logout without any parameters
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
|
||||||
|
<command>
|
||||||
|
<logout/>
|
||||||
|
</command>
|
||||||
|
</epp>
|
||||||
|
|
||||||
Logout
|
Logout
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||||
|
@ -44,6 +52,13 @@ Logout
|
||||||
</command>
|
</command>
|
||||||
</epp>
|
</epp>
|
||||||
|
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
|
||||||
|
<command>
|
||||||
|
<logout/>
|
||||||
|
</command>
|
||||||
|
</epp>
|
||||||
|
|
||||||
Poll
|
Poll
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||||
|
|
26
README.md
26
README.md
|
@ -28,19 +28,19 @@ The application listens on predefined TCP port for formatted EPP frames and tran
|
||||||
HTTP requests according to the following matrix. Application performs regex search for clTRID and an
|
HTTP requests according to the following matrix. Application performs regex search for clTRID and an
|
||||||
XPATH search for command name. It does not check against any XSD schema.
|
XPATH search for command name. It does not check against any XSD schema.
|
||||||
|
|
||||||
| EPP Command | HTTP request | Parameters | Headers | Payload Type | Cookies |
|
| EPP Command | HTTP request | Parameters | Headers | Payload Type | Cookies |
|
||||||
|-------------|----------------------------------|---------------------|---------------------------------------------------------------------|----------------|---------|
|
|-------------|----------------------------------|----------------------------|---------------------------------------------------------------------|----------------|---------|
|
||||||
| hello | `GET /epp_session_url/hello` | | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | | session |
|
| hello | `GET /epp_session_url/hello` | | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | | session |
|
||||||
| login | `POST /epp_session_url/login` | `raw_frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
| login | `POST /epp_session_url/login` | `raw_frame, frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
||||||
| logout | `POST /epp_session_url/logout` | `raw_frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
| logout | `POST /epp_session_url/logout` | `raw_frame, frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
||||||
| poll | `POST /epp_command_url/poll` | `raw_frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
| poll | `POST /epp_command_url/poll` | `raw_frame, frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
||||||
| check | `POST /epp_command_url/check` | `raw_frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
| check | `POST /epp_command_url/check` | `raw_frame, frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
||||||
| info | `POST /epp_command_url/info` | `raw_frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
| info | `POST /epp_command_url/info` | `raw_frame, frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
||||||
| create | `POST /epp_command_url/create` | `raw_frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
| create | `POST /epp_command_url/create` | `raw_frame, frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
||||||
| delete | `POST /epp_command_url/delete` | `raw_frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
| delete | `POST /epp_command_url/delete` | `raw_frame, frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
||||||
| renew | `POST /epp_command_url/renew` | `raw_frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
| renew | `POST /epp_command_url/renew` | `raw_frame, frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
||||||
| update | `POST /epp_command_url/update` | `raw_frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
| update | `POST /epp_command_url/update` | `raw_frame, frame, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | form/multipart | session |
|
||||||
| ANY (error) | `GET /epp_error_url` | `msg, code, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | query params | session |
|
| ANY (error) | `GET /epp_error_url` | `msg, code, clTRID` | SSL-CLIENT-CERT, SSL-CLIENT-S-DN-CN, User-Agent, X-Forwarded-for | query params | session |
|
||||||
|
|
||||||
Error route is used in case EPP frame is malformed.
|
Error route is used in case EPP frame is malformed.
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,10 @@ class EppServer < Roda
|
||||||
end
|
end
|
||||||
|
|
||||||
r.post "logout" do
|
r.post "logout" do
|
||||||
render("session/logout")
|
# Additional check if passes empty frame
|
||||||
|
if r.params['frame']
|
||||||
|
render("session/logout")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -82,10 +82,10 @@ request_from_map(#{command := Command,
|
||||||
%% Return form data or an empty list.
|
%% Return form data or an empty list.
|
||||||
request_body(?helloCommand, _, _) -> "";
|
request_body(?helloCommand, _, _) -> "";
|
||||||
request_body(_Command, RawFrame, nomatch) ->
|
request_body(_Command, RawFrame, nomatch) ->
|
||||||
{multipart, [{<<"raw_frame">>, RawFrame}]};
|
{multipart, [{<<"raw_frame">>, RawFrame}, {<<"frame">>, RawFrame}]};
|
||||||
request_body(_Command, RawFrame, ClTRID) ->
|
request_body(_Command, RawFrame, ClTRID) ->
|
||||||
{multipart,
|
{multipart,
|
||||||
[{<<"raw_frame">>, RawFrame}, {<<"clTRID">>, ClTRID}]}.
|
[{<<"raw_frame">>, RawFrame}, {<<"frame">>, RawFrame}, {<<"clTRID">>, ClTRID}]}.
|
||||||
|
|
||||||
%% Return a list of properties that each represent a query part in a query string.
|
%% Return a list of properties that each represent a query part in a query string.
|
||||||
%% [{"user", "eis"}]} becomes later https://example.com?user=eis
|
%% [{"user", "eis"}]} becomes later https://example.com?user=eis
|
||||||
|
|
|
@ -61,6 +61,7 @@ command_request_builder_test_case(_Config) ->
|
||||||
"http://localhost:9292/command/create",
|
"http://localhost:9292/command/create",
|
||||||
{multipart,
|
{multipart,
|
||||||
[{<<"raw_frame">>,"Some XML here"},
|
[{<<"raw_frame">>,"Some XML here"},
|
||||||
|
{<<"frame">>,"Some XML here"},
|
||||||
{<<"clTRID">>,"EE-123456789"}]},
|
{<<"clTRID">>,"EE-123456789"}]},
|
||||||
[<<"session=Random; Version=1">>],
|
[<<"session=Random; Version=1">>],
|
||||||
[{"User-Agent",<<"EPP proxy">>}], "create"},
|
[{"User-Agent",<<"EPP proxy">>}], "create"},
|
||||||
|
@ -74,6 +75,7 @@ registry_unreachable_test_case(_Config) ->
|
||||||
"http://localhost:9999/someurl",
|
"http://localhost:9999/someurl",
|
||||||
{multipart,
|
{multipart,
|
||||||
[{<<"raw_frame">>,"Some XML here"},
|
[{<<"raw_frame">>,"Some XML here"},
|
||||||
|
{<<"frame">>,"Some XML here"},
|
||||||
{<<"clTRID">>,"EE-123456789"}]},
|
{<<"clTRID">>,"EE-123456789"}]},
|
||||||
[<<"session=Random; Version=1">>],
|
[<<"session=Random; Version=1">>],
|
||||||
[{"User-Agent",<<"EPP proxy">>}], "create"},
|
[{"User-Agent",<<"EPP proxy">>}], "create"},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue