mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Composer dependencies update.
This commit is contained in:
parent
5916608d84
commit
d869816dcc
499 changed files with 24721 additions and 2632 deletions
12
vendor/firebase/php-jwt/src/CachedKeySet.php
vendored
12
vendor/firebase/php-jwt/src/CachedKeySet.php
vendored
|
@ -132,13 +132,13 @@ class CachedKeySet implements ArrayAccess
|
|||
|
||||
private function keyIdExists(string $keyId): bool
|
||||
{
|
||||
$keySetToCache = null;
|
||||
if (null === $this->keySet) {
|
||||
$item = $this->getCacheItem();
|
||||
// Try to load keys from cache
|
||||
if ($item->isHit()) {
|
||||
// item found! Return it
|
||||
$this->keySet = $item->get();
|
||||
$jwks = $item->get();
|
||||
$this->keySet = JWK::parseKeySet(json_decode($jwks, true), $this->defaultAlg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,17 +148,15 @@ class CachedKeySet implements ArrayAccess
|
|||
}
|
||||
$request = $this->httpFactory->createRequest('get', $this->jwksUri);
|
||||
$jwksResponse = $this->httpClient->sendRequest($request);
|
||||
$jwks = json_decode((string) $jwksResponse->getBody(), true);
|
||||
$this->keySet = $keySetToCache = JWK::parseKeySet($jwks, $this->defaultAlg);
|
||||
$jwks = (string) $jwksResponse->getBody();
|
||||
$this->keySet = JWK::parseKeySet(json_decode($jwks, true), $this->defaultAlg);
|
||||
|
||||
if (!isset($this->keySet[$keyId])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($keySetToCache) {
|
||||
$item = $this->getCacheItem();
|
||||
$item->set($keySetToCache);
|
||||
$item->set($jwks);
|
||||
if ($this->expiresAfter) {
|
||||
$item->expiresAfter($this->expiresAfter);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue