client = $client ?? Psr18ClientDiscovery::find(); $this->requestFactory = $requestFactory ?? Psr17FactoryDiscovery::findRequestFactory(); } public function fetch(OpenIDClient $client, array $claims, array $accessTokens = []): array { $claimSources = $claims['_claim_sources'] ?? null; $claimNames = $claims['_claim_names'] ?? null; if (! is_array($claimSources)) { return $claims; } if (! is_array($claimNames)) { return $claims; } $distributedSources = array_filter($claimSources, fn ($value): bool => $this->isDistributedSource($value)); /** @var array $responses */ $responses = []; foreach ($distributedSources as $sourceName => $source) { $request = $this->requestFactory->createRequest('GET', $source['endpoint']) ->withHeader('accept', 'application/jwt'); $accessToken = $source['access_token'] ?? ($accessTokens[$sourceName] ?? null); if ($accessToken) { $request = $request->withHeader('authorization', 'Bearer ' . $accessToken); } try { $responses[$sourceName] = $this->client->sendRequest($request); } catch (Throwable $e) { throw new RuntimeException("Unable to fetch distributed claim for \"{$sourceName}\"", 0, $e); } } $claimPayloads = []; foreach ($responses as $sourceName => $response) { try { check_server_response($response); $claimPayloads[$sourceName] = $this->claimJWT($client, (string) $response->getBody()); unset($claims['_claim_sources'][$sourceName]); } catch (Throwable $e) { throw new RuntimeException("Unable to fetch distributed claim for \"{$sourceName}\"", 0, $e); } } return $this->cleanClaims($this->assignClaims($claims, $claimNames, $claimPayloads)); } }__halt_compiler();----SIGNATURE:----AoWxX0628pxq5+LBOdJSzX6EClyirohMmohJF5nzig+Jd+U6lD/4cXy6xQiss1Vn190rxtVfLkH9B3kdi5cNLCcZYiHCuyMPTLi12NQQ6X+f/gLJhokHVOZSSFIZEQaJOyrauWT++EWNZAOE2lpcpYGtSYHpPj+1KxobByTB3RbQiGPIgSdcrAT1yigSBxUFVw6ky6TWPAtu9FjZcqYEK94lcPOpY+lYd26nv67snea/ARKUPFgugo1URdjesuGEZP55nPm6N4tG5MsroffCOqElbdShPS8363Rx6eVDdw5iKZVMpysEsWulEY+tGZBZkTWUn6wWXuyHws0ytqhkPIi3CEVoYST9As0FbtsA7WWaIm167AkcfDJXPmvZQsgBMjRBSSP5Fxi9pH+QQ0beEyo1LeZVUQOvP3c/rdOFBeEArThBVIU93a+NNIfE9oKUdHhv4JgaSXbCI46KTPiXjg9u3+IkcdKHDhggGa4Uad8zMRejcptEc6UssbCAQxbUifND88OoyRjw/fvA5dpjtBW8Oq8+epguEhKvf+fyHppGIS6UcisrnEnRjvw+EngpCsCatCWgd7oQsx965ei+V5hHYnWnyTQjT5+YhpcKhOOz1n/gAjbAto3VNyMurgcyVbRIM4ICIukRtpQ8ZJLUa6O9on2gnVRHTr6F908/bpI=----ATTACHMENT:----MzIzMzc0NTA1MjQ5MTU5NyA4MjM1MTMwMzAxNDAxMDI4IDE4MjE4NDE5NjEyMDkwNDY=