Chore: reject absurd max age values (#10243)

This commit is contained in:
shamoon authored and GitHub committed 2025-06-22 07:39:36 -07:00
1 parent 59afbe09b1
commit dbf3721ec2
2 files changed
+46

No files matched your search

+5
View File
@@ -125,3 +125,8 @@ class MailRuleSerializer(OwnedObjectSerializer):
raise serializers.ValidationError("An action parameter is required.")
return attrs
def validate_maximum_age(self, value):
if value > 36500: # ~100 years
raise serializers.ValidationError("Maximum mail age is unreasonably large.")
return value