[Concept] Remove Authorization responsibility from YouTrackClient
antonkomarev opened this issue · 1 comments
antonkomarev commented
I've started to overlook an API and I maybe it should be refactored.
antonkomarev commented
Solution №1
// Instantiate YouTrack API Cookie Authenticator
$authenticator = new Rest\Authenticator\CookieAuthenticator($apiUsername, $apiPassword);
// Instantiate YouTrack API Cookie Authorizer
$authorizer = new Rest\Authorizer\CookieAuthorizer($authenticator);
// Instantiate YouTrack API HTTP Client
$httpClient = new Rest\HttpClient\GuzzleHttpClient($psrHttpClient, $authorizer);
// Instantiate YouTrack API Client
$client = new Rest\Client\YouTrackClient($httpClient);