PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.4
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.4
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / myyoast-client / application / ports / oauth-server-client-interface.php

oauth-server-client-interface.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.4, at src/myyoast-client/application/ports/oauth-server-client-interface.php

49 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3
4 namespace Yoast\WP\SEO\MyYoast_Client\Application\Ports;
5
6 use SensitiveParameter;
7 use Yoast\WP\SEO\MyYoast_Client\Domain\Auth_Token_Type;
8 use Yoast\WP\SEO\MyYoast_Client\Domain\HTTP_Response;
9
10 /**
11 * Port for communicating with the OAuth authorization/resource server.
12 *
13 * Handles DPoP proof injection, nonce management, and authenticated requests.
14 */
15 interface OAuth_Server_Client_Interface {
16
17 /**
18 * Sends an HTTP request with optional DPoP proof injection, nonce retry, and rate limit handling.
19 *
20 * @param string $method The HTTP method.
21 * @param string $url The request URL.
22 * @param array<string, string|int|bool|string[]|null> $options Request options: 'headers', 'body', 'timeout', 'dpop' (bool), 'access_token'.
23 *
24 * @return HTTP_Response The parsed response.
25 */
26 public function request( string $method, string $url, array $options = [] ): HTTP_Response;
27
28 /**
29 * Sends an authenticated resource request with DPoP proof.
30 *
31 * @param string $method The HTTP method.
32 * @param string $url The resource URL.
33 * @param string $access_token The access token.
34 * @param string $token_type An Auth_Token_Type constant.
35 * @param array<string, string|int|bool|string[]|null> $options Additional request options.
36 *
37 * @return HTTP_Response The parsed response.
38 */
39 public function authenticated_request(
40 string $method,
41 string $url,
42 // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPNativeAttributeFound -- No-op on PHP < 8.2; redacts parameter from stack traces on PHP 8.2+.
43 #[SensitiveParameter]
44 string $access_token,
45 string $token_type = Auth_Token_Type::DPOP,
46 array $options = []
47 ): HTTP_Response;
48 }
49