Open OlegPhenomenon opened 8 months ago
This pull request is split into 14 parts for easier review. 👀 Review pull request on Viezly
Changed files are located in these folders:
/
app/controllers/admin
app/interactions/whois
app/jobs
app/models
app/services
app/views/admin
config
db
lib/core_monkey_patches
lib/gem_monkey_patches
lib/xsd
test
close #2611
What is this? This is the implementation for interacting with BSA reserved domains, which can be obtained from GoDaddy.
What do you need to know beforehand?
application.yml file
, you need to add the following keys:bsa_base_url
andbsa_api_key
.rake bsa_domains:call
. This rake task initially runs theFetchGodaddyBsaBlockOrderListJob
, which retrieves all data about domains that have theQueuedForActivation
status. Then, when the job has completed, another job,UpdateGodaddyDomainsStatusJob
, is run. It takes these domains and changes their status fromQueuedForActivation
toActivationInProgress
both on the GoDaddy side and on our side. Then the same job is run again, but this time it changes the status fromActivationInProgress
toActive
. Skipping and changing the status fromQueuedForActivation
toActive
is not allowed; the statusActivationInProgress
must be set beforehand. This is a particular feature of the finite state machine on GoDaddy's side.Implementation Description
GoDaddy Service Token Management:
The GoDaddy service operates in such a way that the token refreshes every 20 minutes and also has a limit on the number of requests within a specific time frame. Therefore, the generated token is stored in a Redis cache, and it is used for each request. There is also a check for the token's expiration time; if the 20-minute period has expired, a request is made to GoDaddy to obtain a new token.
Two jobs were implemented:
BsaProtectedDomains
table. By default, this job uses theQueuedForActivation
status, but it can also accept other statuses as parameters if needed... will be continued :)