From 416af3df8bd12b8d8ad478dc005d061cd9717a5f Mon Sep 17 00:00:00 2001 From: Martin Klotz Date: Wed, 18 Sep 2024 13:19:38 +0200 Subject: [PATCH 1/2] deny unknown fields --- src/lib.rs | 3 +++ src/workflow.rs | 1 + 2 files changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index c9a17438..6470b888 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -452,6 +452,7 @@ impl Display for StepID { pub trait Step {} #[derive(Deserialize)] +#[serde(deny_unknown_fields)] pub struct ImporterStep { #[serde(flatten)] module: ReadFrom, @@ -473,6 +474,7 @@ impl ImporterStep { impl Step for ImporterStep {} #[derive(Deserialize)] +#[serde(deny_unknown_fields)] pub struct ExporterStep { #[serde(flatten)] module: WriteAs, @@ -495,6 +497,7 @@ impl ExporterStep { impl Step for ExporterStep {} #[derive(Deserialize)] +#[serde(deny_unknown_fields)] pub struct ManipulatorStep { #[serde(flatten)] module: GraphOp, diff --git a/src/workflow.rs b/src/workflow.rs index 31cb3474..1dbf8954 100644 --- a/src/workflow.rs +++ b/src/workflow.rs @@ -45,6 +45,7 @@ pub enum StatusMessage { /// The manipulators are executed in their defined sequence and can change the annotation graph. /// Last, all exporters are called with the now read-only annotation graph in parallel. #[derive(Deserialize)] +#[serde(deny_unknown_fields)] pub struct Workflow { import: Vec, graph_op: Option>, From 70a82d87ef94410517bd30aa4349e4364fb64412 Mon Sep 17 00:00:00 2001 From: Martin Klotz Date: Wed, 18 Sep 2024 13:21:06 +0200 Subject: [PATCH 2/2] update --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96952364..3247afd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `xlsx` importer did not give the correct node name to segmentation token. Due to this inconsistency, span annotations on segmentation nodes where not connected to the segmentation token. +- unknown keys in toml configurations are now denied not only in config context, but globally in a workflow file ## [0.16.0] - 2024-09-02