1 | <?php |
||
13 | class Rest_Authentication { |
||
14 | |||
15 | /** |
||
16 | * The rest authentication status. |
||
17 | * |
||
18 | * @since 8.9.0 |
||
19 | * @var boolean |
||
20 | */ |
||
21 | private $rest_authentication_status = null; |
||
22 | |||
23 | /** |
||
24 | * The rest authentication type. |
||
25 | * Can be either 'user' or 'blog' depending on whether the request |
||
26 | * is signed with a user or a blog token. |
||
27 | * |
||
28 | * @since 9.9.0 |
||
29 | * @var string |
||
30 | */ |
||
31 | private $rest_authentication_type = null; |
||
32 | |||
33 | /** |
||
34 | * The Manager object. |
||
35 | * |
||
36 | * @since 8.9.0 |
||
37 | * @var Object |
||
38 | */ |
||
39 | private $connection_manager = null; |
||
40 | |||
41 | /** |
||
42 | * Holds the singleton instance of this class |
||
43 | * |
||
44 | * @since 8.9.0 |
||
45 | * @var Object |
||
46 | */ |
||
47 | private static $instance = false; |
||
48 | |||
49 | /** |
||
50 | * Flag used to avoid determine_current_user filter to enter an infinite loop |
||
51 | * |
||
52 | * @since 9.7.0 |
||
53 | * @var boolean |
||
54 | */ |
||
55 | private $doing_determine_current_user_filter = false; |
||
56 | |||
57 | /** |
||
58 | * The constructor. |
||
59 | */ |
||
60 | private function __construct() { |
||
63 | |||
64 | /** |
||
65 | * Controls the single instance of this class. |
||
66 | * |
||
67 | * @static |
||
68 | */ |
||
69 | public static function init() { |
||
79 | |||
80 | /** |
||
81 | * Authenticates requests from Jetpack server to WP REST API endpoints. |
||
82 | * Uses the existing XMLRPC request signing implementation. |
||
83 | * |
||
84 | * @param int|bool $user User ID if one has been determined, false otherwise. |
||
85 | * |
||
86 | * @return int|null The user id or null if the request was not authenticated. |
||
87 | */ |
||
88 | public function wp_rest_authenticate( $user ) { |
||
186 | |||
187 | /** |
||
188 | * Report authentication status to the WP REST API. |
||
189 | * |
||
190 | * @param WP_Error|mixed $value Error from another authentication handler, null if we should handle it, or another value if not. |
||
191 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
||
192 | */ |
||
193 | public function wp_rest_authentication_errors( $value ) { |
||
199 | |||
200 | /** |
||
201 | * Resets the saved authentication state in between testing requests. |
||
202 | */ |
||
203 | public function reset_saved_auth_state() { |
||
207 | |||
208 | /** |
||
209 | * Whether the request was signed with a blog token. |
||
210 | * |
||
211 | * @since 9.9.0 |
||
212 | * |
||
213 | * @return bool True if the request was signed with a valid blog token, false otherwise. |
||
214 | */ |
||
215 | public static function is_signed_with_blog_token() { |
||
220 | } |
||
221 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..