feat(blocklist): add url-domain host patterns (#3164)

This commit is contained in:
Hampus
2026-10-03 14:46:08 +02:00
committed by GitHub
parent e9167d96ec
commit 7eebfca20b
28 changed files with 1074 additions and 134 deletions
@@ -340,13 +340,13 @@ export const BanUrlRequest = z.object({
export type BanUrlRequest = z.infer<typeof BanUrlRequest>;
export const BanUrlDomainRequest = z.object({
domain: createStringType(1, 253)
.refine(
(v) => /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i.test(v),
'Must be a valid domain',
)
.describe('Domain to ban (e.g. example.com)'),
match_subdomains: z.boolean().default(true).describe('If true, any subdomain rooted at this domain is also banned'),
domain: createStringType(1, 253).describe(
'Domain to ban (e.g. example.com), or a pattern whose leftmost label contains * under a registrable domain (e.g. *shop*.example.com). Internationalized names are stored in ASCII form.',
),
match_subdomains: z
.boolean()
.default(true)
.describe('If true, any subdomain rooted at this domain, or at a host the pattern matches, is also banned'),
category: createStringType(1, 64).optional().describe('Category / source slug (defaults to "manual")'),
severity: z
.number()