@@ -144,6 +144,15 @@ class ValidateAntiForgeryAttribute extends Attribute {
144144 }
145145}
146146
147+ /**
148+ * The `Microsoft.AspNetCore.Mvc.AutoValidateAntiforgeryTokenAttribute` class.
149+ */
150+ class AutoValidateAntiforgeryTokenAttribute extends Class {
151+ AutoValidateAntiforgeryTokenAttribute ( ) {
152+ this .hasFullyQualifiedName ( "Microsoft.AspNetCore.Mvc" , "AutoValidateAntiforgeryTokenAttribute" )
153+ }
154+ }
155+
147156/**
148157 * A class that has a name like `[Auto...]Validate[...]Anti[Ff]orgery[...Token]` and implements `IFilterMetadata` interface
149158 * This class can be added to a collection of global `MvcOptions.Filters` collection.
@@ -230,11 +239,20 @@ private Assembly getAnAssemblyFor(Type type) {
230239 result = getACompilationFor ( type ) .getOutputAssembly ( )
231240}
232241
233- private predicate isMicrosoftAspNetCoreMvcRegistration ( MethodCall call ) {
234- call .getTarget ( )
235- .hasFullyQualifiedName ( "Microsoft.Extensions.DependencyInjection" ,
236- [ "MvcServiceCollectionExtensions" , "MvcCoreServiceCollectionExtensions" ] ,
237- [ "AddControllers" , "AddControllersWithViews" , "AddMvc" , "AddMvcCore" ] )
242+ /**
243+ * A method that is a registration of an ASP.NET Core MVC service, i.e. `AddControllers`, `AddControllersWithViews`, `AddMvc`, or `AddMvcCore`.
244+ */
245+ class MicrosoftAspNetCoreMvcRegistration extends Method {
246+ MicrosoftAspNetCoreMvcRegistration ( ) {
247+ this .hasFullyQualifiedName ( "Microsoft.Extensions.DependencyInjection" ,
248+ [ "MvcServiceCollectionExtensions" , "MvcCoreServiceCollectionExtensions" ] ,
249+ [ "AddControllers" , "AddControllersWithViews" , "AddMvc" , "AddMvcCore" ] )
250+ }
251+ }
252+
253+ /** Holds if the method call is a registration of an ASP.NET Core MVC service. */
254+ predicate isMicrosoftAspNetCoreMvcRegistration ( MethodCall call ) {
255+ call .getTarget ( ) instanceof MicrosoftAspNetCoreMvcRegistration
238256}
239257
240258private predicate isMicrosoftAspNetCoreMvcApplication ( Compilation compilation ) {
0 commit comments