feat: add domain claims endpoints#228
Conversation
Adds Domains.Claims sub-resource with create, get, and verify methods
(plus _async variants) covering the new Domain Claims API:
- POST /domains/claim
- GET /domains/{domain_id}/claim
- POST /domains/{domain_id}/claim/verify
There was a problem hiding this comment.
3 issues found across 8 files
Confidence score: 4/5
- In
tests/domain_claims_async_test.py, test method names useshould, which can violate team naming conventions and may cause style/lint checks or reviewer churn even if behavior is correct; rename those test methods to direct declarative names before merging.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tests/domain_claims_async_test.py">
<violation number="1" location="tests/domain_claims_async_test.py:44">
P2: Custom agent: **No `should` in tests**
These test method names include the word 'should', which goes against the project's convention of avoiding 'should' in test descriptions. Use direct, declarative language instead. For example, rename `test_should_create_domain_claim_async_raise_exception_when_no_content` to something like `test_create_domain_claim_async_raises_exception_when_no_content`.</violation>
<violation number="2" location="tests/domain_claims_async_test.py:75">
P2: Custom agent: **No `should` in tests**
This test method name includes 'should', which goes against the project's convention of avoiding 'should' in test descriptions. Use direct, declarative language instead, such as `test_get_domain_claim_async_raises_exception_when_no_content`.</violation>
<violation number="3" location="tests/domain_claims_async_test.py:102">
P2: Custom agent: **No `should` in tests**
This test method name includes 'should', which goes against the project's convention of avoiding 'should' in test descriptions. Use direct, declarative language instead, such as `test_verify_domain_claim_async_raises_exception_when_no_content`.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| assert claim["id"] == "dacf4072-4119-4d88-932f-6c6126d3a9d1" | ||
| assert claim["status"] == "pending" | ||
|
|
||
| async def test_should_verify_domain_claim_async_raise_exception_when_no_content( |
There was a problem hiding this comment.
P2: Custom agent: No should in tests
This test method name includes 'should', which goes against the project's convention of avoiding 'should' in test descriptions. Use direct, declarative language instead, such as test_verify_domain_claim_async_raises_exception_when_no_content.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/domain_claims_async_test.py, line 102:
<comment>This test method name includes 'should', which goes against the project's convention of avoiding 'should' in test descriptions. Use direct, declarative language instead, such as `test_verify_domain_claim_async_raises_exception_when_no_content`.</comment>
<file context>
@@ -0,0 +1,109 @@
+ assert claim["id"] == "dacf4072-4119-4d88-932f-6c6126d3a9d1"
+ assert claim["status"] == "pending"
+
+ async def test_should_verify_domain_claim_async_raise_exception_when_no_content(
+ self,
+ ) -> None:
</file context>
| async def test_should_verify_domain_claim_async_raise_exception_when_no_content( | |
| async def test_verify_domain_claim_async_raises_exception_when_no_content( |
| assert claim["status"] == "blocked" | ||
| assert claim["blocked_reason"] == "grace_period" | ||
|
|
||
| async def test_should_get_domain_claim_async_raise_exception_when_no_content( |
There was a problem hiding this comment.
P2: Custom agent: No should in tests
This test method name includes 'should', which goes against the project's convention of avoiding 'should' in test descriptions. Use direct, declarative language instead, such as test_get_domain_claim_async_raises_exception_when_no_content.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/domain_claims_async_test.py, line 75:
<comment>This test method name includes 'should', which goes against the project's convention of avoiding 'should' in test descriptions. Use direct, declarative language instead, such as `test_get_domain_claim_async_raises_exception_when_no_content`.</comment>
<file context>
@@ -0,0 +1,109 @@
+ assert claim["status"] == "blocked"
+ assert claim["blocked_reason"] == "grace_period"
+
+ async def test_should_get_domain_claim_async_raise_exception_when_no_content(
+ self,
+ ) -> None:
</file context>
| async def test_should_get_domain_claim_async_raise_exception_when_no_content( | |
| async def test_get_domain_claim_async_raises_exception_when_no_content( |
| assert claim["status"] == "pending" | ||
| assert claim["record"]["type"] == "TXT" | ||
|
|
||
| async def test_should_create_domain_claim_async_raise_exception_when_no_content( |
There was a problem hiding this comment.
P2: Custom agent: No should in tests
These test method names include the word 'should', which goes against the project's convention of avoiding 'should' in test descriptions. Use direct, declarative language instead. For example, rename test_should_create_domain_claim_async_raise_exception_when_no_content to something like test_create_domain_claim_async_raises_exception_when_no_content.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/domain_claims_async_test.py, line 44:
<comment>These test method names include the word 'should', which goes against the project's convention of avoiding 'should' in test descriptions. Use direct, declarative language instead. For example, rename `test_should_create_domain_claim_async_raise_exception_when_no_content` to something like `test_create_domain_claim_async_raises_exception_when_no_content`.</comment>
<file context>
@@ -0,0 +1,109 @@
+ assert claim["status"] == "pending"
+ assert claim["record"]["type"] == "TXT"
+
+ async def test_should_create_domain_claim_async_raise_exception_when_no_content(
+ self,
+ ) -> None:
</file context>
| async def test_should_create_domain_claim_async_raise_exception_when_no_content( | |
| async def test_create_domain_claim_async_raises_exception_when_no_content( |
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.
Re-trigger cubic
Adds Domains.Claims sub-resource with create, get, and verify methods (plus _async variants) covering the new Domain Claims API:
Summary by cubic
Add Domain Claims API support with
Domains.Claimsmethods to create, get, and verify claims (sync and async) so users can claim already-verified domains. Exposes claim types inresendand includes an example and tests.Domains.Claims.create(params)→ POST/domains/claim(supports optionalregion,custom_return_path,tracking_subdomain,open_tracking,click_tracking)Domains.Claims.get(domain_id)→ GET/domains/{domain_id}/claimDomains.Claims.verify(domain_id)→ POST/domains/{domain_id}/claim/verifycreate_async,get_async,verify_asyncresend:DomainClaims,DomainClaim,DomainClaimRecordexamples/domain_claims.pyand sync/async tests, including coverage for optional create paramsWritten for commit fd67f25. Summary will update on new commits.