Skip to content

feat(domains): add forge activation methods - #128

Open
lucasfcosta wants to merge 2 commits into
mainfrom
feature/dev-2478-rust-sdk-external-tony-via-slack-team-sdks
Open

lucasfcosta wants to merge 2 commits into
mainfrom
feature/dev-2478-rust-sdk-external-tony-via-slack-team-sdks

Conversation

@lucasfcosta

@lucasfcosta lucasfcosta commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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 full Domain. The return path is optional (with_return_path("send")); a bare new() 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/verify with {"scope":["forge"]}. Scoped, only the Forge record is re-checked, so the records that are already verified are not re-proven. A bare VerifyDomainOptions::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 422 return_path_unavailable. Composes with the other DomainChanges fields.

Part of DEV-2478.

Validation

  • cargo fmt --check, cargo clippy --all-targets -- -Dwarnings (plus the --no-default-features --features rustls-tls and --features blocking variants) and the offline serde tests all pass locally.
  • Tests assert the wire shapes: the empty enable body and return_path mapping, the scoped verify body (and the no-body default), and forge_return_path composed with another change in one PATCH body.

Notes for reviewers

  • verify changed signature to take VerifyDomainOptions, which breaks existing verify(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 keep verify(id) intact, a separate scoped method works too, happy to rework.
  • VerifyDomainScope is an enum with the single Forge variant, 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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: This adds new public Forge client methods and a forge_status field, extending the SDK's public API; the author is also holding merge until the remaining Forge endpoints roll out.

View guided diff | Re-trigger cubic

@lucasfcosta
lucasfcosta marked this pull request as ready for review November 11, 2026 21:25
@lucasfcosta lucasfcosta changed the title feat(domains): add forge activation methods and forge_status feat(domains): add forge activation methods Nov 11, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Adds new public Forge client methods and request types; the earlier forge_status addition was removed. The author is holding merge until remaining Forge endpoints roll out, and key API behaviors are not verifiable from the diff.

View guided diff | Re-trigger cubic

@lucasfcosta
lucasfcosta force-pushed the feature/dev-2478-rust-sdk-external-tony-via-slack-team-sdks branch from 6cb8305 to 1bc3a53 Compare November 11, 2026 23:51
@lucasfcosta lucasfcosta changed the title feat(domains): add forge activation methods feat(domains): add forge activation methods and forge_status Nov 11, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Adds new public Forge activation methods and request/status types to the SDK. This expands the public API contract and depends on external Forge API behavior not verifiable from the diff, so it needs human sign-off.

View guided diff | Re-trigger cubic

@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Nov 12, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lucasfcosta
lucasfcosta force-pushed the feature/dev-2478-rust-sdk-external-tony-via-slack-team-sdks branch from 1bc3a53 to add4743 Compare November 12, 2026 12:45
@lucasfcosta lucasfcosta changed the title feat(domains): add forge activation methods and forge_status feat(domains): add forge activation methods Nov 12, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Adds new public Forge activation methods and types to the SDK, expanding the public API contract for downstream consumers. The external Forge API behaviors are claimed but not verifiable from this diff, so the signature and contract choices need maintainer sign-off.

View guided diff | Re-trigger cubic

Matches the reshaped API: forge keeps only enable_forge (return path
optional, the server picks a free DNS label when omitted), verify gains
an optional scope of [forge] that re-checks only the Forge record, and
DomainChanges gains forge_return_path to move the Forge return path
without starting verification.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Confidence score: 4/5

  • In src/domains.rs, with_scope([]) sends an empty scope array instead of the documented no-scope request, so the API may reject it or return no records. Normalize an empty iterator to None or reject it before verify.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/domains.rs">

<violation number="1" location="src/domains.rs:573">
P2: `with_scope([])` sends an empty scope array instead of using the documented no-scope request, which can be rejected by the API or verify no records. Normalize an empty iterator to `None` (or reject it) before `verify` serializes the options.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread src/domains.rs
/// checked.
#[inline]
pub fn with_scope(mut self, scope: impl IntoIterator<Item = VerifyDomainScope>) -> Self {
self.scope = Some(scope.into_iter().collect());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: with_scope([]) sends an empty scope array instead of using the documented no-scope request, which can be rejected by the API or verify no records. Normalize an empty iterator to None (or reject it) before verify serializes the options.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/domains.rs, line 573:

<comment>`with_scope([])` sends an empty scope array instead of using the documented no-scope request, which can be rejected by the API or verify no records. Normalize an empty iterator to `None` (or reject it) before `verify` serializes the options.</comment>

<file context>
@@ -567,6 +541,44 @@ pub mod types {
+        /// checked.
+        #[inline]
+        pub fn with_scope(mut self, scope: impl IntoIterator<Item = VerifyDomainScope>) -> Self {
+            self.scope = Some(scope.into_iter().collect());
+            self
+        }
</file context>
Suggested change
self.scope = Some(scope.into_iter().collect());
let scope = scope.into_iter().collect::<Vec<_>>();
self.scope = (!scope.is_empty()).then_some(scope);

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant