Skip to content

Add some changes related to RDAP Feb 2024 profile #2759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025

Conversation

gbrodman
Copy link
Collaborator

@gbrodman gbrodman commented May 28, 2025

This implements two type of changes:

  1. changing the link type for things like the terms of service
  2. adding the request URL to each and every link with the "value" field. This is a bit tricky to implement because the links are generated in various places, but we can implement it by adding it to the results after generation.

See b/418782147 for more information


This change is Reviewable

@gbrodman gbrodman added the kokoro:force-run Force a Kokoro build. label May 28, 2025
@domain-registry-eng domain-registry-eng removed the kokoro:force-run Force a Kokoro build. label May 28, 2025
@gbrodman gbrodman force-pushed the rdapNotices branch 2 times, most recently from 8c9ffba to 2fed4ba Compare May 30, 2025 16:34
@gbrodman gbrodman requested a review from ptkach May 30, 2025 18:24
Copy link
Collaborator

@ptkach ptkach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 6 of 63 files at r1, all commit messages.
Reviewable status: 6 of 63 files reviewed, 3 unresolved discussions


core/src/main/java/google/registry/rdap/RdapActionBase.java line 291 at r1 (raw file):

      jsonArray.forEach(this::addLinkValuesRecursively);
    }
    if (jsonElement instanceof JsonObject jsonObject) {

I think else if would make it clearer that these are separate cases, even despite the fact that element can't be an instance of both.


core/src/main/java/google/registry/rdap/RdapActionBase.java line 293 at r1 (raw file):

    if (jsonElement instanceof JsonObject jsonObject) {
      if (jsonObject.has("links")) {
        addLinkValues(jsonObject.getAsJsonArray("links"));

Do you wanna check if that's actually an array first before getting it as array? https://www.javadoc.io/doc/com.google.code.gson/gson/2.6.2/com/google/gson/JsonElement.html#isJsonArray--

Code quote:

getAsJsonArray("links")

core/src/main/java/google/registry/rdap/RdapActionBase.java line 300 at r1 (raw file):

  private void addLinkValues(JsonArray linksArray) {
    linksArray.forEach(

nit, can we replace with steam() + filter() + forEach()

Copy link
Collaborator

@ptkach ptkach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 6 of 63 files reviewed, 4 unresolved discussions (waiting on @gbrodman)


core/src/test/java/google/registry/rdap/RdapActionBaseTestCase.java line 160 at r1 (raw file):

  JsonObject createTosNotice() {
    return GSON.toJsonTree(

It seems odd, why not just write a json instead? These are basic types - strings mostly.

Copy link
Collaborator Author

@gbrodman gbrodman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 5 of 63 files reviewed, 3 unresolved discussions (waiting on @ptkach)


core/src/main/java/google/registry/rdap/RdapActionBase.java line 291 at r1 (raw file):

Previously, ptkach (Pavlo Tkach) wrote…

I think else if would make it clearer that these are separate cases, even despite the fact that element can't be an instance of both.

Done.


core/src/main/java/google/registry/rdap/RdapActionBase.java line 293 at r1 (raw file):

Previously, ptkach (Pavlo Tkach) wrote…

Do you wanna check if that's actually an array first before getting it as array? https://www.javadoc.io/doc/com.google.code.gson/gson/2.6.2/com/google/gson/JsonElement.html#isJsonArray--

yeah fair, it always should be, but good to check


core/src/main/java/google/registry/rdap/RdapActionBase.java line 300 at r1 (raw file):

Previously, ptkach (Pavlo Tkach) wrote…

nit, can we replace with steam() + filter() + forEach()

Done (requires a call to Streams)


core/src/test/java/google/registry/rdap/RdapActionBaseTestCase.java line 160 at r1 (raw file):

Previously, ptkach (Pavlo Tkach) wrote…

It seems odd, why not just write a json instead? These are basic types - strings mostly.

this was copied over from the helper class and I kept the existing structure, but you're right that this can just be changed to a multiline string (sometimes with interpolation).

@gbrodman gbrodman force-pushed the rdapNotices branch 2 times, most recently from 4436bfb to 0e589fe Compare June 6, 2025 19:12
This implements two type of changes:
1. changing the link type for things like the terms of service
2. adding the request URL to each and every link with the "value" field.
   This is a bit tricky to implement because the links are generated in
various places, but we can implement it by adding it to the results
after generation.

See b/418782147 for more information
Copy link
Collaborator

@ptkach ptkach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 56 of 63 files at r1, 2 of 2 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @gbrodman)

Copy link
Collaborator

@ptkach ptkach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @gbrodman)

@gbrodman gbrodman added this pull request to the merge queue Jun 11, 2025
Merged via the queue into google:master with commit 1f6a091 Jun 11, 2025
9 checks passed
@gbrodman gbrodman deleted the rdapNotices branch June 11, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants