Verified Commit 50eb9bca authored by catch's avatar catch Committed by Lee Rowlands
Browse files

Issue #3347067 by danflanagan8, _pratik_, smustgrave, longwave:...

Issue #3347067 by danflanagan8, _pratik_, smustgrave, longwave: CsrfAccessCheck docblock extremely out of date

(cherry picked from commit 45e7bcd5)
parent 040baa39
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -8,11 +8,19 @@
use Symfony\Component\HttpFoundation\Request;

/**
 * Allows access to routes to be controlled by a '_csrf_token' parameter.
 * Access protection against CSRF attacks.
 *
 * To use this check, add a "token" GET parameter to URLs of which the value is
 * a token generated by \Drupal::csrfToken()->get() using the same value as the
 * "_csrf_token" parameter in the route.
 * The CsrfAccessCheck is added to any route with the '_csrf_token' route
 * requirement. If a link/url to a protected route is generated using the
 * url_generator service, a valid token will be added automatically. Otherwise,
 * a valid token can be generated by the csrf_token service using the route's
 * path (without leading slash) as the argument when generating the token. This
 * token can then be added as the 'token' query parameter when accessing the
 * protected route.
 *
 * @see \Drupal\Core\Access\RouteProcessorCsrf
 * @see \Drupal\Core\Access\CsrfTokenGenerator
 * @see https://www.drupal.org/docs/8/api/routing-system/access-checking-on-routes/csrf-access-checking
 */
class CsrfAccessCheck implements RoutingAccessInterface {