KnpLabs / KnpLabs/php-github-api

'Expiration time' claim ('exp') must be a numeric value representing the future time at which the assertion expires

Open
#1,039 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
2.2k
Forks
587
PR merge metrics
No merged PRs in 30d

Description

**PHP version**: 8.0.11

**Description**
I (occasionally) get the following error when attempting to authenticate as an app
```
'Expiration time' claim ('exp') must be a numeric value representing the future time at which the assertion expires
```

**Stacktrace**
```
#0 /var/task/vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php(31): Github\HttpClient\Plugin\GithubExceptionThrower->Github\HttpClient\Plugin\{closure}(Object(GuzzleHttp\Psr7\Response))
#1 /var/task/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/GithubExceptionThrower.php(124): Http\Client\Promise\HttpFulfilledPromise->then(Object(Closure))
#2 /var/task/vendor/php-http/client-common/src/PluginChain.php(48): Github\HttpClient\Plugin\GithubExceptionThrower->handleRequest(Object(Nyholm\Psr7\Request), Object(Closure), Object(Http\Client\Common\PluginChain))
#3 /var/task/vendor/php-http/client-common/src/Plugin/RetryPlugin.php(106): Http\Client\Common\PluginChain->Http\Client\Common\{closure}(Object(Nyholm\Psr7\Request))
#4 /var/task/vendor/php-http/client-common/src/Plugin/RetryPlugin.php(173): Http\Client\Common\Plugin\RetryPlugin->handleRequest(Object(Nyholm\Psr7\Request), Object(Closure), Object(Http\Client\Common\PluginChain))
#5 /var/task/vendor/php-http/client-common/src/Plugin/RetryPlugin.php(144): Http\Client\Common\Plugin\RetryPlugin->retry(Object(Nyholm\Psr7\Request), Object(Closure), Object(Http\Client\Common\PluginChain), '000000005952042...', 1000000)
#6 /var/task/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php(30): Http\Client\Common\Plugin\RetryPlugin->Http\Client\Common\Plugin\{closure}(Object(Github\Exception\RuntimeException))
#7 /var/task/vendor/php-http/client-common/src/Plugin/RetryPlugin.php(145): Http\Client\Promise\HttpRejectedPromise->then(Object(Closure), Object(Closure))
#8 /var/task/vendor/php-http/client-common/src/Plugin/RetryPlugin.php(173): Http\Client\Common\Plugin\RetryPlugin->handleRequest(Object(Nyholm\Psr7\Request), Object(Closure), Object(Http\Client\Common\PluginChain))
#9 /var/task/vendor/php-http/client-common/src/Plugin/RetryPlugin.php(144): Http\Client\Common\Plugin\RetryPlugin->retry(Object(Nyholm\Psr7\Request), Object(Closure), Object(Http\Client\Common\PluginChain), '000000005952042...', 500000)
#10 /var/task/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php(30): Http\Client\Common\Plugin\RetryPlugin->Http\Client\Common\Plugin\{closure}(Object(Github\Exception\RuntimeException))
#11 /var/task/vendor/php-http/client-common/src/Plugin/RetryPlugin.php(145): Http\Client\Promise\HttpRejectedPromise->then(Object(Closure), Object(Closure))
#12 /var/task/vendor/php-http/client-common/src/PluginChain.php(48): Http\Client\Common\Plugin\RetryPlugin->handleRequest(Object(Nyholm\Psr7\Request), Object(Closure), Object(Http\Client\Common\PluginChain))
#13 /var/task/vendor/php-http/client-common/src/PluginChain.php(63): Http\Client\Common\PluginChain->Http\Client\Common\{closure}(Object(Nyholm\Psr7\Request))
#14 /var/task/vendor/php-http/client-common/src/PluginClient.php(90): Http\Client\Common\PluginChain->__invoke(Object(Nyholm\Psr7\Request))
#15 /var/task/vendor/php-http/client-common/src/HttpMethodsClient.php(148): Http\Client\Common\PluginClient->sendRequest(Object(Nyholm\Psr7\Request))
#16 /var/task/vendor/php-http/client-common/src/HttpMethodsClient.php(108): Http\Client\Common\HttpMethodsClient->sendRequest(Object(Nyholm\Psr7\Request))
#17 /var/task/vendor/php-http/client-common/src/HttpMethodsClient.php(70): Http\Client\Common\HttpMethodsClient->send('POST', '/app/installati...', Array, NULL)
#18 /var/task/vendor/knplabs/github-api/lib/Github/Api/AbstractApi.php(145): Http\Client\Common\HttpMethodsClient->post('/app/installati...', Array, NULL)
#19 /var/task/vendor/knplabs/github-api/lib/Github/Api/AcceptHeaderTrait.php(34): Github\Api\AbstractApi->postRaw('/app/installati...', NULL, Array)
#20 /var/task/vendor/knplabs/github-api/lib/Github/Api/AbstractApi.php(127): Github\Api\Apps->postRaw('/app/installati...', NULL, Array)
#21 /var/task/vendor/knplabs/github-api/lib/Github/Api/AcceptHeaderTrait.php(29): Github\Api\AbstractApi->post('/app/installati...', Array, Array)
#22 /var/task/vendor/knplabs/github-api/lib/Github/Api/Apps.php(39): Github\Api\Apps->post('/app/installati...', Array)
#23 /var/task/app/Services/GithubService.php(29): Github\Api\Apps->createInstallationToken(******)
#24 /var/task/app/Jobs/ChannelReviewRequested.php(165): App\Services\GithubService->getConnection('******, ******)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at Github\Api\Apps::createInstallationToken in lib/Github/Api/Apps.php and follow the call from app/Services/GithubService.php line 29. Reproduce the app-authentication request and inspect how the expiration claim is produced; done means the request no longer intermittently returns this validation error and the behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.