2019-02-21 01:28:52 +05:30
|
|
|
<?php
|
2019-08-23 13:58:04 +05:30
|
|
|
declare(strict_types=1);
|
|
|
|
|
2019-02-21 01:28:52 +05:30
|
|
|
namespace api\tests\_pages;
|
|
|
|
|
2019-08-23 13:58:04 +05:30
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
*/
|
2019-02-21 01:28:52 +05:30
|
|
|
class OauthRoute extends BasePage {
|
|
|
|
|
2019-08-23 13:58:04 +05:30
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
*/
|
2019-02-21 01:28:52 +05:30
|
|
|
public function validate(array $queryParams): void {
|
|
|
|
$this->getActor()->sendGET('/api/oauth2/v1/validate', $queryParams);
|
|
|
|
}
|
|
|
|
|
2019-08-23 13:58:04 +05:30
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
*/
|
2019-02-21 01:28:52 +05:30
|
|
|
public function complete(array $queryParams = [], array $postParams = []): void {
|
|
|
|
$this->getActor()->sendPOST('/api/oauth2/v1/complete?' . http_build_query($queryParams), $postParams);
|
|
|
|
}
|
|
|
|
|
2019-08-23 13:58:04 +05:30
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
*/
|
2019-02-21 01:28:52 +05:30
|
|
|
public function issueToken(array $postParams = []): void {
|
|
|
|
$this->getActor()->sendPOST('/api/oauth2/v1/token', $postParams);
|
|
|
|
}
|
|
|
|
|
2019-08-23 13:58:04 +05:30
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
*/
|
2019-02-21 01:28:52 +05:30
|
|
|
public function createClient(string $type, array $postParams): void {
|
|
|
|
$this->getActor()->sendPOST('/api/v1/oauth2/' . $type, $postParams);
|
|
|
|
}
|
|
|
|
|
2019-08-23 13:58:04 +05:30
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
*/
|
2019-02-21 01:28:52 +05:30
|
|
|
public function updateClient(string $clientId, array $params): void {
|
|
|
|
$this->getActor()->sendPUT('/api/v1/oauth2/' . $clientId, $params);
|
|
|
|
}
|
|
|
|
|
2019-08-23 13:58:04 +05:30
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
*/
|
2019-02-21 01:28:52 +05:30
|
|
|
public function deleteClient(string $clientId): void {
|
|
|
|
$this->getActor()->sendDELETE('/api/v1/oauth2/' . $clientId);
|
|
|
|
}
|
|
|
|
|
2019-08-23 13:58:04 +05:30
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
*/
|
2019-02-21 01:28:52 +05:30
|
|
|
public function resetClient(string $clientId, bool $regenerateSecret = false): void {
|
2019-02-26 04:56:02 +05:30
|
|
|
$this->getActor()->sendPOST("/api/v1/oauth2/{$clientId}/reset" . ($regenerateSecret ? '?regenerateSecret' : ''));
|
2019-02-21 01:28:52 +05:30
|
|
|
}
|
|
|
|
|
2019-08-23 13:58:04 +05:30
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
*/
|
2019-02-21 01:28:52 +05:30
|
|
|
public function getClient(string $clientId): void {
|
2019-02-26 04:56:02 +05:30
|
|
|
$this->getActor()->sendGET("/api/v1/oauth2/{$clientId}");
|
2019-02-21 01:28:52 +05:30
|
|
|
}
|
|
|
|
|
2019-08-23 13:58:04 +05:30
|
|
|
/**
|
|
|
|
* @deprecated
|
|
|
|
*/
|
2019-02-21 01:28:52 +05:30
|
|
|
public function getPerAccount(int $accountId): void {
|
2019-02-26 04:56:02 +05:30
|
|
|
$this->getActor()->sendGET("/api/v1/accounts/{$accountId}/oauth2/clients");
|
2019-02-21 01:28:52 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
}
|