Add Pages domain verify API endpoint
What does this MR do and why?
The existing Pages domain Verification process involves the configuration of DNS records, then either:
- A manual UI action to verify the DNS record contents; or
- Wait an unspecified amount of time for the system to check for you
In issue #21261 (closed), there is some customer interest in seeing an API endpoint implemented to automate/script this process. I imagine this could be done by:
- Using the existing API to create a Pages domain record. This provides a
verification_code
value. - Using this value, use an external tool to create a DNS record with the DNS provider.
- Once the DNS provider has created the record, make a request to
PUT /projects/:id/pages/domains/:domain/verify
to have immediate verification.
References
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Video example:
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- In a Pages project, add a custom domain for DNS you control.
- Configure via your DNS provider the TXT record.
- Once saved, use the
PUT /projects/:id/pages/domains/:domain/verify
API endpoint to immediately verify your domain with GitLab Pages