Skip to content

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

Merged
felipefreitag merged 5 commits into
mainfrom
feature/dev-2472-python-sdk-internal-squad-devtools
Nov 19, 2026
Merged

felipefreitag merged 5 commits into
mainfrom
feature/dev-2472-python-sdk-internal-squad-devtools

Conversation

@lucasfcosta

@lucasfcosta lucasfcosta commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds Forge activation to Domains, matching the public API shape (resend/resend-monorepo#14706). Ports the Node implementation (resend/resend-node#1193) into this SDK's idioms. Part of DEV-2472.

  • resend.Domains.Forge.enable({ "id": ..., "custom_return_path": ... }) -> POST /domains/{id}/forge. custom_return_path is optional and uses the same name and validation as custom_return_path on Domains.create; when omitted, the API picks a free label. It is set once and cannot be changed afterwards. Returns the full domain and is idempotent on the API side. Ships with its _async variant.
  • resend.Domains.verify(domain_id, params={ "scope": ["forge"] }) -> POST /domains/{id}/verify. params is a new optional argument (Domains.VerifyParams, scope: List[Literal["forge"]]); scoped, only the Forge record is re-checked. Without params the request is byte-identical to before. Same on verify_async.

Domains.update is unchanged: there is no Forge field on PATCH /domains/{id}. Domain response types are unchanged: Forge state is read from the Forge record in the records array.

Validation

tox -e lint,mypy,py: flake8 and mypy clean, 878 tests passing. Tests assert the wire shapes: enable's {"custom_return_path": ...} body and empty body, verify's {"scope": ["forge"]} body (and {} without params), sync and async. examples/domain_forge.py walks enable then scoped verify, with the domain ID read from RESEND_DOMAIN_ID.

Notes for reviewers

  • VerifyParams is a nested TypedDict on Domains with scope: NotRequired[List[VerifyDomainScope]], where VerifyDomainScope = Literal["forge"] lives next to TlsOptions.
  • The underlying class is DomainForge exposed as Domains.Forge, matching how DomainClaims is exposed as Domains.Claims.
  • Forge enable strips id from the request body (it only addresses the path), following the ApiKeys.update precedent.
  • Bumps the version to 2.55.0 (2.54.0 is released).

Summary by cubic

Adds a Forge subresource to Domains and folds Forge verification into the classic domain endpoint, per DEV-2472.

  • Domains.Forge.enable posts to /domains/{id}/forge with an optional custom_return_path; id is stripped from the request body.
  • Domains.verify now accepts an optional scope: ["forge"] to re-check only the Forge record.
  • Bumps the SDK version to 2.55.0 and adds sync and async unit tests plus an examples/domain_forge.py example using a label the API accepts.

Validation

  • Unit tests cover URL, HTTP verb, body mapping, the empty-body enable, and the no-content error path for the new methods, sync and async.

Written for commit 0a469dc. Summary will update on new commits.

View guided diff

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 9 files

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

View guided diff | Re-trigger cubic

Comment thread examples/domain_forge.py Resolved
Comment thread tests/domain_forge_async_test.py Resolved

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 1 file (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: Auto-approval blocked by 2 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@lucasfcosta
lucasfcosta marked this pull request as ready for review November 11, 2026 21:24
@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
Contributor

Choose a reason for hiding this comment

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

0 issues found across 7 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: Auto-approval blocked by 2 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@lucasfcosta
lucasfcosta force-pushed the feature/dev-2472-python-sdk-internal-squad-devtools branch from 1cbc387 to 240fdd5 Compare November 11, 2026 23:50

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 7 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: Auto-approval blocked by 2 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

@lucasfcosta lucasfcosta changed the title feat(domains): add forge activation methods feat(domains): add forge activation methods and forge_status Nov 11, 2026
@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-2472-python-sdk-internal-squad-devtools branch from 240fdd5 to c8a396f 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
Matches the reshaped API: Domains.Forge keeps only enable (return_path
optional), Domains.verify gains an optional scope of ["forge"] that
re-checks only the Forge record, and Domains.update 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
Contributor

Choose a reason for hiding this comment

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

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

Confidence score: 5/5

  • In resend/domains/_domains.py, the docstring’s “another host” wording could lead callers to pass a full hostname; say “subdomain” to match Domains.Forge.enable.
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="resend/domains/_domains.py">

<violation number="1" location="resend/domains/_domains.py:156">
P3: This docstring says the Forge return path moves "to another host", but the value is a subdomain label, as `Domains.Forge.enable` documents for `return_path`. Say "subdomain" so callers don't pass a full hostname.</violation>
</file>

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Re-trigger cubic

Linked issue analysis

Linked issue: DEV-2472: Python SDK (internal, squad-devtools)

Status Acceptance criteria Notes
✅ Add Forge activation and scoped verification to the Python SDK Domains.Forge.enable and scoped Domains.verify call the Forge endpoints, with sync and async tests covering request bodies.

Comment thread resend/domains/_domains.py Resolved
Comment thread resend/domains/_domains.py Resolved
Drop forge_return_path from Domains.update: the return path is set once on
enable and cannot be changed afterwards.
…on-sdk-internal-squad-devtools

# Conflicts:
#	resend/domains/_domains.py
#	resend/version.py
#	tests/domains_test.py
@vieiralucas

Copy link
Copy Markdown
Member

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review

@vieiralucas I have started the AI code review. It will take a few minutes to complete.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cubic analysis

No issues found across 10 files

Confidence score: 5/5

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

Linked issue analysis

Linked issue: DEV-2472: Python SDK (internal, squad-devtools)

Status Acceptance criteria Notes
✅ Add Forge activation and scoped verification to the Python SDK Domains.Forge.enable and scoped Domains.verify call the Forge endpoints, with sync and async tests covering request bodies.

Requires human review: Adds Domains.Forge.enable/enable_async and an optional Forge scope to Domains.verify, expanding the SDK's public API with a new endpoint and request shape; shipping this new contract needs human sign-off.

View guided diff | Re-trigger cubic

Add the see more docs link to Forge.enable and enable_async, like every other domain method. The example passed custom_return_path "send", which is the default return path of a classic domain, so the API would reject it. Use "forge", as the docs do.
@felipefreitag
felipefreitag merged commit 838b599 into main Nov 19, 2026
24 checks passed
@felipefreitag
felipefreitag deleted the feature/dev-2472-python-sdk-internal-squad-devtools branch November 19, 2026 13:30
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.

3 participants