mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-19 00:15:43 +01:00
fix: only allow specified operators
This commit is contained in:
parent
bf778a6741
commit
3db680a40e
@ -1,4 +1,5 @@
|
||||
import joi from 'joi';
|
||||
import { ALL_OPERATORS } from '../util/constants';
|
||||
import { nameType } from '../routes/util';
|
||||
|
||||
export const nameSchema = joi
|
||||
@ -8,7 +9,7 @@ export const nameSchema = joi
|
||||
|
||||
export const constraintSchema = joi.object().keys({
|
||||
contextName: joi.string(),
|
||||
operator: joi.string(),
|
||||
operator: joi.string().valid(...ALL_OPERATORS),
|
||||
values: joi.array().items(joi.string().min(1).max(100)).min(1).optional(),
|
||||
value: joi.optional(),
|
||||
caseInsensitive: joi.boolean().optional(),
|
||||
|
Loading…
Reference in New Issue
Block a user