@@ -33,7 +33,7 @@ module Starlette {
3333 API:: Node cls ( ) { result = API:: moduleImport ( "starlette" ) .getMember ( "app" ) }
3434
3535 /** Gets a reference to a Starlette application (an instance of `starlette.app`). */
36- API:: Node instance ( ) { result = cls ( ) .getReturn ( ) }
36+ API:: Node instance ( ) { result = cls ( ) .getAnInstance ( ) }
3737 }
3838
3939 /**
@@ -47,7 +47,7 @@ module Starlette {
4747 /**
4848 * Gets the string corresponding to the middleware
4949 */
50- string middleware_name ( ) { result = this .getArg ( 0 ) .asExpr ( ) .( Name ) .toString ( ) }
50+ string getMiddlewareName ( ) { result = this .getArg ( 0 ) .asExpr ( ) .( Name ) .getId ( ) }
5151 }
5252
5353 /**
@@ -57,11 +57,11 @@ module Starlette {
5757 /**
5858 * Gets the string corresponding to the middleware
5959 */
60- override string middleware_name ( ) { result = this .getArg ( 0 ) .asExpr ( ) .( Name ) .toString ( ) }
60+ override string getMiddlewareName ( ) { result = this .getArg ( 0 ) .asExpr ( ) .( Name ) .getId ( ) }
6161
62- override DataFlow:: Node allowed_origins ( ) { result = this .getArgByName ( "allow_origins" ) }
62+ override DataFlow:: Node getOrigins ( ) { result = this .getArgByName ( "allow_origins" ) }
6363
64- override DataFlow:: Node allowed_credentials ( ) {
64+ override DataFlow:: Node getCredentialsAllowed ( ) {
6565 result = this .getArgByName ( "allow_credentials" )
6666 }
6767
@@ -89,32 +89,8 @@ module Starlette {
8989 result = ModelOutput:: getATypeNode ( "starlette.middleware.Middleware~Subclass" ) .getASubclass * ( )
9090 }
9191
92- /**
93- * A source of instances of `starlette.middleware.Middleware`, extend this class to model new instances.
94- *
95- * This can include instantiations of the class, return values from function
96- * calls, or a special parameter that will be set when functions are called by an external
97- * library.
98- *
99- * Use the predicate `Middleware::instance()` to get references to instances of `starlette.middleware.middleware`.
100- */
101- abstract class InstanceSource extends DataFlow:: LocalSourceNode { }
102-
103- /** A direct instantiation of `starlette.middleware.Middleware`. */
104- class ClassInstantiation extends InstanceSource , DataFlow:: CallCfgNode {
105- ClassInstantiation ( ) { this = classRef ( ) .getACall ( ) }
106- }
107-
108- /** Gets a reference to an instance of `starlette.middleware.Middleware`. */
109- private DataFlow:: TypeTrackingNode instance ( DataFlow:: TypeTracker t ) {
110- t .start ( ) and
111- result instanceof InstanceSource
112- or
113- exists ( DataFlow:: TypeTracker t2 | result = instance ( t2 ) .track ( t2 , t ) )
114- }
115-
11692 /** Gets a reference to an instance of `starlette.middleware.Middleware`. */
117- DataFlow:: Node instance ( ) { instance ( DataFlow :: TypeTracker :: end ( ) ) . flowsTo ( result ) }
93+ DataFlow:: Node instance ( ) { result = classRef ( ) . getACall ( ) }
11894 }
11995
12096 /**
0 commit comments