mirror of
https://github.com/google/nomulus
synced 2026-01-06 21:47:31 +00:00
Return all applicable reserved list entries associated with a label
Instead of only returning the most severe one, return all applicable ones. This is because the reserved list has grown to a list of types that are not strictly comparable but orthogonal to each other. We can no longer depend on the fact that the most severe type incorporates all properties of those beneath it. Therefore returning all of them and treat them one by one in the calling site is the correct behavior. Due to constraint imposed in eppcom.xsd, during domain checks the response can only contain a reservation reason of fewer than 32 characters, therefore we are returning the message for the type with highest severity, in case of multiple reservation types for a label. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149776106
This commit is contained in:
@@ -17,7 +17,7 @@ package google.registry.flows.domain;
|
||||
import static google.registry.flows.FlowUtils.validateClientIsLoggedIn;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyTargetIdCount;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.checkAllowedAccessToTld;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.getReservationType;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.getReservationTypes;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.handleFeeRequest;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.validateDomainName;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.validateDomainNameWithIdnTables;
|
||||
@@ -25,6 +25,7 @@ import static google.registry.flows.domain.DomainFlowUtils.verifyNotInPredelegat
|
||||
import static google.registry.model.EppResourceUtils.checkResourcesExist;
|
||||
import static google.registry.model.index.DomainApplicationIndex.loadActiveApplicationsByDomainName;
|
||||
import static google.registry.model.registry.label.ReservationType.UNRESERVED;
|
||||
import static google.registry.model.registry.label.ReservationType.getTypeOfHighestSeverity;
|
||||
import static google.registry.pricing.PricingEngineProxy.isDomainPremium;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
@@ -179,14 +180,15 @@ public final class DomainCheckFlow implements Flow {
|
||||
}})) {
|
||||
return "Pending allocation";
|
||||
}
|
||||
ReservationType reservationType = getReservationType(domainName);
|
||||
if (reservationType == UNRESERVED
|
||||
ImmutableSet<ReservationType> reservationTypes = getReservationTypes(domainName);
|
||||
if (reservationTypes.equals(ImmutableSet.of(UNRESERVED))
|
||||
&& isDomainPremium(domainName.toString(), now)
|
||||
&& registry.getPremiumPriceAckRequired()
|
||||
&& eppInput.getSingleExtension(FeeCheckCommandExtension.class) == null) {
|
||||
return "Premium names require EPP ext.";
|
||||
}
|
||||
return reservationType.getMessageForCheck();
|
||||
|
||||
return getTypeOfHighestSeverity(reservationTypes).getMessageForCheck();
|
||||
}
|
||||
|
||||
/** Handle the fee check extension. */
|
||||
|
||||
Reference in New Issue
Block a user