thephpleague/oauth2-client

Suggestion - a very small code change would implement rate limiting

globalvisionmedia opened this issue · 1 comments

a lot of APIs have rate limiting but...

If you were to add:
$client_options = ['timeout', 'proxy', 'handler'];

then we could use this: composer require spatie/guzzle-rate-limiter-middleware and write apps that include (for example)

$stack = HandlerStack::create();
$stack->push(RateLimiterMiddleware::perSecond(8));

$provider = new Provider([
'clientId' => MYOB_CLIENT_ID,
'clientSecret' => MYOB_CLIENT_SECRET,
'redirectUri' => CALLBACK_URI,
'username' => USERNAME,
'password' => PASSWORD,
'scopes' => ['CompanyFile'],
'handler' => $stack
]);