feat(domains): add forge activation methods
LU
3d ago+169+169+012345678901234567890123456789-6-6-0123456789
Summary
Adds Forge activation to DomainsSvc, matching the folded API surface (the standalone forge verify and update endpoints no longer exist). This is the Rust port of resend/resend-node#1193; the endpoints are specified in resend/resend-openapi#144.
resend.domains.enable_forge(id, EnableForgeOptions::new())→POST /domains/:id/forge. Returns the fullDomain. The return path is optional (with_return_path("send")); a barenew()sends an empty body and the API picks a label that is free in the domain's DNS. Idempotent on the API side.resend.domains.verify(id, VerifyDomainOptions::new().with_scope([VerifyDomainScope::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. A bareVerifyDomainOptions::new()sends no body, preserving the old wire behavior exactly.resend.domains.update(id, DomainChanges::new().with_forge_return_path("outbound"))→PATCH /domains/:id. 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. Composes with the otherDomainChangesfields.
Part of DEV-2478.
Validation
cargo fmt --check,cargo clippy --all-targets -- -Dwarnings(plus the--no-default-features --features rustls-tlsand--features blockingvariants) and the offline serde tests all pass locally.- Tests assert the wire shapes: the empty enable body and
return_pathmapping, the scoped verify body (and the no-body default), andforge_return_pathcomposed with another change in one PATCH body.
Notes for reviewers
verifychanged signature to takeVerifyDomainOptions, which breaks existingverify(id)callers; the branch already bumps 0.35.2 → 0.36.0, a breaking bump in 0.x, so semver is covered. If you would rather keepverify(id)intact, a separate scoped method works too, happy to rework.VerifyDomainScopeis an enum with the singleForgevariant, serialized as"forge".- Happy to drop the version bump commit if you prefer bumping at release time.
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-rust release.