Repository navigation
feat(domains): add forge activation methods - #320
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
1cbc387 to
240fdd5
Compare
There was a problem hiding this comment.
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
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
240fdd5 to
c8a396f
Compare
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>
There was a problem hiding this comment.
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 matchDomains.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. |
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
|
@cubic-dev-ai review |
@vieiralucas I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
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.
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_pathis optional and uses the same name and validation ascustom_return_pathonDomains.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_asyncvariant.resend.Domains.verify(domain_id, params={ "scope": ["forge"] })->POST /domains/{id}/verify.paramsis a new optional argument (Domains.VerifyParams,scope: List[Literal["forge"]]); scoped, only the Forge record is re-checked. Withoutparamsthe request is byte-identical to before. Same onverify_async.Domains.updateis unchanged: there is no Forge field onPATCH /domains/{id}. Domain response types are unchanged: Forge state is read from the Forge record in therecordsarray.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.pywalks enable then scoped verify, with the domain ID read fromRESEND_DOMAIN_ID.Notes for reviewers
VerifyParamsis a nested TypedDict onDomainswithscope: NotRequired[List[VerifyDomainScope]], whereVerifyDomainScope = Literal["forge"]lives next toTlsOptions.DomainForgeexposed asDomains.Forge, matching howDomainClaimsis exposed asDomains.Claims.idfrom the request body (it only addresses the path), following theApiKeys.updateprecedent.Summary by cubic
Adds a
Forgesubresource toDomainsand folds Forge verification into the classic domain endpoint, per DEV-2472.Domains.Forge.enableposts to/domains/{id}/forgewith an optionalcustom_return_path;idis stripped from the request body.Domains.verifynow accepts an optionalscope: ["forge"]to re-check only the Forge record.examples/domain_forge.pyexample using a label the API accepts.Validation
Written for commit 0a469dc. Summary will update on new commits.