csrf_test.routing.yml

Same filename and directory in other branches
  1. 11.x core/modules/system/tests/modules/csrf_test/csrf_test.routing.yml
  2. 10 core/modules/system/tests/modules/csrf_test/csrf_test.routing.yml
  3. 9 core/modules/system/tests/modules/csrf_test/csrf_test.routing.yml
  4. 8.9.x core/modules/system/tests/modules/csrf_test/csrf_test.routing.yml
core/modules/system/tests/modules/csrf_test/csrf_test.routing.yml
1 string reference to YAML keys in csrf_test.routing.yml
CsrfRequestHeaderTest::testRouteAccess in core/modules/system/tests/src/Functional/CsrfRequestHeaderTest.php
Tests access to routes protected by CSRF request header requirements.

File

core/modules/system/tests/modules/csrf_test/csrf_test.routing.yml

View source
  1. # Tests CSRF request header token protection.
  2. csrf_test.protected:
  3. path: csrf/protected
  4. methods: ['POST']
  5. defaults:
  6. _controller: '\Drupal\csrf_test\Controller\TestController::testMethod'
  7. requirements:
  8. _csrf_request_header_token: 'TRUE'
  9. csrf_test.protected_read_only:
  10. path: csrf/protected/read-only
  11. methods: ['GET']
  12. defaults:
  13. _controller: '\Drupal\csrf_test\Controller\TestController::testMethod'
  14. requirements:
  15. _access: 'TRUE'
  16. _csrf_request_header_token: 'TRUE'
  17. csrf_test.route_with_csrf_token:
  18. path: csrf/protected/route
  19. defaults:
  20. _controller: '\Drupal\csrf_test\Controller\TestController::testMethod'
  21. requirements:
  22. _permission: 'administer site configuration'
  23. _csrf_token: 'TRUE'

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.