cisagov / manage.get.gov

A Django-based domain name registrar used by the .gov domain to communicate with an EPP registry
https://get.gov
Other
58 stars 18 forks source link

Add RDAP data endpoint in manage.get.gov API #2589

Open erinysong opened 1 month ago

erinysong commented 1 month ago

Issue description

To enable users to view domain registration information, we are using WHOIS/RDAP to look up the registration data of a domain. However, GFE devices are blocked from accessing WHOIS due to being equipped with ZScaler, which blocks WHOIS. This prevents users on GFEs from accessing WHOIS data.

Because manage.get.gov is serviced through cloud.gov, we will be adding a public API endpoint that acts as middleware to fetch WHOIS/RDAP data. The API endpoint can then be called on other .gov services without being blocked by ZScaler.

Acceptance criteria

Additional context

Removed ACs above because RDAP returns JSON with error handling which is then parsed on get.gov's end

No response

Links to other issues

blocks: #316

erinysong commented 6 days ago

@abroddrick re: the 2nd AC that got added - the RDAP API already returns JSON indicating a bad request was made when you query an invalid .gov domain (either because it doesn't end in .gov or it does not exist as a .gov domain). Given RDAP's APIs has different conventions from the EPP API, do we want to have different error handling for the two as well?

RDAP gives more robust error descriptions when you give it an invalid domain to query but I can also be convinced we should handle these errors on our own API's end to minimize calls to RDAP

// Example of inputting whitehouse into RDAP

...
 "description": [
    "whitehouse is not a valid domain name: Domain name must have exactly one part above the TLD"
  ],
  "errorCode": 400,
  "title": "Bad Request",
...

// Example of inputting whitehouse.com into RDAP

...
 "lang": "en",
  "description": [
    "whitehouse.com is not a valid domain name: Domain name is under tld com which doesn't exist"
  ],
  "errorCode": 400,
  "title": "Bad Request",
...