feat(admin): accept domain entries in the email blocklist (#3129)

This commit is contained in:
Hampus
2026-10-02 18:00:38 +02:00
committed by GitHub
parent b54016653b
commit 1abde06824
8 changed files with 106 additions and 15 deletions
+6 -2
View File
@@ -13427,7 +13427,10 @@
"BanEmailRequest": {
"type": "object",
"properties": {
"email": {"description": "Email address to ban", "allOf": [{"$ref": "#/components/schemas/EmailType"}]}
"email": {
"description": "Email address to ban, or a domain written as @example.com to ban every address at it and its subdomains",
"allOf": [{"$ref": "#/components/schemas/EmailBlocklistEntryType"}]
}
},
"required": ["email"]
},
@@ -13436,7 +13439,7 @@
"properties": {"ip": {"description": "IPv4/IPv6 address or CIDR range to ban", "type": "string"}},
"required": ["ip"]
},
"EmailType": {"type": "string"},
"EmailBlocklistEntryType": {"type": "string"},
"CheckAvatarHashRequest": {
"type": "object",
"properties": {"hashes": {"minItems": 1, "maxItems": 1000, "type": "array", "items": {"type": "string"}}},
@@ -16036,6 +16039,7 @@
{"name": "PERKS_DISABLED", "value": "256", "description": "User has temporarily disabled premium perks"}
]
},
"EmailType": {"type": "string"},
"AdminRelationshipEntrySchema": {
"type": "object",
"properties": {
+1 -1
View File
@@ -11,7 +11,7 @@ impl AdminApiClient {
"email",
generated_types::AdminBlocklistEntryCreateRequest::from(
generated_types::BanEmailRequest {
email: generated_types::EmailType::from(email.to_owned()),
email: generated_types::EmailBlocklistEntryType::from(email.to_owned()),
},
),
audit_log_reason,
+3 -3
View File
@@ -37,10 +37,10 @@ pub const BAN_CONFIGS: &[BanConfig] = &[
BanConfig {
title: "Email Bans",
route: "/email-bans",
input_label: "Email Address",
input_label: "Email Address or Domain",
input_name: "email",
input_type: "email",
placeholder: "[email protected]",
input_type: "text",
placeholder: "[email protected] or @example.com",
entity_name: "Email",
active_page: "email-bans",
show_bulk_tools: false,