mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Update the ordering of the DomainCreateFlow 'After Validation' extension point
Custom logic to block domain labels is currently being implemented in 'Before Save'. At that point, the default flow has already validated the SMD, premium, and reserved. Only then can we determine if we should block the label, so the 'After Validation' extension point doesn't currently fit the need. However, as a result, if the label is blocked, but the fee extension is missing, a generic fee error is thrown, stating the fee extension must be present. We would rather state that the label is blocked. Then, if the SMD is present, we override the block, validate that the fee is present with the correct price, and allow the domain create. The solution is to move the 'After Validation' extension point to actually be after all validation, including of the SMD, but before the fee check. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=143790163
This commit is contained in:
parent
44972b916a
commit
7fba7c1e4f
1 changed files with 15 additions and 14 deletions
|
@ -200,16 +200,6 @@ public class DomainCreateFlow implements TransactionalFlow {
|
||||||
validateLaunchCreateNotice(launchCreate.getNotice(), domainLabel, isSuperuser, now);
|
validateLaunchCreateNotice(launchCreate.getNotice(), domainLabel, isSuperuser, now);
|
||||||
}
|
}
|
||||||
boolean isSunriseCreate = hasSignedMarks && SUNRISE_STATES.contains(tldState);
|
boolean isSunriseCreate = hasSignedMarks && SUNRISE_STATES.contains(tldState);
|
||||||
customLogic.afterValidation(
|
|
||||||
DomainCreateFlowCustomLogic.AfterValidationParameters.newBuilder()
|
|
||||||
.setDomainName(domainName)
|
|
||||||
.setYears(years)
|
|
||||||
.build());
|
|
||||||
|
|
||||||
FeeCreateCommandExtension feeCreate =
|
|
||||||
eppInput.getSingleExtension(FeeCreateCommandExtension.class);
|
|
||||||
FeesAndCredits feesAndCredits = pricingLogic.getCreatePrice(registry, targetId, now, years);
|
|
||||||
validateFeeChallenge(targetId, registry.getTldStr(), now, feeCreate, feesAndCredits);
|
|
||||||
// Superusers can create reserved domains, force creations on domains that require a claims
|
// Superusers can create reserved domains, force creations on domains that require a claims
|
||||||
// notice without specifying a claims key, ignore the registry phase, and override blocks on
|
// notice without specifying a claims key, ignore the registry phase, and override blocks on
|
||||||
// registering premium domains.
|
// registering premium domains.
|
||||||
|
@ -231,6 +221,20 @@ public class DomainCreateFlow implements TransactionalFlow {
|
||||||
verifyNoOpenApplications(now);
|
verifyNoOpenApplications(now);
|
||||||
verifyIsGaOrIsSpecialCase(tldState, isAnchorTenant);
|
verifyIsGaOrIsSpecialCase(tldState, isAnchorTenant);
|
||||||
}
|
}
|
||||||
|
String signedMarkId = hasSignedMarks
|
||||||
|
// If a signed mark was provided, then it must match the desired domain label. Get the mark
|
||||||
|
// at this point so that we can verify it before the "after validation" extension point.
|
||||||
|
? tmchUtils.verifySignedMarks(launchCreate.getSignedMarks(), domainLabel, now).getId()
|
||||||
|
: null;
|
||||||
|
customLogic.afterValidation(
|
||||||
|
DomainCreateFlowCustomLogic.AfterValidationParameters.newBuilder()
|
||||||
|
.setDomainName(domainName)
|
||||||
|
.setYears(years)
|
||||||
|
.build());
|
||||||
|
FeeCreateCommandExtension feeCreate =
|
||||||
|
eppInput.getSingleExtension(FeeCreateCommandExtension.class);
|
||||||
|
FeesAndCredits feesAndCredits = pricingLogic.getCreatePrice(registry, targetId, now, years);
|
||||||
|
validateFeeChallenge(targetId, registry.getTldStr(), now, feeCreate, feesAndCredits);
|
||||||
SecDnsCreateExtension secDnsCreate =
|
SecDnsCreateExtension secDnsCreate =
|
||||||
validateSecDnsExtension(eppInput.getSingleExtension(SecDnsCreateExtension.class));
|
validateSecDnsExtension(eppInput.getSingleExtension(SecDnsCreateExtension.class));
|
||||||
String repoId = createDomainRepoId(ObjectifyService.allocateId(), registry.getTldStr());
|
String repoId = createDomainRepoId(ObjectifyService.allocateId(), registry.getTldStr());
|
||||||
|
@ -264,10 +268,7 @@ public class DomainCreateFlow implements TransactionalFlow {
|
||||||
.setAutorenewBillingEvent(Key.create(autorenewBillingEvent))
|
.setAutorenewBillingEvent(Key.create(autorenewBillingEvent))
|
||||||
.setAutorenewPollMessage(Key.create(autorenewPollMessage))
|
.setAutorenewPollMessage(Key.create(autorenewPollMessage))
|
||||||
.setLaunchNotice(hasClaimsNotice ? launchCreate.getNotice() : null)
|
.setLaunchNotice(hasClaimsNotice ? launchCreate.getNotice() : null)
|
||||||
.setSmdId(hasSignedMarks
|
.setSmdId(signedMarkId)
|
||||||
// If a signed mark was provided, then it must match the desired domain label.
|
|
||||||
? tmchUtils.verifySignedMarks(launchCreate.getSignedMarks(), domainLabel, now).getId()
|
|
||||||
: null)
|
|
||||||
.setDsData(secDnsCreate == null ? null : secDnsCreate.getDsData())
|
.setDsData(secDnsCreate == null ? null : secDnsCreate.getDsData())
|
||||||
.setRegistrant(command.getRegistrant())
|
.setRegistrant(command.getRegistrant())
|
||||||
.setAuthInfo(command.getAuthInfo())
|
.setAuthInfo(command.getAuthInfo())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue