diff --git a/core/src/main/java/google/registry/flows/domain/DomainDeleteFlow.java b/core/src/main/java/google/registry/flows/domain/DomainDeleteFlow.java index 1b1285c65..6414aa93b 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainDeleteFlow.java +++ b/core/src/main/java/google/registry/flows/domain/DomainDeleteFlow.java @@ -77,6 +77,7 @@ import google.registry.model.domain.fee.FeeTransformResponseExtension; import google.registry.model.domain.fee06.FeeDeleteResponseExtensionV06; import google.registry.model.domain.fee11.FeeDeleteResponseExtensionV11; import google.registry.model.domain.fee12.FeeDeleteResponseExtensionV12; +import google.registry.model.domain.feestdv1.FeeDeleteResponseExtensionStdV1; import google.registry.model.domain.metadata.MetadataExtension; import google.registry.model.domain.rgp.GracePeriodStatus; import google.registry.model.domain.secdns.SecDnsCreateExtension; @@ -428,6 +429,9 @@ public final class DomainDeleteFlow implements MutatingFlow, SqlStatementLogging @Nullable private FeeTransformResponseExtension.Builder getDeleteResponseBuilder() { Set uris = nullToEmpty(sessionMetadata.getServiceExtensionUris()); + if (uris.contains(ServiceExtension.FEE_1_00.getUri())) { + return new FeeDeleteResponseExtensionStdV1.Builder(); + } if (uris.contains(ServiceExtension.FEE_0_12.getUri())) { return new FeeDeleteResponseExtensionV12.Builder(); } diff --git a/core/src/main/java/google/registry/model/domain/fee/Fee.java b/core/src/main/java/google/registry/model/domain/fee/Fee.java index a0bed40a4..d364a17a3 100644 --- a/core/src/main/java/google/registry/model/domain/fee/Fee.java +++ b/core/src/main/java/google/registry/model/domain/fee/Fee.java @@ -64,6 +64,7 @@ public class Fee extends BaseFee { public static final ImmutableSet FEE_EXTENSION_URIS = ImmutableSet.of( + ServiceExtension.FEE_1_00.getUri(), ServiceExtension.FEE_0_12.getUri(), ServiceExtension.FEE_0_11.getUri(), ServiceExtension.FEE_0_6.getUri()); diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckCommandExtensionItemStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckCommandExtensionItemStdV1.java new file mode 100644 index 000000000..fb74aa5a7 --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckCommandExtensionItemStdV1.java @@ -0,0 +1,112 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.model.domain.feestdv1; + +import com.google.common.base.Ascii; +import google.registry.model.domain.Period; +import google.registry.model.domain.fee.FeeCheckCommandExtensionItem; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; +import java.util.Locale; +import java.util.Optional; +import org.joda.money.CurrencyUnit; +import org.joda.time.DateTime; + +/** + * An individual price check item in version 1.0 of the fee extension on domain check commands. + * Items look like: + * + *
{@code
+ * 
+ *   1
+ *   premium
+ *   2017-05-17T13:22:21.0Z
+ * 
+ * }
+ */ +@XmlType(propOrder = {"period", "feeClass", "feeDate"}) +public class FeeCheckCommandExtensionItemStdV1 extends FeeCheckCommandExtensionItem { + + /** The default validity period (if not specified) is 1 year for all operations. */ + static final Period DEFAULT_PERIOD = Period.create(1, Period.Unit.YEARS); + + @XmlAttribute(name = "name") + String commandName; + + @XmlAttribute String phase; + + @XmlAttribute String subphase; + + @XmlElement(name = "class") + String feeClass; + + @XmlElement(name = "date") + DateTime feeDate; + + /** Version 1.0 does not support domain name or currency in fee extension items. */ + @Override + public boolean isDomainNameSupported() { + return false; + } + + @Override + public String getDomainName() { + throw new UnsupportedOperationException("Domain not supported"); + } + + @Override + public CurrencyUnit getCurrency() { + return null; // This version of the fee extension doesn't specify currency per-item. + } + + @Override + public String getUnparsedCommandName() { + return commandName; + } + + @Override + public CommandName getCommandName() { + // Require the xml string to be lowercase. + if (commandName != null && commandName.toLowerCase(Locale.ENGLISH).equals(commandName)) { + try { + return CommandName.valueOf(Ascii.toUpperCase(commandName)); + } catch (IllegalArgumentException e) { + // Swallow this and return UNKNOWN below because there's no matching CommandName. + } + } + return CommandName.UNKNOWN; + } + + @Override + public String getPhase() { + return phase; + } + + @Override + public String getSubphase() { + return subphase; + } + + @Override + public FeeCheckResponseExtensionItemStdV1.Builder createResponseBuilder() { + return new FeeCheckResponseExtensionItemStdV1.Builder(); + } + + @Override + public Optional getEffectiveDate() { + return Optional.ofNullable(feeDate); + } +} diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckCommandExtensionStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckCommandExtensionStdV1.java new file mode 100644 index 000000000..aaa2ba016 --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckCommandExtensionStdV1.java @@ -0,0 +1,63 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.model.domain.feestdv1; + +import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy; + +import com.google.common.collect.ImmutableList; +import google.registry.model.ImmutableObject; +import google.registry.model.domain.fee.FeeCheckCommandExtension; +import google.registry.model.domain.fee.FeeCheckResponseExtensionItem; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; +import java.util.List; +import org.joda.money.CurrencyUnit; + +/** Version 1.0 of the fee extension that may be present on domain check commands. */ +@XmlRootElement(name = "check") +@XmlType(propOrder = {"currency", "items"}) +public class FeeCheckCommandExtensionStdV1 extends ImmutableObject + implements FeeCheckCommandExtension< + FeeCheckCommandExtensionItemStdV1, FeeCheckResponseExtensionStdV1> { + + CurrencyUnit currency; + + @Override + public CurrencyUnit getCurrency() { + return currency; + } + + @XmlElement(name = "command") + List items; + + @Override + public ImmutableList getItems() { + return nullToEmptyImmutableCopy(items); + } + + @Override + public FeeCheckResponseExtensionStdV1 createResponse( + ImmutableList items) { + ImmutableList.Builder builder = + new ImmutableList.Builder<>(); + for (FeeCheckResponseExtensionItem item : items) { + if (item instanceof FeeCheckResponseExtensionItemStdV1) { + builder.add((FeeCheckResponseExtensionItemStdV1) item); + } + } + return FeeCheckResponseExtensionStdV1.create(currency, builder.build()); + } +} diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionItemCommandStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionItemCommandStdV1.java new file mode 100644 index 000000000..8571dcf3d --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionItemCommandStdV1.java @@ -0,0 +1,119 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.model.domain.feestdv1; + +import static google.registry.util.CollectionUtils.forceEmptyToNull; + +import com.google.common.base.Ascii; +import com.google.common.collect.ImmutableList; +import google.registry.model.Buildable; +import google.registry.model.ImmutableObject; +import google.registry.model.domain.Period; +import google.registry.model.domain.fee.Fee; +import google.registry.model.domain.fee.FeeQueryCommandExtensionItem.CommandName; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; +import java.util.List; +import org.joda.time.DateTime; + +/** The version 1.0 response command entity for a domain check on a single resource. */ +@XmlType(propOrder = {"period", "fee", "feeClass", "effectiveDate", "notAfterDate"}) +public class FeeCheckResponseExtensionItemCommandStdV1 extends ImmutableObject { + + /** The command that was checked. */ + @XmlAttribute(name = "name") + String commandName; + + /** The phase that was checked. */ + @XmlAttribute String phase; + + /** The subphase that was checked. */ + @XmlAttribute String subphase; + + /** The period that was checked. */ + Period period; + + /** + * The magnitude of the fee, in the specified units, with an optional description. + * + *

This is a list because a single operation can involve multiple fees. + */ + List fee; + + /** + * The type of the fee. + * + *

We will use "premium" for fees on premium names, and omit the field otherwise. + */ + @XmlElement(name = "class") + String feeClass; + + /** The effective date that the check is to be performed on (if specified in the query). */ + @XmlElement(name = "date") + DateTime effectiveDate; + + /** The date after which the quoted fee is no longer valid (if applicable). */ + @XmlElement(name = "notAfter") + DateTime notAfterDate; + + public String getFeeClass() { + return feeClass; + } + + /** Builder for {@link FeeCheckResponseExtensionItemCommandStdV1}. */ + public static class Builder extends Buildable.Builder { + + public Builder setCommandName(CommandName commandName) { + getInstance().commandName = Ascii.toLowerCase(commandName.name()); + return this; + } + + public Builder setPhase(String phase) { + getInstance().phase = phase; + return this; + } + + public Builder setSubphase(String subphase) { + getInstance().subphase = subphase; + return this; + } + + public Builder setPeriod(Period period) { + getInstance().period = period; + return this; + } + + public Builder setEffectiveDate(DateTime effectiveDate) { + getInstance().effectiveDate = effectiveDate; + return this; + } + + public Builder setNotAfterDate(DateTime notAfterDate) { + getInstance().notAfterDate = notAfterDate; + return this; + } + + public Builder setFee(List fees) { + getInstance().fee = forceEmptyToNull(ImmutableList.copyOf(fees)); + return this; + } + + public Builder setClass(String feeClass) { + getInstance().feeClass = feeClass; + return this; + } + } +} diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionItemStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionItemStdV1.java new file mode 100644 index 000000000..cbbd9530a --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionItemStdV1.java @@ -0,0 +1,122 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.model.domain.feestdv1; + +import static google.registry.util.CollectionUtils.forceEmptyToNull; + +import com.google.common.collect.ImmutableList; +import google.registry.model.domain.DomainObjectSpec; +import google.registry.model.domain.Period; +import google.registry.model.domain.fee.Fee; +import google.registry.model.domain.fee.FeeCheckResponseExtensionItem; +import google.registry.model.domain.fee.FeeQueryCommandExtensionItem.CommandName; +import jakarta.xml.bind.annotation.XmlType; +import org.joda.time.DateTime; + +/** The version 1.0 response for a domain check on a single resource. */ +@XmlType(propOrder = {"object", "command"}) +public class FeeCheckResponseExtensionItemStdV1 extends FeeCheckResponseExtensionItem { + + /** The domain that was checked. */ + DomainObjectSpec object; + + /** The command that was checked. */ + FeeCheckResponseExtensionItemCommandStdV1 command; + + /** + * This method is overridden and not annotated for JAXB because this version of the extension + * doesn't support "period". + */ + @Override + public Period getPeriod() { + return super.getPeriod(); + } + + /** + * This method is overridden and not annotated for JAXB because this version of the extension + * doesn't support "fee". + */ + @Override + public ImmutableList getFees() { + return super.getFees(); + } + + /** + * This method is not annotated for JAXB because this version of the extension doesn't support + * "feeClass" and because the data comes off of the command object rather than a field. + */ + @Override + public String getFeeClass() { + return command.getFeeClass(); + } + + /** Builder for {@link FeeCheckResponseExtensionItemStdV1}. */ + public static class Builder + extends FeeCheckResponseExtensionItem.Builder { + + final FeeCheckResponseExtensionItemCommandStdV1.Builder commandBuilder = + new FeeCheckResponseExtensionItemCommandStdV1.Builder(); + + @Override + public Builder setCommand(CommandName commandName, String phase, String subphase) { + commandBuilder.setCommandName(commandName); + commandBuilder.setPhase(phase); + commandBuilder.setSubphase(subphase); + return this; + } + + @Override + public Builder setPeriod(Period period) { + commandBuilder.setPeriod(period); + return this; + } + + @Override + public Builder setFees(ImmutableList fees) { + commandBuilder.setFee(forceEmptyToNull(ImmutableList.copyOf(fees))); + return this; + } + + @Override + public Builder setClass(String feeClass) { + commandBuilder.setClass(feeClass); + return this; + } + + @Override + public Builder setDomainNameIfSupported(String name) { + getInstance().object = new DomainObjectSpec(name); + return this; + } + + @Override + public FeeCheckResponseExtensionItemStdV1 build() { + getInstance().command = commandBuilder.build(); + return super.build(); + } + + @Override + public Builder setEffectiveDateIfSupported(DateTime effectiveDate) { + commandBuilder.setEffectiveDate(effectiveDate); + return this; + } + + @Override + public Builder setNotAfterDateIfSupported(DateTime notAfterDate) { + commandBuilder.setNotAfterDate(notAfterDate); + return this; + } + } +} diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionStdV1.java new file mode 100644 index 000000000..d28b3796d --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionStdV1.java @@ -0,0 +1,59 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.model.domain.feestdv1; + +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableList; +import google.registry.model.ImmutableObject; +import google.registry.model.domain.fee.FeeCheckResponseExtension; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; +import org.joda.money.CurrencyUnit; + +/** + * An XML data object that represents version 1.0 of the fee extension that may be present on the + * response to EPP domain check commands. + */ +@XmlRootElement(name = "chkData") +@XmlType(propOrder = {"currency", "items"}) +public class FeeCheckResponseExtensionStdV1 extends ImmutableObject + implements FeeCheckResponseExtension { + + CurrencyUnit currency; + + /** Check responses. */ + @XmlElement(name = "cd") + ImmutableList items; + + @Override + public void setCurrencyIfSupported(CurrencyUnit currency) { + this.currency = currency; + } + + @VisibleForTesting + @Override + public ImmutableList getItems() { + return items; + } + + static FeeCheckResponseExtensionStdV1 create( + CurrencyUnit currency, ImmutableList items) { + FeeCheckResponseExtensionStdV1 instance = new FeeCheckResponseExtensionStdV1(); + instance.currency = currency; + instance.items = items; + return instance; + } +} diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeCreateCommandExtensionStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCreateCommandExtensionStdV1.java new file mode 100644 index 000000000..296fc212f --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCreateCommandExtensionStdV1.java @@ -0,0 +1,45 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.model.domain.feestdv1; + +import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy; + +import com.google.common.collect.ImmutableList; +import google.registry.model.domain.fee.Credit; +import google.registry.model.domain.fee.FeeCreateCommandExtension; +import google.registry.model.domain.fee.FeeTransformResponseExtension; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; +import java.util.List; + +/** A fee extension that may be present on domain create commands. */ +@XmlRootElement(name = "create") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeCreateCommandExtensionStdV1 extends FeeCreateCommandExtension { + + @XmlElement(name = "credit") + List credits; + + @Override + public ImmutableList getCredits() { + return nullToEmptyImmutableCopy(credits); + } + + @Override + public FeeTransformResponseExtension.Builder createResponseBuilder() { + return new FeeTransformResponseExtension.Builder(new FeeCreateResponseExtensionStdV1()); + } +} diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeCreateResponseExtensionStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCreateResponseExtensionStdV1.java new file mode 100644 index 000000000..5491392c2 --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCreateResponseExtensionStdV1.java @@ -0,0 +1,27 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.model.domain.feestdv1; + +import google.registry.model.domain.fee.FeeTransformResponseExtension; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; + +/** + * An XML data object that represents a fee extension that may be present on the response to EPP + * domain create commands. + */ +@XmlRootElement(name = "creData") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeCreateResponseExtensionStdV1 extends FeeTransformResponseExtension {} diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeDeleteResponseExtensionStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeDeleteResponseExtensionStdV1.java new file mode 100644 index 000000000..0350e9ce4 --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeDeleteResponseExtensionStdV1.java @@ -0,0 +1,35 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.model.domain.feestdv1; + +import google.registry.model.domain.fee.FeeTransformResponseExtension; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; + +/** + * An XML data object that represents a fee extension that may be present on the response to EPP + * domain create commands. + */ +@XmlRootElement(name = "delData") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeDeleteResponseExtensionStdV1 extends FeeTransformResponseExtension { + + /** Builder for {@link FeeDeleteResponseExtensionStdV1}. */ + public static class Builder extends FeeTransformResponseExtension.Builder { + public Builder() { + super(new FeeDeleteResponseExtensionStdV1()); + } + } +} diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeRenewCommandExtensionStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeRenewCommandExtensionStdV1.java new file mode 100644 index 000000000..305cabbae --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeRenewCommandExtensionStdV1.java @@ -0,0 +1,45 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.model.domain.feestdv1; + +import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy; + +import com.google.common.collect.ImmutableList; +import google.registry.model.domain.fee.Credit; +import google.registry.model.domain.fee.FeeRenewCommandExtension; +import google.registry.model.domain.fee.FeeTransformResponseExtension; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; +import java.util.List; + +/** A fee extension that may be present on domain renew commands. */ +@XmlRootElement(name = "renew") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeRenewCommandExtensionStdV1 extends FeeRenewCommandExtension { + + @XmlElement(name = "credit") + List credits; + + @Override + public ImmutableList getCredits() { + return nullToEmptyImmutableCopy(credits); + } + + @Override + public FeeTransformResponseExtension.Builder createResponseBuilder() { + return new FeeTransformResponseExtension.Builder(new FeeRenewResponseExtensionStdV1()); + } +} diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeRenewResponseExtensionStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeRenewResponseExtensionStdV1.java new file mode 100644 index 000000000..ea6f8a2fe --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeRenewResponseExtensionStdV1.java @@ -0,0 +1,27 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.model.domain.feestdv1; + +import google.registry.model.domain.fee.FeeTransformResponseExtension; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; + +/** + * An XML data object that represents a fee extension that may be present on the response to EPP + * domain renew commands. + */ +@XmlRootElement(name = "renData") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeRenewResponseExtensionStdV1 extends FeeTransformResponseExtension {} diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeTransferCommandExtensionStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeTransferCommandExtensionStdV1.java new file mode 100644 index 000000000..1f6ae4fa5 --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeTransferCommandExtensionStdV1.java @@ -0,0 +1,45 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.model.domain.feestdv1; + +import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy; + +import com.google.common.collect.ImmutableList; +import google.registry.model.domain.fee.Credit; +import google.registry.model.domain.fee.FeeTransferCommandExtension; +import google.registry.model.domain.fee.FeeTransformResponseExtension; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; +import java.util.List; + +/** A fee extension that may be present on domain transfer requests. */ +@XmlRootElement(name = "transfer") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeTransferCommandExtensionStdV1 extends FeeTransferCommandExtension { + + @XmlElement(name = "credit") + List credits; + + @Override + public ImmutableList getCredits() { + return nullToEmptyImmutableCopy(credits); + } + + @Override + public FeeTransformResponseExtension.Builder createResponseBuilder() { + return new FeeTransformResponseExtension.Builder(new FeeTransferResponseExtensionStdV1()); + } +} diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeTransferResponseExtensionStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeTransferResponseExtensionStdV1.java new file mode 100644 index 000000000..ac04e785a --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeTransferResponseExtensionStdV1.java @@ -0,0 +1,27 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.model.domain.feestdv1; + +import google.registry.model.domain.fee.FeeTransformResponseExtension; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; + +/** + * An XML data object that represents a fee extension that may be present on the response to EPP + * domain transfer requests. + */ +@XmlRootElement(name = "trnData") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeTransferResponseExtensionStdV1 extends FeeTransformResponseExtension {} diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeUpdateCommandExtensionStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeUpdateCommandExtensionStdV1.java new file mode 100644 index 000000000..5e3e51d02 --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeUpdateCommandExtensionStdV1.java @@ -0,0 +1,45 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.model.domain.feestdv1; + +import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy; + +import com.google.common.collect.ImmutableList; +import google.registry.model.domain.fee.Credit; +import google.registry.model.domain.fee.FeeTransformResponseExtension; +import google.registry.model.domain.fee.FeeUpdateCommandExtension; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; +import java.util.List; + +/** A fee extension that may be present on domain update commands. */ +@XmlRootElement(name = "update") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeUpdateCommandExtensionStdV1 extends FeeUpdateCommandExtension { + + @XmlElement(name = "credit") + List credits; + + @Override + public ImmutableList getCredits() { + return nullToEmptyImmutableCopy(credits); + } + + @Override + public FeeTransformResponseExtension.Builder createResponseBuilder() { + return new FeeTransformResponseExtension.Builder(new FeeUpdateResponseExtensionStdV1()); + } +} diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeUpdateResponseExtensionStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeUpdateResponseExtensionStdV1.java new file mode 100644 index 000000000..2b22f7c6c --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeUpdateResponseExtensionStdV1.java @@ -0,0 +1,27 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package google.registry.model.domain.feestdv1; + +import google.registry.model.domain.fee.FeeTransformResponseExtension; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; + +/** + * An XML data object that represents a fee extension that may be present on the response to EPP + * domain update commands. + */ +@XmlRootElement(name = "updData") +@XmlType(propOrder = {"currency", "fees", "credits"}) +public class FeeUpdateResponseExtensionStdV1 extends FeeTransformResponseExtension {} diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/package-info.java b/core/src/main/java/google/registry/model/domain/feestdv1/package-info.java new file mode 100644 index 000000000..b99a8baea --- /dev/null +++ b/core/src/main/java/google/registry/model/domain/feestdv1/package-info.java @@ -0,0 +1,34 @@ +// Copyright 2025 The Nomulus Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +@XmlSchema( + namespace = "urn:ietf:params:xml:ns:epp:fee-1.0", + xmlns = @XmlNs(prefix = "fee_1_00", namespaceURI = "urn:ietf:params:xml:ns:epp:fee-1.0"), + elementFormDefault = XmlNsForm.QUALIFIED) +@XmlAccessorType(XmlAccessType.FIELD) +@XmlJavaTypeAdapters({ + @XmlJavaTypeAdapter(CurrencyUnitAdapter.class), + @XmlJavaTypeAdapter(UtcDateTimeAdapter.class) +}) +package google.registry.model.domain.feestdv1; + +import google.registry.model.adapters.CurrencyUnitAdapter; +import google.registry.xml.UtcDateTimeAdapter; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlNs; +import jakarta.xml.bind.annotation.XmlNsForm; +import jakarta.xml.bind.annotation.XmlSchema; +import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapters; diff --git a/core/src/main/java/google/registry/model/eppcommon/EppXmlTransformer.java b/core/src/main/java/google/registry/model/eppcommon/EppXmlTransformer.java index 42d4daa81..91c64d8e7 100644 --- a/core/src/main/java/google/registry/model/eppcommon/EppXmlTransformer.java +++ b/core/src/main/java/google/registry/model/eppcommon/EppXmlTransformer.java @@ -43,6 +43,7 @@ public class EppXmlTransformer { "fee06.xsd", "fee11.xsd", "fee12.xsd", + "fee-std-v1.xsd", "metadata.xsd", "mark.xsd", "dsig.xsd", diff --git a/core/src/main/java/google/registry/model/eppcommon/ProtocolDefinition.java b/core/src/main/java/google/registry/model/eppcommon/ProtocolDefinition.java index d6d6423b5..5b57b59bc 100644 --- a/core/src/main/java/google/registry/model/eppcommon/ProtocolDefinition.java +++ b/core/src/main/java/google/registry/model/eppcommon/ProtocolDefinition.java @@ -25,6 +25,8 @@ import google.registry.model.domain.fee11.FeeCheckCommandExtensionV11; import google.registry.model.domain.fee11.FeeCheckResponseExtensionV11; import google.registry.model.domain.fee12.FeeCheckCommandExtensionV12; import google.registry.model.domain.fee12.FeeCheckResponseExtensionV12; +import google.registry.model.domain.feestdv1.FeeCheckCommandExtensionStdV1; +import google.registry.model.domain.feestdv1.FeeCheckResponseExtensionStdV1; import google.registry.model.domain.launch.LaunchCreateExtension; import google.registry.model.domain.metadata.MetadataExtension; import google.registry.model.domain.rgp.RgpUpdateExtension; @@ -54,6 +56,7 @@ public class ProtocolDefinition { FEE_0_6(FeeCheckCommandExtensionV06.class, FeeCheckResponseExtensionV06.class, true), FEE_0_11(FeeCheckCommandExtensionV11.class, FeeCheckResponseExtensionV11.class, true), FEE_0_12(FeeCheckCommandExtensionV12.class, FeeCheckResponseExtensionV12.class, true), + FEE_1_00(FeeCheckCommandExtensionStdV1.class, FeeCheckResponseExtensionStdV1.class, true), METADATA_1_0(MetadataExtension.class, null, false); private final Class commandExtensionClass; diff --git a/core/src/main/java/google/registry/model/eppinput/EppInput.java b/core/src/main/java/google/registry/model/eppinput/EppInput.java index 04855737c..b2c55ad00 100644 --- a/core/src/main/java/google/registry/model/eppinput/EppInput.java +++ b/core/src/main/java/google/registry/model/eppinput/EppInput.java @@ -40,6 +40,11 @@ import google.registry.model.domain.fee12.FeeCreateCommandExtensionV12; import google.registry.model.domain.fee12.FeeRenewCommandExtensionV12; import google.registry.model.domain.fee12.FeeTransferCommandExtensionV12; import google.registry.model.domain.fee12.FeeUpdateCommandExtensionV12; +import google.registry.model.domain.feestdv1.FeeCheckCommandExtensionStdV1; +import google.registry.model.domain.feestdv1.FeeCreateCommandExtensionStdV1; +import google.registry.model.domain.feestdv1.FeeRenewCommandExtensionStdV1; +import google.registry.model.domain.feestdv1.FeeTransferCommandExtensionStdV1; +import google.registry.model.domain.feestdv1.FeeUpdateCommandExtensionStdV1; import google.registry.model.domain.launch.LaunchCheckExtension; import google.registry.model.domain.launch.LaunchCreateExtension; import google.registry.model.domain.launch.LaunchDeleteExtension; @@ -348,6 +353,13 @@ public class EppInput extends ImmutableObject { @XmlElementRef(type = FeeTransferCommandExtensionV12.class), @XmlElementRef(type = FeeUpdateCommandExtensionV12.class), + // Fee extension standard version 1.0 (RFC 8748) + @XmlElementRef(type = FeeCheckCommandExtensionStdV1.class), + @XmlElementRef(type = FeeCreateCommandExtensionStdV1.class), + @XmlElementRef(type = FeeRenewCommandExtensionStdV1.class), + @XmlElementRef(type = FeeTransferCommandExtensionStdV1.class), + @XmlElementRef(type = FeeUpdateCommandExtensionStdV1.class), + // Launch phase extensions @XmlElementRef(type = LaunchCheckExtension.class), @XmlElementRef(type = LaunchCreateExtension.class), diff --git a/core/src/main/java/google/registry/model/eppoutput/EppResponse.java b/core/src/main/java/google/registry/model/eppoutput/EppResponse.java index 4d0543773..3572f59b4 100644 --- a/core/src/main/java/google/registry/model/eppoutput/EppResponse.java +++ b/core/src/main/java/google/registry/model/eppoutput/EppResponse.java @@ -43,6 +43,12 @@ import google.registry.model.domain.fee12.FeeDeleteResponseExtensionV12; import google.registry.model.domain.fee12.FeeRenewResponseExtensionV12; import google.registry.model.domain.fee12.FeeTransferResponseExtensionV12; import google.registry.model.domain.fee12.FeeUpdateResponseExtensionV12; +import google.registry.model.domain.feestdv1.FeeCheckResponseExtensionStdV1; +import google.registry.model.domain.feestdv1.FeeCreateResponseExtensionStdV1; +import google.registry.model.domain.feestdv1.FeeDeleteResponseExtensionStdV1; +import google.registry.model.domain.feestdv1.FeeRenewResponseExtensionStdV1; +import google.registry.model.domain.feestdv1.FeeTransferResponseExtensionStdV1; +import google.registry.model.domain.feestdv1.FeeUpdateResponseExtensionStdV1; import google.registry.model.domain.launch.LaunchCheckResponseExtension; import google.registry.model.domain.rgp.RgpInfoExtension; import google.registry.model.domain.secdns.SecDnsInfoExtension; @@ -142,6 +148,12 @@ public class EppResponse extends ImmutableObject implements ResponseOrGreeting { @XmlElementRef(type = FeeRenewResponseExtensionV12.class), @XmlElementRef(type = FeeTransferResponseExtensionV12.class), @XmlElementRef(type = FeeUpdateResponseExtensionV12.class), + @XmlElementRef(type = FeeCheckResponseExtensionStdV1.class), + @XmlElementRef(type = FeeCreateResponseExtensionStdV1.class), + @XmlElementRef(type = FeeDeleteResponseExtensionStdV1.class), + @XmlElementRef(type = FeeRenewResponseExtensionStdV1.class), + @XmlElementRef(type = FeeTransferResponseExtensionStdV1.class), + @XmlElementRef(type = FeeUpdateResponseExtensionStdV1.class), @XmlElementRef(type = LaunchCheckResponseExtension.class), @XmlElementRef(type = RgpInfoExtension.class), @XmlElementRef(type = SecDnsInfoExtension.class) diff --git a/core/src/main/java/google/registry/xjc/XjcXmlTransformer.java b/core/src/main/java/google/registry/xjc/XjcXmlTransformer.java index 55c772b9b..e3df02cba 100644 --- a/core/src/main/java/google/registry/xjc/XjcXmlTransformer.java +++ b/core/src/main/java/google/registry/xjc/XjcXmlTransformer.java @@ -29,38 +29,40 @@ import java.nio.charset.Charset; /** Static methods for marshalling to and from the generated classes. */ public class XjcXmlTransformer { - private static final XmlTransformer INSTANCE = new XmlTransformer( - XjcXmlTransformer.class.getPackage(), - // Hardcoded XML schemas, ordered with respect to dependency. - new ImmutableMap.Builder() - .put("eppcom", "eppcom.xsd") - .put("epp", "epp.xsd") - .put("contact", "contact.xsd") - .put("host", "host.xsd") - .put("domain", "domain.xsd") - .put("rgp", "rgp.xsd") - .put("secdns", "secdns.xsd") - .put("mark", "mark.xsd") - .put("dsig", "dsig.xsd") - .put("smd", "smd.xsd") - .put("fee06", "fee06.xsd") - .put("fee11", "fee11.xsd") - .put("fee12", "fee12.xsd") - .put("launch", "launch.xsd") - .put("rde", "rde.xsd") - .put("rdeheader", "rde-header.xsd") - .put("rdereport", "rde-report.xsd") - .put("rdecontact", "rde-contact.xsd") - .put("rdehost", "rde-host.xsd") - .put("rdeidn", "rde-idn.xsd") - .put("rdedomain", "rde-domain.xsd") - .put("rdeeppparams", "rde-eppparams.xsd") - .put("rdenndn", "rde-nndn.xsd") - .put("rdenotification", "rde-notification.xsd") - .put("rdepolicy", "rde-policy.xsd") - .put("rderegistrar", "rde-registrar.xsd") - .put("iirdea", "iirdea.xsd") - .build()); + private static final XmlTransformer INSTANCE = + new XmlTransformer( + XjcXmlTransformer.class.getPackage(), + // Hardcoded XML schemas, ordered with respect to dependency. + new ImmutableMap.Builder() + .put("eppcom", "eppcom.xsd") + .put("epp", "epp.xsd") + .put("contact", "contact.xsd") + .put("host", "host.xsd") + .put("domain", "domain.xsd") + .put("rgp", "rgp.xsd") + .put("secdns", "secdns.xsd") + .put("mark", "mark.xsd") + .put("dsig", "dsig.xsd") + .put("smd", "smd.xsd") + .put("fee06", "fee06.xsd") + .put("fee11", "fee11.xsd") + .put("fee12", "fee12.xsd") + .put("fee_1_00", "fee-std-v1.xsd") + .put("launch", "launch.xsd") + .put("rde", "rde.xsd") + .put("rdeheader", "rde-header.xsd") + .put("rdereport", "rde-report.xsd") + .put("rdecontact", "rde-contact.xsd") + .put("rdehost", "rde-host.xsd") + .put("rdeidn", "rde-idn.xsd") + .put("rdedomain", "rde-domain.xsd") + .put("rdeeppparams", "rde-eppparams.xsd") + .put("rdenndn", "rde-nndn.xsd") + .put("rdenotification", "rde-notification.xsd") + .put("rdepolicy", "rde-policy.xsd") + .put("rderegistrar", "rde-registrar.xsd") + .put("iirdea", "iirdea.xsd") + .build()); public static XmlTransformer get() { return INSTANCE; diff --git a/core/src/main/java/google/registry/xjc/bindings.xjb b/core/src/main/java/google/registry/xjc/bindings.xjb index 89d8b96a5..409c4b31f 100644 --- a/core/src/main/java/google/registry/xjc/bindings.xjb +++ b/core/src/main/java/google/registry/xjc/bindings.xjb @@ -164,6 +164,15 @@ + + + + + + + + + diff --git a/core/src/main/java/google/registry/xjc/package-info.java.in b/core/src/main/java/google/registry/xjc/package-info.java.in index 87136cc7d..dfcd6102c 100644 --- a/core/src/main/java/google/registry/xjc/package-info.java.in +++ b/core/src/main/java/google/registry/xjc/package-info.java.in @@ -26,6 +26,9 @@ @jakarta.xml.bind.annotation.XmlNs( prefix = "fee12", namespaceURI = "urn:ietf:params:xml:ns:fee-0.12"), + @jakarta.xml.bind.annotation.XmlNs( + prefix = "fee_1_00", + namespaceURI = "urn:ietf:params:xml:ns:epp:fee-1.0"), @jakarta.xml.bind.annotation.XmlNs( prefix = "host", namespaceURI = "urn:ietf:params:xml:ns:host-1.0"), diff --git a/core/src/main/java/google/registry/xjc/package-info.map b/core/src/main/java/google/registry/xjc/package-info.map index 55b700c04..36ef0a1de 100644 --- a/core/src/main/java/google/registry/xjc/package-info.map +++ b/core/src/main/java/google/registry/xjc/package-info.map @@ -6,6 +6,7 @@ eppcom urn:ietf:params:xml:ns:eppcom-1.0 fee06 urn:ietf:params:xml:ns:fee-0.6 fee11 urn:ietf:params:xml:ns:fee-0.11 fee12 urn:ietf:params:xml:ns:fee-0.12 +fee_1_00 urn:ietf:params:xml:ns:epp:fee-1.0 host urn:ietf:params:xml:ns:host-1.0 iirdea urn:ietf:params:xml:ns:iirdea-1.0 launch urn:ietf:params:xml:ns:launch-1.0 diff --git a/core/src/main/java/google/registry/xml/xsd/fee-std-v1.xsd b/core/src/main/java/google/registry/xml/xsd/fee-std-v1.xsd new file mode 100644 index 000000000..6d73d912b --- /dev/null +++ b/core/src/main/java/google/registry/xml/xsd/fee-std-v1.xsd @@ -0,0 +1,242 @@ + + + + + + + + Extensible Provisioning Protocol + v1.0 extension schema for fee + information. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/src/test/java/google/registry/flows/FlowTestCase.java b/core/src/test/java/google/registry/flows/FlowTestCase.java index 9611bd9ac..bb485939c 100644 --- a/core/src/test/java/google/registry/flows/FlowTestCase.java +++ b/core/src/test/java/google/registry/flows/FlowTestCase.java @@ -112,6 +112,10 @@ public abstract class FlowTestCase { eppLoader = new EppLoader(this, inputFilename, substitutions); } + protected void setEppInputXml(String eppXml) { + eppLoader = new EppLoader(eppXml); + } + /** Returns the EPP data loaded by a previous call to setEppInput. */ protected EppInput getEppInput() throws EppException { return eppLoader.getEpp(); @@ -130,6 +134,28 @@ public abstract class FlowTestCase { return TestDataHelper.loadFile(getClass(), filename, substitutions); } + /** + * Converts an input or response EPP message with draft fee extension v12 to std v1. + * + *

There is no practical changes between draft v12 and the v1 standard. This method allows us + * to reuse v12 test data. + */ + protected String loadFeeV12FileAsStdV1(String filename) { + String content = loadFile(filename); + return content.replace("urn:ietf:params:xml:ns:fee-0.12", "urn:ietf:params:xml:ns:epp:fee-1.0"); + } + + /** + * Converts an input or response EPP message with draft fee extension v12 to std v1. + * + *

There is no practical changes between draft v12 and the v1 standard. This method allows us + * to reuse v12 test data. + */ + protected String loadFeeV12FileAsStdV1(String filename, Map substitutions) { + String content = loadFile(filename, substitutions); + return content.replace("urn:ietf:params:xml:ns:fee-0.12", "urn:ietf:params:xml:ns:epp:fee-1.0"); + } + @Nullable protected String getClientTrid() throws Exception { return eppLoader.getEpp().getCommandWrapper().getClTrid().orElse(null); diff --git a/core/src/test/java/google/registry/flows/domain/DomainCheckFlowTest.java b/core/src/test/java/google/registry/flows/domain/DomainCheckFlowTest.java index c9a302926..c88170137 100644 --- a/core/src/test/java/google/registry/flows/domain/DomainCheckFlowTest.java +++ b/core/src/test/java/google/registry/flows/domain/DomainCheckFlowTest.java @@ -87,11 +87,17 @@ import google.registry.model.tld.Tld.TldState; import google.registry.model.tld.label.ReservedList; import google.registry.testing.DatabaseHelper; import java.math.BigDecimal; +import java.util.Map; import java.util.Optional; +import java.util.stream.Stream; import org.joda.money.Money; import org.joda.time.DateTime; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; /** Unit tests for {@link DomainCheckFlow}. */ class DomainCheckFlowTest extends ResourceCheckFlowTestCase { @@ -945,19 +951,23 @@ class DomainCheckFlowTest extends ResourceCheckFlowTestCase substitutions) { + return isFeeStdV1 + ? test.loadFeeV12FileAsStdV1(filename, substitutions) + : test.loadFile(filename, substitutions); + } + } + + @SuppressWarnings("unused") + private static Stream provideFeeTestParams() { + return Stream.of( + Arguments.of("fee_12", new FeeFileLoader(false)), + Arguments.of("fee_std_v1", new FeeFileLoader(true))); + } } diff --git a/core/src/test/java/google/registry/flows/domain/DomainDeleteFlowTest.java b/core/src/test/java/google/registry/flows/domain/DomainDeleteFlowTest.java index f93182d91..a641539dd 100644 --- a/core/src/test/java/google/registry/flows/domain/DomainDeleteFlowTest.java +++ b/core/src/test/java/google/registry/flows/domain/DomainDeleteFlowTest.java @@ -399,17 +399,20 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase - + 2000-01-01T00:00:00Z 1.0 diff --git a/core/src/test/resources/google/registry/beam/rde/reducer_rde.xml b/core/src/test/resources/google/registry/beam/rde/reducer_rde.xml index ffb8b40f1..d08ea65e0 100644 --- a/core/src/test/resources/google/registry/beam/rde/reducer_rde.xml +++ b/core/src/test/resources/google/registry/beam/rde/reducer_rde.xml @@ -1,5 +1,5 @@ - + 2000-01-01T00:00:00Z 1.0 diff --git a/core/src/test/resources/google/registry/beam/rde/reducer_rde_report.xml b/core/src/test/resources/google/registry/beam/rde/reducer_rde_report.xml index fe9b190b8..9c5608661 100644 --- a/core/src/test/resources/google/registry/beam/rde/reducer_rde_report.xml +++ b/core/src/test/resources/google/registry/beam/rde/reducer_rde_report.xml @@ -1,5 +1,5 @@ - + AAAABXDKZ6WAA 1 draft-arias-noguchi-registry-data-escrow-06 diff --git a/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_fee_anchor_response.xml b/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_fee_anchor_response.xml index f9c3ba032..409a9205e 100644 --- a/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_fee_anchor_response.xml +++ b/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_fee_anchor_response.xml @@ -1,5 +1,5 @@ - + Command completed successfully diff --git a/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_fee_response.xml b/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_fee_response.xml index 2f64bbf47..a6bd49f59 100644 --- a/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_fee_response.xml +++ b/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_fee_response.xml @@ -1,5 +1,5 @@ - + Command completed successfully diff --git a/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_fee_specificuse_response.xml b/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_fee_specificuse_response.xml index f3530e6a8..237ab78cd 100644 --- a/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_fee_specificuse_response.xml +++ b/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_fee_specificuse_response.xml @@ -1,5 +1,5 @@ - + Command completed successfully diff --git a/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_promotion_response.xml b/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_promotion_response.xml index 8d5d2d93d..5f8b2fb8e 100644 --- a/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_promotion_response.xml +++ b/core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_promotion_response.xml @@ -1,5 +1,5 @@ - + Command completed successfully diff --git a/core/src/test/resources/google/registry/flows/domain/domain_check_fee_response_thirty_domains.xml b/core/src/test/resources/google/registry/flows/domain/domain_check_fee_response_thirty_domains.xml index c804520c3..fd9465877 100644 --- a/core/src/test/resources/google/registry/flows/domain/domain_check_fee_response_thirty_domains.xml +++ b/core/src/test/resources/google/registry/flows/domain/domain_check_fee_response_thirty_domains.xml @@ -1,5 +1,5 @@ - + Command completed successfully diff --git a/core/src/test/resources/google/registry/flows/domain/domain_create_blocked_by_bsa.xml b/core/src/test/resources/google/registry/flows/domain/domain_create_blocked_by_bsa.xml index 3ecd5e742..c0453658b 100644 --- a/core/src/test/resources/google/registry/flows/domain/domain_create_blocked_by_bsa.xml +++ b/core/src/test/resources/google/registry/flows/domain/domain_create_blocked_by_bsa.xml @@ -1,5 +1,5 @@ - + Domain label is blocked by the Brand Safety Alliance diff --git a/core/src/test/resources/google/registry/flows/greeting.xml b/core/src/test/resources/google/registry/flows/greeting.xml index 3e4d3a54d..f039bfca7 100644 --- a/core/src/test/resources/google/registry/flows/greeting.xml +++ b/core/src/test/resources/google/registry/flows/greeting.xml @@ -15,6 +15,7 @@ urn:ietf:params:xml:ns:fee-0.6 urn:ietf:params:xml:ns:fee-0.11 urn:ietf:params:xml:ns:fee-0.12 + urn:ietf:params:xml:ns:epp:fee-1.0 diff --git a/core/src/test/resources/google/registry/flows/poll/poll_message_domain_pending_action_immediate_delete.xml b/core/src/test/resources/google/registry/flows/poll/poll_message_domain_pending_action_immediate_delete.xml index 04e46a35e..bb867a0ab 100644 --- a/core/src/test/resources/google/registry/flows/poll/poll_message_domain_pending_action_immediate_delete.xml +++ b/core/src/test/resources/google/registry/flows/poll/poll_message_domain_pending_action_immediate_delete.xml @@ -1,4 +1,4 @@ - + Command completed successfully; ack to dequeue diff --git a/core/src/test/resources/google/registry/flows/session/greeting.xml b/core/src/test/resources/google/registry/flows/session/greeting.xml index 3e4d3a54d..f039bfca7 100644 --- a/core/src/test/resources/google/registry/flows/session/greeting.xml +++ b/core/src/test/resources/google/registry/flows/session/greeting.xml @@ -15,6 +15,7 @@ urn:ietf:params:xml:ns:fee-0.6 urn:ietf:params:xml:ns:fee-0.11 urn:ietf:params:xml:ns:fee-0.12 + urn:ietf:params:xml:ns:epp:fee-1.0