Skip to content

Commit

Permalink
Add route name path regex to schema checks
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlycoconuts committed Sep 19, 2022
1 parent de09d66 commit f5e889e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/src/router/components/form/validation/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ const routerNameRegex = /^[a-z0-9-]*$/,
kafkaBrokersRegex =
/^([a-z]+:\/\/)?\[?([0-9a-zA-Z\-%._:]*)\]?:([0-9]+)(,([a-z]+:\/\/)?\[?([0-9a-zA-Z\-%._:]*)\]?:([0-9]+))*$/i,
kafkaTopicRegex = /^[A-Za-z0-9_.-]{1,249}/i,
trafficRuleNameRegex = /^[A-Za-z\d][\w\d \-()#$%&:.]*[\w\d\-()#$%&:.]$/;
trafficRuleNameRegex = /^[A-Za-z\d][\w\d \-()#$%&:.]*[\w\d\-()#$%&:.]$/,
routeNamePathRegex = /^[\w\-]*(?:\.[\w\-]+)*$/;

const timeoutSchema = yup
.string()
Expand Down Expand Up @@ -249,6 +250,7 @@ const mappingSchema = yup.object().shape({

const standardEnsemblerConfigSchema = yup.object().shape({
experiment_mappings: yup.array(mappingSchema),
route_name_path: yup.string().matches(routeNamePathRegex, "Route name path needs to be a valid period-delimited path"),
fallback_response_route_id: validRouteSchema,
});

Expand Down

0 comments on commit f5e889e

Please sign in to comment.