Skip to content

Commit

Permalink
Remove limits from tags
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Jan 25, 2024
1 parent f80150b commit 011f973
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
22 changes: 0 additions & 22 deletions x-pack/plugins/cases/server/connectors/cases/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,28 +75,6 @@ describe('CasesConnectorRunParamsSchema', () => {
).not.toThrow();
});

it('does not accept more than 10 tags', () => {
const params = getParams();

expect(() =>
CasesConnectorRunParamsSchema.validate({
...params,
rule: { ...params.rule, tags: Array(11).fill('test') },
})
).toThrow();
});

it('does not accept a tag that is more than 50 characters', () => {
const params = getParams();

expect(() =>
CasesConnectorRunParamsSchema.validate({
...params,
rule: { ...params.rule, tags: ['x'.repeat(51)] },
})
).toThrow();
});

it('does not accept an empty tag', () => {
const params = getParams();

Expand Down
8 changes: 1 addition & 7 deletions x-pack/plugins/cases/server/connectors/cases/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ const GroupingSchema = schema.arrayOf(schema.string(), { minSize: 0, maxSize: 1
const RuleSchema = schema.object({
id: schema.string(),
name: schema.string(),
/**
* TODO: Verify limits
*/
tags: schema.arrayOf(schema.string({ minLength: 1, maxLength: 50 }), {
minSize: 0,
maxSize: 10,
}),
tags: schema.arrayOf(schema.string(), { defaultValue: [] }),
ruleUrl: schema.nullable(schema.string()),
});

Expand Down

0 comments on commit 011f973

Please sign in to comment.