Skip to content

Commit bc3cd74

Browse files
committed
Revert "fix(api): catch duplicate records in RRset on database layer"
This reverts commit b0f9a40.
1 parent 9b22d52 commit bc3cd74

3 files changed

Lines changed: 0 additions & 48 deletions

File tree

api/desecapi/migrations/0045_rr_unique_record_in_rrset.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

api/desecapi/models/records.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -265,20 +265,6 @@ class RR(ExportModelOperationsMixin("RR"), models.Model):
265265
dns.rdatatype.SPF: LongQuotedTXT, # we slightly deviate from RFC 1035 and allow tokens longer than 255 bytes
266266
}
267267

268-
class Meta:
269-
constraints = [
270-
# not using UniqueConstraint as its btree's entry size is limited to 1/3 page size;
271-
# however, some records (OPENPGPKEY, PQC keys/signatures?) may be larger
272-
# Alternatively, could use a unique constraint on hash(content), but Django lacks API
273-
ExclusionConstraint(
274-
name="unique_record_in_rrset",
275-
expressions=[
276-
("rrset", RangeOperators.EQUAL),
277-
("content", RangeOperators.EQUAL),
278-
],
279-
),
280-
]
281-
282268
@classmethod
283269
def to_wire(cls, type_, any_presentation_format, *, digestable):
284270
"""

api/desecapi/tests/test_rrsets.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from django.conf import settings
88
from django.core.exceptions import ValidationError
99
from django.core.management import call_command
10-
from django.db import IntegrityError
11-
from psycopg.errors import ExclusionViolation
1210
from rest_framework import status
1311

1412
from desecapi.models import BlockedSubnet, Domain, RR, RRset
@@ -17,18 +15,6 @@
1715

1816

1917
class UnauthenticatedRRSetTestCase(DesecTestCase):
20-
def test_unique_record_in_rrset(self):
21-
domain = self.create_domain()
22-
with self.assertRaises(IntegrityError) as cm:
23-
RRset.objects.create(
24-
domain=domain,
25-
subname="foo",
26-
type="A",
27-
ttl=3600,
28-
contents=["1.2.3.4"] * 2,
29-
)
30-
self.assertIsInstance(cm.exception.__cause__, ExclusionViolation)
31-
3218
def test_unauthorized_access(self):
3319
url = self.reverse("v1:rrsets", name="example.com")
3420
for method in [

0 commit comments

Comments
 (0)