Compare commits

..

2 Commits

Author SHA1 Message Date
Owen Schwartz bc56a2bed0 Merge pull request #3647 from argueta-xyz/country-is-not-rule-via-blueprint
Allow COUNTRY_IS_NOT rules to be created via Blueprints
2026-08-28 10:52:24 -04:00
Alejandro Argueta 7cda28d685 Update RuleSchema to allow COUNTRY_IS_NOT rules to be created via blueprints as well. 2026-08-27 14:18:48 -07:00
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
# FROM node:24.18.1-slim AS base # FROM node:24.18.1-slim AS base
FROM public.ecr.aws/docker/library/node:26.8.1-slim AS base FROM public.ecr.aws/docker/library/node:24.18.1-slim AS base
WORKDIR /app WORKDIR /app
@@ -33,7 +33,7 @@ FROM base AS builder
RUN npm ci --omit=dev RUN npm ci --omit=dev
# FROM node:24.18.1-slim AS runner # FROM node:24.18.1-slim AS runner
FROM public.ecr.aws/docker/library/node:26.8.1-slim AS runner FROM public.ecr.aws/docker/library/node:24.18.1-slim AS runner
WORKDIR /app WORKDIR /app
+1 -1
View File
@@ -1,4 +1,4 @@
FROM node:26.8.1-alpine FROM node:24.18.1-alpine
WORKDIR /app WORKDIR /app
+2 -2
View File
@@ -101,7 +101,7 @@ export const AuthSchema = z.object({
export const RuleSchema = z export const RuleSchema = z
.object({ .object({
action: z.enum(["allow", "deny", "pass"]), action: z.enum(["allow", "deny", "pass"]),
match: z.enum(["cidr", "path", "ip", "country", "asn", "region"]), match: z.enum(["cidr", "path", "ip", "country", "country_is_not", "asn", "region"]),
value: z.coerce.string(), value: z.coerce.string(),
priority: z.int().optional(), priority: z.int().optional(),
enabled: z.boolean().optional().default(true) enabled: z.boolean().optional().default(true)
@@ -136,7 +136,7 @@ export const RuleSchema = z
) )
.refine( .refine(
(rule) => { (rule) => {
if (rule.match === "country") { if (rule.match === "country" || rule.match === "country_is_not") {
if (!hasMaxmindCountryDb) { if (!hasMaxmindCountryDb) {
return false; return false;
} }