Default missing type= argument to "registration" in launch:create EPP extension

<launch:create> has an optional type argument, that can take either "application" or "registration":
https://tools.ietf.org/html/rfc8334#section-3.3.1

We get that type via createExtension.get().getCreateType(), where if the type= argument isn't given, the function returns null.

In that case, we need to decide based on the TLD - application for end-date sunrise, and registration for start-date sunrise.

For now we can't do that, because FlowPicker doesn't have access to the TLD information. Until that is fixed we decide as follows:

- landrush and sunrush phases will default to APPLICATION, because there's no possible
registration for it.

- sunrise defaults to REGISTRATION because we're currenly launching start-date sunrise that uses registration.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189942568
This commit is contained in:
guyben 2018-03-21 11:47:14 -07:00 committed by jianglai
parent e525df791f
commit edcb725a18
9 changed files with 211 additions and 9 deletions

View file

@ -1189,4 +1189,59 @@ public class EppLifecycleDomainTest extends EppTestCase {
assertCommandAndResponse("logout.xml", "logout_response.xml");
}
/**
* Test that missing type= argument on launch create works in start-date sunrise.
*
* <p>TODO(b/76095570):have the same exact test on end-date sunrise - using the same .xml file -
* that checks that an application was created.
*/
@Test
public void testDomainCreation_startDateSunrise_noType() throws Exception {
// The signed mark is valid between 2013 and 2017
DateTime sunriseDate = DateTime.parse("2014-09-08T09:09:09Z");
DateTime gaDate = sunriseDate.plusDays(30);
createTld(
"example",
ImmutableSortedMap.of(
START_OF_TIME, TldState.PREDELEGATION,
sunriseDate, TldState.START_DATE_SUNRISE,
gaDate, TldState.GENERAL_AVAILABILITY));
assertCommandAndResponse("login_valid.xml", "login_response.xml", sunriseDate.minusDays(3));
createContactsAndHosts();
// During start-date sunrise, create with mark will succeed but without will fail.
// We also test we can delete without a mark.
assertCommandAndResponse(
"domain_info.xml",
ImmutableMap.of("NAME", "test-validate.example"),
"response_error.xml",
ImmutableMap.of(
"MSG", "The domain with given ID (example.tld) doesn't exist.", "CODE", "2303"),
sunriseDate.plusDays(1));
assertCommandAndResponse(
"domain_create_start_date_sunrise_encoded_mark_no_type.xml",
ImmutableMap.of(),
"domain_create_response.xml",
ImmutableMap.of(
"NAME", "test-validate.example",
"CRDATE", "2014-09-09T09:10:09Z",
"EXDATE", "2015-09-09T09:10:09Z"),
sunriseDate.plusDays(1).plusMinutes(1));
assertCommandAndResponse(
"domain_info_wildcard.xml",
ImmutableMap.of("NAME", "test-validate.example"),
"domain_info_response_ok_wildcard.xml",
ImmutableMap.of(
"NAME", "test-validate.example",
"CRDATE", "2014-09-09T09:10:09Z",
"EXDATE", "2015-09-09T09:10:09Z"),
sunriseDate.plusDays(1).plusMinutes(2));
assertCommandAndResponse("logout.xml", "logout_response.xml");
}
}

View file

@ -1779,6 +1779,24 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
assertNoLordn("0000001761376042759136-65535", null);
}
/**
* Test that missing type= argument on launch create works in start-date sunrise.
*
* <p>TODO(b/76095570):have the same exact test on end-date sunrise - using the same .xml file -
* that checks that an application was created.
*/
@Test
public void testSuccess_startDateSunriseRegistration_withEncodedSignedMark_noType()
throws Exception {
createTld("tld", TldState.START_DATE_SUNRISE);
clock.setTo(DateTime.parse("2014-09-09T09:09:09Z"));
setEppInput("domain_create_sunrise_encoded_signed_mark_no_type.xml");
persistContactsAndHosts();
runFlowAssertResponse(loadFile("domain_create_response_encoded_signed_mark_name.xml"));
assertSuccessfulCreate("tld", false);
assertNoLordn("0000001761376042759136-65535", null);
}
/** Tests possible confusion caused by the common start-date and end-date sunrise LaunchPhase. */
@Test

View file

@ -15,7 +15,8 @@
</create>
<extension>
<launch:create
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0">
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0"
type="application">
<launch:phase>sunrise</launch:phase>
<launch:codeMark>
<launch:code>49FD46E6C4B45C55D4AC</launch:code>

File diff suppressed because one or more lines are too long

View file

@ -19,7 +19,8 @@
</create>
<extension>
<launch:create
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0">
xmlns:launch="urn:ietf:params:xml:ns:launch-1.0"
type="application">
<launch:phase>sunrise</launch:phase>
</launch:create>
</extension>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,38 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<response>
<result code="1000">
<msg>Command completed successfully</msg>
</result>
<resData>
<domain:infData
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>%NAME%</domain:name>
<domain:roid>%ROID%</domain:roid>
<domain:status s="ok"/>
<domain:registrant>jd1234</domain:registrant>
<domain:contact type="admin">sh8013</domain:contact>
<domain:contact type="tech">sh8013</domain:contact>
<domain:ns>
<domain:hostObj>ns1.example.external</domain:hostObj>
<domain:hostObj>ns2.example.external</domain:hostObj>
</domain:ns>
<domain:clID>NewRegistrar</domain:clID>
<domain:crID>NewRegistrar</domain:crID>
<domain:crDate>%CRDATE%</domain:crDate>
<domain:exDate>%EXDATE%</domain:exDate>
<domain:authInfo>
<domain:pw>2fooBAR</domain:pw>
</domain:authInfo>
</domain:infData>
</resData>
<extension>
<rgp:infData xmlns:rgp="urn:ietf:params:xml:ns:rgp-1.0">
<rgp:rgpStatus s="addPeriod"/>
</rgp:infData>
</extension>
<trID>
<clTRID>ABC-12345</clTRID>
<svTRID>server-trid</svTRID>
</trID>
</response>
</epp>

View file

@ -0,0 +1,11 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<info>
<domain:info
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name hosts="all">%NAME%</domain:name>
</domain:info>
</info>
<clTRID>ABC-12345</clTRID>
</command>
</epp>