You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we set options to the Factory for timeout and proxy, the call to the method createAppCheck() will return a new AppCheck which is using a CachedKeySet that can't use the same options.
useKreait\Firebase\Factory;
$factory = (newFactory)->withServiceAccount('/path/to/firebase_credentials.json');
$options = HttpClientOptions::default();
$options = $options->withTimeOut(3.5);
// Use a proxy that all API requests should be passed through.$options = $options->withProxy('tcp://<host>:<port>');
$factory = $factory->withHttpClientOptions($options);
$appCheck = $factory->createAppCheck();
Here, $appCheck will not have the proxy and timeout options for the CachedKeySet :
$keySet = newCachedKeySet(
'https://firebaseappcheck.googleapis.com/v1/jwks',
newClient(), // <---- new Guzzle Http Client which will not receive the Guzzle Config$this->httpFactory,
$this->keySetCache,
21600,
true,
);
returnnewAppCheck(
newAppCheck\ApiClient($http),
newAppCheckTokenGenerator(
$this->serviceAccount['client_email'],
$this->serviceAccount['private_key'],
$this->clock,
),
newAppCheckTokenVerifier($projectId, $keySet),
);
It works for us only if we modify like this :
$keySet = newCachedKeySet(
'https://firebaseappcheck.googleapis.com/v1/jwks',
newClient($this->httpClientOptions->guzzleConfig()), // <--- we pass the Factory's GuzzleConfig$this->httpFactory,
$this->keySetCache,
21600,
true,
);
Installed packages
firebase/php-jwt : v6.8.0
PHP version and extensions
PHP 8.1.19
Composer 2.2.7
Steps to reproduce the issue.
With this example :
useKreait\Firebase\Factory;
$factory = (newFactory)->withServiceAccount('/path/to/firebase_credentials.json');
$options = HttpClientOptions::default();
$options = $options->withTimeOut(3.5);
// Use a proxy that all API requests should be passed through.$options = $options->withProxy('****** put real proxy here ******');
$factory = $factory->withHttpClientOptions($options);
$appCheck = $factory->createAppCheck();
$appCheckToken = '****** put a token here ******';
$appCheck->verifyToken($appCheckToken);
When we call verifyToken :
instead of having a timeout after 3.5 seconds, it takes 60 seconds (default Guzzle timeout).
the response is a 504
debug of HttpClient used by JWT::keyIdExists shows no options (no timeout, no proxy)
If we use the same code but change how the Factory create a new Client()
Describe the bug
When we set options to the Factory for timeout and proxy, the call to the method createAppCheck() will return a new AppCheck which is using a CachedKeySet that can't use the same options.
Here, $appCheck will not have the proxy and timeout options for the CachedKeySet :
It works for us only if we modify like this :
Installed packages
firebase/php-jwt : v6.8.0
PHP version and extensions
Steps to reproduce the issue.
With this example :
When we call
verifyToken
:If we use the same code but change how the Factory create a new Client()
When we call
verifyToken
:Error message/Stack trace
Additional information
No response
The text was updated successfully, but these errors were encountered: