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:----P5htsKWEiAVZs+00EnSyG5VjsmccZu08aQW87n3MxfZyYWkqeucVM5y6IzShE9vFOQ8VAK1OsxbxEps9NHEBh+gyCuWEratLUkGLeSCFwC3XSfjfVGNNDivXBLFRlKGBhqg7UiXzXt53WidCyyqUnUX2W2VAXrN+/UAAstHQsQABA29aDduBAb29mCFzQxuKSG6n8sxlvj6OczHqHq6qS4YfBP0kVZh3Npl/XbOLgnXEbUpjebSzIuA67h76ywFbqkaMcKN1l3kt52EJtpUK6kCmieLq9OlxJ++N7I+DUeguswoGISbGQoEk7AXZhInV8VC6lXyVHwWhT7GlwQU2jln7UfD66K7UU533h0wol3NfW8Dq/nNlsee53BrMRAfhpRfefG0wVDGhyeRYR48fYF5Vx9hAfw4ltYziKaqcv6M1usOCZfn5nvEymXmmWHrU9Vz/VoDvPvtMR4b1UxVZnDX/QqNX/FGoCkROeZSyBqBfZQ0O90ALmJxsM/tho3ID7hQdzYZpHav9r/7OZovhGt9532HllCkFY0Ch0ejpeWyV2Bph5L22KsjUgAYuqApYfl/ihSn3zpsjnBbdIkNFlIDLKItO+XF58SDKbXBNO3+p2wUd0yqdzeQEJTbioUlpyCESBYTFNGNIdkRqNR5IsVELP+bqtC1MKUDmFaKJXBo=----ATTACHMENT:----NzYwNjQ4ODgwOTQ1ODMzNSAxNzAzMjg3NzIzMDY3NTAgNDc2MzI2MzkxMDI2MjQzNQ==