Skip to content

Commit

Permalink
[Reporting] Config Schema Validation for rules[N].protocol strings (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan authored Oct 16, 2020
1 parent ee1ef74 commit a9dfaee
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion x-pack/plugins/reporting/server/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@ const QueueSchema = schema.object({
const RulesSchema = schema.object({
allow: schema.boolean(),
host: schema.maybe(schema.string()),
protocol: schema.maybe(schema.string()),
protocol: schema.maybe(
schema.string({
validate(value) {
if (!/:$/.test(value)) {
return 'must end in colon';
}
},
})
),
});

const CaptureSchema = schema.object({
Expand Down

0 comments on commit a9dfaee

Please sign in to comment.