@@ -1271,23 +1271,26 @@ module PrivateDjango {
1271
1271
}
1272
1272
1273
1273
/** An attribute read on an django request that is a `MultiValueDict` instance. */
1274
- private class DjangoHttpRequestMultiValueDictInstances extends Django:: MultiValueDict:: InstanceSource {
1274
+ private class DjangoHttpRequestMultiValueDictInstances extends Django:: MultiValueDict:: InstanceSource
1275
+ {
1275
1276
DjangoHttpRequestMultiValueDictInstances ( ) {
1276
1277
this .( DataFlow:: AttrRead ) .getObject ( ) = instance ( ) and
1277
1278
this .( DataFlow:: AttrRead ) .getAttributeName ( ) in [ "GET" , "POST" , "FILES" ]
1278
1279
}
1279
1280
}
1280
1281
1281
1282
/** An attribute read on an django request that is a `ResolverMatch` instance. */
1282
- private class DjangoHttpRequestResolverMatchInstances extends Django:: ResolverMatch:: InstanceSource {
1283
+ private class DjangoHttpRequestResolverMatchInstances extends Django:: ResolverMatch:: InstanceSource
1284
+ {
1283
1285
DjangoHttpRequestResolverMatchInstances ( ) {
1284
1286
this .( DataFlow:: AttrRead ) .getObject ( ) = instance ( ) and
1285
1287
this .( DataFlow:: AttrRead ) .getAttributeName ( ) = "resolver_match"
1286
1288
}
1287
1289
}
1288
1290
1289
1291
/** An `UploadedFile` instance that originates from a django request. */
1290
- private class DjangoHttpRequestUploadedFileInstances extends Django:: UploadedFile:: InstanceSource {
1292
+ private class DjangoHttpRequestUploadedFileInstances extends Django:: UploadedFile:: InstanceSource
1293
+ {
1291
1294
DjangoHttpRequestUploadedFileInstances ( ) {
1292
1295
// TODO: this currently only works in local-scope, since writing type-trackers for
1293
1296
// this is a little too much effort. Once API-graphs are available for more
@@ -1421,7 +1424,8 @@ module PrivateDjango {
1421
1424
* Use the predicate `HttpResponseRedirect::instance()` to get references to instances of `django.http.response.HttpResponseRedirect`.
1422
1425
*/
1423
1426
abstract class InstanceSource extends HttpResponse:: InstanceSource ,
1424
- Http:: Server:: HttpRedirectResponse:: Range , DataFlow:: Node { }
1427
+ Http:: Server:: HttpRedirectResponse:: Range , DataFlow:: Node
1428
+ { }
1425
1429
1426
1430
/** A direct instantiation of `django.http.response.HttpResponseRedirect`. */
1427
1431
private class ClassInstantiation extends InstanceSource , DataFlow:: CallCfgNode {
@@ -1483,7 +1487,8 @@ module PrivateDjango {
1483
1487
* Use the predicate `HttpResponsePermanentRedirect::instance()` to get references to instances of `django.http.response.HttpResponsePermanentRedirect`.
1484
1488
*/
1485
1489
abstract class InstanceSource extends HttpResponse:: InstanceSource ,
1486
- Http:: Server:: HttpRedirectResponse:: Range , DataFlow:: Node { }
1490
+ Http:: Server:: HttpRedirectResponse:: Range , DataFlow:: Node
1491
+ { }
1487
1492
1488
1493
/** A direct instantiation of `django.http.response.HttpResponsePermanentRedirect`. */
1489
1494
private class ClassInstantiation extends InstanceSource , DataFlow:: CallCfgNode {
@@ -2086,7 +2091,8 @@ module PrivateDjango {
2086
2091
*
2087
2092
* See https://docs.djangoproject.com/en/3.1/ref/request-response/#django.http.HttpResponse.write
2088
2093
*/
2089
- class HttpResponseWriteCall extends Http:: Server:: HttpResponse:: Range , DataFlow:: CallCfgNode {
2094
+ class HttpResponseWriteCall extends Http:: Server:: HttpResponse:: Range , DataFlow:: CallCfgNode
2095
+ {
2090
2096
DjangoImpl:: DjangoHttp:: Response:: HttpResponse:: InstanceSource instance ;
2091
2097
2092
2098
HttpResponseWriteCall ( ) { this .getFunction ( ) = write ( instance ) }
@@ -2106,7 +2112,8 @@ module PrivateDjango {
2106
2112
* A call to `set_cookie` on a HTTP Response.
2107
2113
*/
2108
2114
class DjangoResponseSetCookieCall extends Http:: Server:: CookieWrite:: Range ,
2109
- DataFlow:: MethodCallNode {
2115
+ DataFlow:: MethodCallNode
2116
+ {
2110
2117
DjangoResponseSetCookieCall ( ) {
2111
2118
this .calls ( DjangoImpl:: DjangoHttp:: Response:: HttpResponse:: instance ( ) , "set_cookie" )
2112
2119
}
@@ -2126,7 +2133,8 @@ module PrivateDjango {
2126
2133
* A call to `delete_cookie` on a HTTP Response.
2127
2134
*/
2128
2135
class DjangoResponseDeleteCookieCall extends Http:: Server:: CookieWrite:: Range ,
2129
- DataFlow:: MethodCallNode {
2136
+ DataFlow:: MethodCallNode
2137
+ {
2130
2138
DjangoResponseDeleteCookieCall ( ) {
2131
2139
this .calls ( DjangoImpl:: DjangoHttp:: Response:: HttpResponse:: instance ( ) , "delete_cookie" )
2132
2140
}
@@ -2429,7 +2437,8 @@ module PrivateDjango {
2429
2437
2430
2438
/** A request handler defined in a django view class, that has no known route. */
2431
2439
private class DjangoViewClassHandlerWithoutKnownRoute extends Http:: Server:: RequestHandler:: Range ,
2432
- DjangoRouteHandler {
2440
+ DjangoRouteHandler
2441
+ {
2433
2442
DjangoViewClassHandlerWithoutKnownRoute ( ) {
2434
2443
exists ( DjangoViewClass vc | vc .getARequestHandler ( ) = this ) and
2435
2444
not exists ( DjangoRouteSetup setup | setup .getARequestHandler ( ) = this )
@@ -2587,7 +2596,8 @@ module PrivateDjango {
2587
2596
// ---------------------------------------------------------------------------
2588
2597
/** A parameter that will receive the django `HttpRequest` instance when a request handler is invoked. */
2589
2598
private class DjangoRequestHandlerRequestParam extends DjangoImpl:: DjangoHttp:: Request:: HttpRequest:: InstanceSource ,
2590
- RemoteFlowSource:: Range , DataFlow:: ParameterNode {
2599
+ RemoteFlowSource:: Range , DataFlow:: ParameterNode
2600
+ {
2591
2601
DjangoRequestHandlerRequestParam ( ) {
2592
2602
this .getParameter ( ) = any ( DjangoRouteSetup setup ) .getARequestHandler ( ) .getRequestParam ( )
2593
2603
or
@@ -2604,7 +2614,8 @@ module PrivateDjango {
2604
2614
* See https://docs.djangoproject.com/en/3.1/topics/class-based-views/generic-display/#dynamic-filtering
2605
2615
*/
2606
2616
private class DjangoViewClassRequestAttributeRead extends DjangoImpl:: DjangoHttp:: Request:: HttpRequest:: InstanceSource ,
2607
- RemoteFlowSource:: Range , DataFlow:: Node {
2617
+ RemoteFlowSource:: Range , DataFlow:: Node
2618
+ {
2608
2619
DjangoViewClassRequestAttributeRead ( ) {
2609
2620
exists ( DataFlow:: AttrRead read | this = read |
2610
2621
read .getObject ( ) = any ( DjangoViewClass vc ) .getASelfRef ( ) and
@@ -2624,7 +2635,8 @@ module PrivateDjango {
2624
2635
* See https://docs.djangoproject.com/en/3.1/topics/class-based-views/generic-display/#dynamic-filtering
2625
2636
*/
2626
2637
private class DjangoViewClassRoutedParamsAttributeRead extends RemoteFlowSource:: Range ,
2627
- DataFlow:: Node {
2638
+ DataFlow:: Node
2639
+ {
2628
2640
DjangoViewClassRoutedParamsAttributeRead ( ) {
2629
2641
exists ( DataFlow:: AttrRead read | this = read |
2630
2642
read .getObject ( ) = any ( DjangoViewClass vc ) .getASelfRef ( ) and
@@ -2652,7 +2664,8 @@ module PrivateDjango {
2652
2664
* - https://docs.djangoproject.com/en/3.1/topics/http/file-uploads/#handling-uploaded-files-with-a-model
2653
2665
*/
2654
2666
private class DjangoFileFieldUploadToFunctionFilenameParam extends RemoteFlowSource:: Range ,
2655
- DataFlow:: ParameterNode {
2667
+ DataFlow:: ParameterNode
2668
+ {
2656
2669
DjangoFileFieldUploadToFunctionFilenameParam ( ) {
2657
2670
exists ( DataFlow:: CallCfgNode call , DataFlow:: Node uploadToArg , Function func |
2658
2671
this .getParameter ( ) = func .getArg ( 1 ) and
@@ -2679,7 +2692,8 @@ module PrivateDjango {
2679
2692
* See https://docs.djangoproject.com/en/3.1/topics/http/shortcuts/#redirect
2680
2693
*/
2681
2694
private class DjangoShortcutsRedirectCall extends Http:: Server:: HttpRedirectResponse:: Range ,
2682
- DataFlow:: CallCfgNode {
2695
+ DataFlow:: CallCfgNode
2696
+ {
2683
2697
DjangoShortcutsRedirectCall ( ) { this = DjangoImpl:: Shortcuts:: redirect ( ) .getACall ( ) }
2684
2698
2685
2699
/**
@@ -2713,7 +2727,8 @@ module PrivateDjango {
2713
2727
* See https://docs.djangoproject.com/en/3.1/ref/class-based-views/base/#redirectview
2714
2728
*/
2715
2729
private class DjangoRedirectViewGetRedirectUrlReturn extends Http:: Server:: HttpRedirectResponse:: Range ,
2716
- DataFlow:: CfgNode {
2730
+ DataFlow:: CfgNode
2731
+ {
2717
2732
DjangoRedirectViewGetRedirectUrlReturn ( ) {
2718
2733
node = any ( GetRedirectUrlFunction f ) .getAReturnValueFlowNode ( )
2719
2734
}
0 commit comments