1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Composer dependencies update.

This commit is contained in:
Caleb Mazalevskis 2022-07-25 11:30:24 +08:00
parent 5916608d84
commit d869816dcc
No known key found for this signature in database
GPG key ID: 082E6BC1046FAB95
499 changed files with 24721 additions and 2632 deletions

View file

@ -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);
}