Normalize Fee extension XML tags in EPP response#2953
Normalize Fee extension XML tags in EPP response#2953weiminyu wants to merge 1 commit intogoogle:masterfrom
Conversation
core/src/main/java/google/registry/flows/FeeExtensionXmlTagNormalizer.java
Fixed
Show fixed
Hide fixed
|
|
||
| @ParameterizedTest | ||
| @MethodSource("provideTestCombinations") | ||
| void success_withFeeExtension(String name, String inputXmlFilename, String expectedXmlFilename) |
Check notice
Code scanning / CodeQL
Useless parameter Note test
9d63c22 to
168443b
Compare
Nomulus currently supports multiple versions of the Fee extensions. Our current tooling requires that each version must use a unique namespace tag, e.g., fee11, fee12, etc. Some client registrars are sensitive to the tag literal used by the version of the extension they use. For example, a few registrars currently using v0.6 have requested that the `fee` literal be used on the versions they currently use. With registrars upgrading at their own schedule, this kind of requests are impossible to satisfy. This PR instroduces a namespace normalizer class for EPP responses. The key optimization is that each EPP response never mixes multiple versions of a service extension. Therefore we can define a canonical tag for each extension, and change the tag of the extension in use in a response to that. This normalizer only handles Fee extensions right now, but the idea can be extended to others if use cases come up. This normalizer will be applied to all flows in a future PR.
168443b to
d1f9e95
Compare
weiminyu
left a comment
There was a problem hiding this comment.
@weiminyu resolved 2 discussions.
Reviewable status: 0 of 10 files reviewed, all discussions resolved (waiting on @CydeWeys and @gbrodman).
CydeWeys
left a comment
There was a problem hiding this comment.
@CydeWeys made 2 comments.
Reviewable status: 0 of 10 files reviewed, 2 unresolved discussions (waiting on @gbrodman and @weiminyu).
core/src/main/java/google/registry/flows/FeeExtensionXmlTagNormalizer.java line 55 at r2 (raw file):
* * <p>Some registrars are not XML namespace-aware and rely on the XML tags being specific literals. * This makes it impossible to perform seamless rollout of new versions. Nomulus and the all
Grammar error here
core/src/main/java/google/registry/flows/FeeExtensionXmlTagNormalizer.java line 63 at r2 (raw file):
* versions from the message, thus freeing up the canonical tag ('fee') for the active version. */ public class FeeExtensionXmlTagNormalizer {
What are the performance implications of this approach? This is running a nontrivial amount of XML parsing code for each command response we return, right?
Nomulus currently supports multiple versions of the Fee extensions. Our current tooling requires that each version must use a unique namespace tag, e.g., fee11, fee12, etc.
Some client registrars are sensitive to the tag literal used by the version of the extension they use. For example, a few registrars currently using v0.6 have requested that the
feeliteral be used on the versions they currently use. With registrars upgrading at their own schedule, this kind of requests are impossible to satisfy.This PR instroduces a namespace normalizer class for EPP responses. The key optimization is that each EPP response never mixes multiple versions of a service extension. Therefore we can define a canonical tag for each extension, and change the tag of the extension in use in a response to that. This normalizer only handles Fee extensions right now, but the idea can be extended to others if use cases come up.
This normalizer will be applied to all flows in a future PR.
This change is