public function Oauth2Token::getCacheTagsToInvalidate in Simple OAuth (OAuth2) & OpenID Connect 5.x
Same name and namespace in other branches
- 8.4 src/Entity/Oauth2Token.php \Drupal\simple_oauth\Entity\Oauth2Token::getCacheTagsToInvalidate()
Returns the cache tags that should be used to invalidate caches.
This will not return additional cache tags added through addCacheTags().
Return value
string[] Set of cache tags.
Overrides EntityBase::getCacheTagsToInvalidate
See also
\Drupal\Core\Cache\RefinableCacheableDependencyInterface::addCacheTags()
\Drupal\Core\Cache\CacheableDependencyInterface::getCacheTags()
1 call to Oauth2Token::getCacheTagsToInvalidate()
- Oauth2Token::getCacheTags in src/
Entity/ Oauth2Token.php - The cache tags associated with this object.
File
- src/
Entity/ Oauth2Token.php, line 227
Class
- Oauth2Token
- Defines the Oauth2 Token entity.
Namespace
Drupal\simple_oauth\EntityCode
public function getCacheTagsToInvalidate() {
// It's feasible there are millions of OAuth2 tokens in rotation; they're
// used only for authentication, not for computing output. Hence it does not
// make sense for an OAuth2 token to be a cacheable dependency. Consequently
// generating a unique cache tag for every OAuth2 token entity should be
// avoided. Therefore a single cache tag is used for all OAuth2 token
// entities, including for lists.
return [
'oauth2_token',
];
}