Skip to content

Commit a753539

Browse files
rehanvdmclaude
andcommitted
feat(domains): add TrackingCAA record support
The Domains API now returns an extra DNS record `TrackingCAA` (type `CAA`, value `0 issue "amazon.com"`) when a `tracking_subdomain` is configured AND the customer's root domain has CAA records that would prevent AWS from issuing the tracking-domain certificate. Updates the Record docstring to list `TrackingCAA` as an example value and extends the create/get domain test fixtures (sync + async) to include the new record. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f60251f commit a753539

3 files changed

Lines changed: 61 additions & 3 deletions

File tree

resend/domains/_record.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class Record(TypedDict):
55
record: str
66
"""
7-
The domain record type, ie: SPF, DKIM, Inbound, Tracking.
7+
The domain record type, ie: SPF, DKIM, Inbound, Tracking, TrackingCAA.
88
"""
99
name: str
1010
"""

tests/domains_async_test.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ async def test_domains_create_async_with_tracking_subdomain(self) -> None:
173173
"ttl": "Auto",
174174
"status": "not_started",
175175
},
176+
{
177+
"record": "TrackingCAA",
178+
"name": "",
179+
"value": '0 issue "amazon.com"',
180+
"type": "CAA",
181+
"ttl": "Auto",
182+
"status": "not_started",
183+
},
176184
],
177185
"region": "us-east-1",
178186
}
@@ -195,6 +203,13 @@ async def test_domains_create_async_with_tracking_subdomain(self) -> None:
195203
assert tracking_record["name"] == "links.example.com"
196204
assert tracking_record["value"] == "links1.resend-dns.com"
197205
assert tracking_record["type"] == "CNAME"
206+
tracking_caa_record = next(
207+
(r for r in (domain["records"] or []) if r["record"] == "TrackingCAA"),
208+
None,
209+
)
210+
assert tracking_caa_record is not None
211+
assert tracking_caa_record["type"] == "CAA"
212+
assert tracking_caa_record["value"] == '0 issue "amazon.com"'
198213

199214
async def test_domains_get_async_with_tracking_fields(self) -> None:
200215
self.set_mock_json(
@@ -216,7 +231,15 @@ async def test_domains_get_async_with_tracking_fields(self) -> None:
216231
"type": "CNAME",
217232
"ttl": "Auto",
218233
"status": "verified",
219-
}
234+
},
235+
{
236+
"record": "TrackingCAA",
237+
"name": "",
238+
"value": '0 issue "amazon.com"',
239+
"type": "CAA",
240+
"ttl": "Auto",
241+
"status": "verified",
242+
},
220243
],
221244
}
222245
)
@@ -228,6 +251,12 @@ async def test_domains_get_async_with_tracking_fields(self) -> None:
228251
assert domain["open_tracking"] is True
229252
assert domain["click_tracking"] is True
230253
assert domain["tracking_subdomain"] == "links"
254+
tracking_caa_record = next(
255+
(r for r in (domain["records"] or []) if r["record"] == "TrackingCAA"),
256+
None,
257+
)
258+
assert tracking_caa_record is not None
259+
assert tracking_caa_record["type"] == "CAA"
231260

232261
async def test_domains_update_async(self) -> None:
233262
self.set_mock_json(

tests/domains_test.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,14 @@ def test_domains_create_with_tracking_subdomain(self) -> None:
207207
"ttl": "Auto",
208208
"status": "not_started",
209209
},
210+
{
211+
"record": "TrackingCAA",
212+
"name": "",
213+
"value": '0 issue "amazon.com"',
214+
"type": "CAA",
215+
"ttl": "Auto",
216+
"status": "not_started",
217+
},
210218
],
211219
"region": "us-east-1",
212220
}
@@ -231,6 +239,13 @@ def test_domains_create_with_tracking_subdomain(self) -> None:
231239
assert tracking_record["name"] == "links.example.com"
232240
assert tracking_record["value"] == "links1.resend-dns.com"
233241
assert tracking_record["type"] == "CNAME"
242+
tracking_caa_record = next(
243+
(r for r in (domain["records"] or []) if r["record"] == "TrackingCAA"),
244+
None,
245+
)
246+
assert tracking_caa_record is not None
247+
assert tracking_caa_record["type"] == "CAA"
248+
assert tracking_caa_record["value"] == '0 issue "amazon.com"'
234249

235250
def test_domains_get_with_tracking_fields(self) -> None:
236251
self.set_mock_json(
@@ -252,7 +267,15 @@ def test_domains_get_with_tracking_fields(self) -> None:
252267
"type": "CNAME",
253268
"ttl": "Auto",
254269
"status": "verified",
255-
}
270+
},
271+
{
272+
"record": "TrackingCAA",
273+
"name": "",
274+
"value": '0 issue "amazon.com"',
275+
"type": "CAA",
276+
"ttl": "Auto",
277+
"status": "verified",
278+
},
256279
],
257280
}
258281
)
@@ -264,6 +287,12 @@ def test_domains_get_with_tracking_fields(self) -> None:
264287
assert domain["open_tracking"] is True
265288
assert domain["click_tracking"] is True
266289
assert domain["tracking_subdomain"] == "links"
290+
tracking_caa_record = next(
291+
(r for r in (domain["records"] or []) if r["record"] == "TrackingCAA"),
292+
None,
293+
)
294+
assert tracking_caa_record is not None
295+
assert tracking_caa_record["type"] == "CAA"
267296

268297
def test_domains_update(self) -> None:
269298
self.set_mock_json(

0 commit comments

Comments
 (0)