ZEROSPAM\Framework\SDK\Client\OAuthClient
Class OAuthClient
Client for OAuth server interaction
Synopsis
- // members
- private IOAuthConfiguration $configuration;
- private RateLimitData $rateLimit;
- private ClientInterface $guzzleClient;
- private AccessToken $token;
- private array $postRequestMiddlewares = ;
- private array $preRequestMiddlewares = ;
- private array $refreshTokenMiddlewares = ;
- private IRequest $lastRequest;
- // methods
- public void __construct()
- public IOAuthClient registerMiddleware()
- public IOAuthClient registerPreRequestMiddleware()
- public IOAuthClient registerRefreshTokenMiddleware()
- public IOAuthClient unregisterMiddleware()
- public IOAuthClient unregisterPreRequestMiddleware()
- public IOAuthClient unregisterRefreshTokenMiddleware()
- public AccessToken refreshToken()
- public AccessToken getToken()
- public void setToken()
- public IOAuthConfiguration getConfiguration()
- public IResponse processRequest()
- private void processThrottleData()
Hierarchy
Implements
Members
private
- $configuration — ZEROSPAM\Framework\SDK\Config\IOAuthConfiguration
- $guzzleClient — GuzzleHttp\ClientInterface
- $lastRequest — ZEROSPAM\Framework\SDK\Request\Api\IRequest
- $postRequestMiddlewares — array
- $preRequestMiddlewares — array
- $rateLimit — ZEROSPAM\Framework\SDK\Response\RateLimit\RateLimitData
- $refreshTokenMiddlewares — array
- $token — League\OAuth2\Client\Token\AccessToken
Methods
private
- processThrottleData() — Process the rate limit.
public
- __construct() — OauthClient constructor.
- getConfiguration() — Get linked configuration
- getToken() — Currently used access token.
- processRequest() — Process the given request and return an array containing the results.
- refreshToken() — Refresh token.
- registerMiddleware() — Register the given middleware.
- registerPreRequestMiddleware() — Register a pre request middleware
- registerRefreshTokenMiddleware() — Register a middleware to take care of refresh token
- setToken() — Set the AccessToken
- unregisterMiddleware() — Unregister the middleware.
- unregisterPreRequestMiddleware() — UnRegister a pre request middleware
- unregisterRefreshTokenMiddleware() — UnRegister a refreshToken middleware
History
-
2018-12-05T15:02:50+00:00 (commit #b8fa2d7)
Author: Antoine Aflalo (antoine.aflalo@zerospam.ca) / Commiter: Antoine Aflalo (antoine.aflalo@zerospam.ca)
feat(Response): Save raw data in response
-
2018-12-04T14:53:44+00:00 (commit #9c1434a)
Author: Antoine Aflalo (antoine.aflalo@zerospam.ca) / Commiter: Antoine Aflalo (antoine.aflalo@zerospam.ca)
feat(Configuration): Add default middlewares
-
2018-11-07T16:53:28+00:00 (commit #80a6915)
Author: Antoine Aflalo (antoine.aflalo@zerospam.ca) / Commiter: Antoine Aflalo (antoine.aflalo@zerospam.ca)
fix(EmptyRequest): Don't have a body for GET requests Don't serialize STATIC properties of requests.
-
2018-11-07T15:53:25+00:00 (commit #1f0b5bf)
Author: Antoine Aflalo (antoine.aflalo@zerospam.ca) / Commiter: Antoine Aflalo (antoine.aflalo@zerospam.ca)
fix(Client): Don't set JSON option when empty This cause to send a Content-Type of 2 bytes which isn't RFC compliant and trigger a 400 Bad Request on some CDN (like google).
-
2018-09-11T20:10:35+00:00 (commit #2238875)
Author: Antoine Aflalo (antoine.aflalo@zerospam.ca) / Commiter: Antoine Aflalo (antoine.aflalo@zerospam.ca)
docs(OAuthClient): Fix copy-pasted doc for unregisterRefreshTokenMiddleware
-
2018-09-11T20:07:51+00:00 (commit #c644b40)
Author: Antoine Aflalo (antoine.aflalo@zerospam.ca) / Commiter: Antoine Aflalo (antoine.aflalo@zerospam.ca)
perf(RefreshToken): Add number of tries into callbacks Used to know how many time the refreshToken has been called.
-
2018-09-11T16:03:27+00:00 (commit #e144740)
Author: Antoine Aflalo (antoine.aflalo@zerospam.ca) / Commiter: Antoine Aflalo (antoine.aflalo@zerospam.ca)
feat(RefreshToken): Add refreshToken middleware New feature to control the refreshing of a token. Also provides a default token refresher.
-
2018-07-16T14:26:38+00:00 (commit #290a97d)
Author: Antoine Aflalo (antoine.aflalo@zerospam.ca) / Commiter: Antoine Aflalo (antoine.aflalo@zerospam.ca)
feat(Response): Split Ratelimited from BaseResponse New type of response can now be easily build.