feat: Implement automated option-type ingredient validation#2625
Conversation
…test suite failures
|
Just as a general comment - it would be hugely preferable if you raised PRs against CyberChef manually through the Github web ui, or at least ensured that the headings that the PR template adds are all present and completed. The PR section headings should include: In particular for this specific PR could you add an AI disclosure (which can, if appropriate be "No AI used") |
|
@GCHQDeveloper581 Apologies for the oversight! I have updated the PR description to follow the repository template, including the requested sections and the AI disclosure. Thank you! |
GCHQDeveloper581
left a comment
There was a problem hiding this comment.
The option validation doesn't seem to work for this case, which I believe it should as the empty ingredient is an option ingredient:
(adjust start of URL to suit your local setup)
(input is a hex encoded single pixel PNG image)
|
Thanks for updating the PR description Please could you state the specific AI / version in the declaration as well - eg "GPT 5.5 was used to help implement and verify these changes." |
…on lists, and update test expectations
|
@GCHQDeveloper581 I have updated the validation logic in Ingredient.mjs to handle empty/omitted parameters correctly. Explicitly empty options (like in View_Bit_Plane('', 0)) are now rejected unless the options list explicitly permits them, while unspecified/hidden parameters now resolve to their default values. I've also updated the PR description to explicitly declare the use of Gemini 3.5 Flash. All 2,059 tests are now fully passing. |
|
@GCHQDeveloper581 lemme know any further changes is required !! |
|
@GCHQDeveloper581 I think now it's resloved !! take a look again |
GCHQDeveloper581
left a comment
There was a problem hiding this comment.
Looks good!
Many thanks for your contribution.
Description
This PR extends the automated parameter validation framework to include validation of "option" type ingredients.
It implements global, automated checks for option parameters in
Ingredient.mjs, filters out markdown-based optgroup headings, handles case-insensitive matches, and resolves default option list values (including array-based defaults) during hydration and validation.It also fixes related option config typos and missing parameters in existing ciphers (e.g.,
SM4Encryptmode list) and test definitions.Existing Issue
Fixes #2623
AI disclosure
Gemini 3.5 Flash was used to help implement and verify these changes.
Test Coverage
Added tests in
tests/operations/tests/AutomatedValidation.mjsverifying Option type argument validation:allowEmptyconfiguration.