| 1 |
<?php |
| 2 |
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure. |
| 3 |
|
| 4 |
namespace Yoast\WP\SEO\MyYoast_Client\Application\Grants; |
| 5 |
|
| 6 |
/** |
| 7 |
* Interface for OAuth grant types. |
| 8 |
* |
| 9 |
* Each implementation provides the grant-specific parameters for a token |
| 10 |
* endpoint request. The shared logic (client assertion, error handling) |
| 11 |
* is handled by OAuth_Grant_Handler. |
| 12 |
*/ |
| 13 |
interface Grant_Interface { |
| 14 |
|
| 15 |
/** |
| 16 |
* Returns the OAuth grant type identifier (e.g. "authorization_code"). |
| 17 |
* |
| 18 |
* @return string |
| 19 |
*/ |
| 20 |
public function get_grant_type(): string; |
| 21 |
|
| 22 |
/** |
| 23 |
* Returns the grant-specific parameters to merge into the token request body. |
| 24 |
* |
| 25 |
* @return array<string, string> The parameters (e.g. code, redirect_uri, refresh_token). |
| 26 |
*/ |
| 27 |
public function get_grant_params(): array; |
| 28 |
} |
| 29 |
|