@@ -79,3 +79,50 @@ mod poem_test {
79
79
// ...
80
80
}
81
81
}
82
+
83
+ mod actix_test {
84
+ use actix_web:: { get, web, App , HttpServer } ;
85
+ use crate :: web_frameworks:: sink;
86
+
87
+ async fn my_actix_handler_1 ( path : web:: Path < String > ) -> String { // $ MISSING: Alert[rust/summary/taint-sources]
88
+ let a = path. into_inner ( ) ;
89
+ sink ( a. as_str ( ) ) ; // $ MISSING: hasTaintFlow
90
+ sink ( a. as_bytes ( ) ) ; // $ MISSING: hasTaintFlow
91
+ sink ( a) ; // $ MISSING: hasTaintFlow
92
+
93
+ "" . to_string ( )
94
+ }
95
+
96
+ async fn my_actix_handler_2 ( path : web:: Path < ( String , String ) > ) -> String { // $ MISSING: Alert[rust/summary/taint-sources]
97
+ let ( a, b) = path. into_inner ( ) ;
98
+
99
+ sink ( a) ; // $ MISSING: hasTaintFlow
100
+ sink ( b) ; // $ MISSING: hasTaintFlow
101
+
102
+ "" . to_string ( )
103
+ }
104
+
105
+ async fn my_actix_handler_3 ( web:: Query ( a) : web:: Query < String > ) -> String { // $ MISSING: Alert[rust/summary/taint-sources]
106
+ sink ( a) ; // $ MISSING: hasTaintFlow
107
+
108
+ "" . to_string ( )
109
+ }
110
+
111
+ #[ get( "/4/{a}" ) ]
112
+ async fn my_actix_handler_4 ( path : web:: Path < String > ) -> String { // $ MISSING: Alert[rust/summary/taint-sources]
113
+ let a = path. into_inner ( ) ;
114
+ sink ( a) ; // $ MISSING: hasTaintFlow
115
+
116
+ "" . to_string ( )
117
+ }
118
+
119
+ async fn test_actix ( ) {
120
+ let app = App :: new ( )
121
+ . route ( "/1/{a}" , web:: get ( ) . to ( my_actix_handler_1) )
122
+ . route ( "/2/{a}/{b}" , web:: get ( ) . to ( my_actix_handler_2) )
123
+ . route ( "/3/{a}" , web:: get ( ) . to ( my_actix_handler_3) )
124
+ . service ( my_actix_handler_4) ;
125
+
126
+ // ...
127
+ }
128
+ }
0 commit comments