You are here

public function TestAuthGlobal::applies in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/rest/tests/modules/rest_test/src/Authentication/Provider/TestAuthGlobal.php \Drupal\rest_test\Authentication\Provider\TestAuthGlobal::applies()
  2. 9 core/modules/rest/tests/modules/rest_test/src/Authentication/Provider/TestAuthGlobal.php \Drupal\rest_test\Authentication\Provider\TestAuthGlobal::applies()

Checks whether suitable authentication credentials are on the request.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The request object.

Return value

bool TRUE if authentication credentials suitable for this provider are on the request, FALSE otherwise.

Overrides AuthenticationProviderInterface::applies

File

core/modules/rest/tests/modules/rest_test/src/Authentication/Provider/TestAuthGlobal.php, line 16

Class

TestAuthGlobal
Global authentication provider for testing purposes.

Namespace

Drupal\rest_test\Authentication\Provider

Code

public function applies(Request $request) {
  return $request->headers
    ->has('REST-test-auth-global');
}