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:----HZCPNDbmSYA7jJjY9xRTlggdzUYff/gluJCHs007UORa/63YbhMwTI1SyEpOGwe0rCIbrvBNNR1RUtjmCzt8oU4Sb7C7RFvqmodLEtLVRocdon1acrUPfNvmByH974aR8vrM/2B79FYHIOzqlgisrr1yzJo9H9+DtYgrjNDmgAKx5lwE4YXl3aKvzJzWMZn2rKHTdbOVXT6NcWvG0GjMtAD/lXsoVDW02kU9LyrqgsfACMM6GCpc0UddaAP33FxIFWDjmECSoom6tMS7IV4Gt9hUlUcDwZTpbFLqvmVF8VWIXeF/mmSv66SurG/16b68Hy5epgQAygdIeloIGx21UWgtxEdppipFWA21nEd5xDu49lrfnPHr1fUzCAeAw1+sbHUbQg68H7LWT2/DKBoOc9zWm3nh4cudNKEdHWh0STiiDFjhfHPjg/5v/JZcJUFlCnFtRaDuSypKdbw1tHrlwYxh0oWA7DQ7DwWCNxdIKxLlPLjsE93bFj9GMCemZfbd0Ck3AfyfkqMZWKnwznaBFZ8Tpb4tbCd0dcy6QgCGT8uLqt2N7vgiFqJRhHvHXkP+or5cuTA7zEYhqGMEp/rFTrPGuxrdsW+vLcoF5HmalOZTqnZsePgBW/MQGpBdiOAuE06yTss7CkdeG340zO6qp5rsr4+05v9nlS/w9dCCzsI=----ATTACHMENT:----NDkzMDYxNjQ2OTk2NDAzNCA1Nzk4NzQyNDY4MTg0OTk4IDY2MTE5MzczNTA2NTk5OTI=