feat(admin): add optional expiry to admin IP bans (#3163)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-03 14:41:00 +02:00
1 parent 1664050ef7
commit e9167d96ec
88 files changed
+462 -139

No files matched your search

@@ -294,6 +294,13 @@ export const BanIpRequest = z.object({
ip: createStringType(1, 45)
.refine((value) => IpOrCidrType.safeParse(value).success, 'Must be a valid IPv4/IPv6 address or CIDR range')
.describe('IPv4/IPv6 address or CIDR range to ban'),
duration_hours: z
.number()
.int()
.min(0)
.max(8760)
.optional()
.describe('Hours until the ban expires and its entry is removed. Omit it or use 0 for a permanent ban.'),
});
export type BanIpRequest = z.infer<typeof BanIpRequest>;
@@ -1072,6 +1079,12 @@ export const AuditLogsListResponseSchema = z.object({
export type AuditLogsListResponse = z.infer<typeof AuditLogsListResponseSchema>;
export const BanCheckResponseSchema = z.object({
banned: z.boolean(),
expires_at: z
.string()
.nullable()
.describe(
'ISO 8601 timestamp when the matching ban expires. Null when the ban is permanent, when nothing matches, and on every blocklist other than ip.',
),
});
export const BulkJobResponse = z.object({
job_id: SnowflakeStringType,