mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Change DomainInfoFlowCustomLogic to use the new resData objects
Warning: This is a breaking change to custom logic for domain info. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=146033749
This commit is contained in:
parent
517e374925
commit
565497a6d4
2 changed files with 13 additions and 13 deletions
|
@ -21,6 +21,7 @@ import google.registry.flows.FlowMetadata;
|
|||
import google.registry.flows.SessionMetadata;
|
||||
import google.registry.flows.domain.DomainInfoFlow;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainInfoData;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseExtension;
|
||||
|
@ -90,7 +91,7 @@ public class DomainInfoFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
|
||||
public abstract DomainResource domain();
|
||||
|
||||
public abstract DomainResource resData();
|
||||
public abstract DomainInfoData resData();
|
||||
|
||||
public abstract ImmutableList<? extends ResponseExtension> responseExtensions();
|
||||
|
||||
|
@ -104,7 +105,7 @@ public class DomainInfoFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
|
||||
public abstract Builder setDomain(DomainResource domain);
|
||||
|
||||
public abstract Builder setResData(DomainResource resData);
|
||||
public abstract Builder setResData(DomainInfoData resData);
|
||||
|
||||
public abstract Builder setResponseExtensions(
|
||||
ImmutableList<? extends ResponseExtension> responseExtensions);
|
||||
|
@ -119,7 +120,7 @@ public class DomainInfoFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue
|
||||
public abstract static class BeforeResponseReturnData extends ImmutableObject {
|
||||
|
||||
public abstract DomainResource resData();
|
||||
public abstract DomainInfoData resData();
|
||||
|
||||
public abstract ImmutableList<? extends ResponseExtension> responseExtensions();
|
||||
|
||||
|
@ -131,7 +132,7 @@ public class DomainInfoFlowCustomLogic extends BaseFlowCustomLogic {
|
|||
@AutoValue.Builder
|
||||
public abstract static class Builder {
|
||||
|
||||
public abstract Builder setResData(DomainResource resData);
|
||||
public abstract Builder setResData(DomainInfoData resData);
|
||||
|
||||
public abstract Builder setResponseExtensions(
|
||||
ImmutableList<? extends ResponseExtension> responseExtensions);
|
||||
|
|
|
@ -93,14 +93,6 @@ public final class DomainInfoFlow implements Flow {
|
|||
DomainResource domain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
verifyOptionalAuthInfo(authInfo, domain);
|
||||
customLogic.afterValidation(AfterValidationParameters.newBuilder().setDomain(domain).build());
|
||||
BeforeResponseReturnData responseData =
|
||||
customLogic.beforeResponse(
|
||||
BeforeResponseParameters.newBuilder()
|
||||
.setDomain(domain)
|
||||
.setResData(domain)
|
||||
.setResponseExtensions(getDomainResponseExtensions(domain, now))
|
||||
.build());
|
||||
domain = responseData.resData();
|
||||
prefetchReferencedResources(domain);
|
||||
// Registrars can only see a few fields on unauthorized domains.
|
||||
// This is a policy decision that is left up to us by the rfcs.
|
||||
|
@ -130,8 +122,15 @@ public final class DomainInfoFlow implements Flow {
|
|||
.setLastTransferTime(domain.getLastTransferTime())
|
||||
.setAuthInfo(domain.getAuthInfo());
|
||||
}
|
||||
return responseBuilder
|
||||
BeforeResponseReturnData responseData =
|
||||
customLogic.beforeResponse(
|
||||
BeforeResponseParameters.newBuilder()
|
||||
.setDomain(domain)
|
||||
.setResData(infoBuilder.build())
|
||||
.setResponseExtensions(getDomainResponseExtensions(domain, now))
|
||||
.build());
|
||||
return responseBuilder
|
||||
.setResData(responseData.resData())
|
||||
.setExtensions(responseData.responseExtensions())
|
||||
.build();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue