From efafc2c3165e4ab800fa43dbd05ff1caf2205380 Mon Sep 17 00:00:00 2001 From: KhemrajSingh Rathore Date: Mon, 19 Aug 2024 20:47:05 +0530 Subject: [PATCH] update validation for inference rule (#1256) * update validation for inference rule * handle headOption.get operation in DynamicRuleValidator * use unknown as default value * Revert "use unknown as default value" This reverts commit 557167dadc3220fb820793238b18984c2381bbd4. * Revert "handle headOption.get operation in DynamicRuleValidator" This reverts commit 9dbe52c53dcc0a0fddf14e8c1497b1eaf0018012. --- .../resources/ai/privado/rulevalidator/schema/inferences.json | 2 +- src/main/scala/ai/privado/model/PrivadoTag.scala | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/resources/ai/privado/rulevalidator/schema/inferences.json b/src/main/resources/ai/privado/rulevalidator/schema/inferences.json index dbff9f0a9..4a9e3b92e 100644 --- a/src/main/resources/ai/privado/rulevalidator/schema/inferences.json +++ b/src/main/resources/ai/privado/rulevalidator/schema/inferences.json @@ -55,7 +55,7 @@ "code", "method_full_name" ], - "pattern": "^(code|method_full_name|method_full_name_with_literal|method_full_name_with_property_name)$" + "pattern": "^(code|method_full_name|method_full_name_with_literal|method_full_name_with_property_name|endpoint_domain_with_literal|endpoint_domain_with_property_name)$" }, "domains": { "$id": "#root/inferences/items/domains", diff --git a/src/main/scala/ai/privado/model/PrivadoTag.scala b/src/main/scala/ai/privado/model/PrivadoTag.scala index 1c98f981a..e435b2154 100644 --- a/src/main/scala/ai/privado/model/PrivadoTag.scala +++ b/src/main/scala/ai/privado/model/PrivadoTag.scala @@ -254,6 +254,8 @@ object ConfigRuleType extends Enumeration { } object FilterProperty extends Enumeration { + // TODO When we update the Filter Property also update the validation regex at + // src/main/resources/ai/privado/rulevalidator/schema/inferences.json type FilterProperty = Value val METHOD_FULL_NAME: model.FilterProperty.Value = Value("method_full_name") val CODE: model.FilterProperty.Value = Value("code")