4
4
import java .util .List ;
5
5
import java .util .Map ;
6
6
7
+ import com .akto .dao .api_protection_parse_layer .AggregationLayerParser ;
7
8
import com .akto .dao .test_editor .filter .ConfigParser ;
9
+ import com .akto .dto .api_protection_parse_layer .AggregationRules ;
8
10
import com .akto .dto .monitoring .FilterConfig ;
9
11
import com .akto .dto .test_editor .ConfigParserResult ;
10
12
import com .akto .dto .test_editor .ExecutorConfigParserResult ;
@@ -36,15 +38,15 @@ public static FilterConfig parseConfig(Map<String, Object> config,boolean should
36
38
Object filterMap = config .get (FilterConfig .FILTER );
37
39
if (filterMap == null ) {
38
40
isFilterError = true ;
39
- filterConfig = new FilterConfig (id , null , null );
41
+ filterConfig = new FilterConfig (id , null , null , null );
40
42
}
41
43
42
44
ConfigParser configParser = new ConfigParser ();
43
45
ConfigParserResult filters = configParser .parse (filterMap );
44
46
if (filters == null ) {
45
47
// todo: throw error
46
48
isFilterError = true ;
47
- filterConfig = new FilterConfig (id , null , null );
49
+ filterConfig = new FilterConfig (id , null , null , null );
48
50
}
49
51
50
52
Map <String , List <String >> wordListMap = new HashMap <>();
@@ -54,10 +56,10 @@ public static FilterConfig parseConfig(Map<String, Object> config,boolean should
54
56
}
55
57
} catch (Exception e ) {
56
58
isFilterError = true ;
57
- filterConfig = new FilterConfig (id , filters , null );
59
+ filterConfig = new FilterConfig (id , filters , null , null );
58
60
}
59
61
if (!isFilterError ){
60
- filterConfig = new FilterConfig (id , filters , wordListMap );
62
+ filterConfig = new FilterConfig (id , filters , wordListMap , null );
61
63
}
62
64
63
65
if (shouldParseExecutor ){
@@ -70,6 +72,18 @@ public static FilterConfig parseConfig(Map<String, Object> config,boolean should
70
72
filterConfig .setExecutor (executorConfigParserResult );
71
73
}
72
74
75
+ AggregationLayerParser parser = new AggregationLayerParser ();
76
+ AggregationRules aggRules = null ;
77
+ try {
78
+ aggRules = parser .parse (config );
79
+ } catch (Exception e ) {
80
+ // TODO: handle exception
81
+ }
82
+
83
+ if (filterConfig != null ) {
84
+ filterConfig .setAggregationRules (aggRules );
85
+ }
86
+
73
87
return filterConfig ;
74
88
}
75
89
0 commit comments