@@ -123,7 +123,7 @@ class CsrfProtectionSetting extends DataFlow::Node instanceof CsrfProtectionSett
123123/** Provides a class for modeling new CSRF protection setting APIs. */
124124module CsrfProtectionSetting {
125125 /**
126- * A data-flow node that may set or unset Cross-site request forgery protection
126+ * A data-flow node that enables or disables Cross-site request forgery protection
127127 * in a global manner.
128128 *
129129 * Extend this class to model new APIs. If you want to refine existing API models,
@@ -139,35 +139,39 @@ module CsrfProtectionSetting {
139139}
140140
141141/**
142- * A data-flow node that provides Cross-site request forgery protection
142+ * A data-flow node that enables or disables Cross-site request forgery protection
143143 * for a specific part of an application.
144144 *
145145 * Extend this class to refine existing API models. If you want to model new APIs,
146- * extend `CsrfLocalProtection ::Range` instead.
146+ * extend `CsrfLocalProtectionSetting ::Range` instead.
147147 */
148- class CsrfLocalProtection extends DataFlow:: Node instanceof CsrfLocalProtection :: Range {
148+ class CsrfLocalProtectionSetting extends DataFlow:: Node instanceof CsrfLocalProtectionSetting :: Range {
149149 /**
150- * Gets a `Function` representing the protected interaction
151- * (probably a request handler).
150+ * Gets a request handler whose CSRF protection is changed.
152151 */
153- Function getProtected ( ) { result = super .getProtected ( ) }
152+ Function getRequestHandler ( ) { result = super .getRequestHandler ( ) }
153+
154+ /** Holds if CSRF protection is enabled by this setting */
155+ predicate csrfEnabled ( ) { super .csrfEnabled ( ) }
154156}
155157
156158/** Provides a class for modeling new CSRF protection setting APIs. */
157- module CsrfLocalProtection {
159+ module CsrfLocalProtectionSetting {
158160 /**
159- * A data-flow node that provides Cross-site request forgery protection
161+ * A data-flow node that enables or disables Cross-site request forgery protection
160162 * for a specific part of an application.
161163 *
162164 * Extend this class to model new APIs. If you want to refine existing API models,
163- * extend `CsrfLocalProtection ` instead.
165+ * extend `CsrfLocalProtectionSetting ` instead.
164166 */
165167 abstract class Range extends DataFlow:: Node {
166168 /**
167- * Gets a `Function` representing the protected interaction
168- * (probably a request handler).
169+ * Gets a request handler whose CSRF protection is changed.
169170 */
170- abstract Function getProtected ( ) ;
171+ abstract Function getRequestHandler ( ) ;
172+
173+ /** Holds if CSRF protection is enabled by this setting */
174+ abstract predicate csrfEnabled ( ) ;
171175 }
172176}
173177
0 commit comments