class UsersJwtRequestPolicy in JSON Web Token Authentication (JWT) 8
Cache policy for pages served from JWT auth.
This policy disallows caching of requests that use users_jwt_auth. Otherwise, responses for authenticated requests can get into the page cache and could be delivered to unprivileged users.
Hierarchy
- class \Drupal\users_jwt\PageCache\UsersJwtRequestPolicy implements RequestPolicyInterface
Expanded class hierarchy of UsersJwtRequestPolicy
1 string reference to 'UsersJwtRequestPolicy'
- users_jwt.services.yml in modules/
users_jwt/ users_jwt.services.yml - modules/users_jwt/users_jwt.services.yml
1 service uses UsersJwtRequestPolicy
File
- modules/
users_jwt/ src/ PageCache/ UsersJwtRequestPolicy.php, line 16
Namespace
Drupal\users_jwt\PageCacheView source
class UsersJwtRequestPolicy implements RequestPolicyInterface {
/**
* {@inheritdoc}
*/
public function check(Request $request) {
if (UsersJwtAuth::getJwtFromRequest($request)) {
return self::DENY;
}
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RequestPolicyInterface:: |
constant | Allow delivery of cached pages. | ||
RequestPolicyInterface:: |
constant | Deny delivery of cached pages. | ||
UsersJwtRequestPolicy:: |
public | function |
Determines whether delivery of a cached page should be attempted. Overrides RequestPolicyInterface:: |