Updated Adding a new operation (markdown)
parent
bc71a4ce39
commit
7478e3ea9d
@ -65,6 +65,17 @@ Operation arguments (ingredients) can be set to any of the following types:
|
||||
- Particularly useful for arguments that can be specified in various different formats.
|
||||
- See the [XOR](https://github.com/gchq/CyberChef/blob/master/src/core/operations/XOR.mjs) operation for an example of how this works.
|
||||
|
||||
**Ingredient Validation**
|
||||
|
||||
Some simple validation of ingredient values is automatically performed. The following attributes can be added to an ingredient:
|
||||
- allowEmpty (true/false) - if true then providing no or an empty string will cause an error
|
||||
- min / max (numeric value) - for numbers supplying either or both of these will cause an error to occur if the supplied value is outside the given limits
|
||||
- integer (true/false) - for numbers, setting this to true will cause an error to be raised if a floting point number is supplied
|
||||
- maxLength (numeric value) - an error will be raised if the supplied value (string) is longer than this limit.
|
||||
|
||||
If these validation attributes are included in the ingredient definition there is no need to check for them in the operations run function as the CyberChef framework will carry out the checks for you.
|
||||
|
||||
For more information see the [Automated Validation Test Op](https://github.com/gchq/CyberChef/blob/master/src/core/operations/AutomatedValidationTestOp.mjs) operation and the [corresponding tests](https://github.com/gchq/CyberChef/blob/master/tests/operations/tests/AutomatedValidation.mjs)
|
||||
|
||||
## Presenting complex data
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user