File tree Expand file tree Collapse file tree 3 files changed +28
-28
lines changed
python/ql/lib/semmle/python Expand file tree Collapse file tree 3 files changed +28
-28
lines changed Original file line number Diff line number Diff line change @@ -1425,7 +1425,7 @@ module Http {
1425
1425
string middleware_name ( ) { result = super .middleware_name ( ) }
1426
1426
1427
1427
/**
1428
- * Gets the dataflow node corresponding to the allowed CORS origins
1428
+ * Gets the dataflow node corresponding to the allowed CORS origins
1429
1429
*/
1430
1430
DataFlow:: Node allowed_origins ( ) { result = super .allowed_origins ( ) }
1431
1431
Original file line number Diff line number Diff line change @@ -43,30 +43,32 @@ module FastApi {
43
43
* A call to `app.add_middleware` adding CORSMiddleware.
44
44
*/
45
45
class AddCorsMiddlewareCall extends Http:: Server:: CorsMiddleware:: Range , AddMiddlewareCall {
46
- /**
47
- * Gets the string corresponding to the middleware
48
- */
46
+ /**
47
+ * Gets the string corresponding to the middleware
48
+ */
49
49
override string middleware_name ( ) { result = this .getArg ( 0 ) .asExpr ( ) .( Name ) .toString ( ) }
50
50
51
51
/**
52
- * Gets the dataflow node corresponding to the allowed CORS origins
53
- */
52
+ * Gets the dataflow node corresponding to the allowed CORS origins
53
+ */
54
54
override DataFlow:: Node allowed_origins ( ) { result = this .getArgByName ( "allow_origins" ) }
55
- /**
56
- * Gets the boolean value corresponding to if CORS credentials is enabled
57
- * (`true`) or disabled (`false`) by this node.
58
- */
55
+
56
+ /**
57
+ * Gets the boolean value corresponding to if CORS credentials is enabled
58
+ * (`true`) or disabled (`false`) by this node.
59
+ */
59
60
override DataFlow:: Node allowed_credentials ( ) {
60
61
result = this .getArgByName ( "allow_credentials" )
61
62
}
62
- /**
63
- * Gets the dataflow node corresponding to the allowed CORS methods
64
- */
63
+
64
+ /**
65
+ * Gets the dataflow node corresponding to the allowed CORS methods
66
+ */
65
67
DataFlow:: Node allowed_methods ( ) { result = this .getArgByName ( "allow_methods" ) }
66
68
67
- /**
68
- * Gets the dataflow node corresponding to the allowed CORS headers
69
- */
69
+ /**
70
+ * Gets the dataflow node corresponding to the allowed CORS headers
71
+ */
70
72
DataFlow:: Node allowed_headers ( ) { result = this .getArgByName ( "allow_headers" ) }
71
73
}
72
74
Original file line number Diff line number Diff line change @@ -27,8 +27,6 @@ private import semmle.python.frameworks.data.ModelsAsData
27
27
module Starlette {
28
28
/**
29
29
* Provides models for the `starlette.app` class
30
- *
31
- *
32
30
*/
33
31
module App {
34
32
/** Gets import of `starlette.app`. */
@@ -53,25 +51,25 @@ module Starlette {
53
51
* A call to any of the execute methods on a `app.add_middleware` with CORSMiddleware.
54
52
*/
55
53
class AddCorsMiddlewareCall extends AddMiddlewareCall , Http:: Server:: CorsMiddleware:: Range {
56
-
57
- /**
58
- * Gets the string corresponding to the middleware
59
- */
54
+ /**
55
+ * Gets the string corresponding to the middleware
56
+ */
60
57
override string middleware_name ( ) { result = this .getArg ( 0 ) .asExpr ( ) .( Name ) .toString ( ) }
61
58
62
59
override DataFlow:: Node allowed_origins ( ) { result = this .getArgByName ( "allow_origins" ) }
63
60
64
61
override DataFlow:: Node allowed_credentials ( ) {
65
62
result = this .getArgByName ( "allow_credentials" )
66
63
}
67
- /**
68
- * Gets the dataflow node corresponding to the allowed CORS methods
69
- */
64
+
65
+ /**
66
+ * Gets the dataflow node corresponding to the allowed CORS methods
67
+ */
70
68
DataFlow:: Node allowed_methods ( ) { result = this .getArgByName ( "allow_methods" ) }
71
69
72
- /**
73
- * Gets the dataflow node corresponding to the allowed CORS headers
74
- */
70
+ /**
71
+ * Gets the dataflow node corresponding to the allowed CORS headers
72
+ */
75
73
DataFlow:: Node allowed_headers ( ) { result = this .getArgByName ( "allow_headers" ) }
76
74
}
77
75
You can’t perform that action at this time.
0 commit comments