nl-kat-coordination icon indicating copy to clipboard operation
nl-kat-coordination copied to clipboard

Plugin defaults not rendered / enabled in UI.

Open zcrt opened this issue 1 year ago • 1 comments

Describe the bug Default settings for plugins (using the default key in .json schema) are not rendered in the UI and also seem not to be applied from .json.

To Reproduce Steps to reproduce the behavior:

  1. Go to CVEfindingtypes boefje in interface
  2. Notice missing default value.

Expected behavior

  • Rendering defaults from .json in UI
  • Setting the default from .json in environment variables (make sure this does not clash with environment overrides from backend)

Screenshots image even though https://github.com/minvws/nl-kat-coordination/blob/724fb127db0018447848f8540a1c5a52a85a0624/boefjes/boefjes/plugins/kat_cve_finding_types/schema.json#L10

OpenKAT version 1.10.0rc2

Additional context https://github.com/minvws/nl-kat-coordination/pull/1378#discussion_r1264985790

zcrt avatar Jul 25 '23 10:07 zcrt

So, two separate issues here:

  • If no setting-value is available in the katalogus for this plugin , use the schema specified default if available.
  • When rendering the settings form pre-fill all fields with the schema-specified default value if available. This way they will get stored in the katalogus when enabling this plugin, and end up being used to we don't have to check in the schema again when using the plugin.

underdarknl avatar Sep 20 '23 07:09 underdarknl