From 21ce688fc5994ec39167aab22549d0f0450738bf Mon Sep 17 00:00:00 2001 From: elhoim Date: Sun, 30 Aug 2026 23:31:07 +0000 Subject: [PATCH] Fix explicit --type rejected when absent from describeTypes.json candidate_types was filtered against valid_types (describeTypes.json) even when the user passed an explicit --type. guess_attribute_types already filters its guesses against valid_types internally, so this second filter only ever had an effect on explicit types - rejecting any module-declared input type that GitHub's describeTypes.json does not list. Skip the valid_types-only filter for explicit --type and instead accept the type if it is in valid_types OR in supported_input_types (the set of input types declared by installed expansion modules), so a module-supported type is no longer rejected while still catching genuine typos. --- bin/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/cli.py b/bin/cli.py index 92267b1..6c92f9f 100644 --- a/bin/cli.py +++ b/bin/cli.py @@ -921,7 +921,10 @@ def main() -> int: log("No likely MISP attribute type could be guessed from the input.") return 1 - candidate_types = [(t, r) for t, r in candidate_types if t in valid_types] + if not args.attr_type: + candidate_types = [(t, r) for t, r in candidate_types if t in valid_types] + else: + candidate_types = [(t, r) for t, r in candidate_types if t in valid_types or t in supported_input_types] if not candidate_types: log("No valid MISP attribute type found.") return 1