feat(domains): add forge activation methods
LU
21h ago+150+150+012345678901234567890123456789-4-4-0123456789
Summary
Adds Forge activation, matching the folded API surface (the standalone forge verify and update endpoints no longer exist). Ports resend/resend-node#1193 to Ruby; the API surface is defined in resend/resend-openapi#144.
Resend::Domains::Forge.enable(id:, return_path:)→POST /domains/:id/forge. Returns the full domain response.return_pathis optional; when omitted, the API picks a label that is free in the domain's DNS, and onlyreturn_pathis ever sent in the body. Idempotent on the API side.Resend::Domains.verify(domain_id, scope: ["forge"])→POST /domains/:id/verifywith{"scope":["forge"]}. Scoped, only the Forge record is re-checked, so the records that are already verified are not re-proven. The existingverify(domain_id)call still sends{}exactly as before.Resend::Domains.update({ id: ..., forge_return_path: ... })→PATCH /domains/:id.forge_return_pathpasses through like every other update field: moves the Forge return path while the Forge record is still verifying, does not start verification, and once the record verifies the API refuses with 422return_path_unavailable.
Bumps the version to 1.20.0.
Validation
bundle exec rubocop: 52 files inspected, no offenses detected.bundle exec rake spec: 484 examples, 0 failures (Ruby 3.3).- Specs assert the wire shapes: enable with and without
return_path(empty body asserted), the scoped verify body, and theforge_return_pathPATCH body.
Notes for reviewers
verifykeeps its positionaldomain_idand takes the scope as a trailing params hash, so existing callers are untouched.Forge.enablesends onlyreturn_path(params.slice(:return_path)), so theidused to build the path never leaks into the payload.
Part of DEV-2474.
The Forge enable endpoint is live in production; the scoped verify and forge_return_path land with the API reshape, which deploys before this ships. Ships with the next resend-ruby release.