-
Notifications
You must be signed in to change notification settings - Fork 18
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
2589: RDAP API endpoint [rh] #2843
Conversation
🥳 Successfully deployed to developer sandbox es. |
🥳 Successfully deployed to developer sandbox es. |
🥳 Successfully deployed to developer sandbox es. |
1 similar comment
🥳 Successfully deployed to developer sandbox es. |
🥳 Successfully deployed to developer sandbox es. |
🥳 Successfully deployed to developer sandbox es. |
src/api/tests/test_rdap.py
Outdated
API_BASE_PATH = "/api/v1/rdap/?domain=" | ||
|
||
|
||
class RDapViewTest(TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abroddrick Since we don't call the RDAP API in any of manage.get.gov's views, I had our tests inherit from TestCase rather than create a mock RDAP library since it would go unused unless we find a reason to add RDAP views into the registrar. I can add a mock RDAP library class if we want to follow availability standards but it will likely go unused until we use RDAP in manage.get.gov and not just get.gov
API_BASE_PATH = "/api/v1/rdap/?domain=" | ||
|
||
|
||
class RdapViewTest(TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abroddrick Since we don't call the RDAP API in any of manage.get.gov's views, I had our tests inherit from TestCase rather than create a mock RDAP library since it would go unused unless we find a reason to add RDAP views into the registrar. I can add a mock RDAP library class if we want to follow availability standards but it will likely go unused until we use RDAP in manage.get.gov and not just get.gov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense
src/api/views.py
Outdated
@@ -19,6 +19,7 @@ | |||
|
|||
|
|||
DOMAIN_FILE_URL = "https://raw.githubusercontent.com/cisagov/dotgov-data/main/current-full.csv" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this and any uses of this while your in the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abroddrick sure! I'm not as familiar with where this is used but is current-full no longer referenced in manage.get.gov?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope it isn't
@ttl_cache(ttl=600) | ||
def rdap(request, domain=""): | ||
"""Returns JSON dictionary of a domain's RDAP data from Cloudflare API""" | ||
domain = request.GET.get("domain", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall lgtm! I was just wondering why the ttl is 600 seconds? Is that standard?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think generally 5 minutes is one of the standard defaults for caching which we also use in the availability endpoint! If there ends up being a cache time that makes more sense for this data we can also always update it if the need arises :")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, LGTM. 600 seconds is 10 minutes. Was that intentional for this cache?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack you're right, did not math that math correctly :")
🥳 Successfully deployed to developer sandbox es. |
Ticket
Resolves #2589
Changes
/rdap/?domain=
that fetches RDAP data of a domain from Cloudflare's RDAP API._domains
an artifact of old availability API that is no longer usedContext for reviewers
Adding manage.get.gov API endpoint to fetch domain RDAP in order to mediate fetching Cloudflare data from other .gov projects.
Setup
Go https://getgov-rh.app.cloud.gov/api/v1/rdap/?domain=... and replace ... with different domains. The API should respond to the following use cases:
whitehouse.gov
) will output a JSON of the domain's RDAP data from Cloudflare.whitehouse
) will output a JSOn of the domain's RDAP from Cloudflare.Invalid domain names will be handled by Cloudflare's API handling and error codes which are then used on get.gov's end.
hello.gov
) will output JSON with the error message that the .gov domain searched was not found.Also confirmed that this API successfully displays RDAP JSON on GFEs and would like someone else to verify these steps work on their GFE.
Code Review Verification Steps
As the original developer, I have
Satisfied acceptance criteria and met development standards
Ensured code standards are met (Original Developer)
Validated user-facing changes (if applicable)
As a code reviewer, I have
Reviewed, tested, and left feedback about the changes
Ensured code standards are met (Code reviewer)
Validated user-facing changes as a developer
New pages have been added to .pa11yci file so that they will be tested with our automated accessibility testing
Checked keyboard navigability
Meets all designs and user flows provided by design/product
Tested general usability, landmarks, page header structure, and links with a screen reader (such as Voiceover or ANDI)
Tested with multiple browsers, the suggestion is to use ones that the developer didn't (check off which ones were used)
(Rarely needed) Tested as both an analyst and applicant user
Note: Multiple code reviewers can share the checklists above, a second reviewers should not make a duplicate checklist
As a designer reviewer, I have
Verified that the changes match the design intention
Validated user-facing changes as a designer
Checked keyboard navigability
Tested general usability, landmarks, page header structure, and links with a screen reader (such as Voiceover or ANDI)
Tested with multiple browsers (check off which ones were used)
(Rarely needed) Tested as both an analyst and applicant user
Screenshots