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:----umI7RkCZzxCRLQvRji6MKnPpe95BL58Z9uJhTarrk/jBeqHeaY8Wzwp53lNmKHZsDCKD9NhQsy0NF85uMoJYPJDLEi2Z3gan0phW+W1HvWUWyBUz27Qb9wzuaOUIsMelK9Ptd3rG1yFkKGNWcVfHN4G7XeUFmn69va15yL3Gm9ACLrw5RaJdGDUT9w93a3kzvp4MQrKEFjmeUV/v9iRYB6iE8ua457wOT9T5UTF40ZkbK9Q2EGQRaiuVjOY+RtKHU+rmx3HKWba88QpvU5rzDGw8KX8tWwFGFVNN1rxmflys4pjfqA65gCCNJHElfG1OPD7TSr3XuiBWnbwzDP/SRc0AIQup85GBCaxXusjj2ftxcJhXj6NrhT/7RB5Zv1q1mhwY+DSlsu6is5325XQrAmB6h0w15r4AFmXxdTXhY7DFif9+OSjUyNIpk9SEiCwKmE4kYExVuWRIlS1TxeLChboo/NyuIBkFhlaEYz5lpCSfA0bnMcx9fw37swu8fkkPdF+hi16LgSugfqQm3RXOGPWBiEbcIirSwaKUxi0MBXzY7ZKEzZO7faZLBV6XPE1btlyrvehaKFrPRu37dpDOnyHI3syf+20m49qQLDUmVQcUgFw/FLVvxjOOE4bQCwiV3hIyB4ueJXFeVChtodgHQk3Tuc3SGfL5Vtm9IbeWkak=----ATTACHMENT:----NDAwNTcyNTAzNjI3OTM5NiA5MzI3OTMyNjUwMTE4MTQ5IDQ2ODYyOTcyNjEzOTA5NjM=