diff --git a/server/lib/consts.ts b/server/lib/consts.ts index 2f505ae..20376f8 100644 --- a/server/lib/consts.ts +++ b/server/lib/consts.ts @@ -2,7 +2,7 @@ import path from "path"; import { fileURLToPath } from "url"; // This is a placeholder value replaced by the build process -export const APP_VERSION = "1.0.0-beta.12"; +export const APP_VERSION = "1.0.0-beta.13"; export const __FILENAME = fileURLToPath(import.meta.url); export const __DIRNAME = path.dirname(__FILENAME); diff --git a/src/app/[orgId]/settings/resources/[resourceId]/rules/page.tsx b/src/app/[orgId]/settings/resources/[resourceId]/rules/page.tsx index ac863c5..287e767 100644 --- a/src/app/[orgId]/settings/resources/[resourceId]/rules/page.tsx +++ b/src/app/[orgId]/settings/resources/[resourceId]/rules/page.tsx @@ -57,6 +57,15 @@ import { } from "@app/components/Settings"; import { ListResourceRulesResponse } from "@server/routers/resource/listResourceRules"; import { SwitchInput } from "@app/components/SwitchInput"; +import { Alert, AlertDescription, AlertTitle } from "@app/components/ui/alert"; +import { Check, Info, InfoIcon, X } from "lucide-react"; +import { + InfoSection, + InfoSections, + InfoSectionTitle +} from "@app/components/InfoSection"; +import { Separator } from "@app/components/ui/separator"; +import { InfoPopup } from "@app/components/ui/info-popup"; // Schema for rule validation const addRuleSchema = z.object({ @@ -70,6 +79,11 @@ type LocalRule = ArrayElement & { updated?: boolean; }; +enum RuleAction { + ACCEPT = "Always Allow", + DROP = "Always Deny" +} + export default function ResourceRules(props: { params: Promise<{ resourceId: number }>; }) { @@ -296,8 +310,10 @@ export default function ResourceRules(props: { {row.original.action} - ACCEPT - DROP + + {RuleAction.ACCEPT} + + {RuleAction.DROP} ) @@ -367,6 +383,56 @@ export default function ResourceRules(props: { return ( + + + About Rules + +

+ Rules allow you to control access to your resource based + on a set of criteria. You can create rules to allow or + deny access based on IP address or URL path. Deny rules + take precedence over allow rules. If a request matches + both an allow and a deny rule, the deny rule will be + applied. +

+ + + Actions +
    +
  • + + Always Allow: Bypass all authentication + methods +
  • +
  • + + Always Deny: Block all requests; no + authentication can be attempted +
  • +
+
+ + + + Matching Criteria + +
    +
  • + Match a specific IP address +
  • +
  • + Match a range of IP addresses in CIDR + notation +
  • +
  • + Match a URL path or pattern +
  • +
+
+
+
+
+ Enable Rules @@ -420,10 +486,10 @@ export default function ResourceRules(props: { - ACCEPT + {RuleAction.ACCEPT} - DROP + {RuleAction.DROP} @@ -469,18 +535,20 @@ export default function ResourceRules(props: { name="value" render={({ field }) => ( - Value + - - Enter CIDR{" "} - {resource.http - ? "or path value" - : ""}{" "} - based on match type - )} />