• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / e57e01309ec9fc3afc714e6ce0fd243e7b6d1f90

27 May 2025 12:40PM UTC coverage: 45.733%. First build
e57e01309ec9fc3afc714e6ce0fd243e7b6d1f90

Pull #22275

github

web-flow
Merge f0a8d33c9 into 5f64dc203
Pull Request #22275: Move and refactor ai generator rest endpoints

0 of 392 new or added lines in 26 files covered. (0.0%)

15548 of 33997 relevant lines covered (45.73%)

3.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/ai-authorization/user-interface/callback-route.php
1
<?php
2
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
3
namespace Yoast\WP\SEO\AI_Authorization\User_Interface;
4

5
/**
6
 * Registers the callback route used in the authorization process.
7
 *
8
 * @makePublic
9
 *
10
 * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded
11
 */
12
class Callback_Route extends Abstract_Callback_Route {
13
        /**
14
         *  The prefix for this route.
15
         *
16
         * @var string
17
         */
18
        public const ROUTE_PREFIX = '/ai_generator/callback';
19

20
        /**
21
         * Registers routes with WordPress.
22
         *
23
         * @return void
24
         */
NEW
25
        public function register_routes() {
×
NEW
26
                \register_rest_route(
×
NEW
27
                        parent::ROUTE_NAMESPACE,
×
NEW
28
                        self::ROUTE_PREFIX,
×
NEW
29
                        [
×
NEW
30
                                'methods'             => 'POST',
×
NEW
31
                                'args'                => [
×
NEW
32
                                        'access_jwt'     => [
×
NEW
33
                                                'required'    => true,
×
NEW
34
                                                'type'        => 'string',
×
NEW
35
                                                'description' => 'The access JWT.',
×
NEW
36
                                        ],
×
NEW
37
                                        'refresh_jwt'    => [
×
NEW
38
                                                'required'    => true,
×
NEW
39
                                                'type'        => 'string',
×
NEW
40
                                                'description' => 'The JWT to be used when the access JWT needs to be refreshed.',
×
NEW
41
                                        ],
×
NEW
42
                                        'code_challenge' => [
×
NEW
43
                                                'required'    => true,
×
NEW
44
                                                'type'        => 'string',
×
NEW
45
                                                'description' => 'The SHA266 of the verification code used to check the authenticity of a callback call.',
×
NEW
46
                                        ],
×
NEW
47
                                        'user_id'        => [
×
NEW
48
                                                'required'    => true,
×
NEW
49
                                                'type'        => 'integer',
×
NEW
50
                                                'description' => 'The id of the user associated to the code verifier.',
×
NEW
51
                                        ],
×
NEW
52
                                ],
×
NEW
53
                                'callback'            => [ $this, 'callback' ],
×
NEW
54
                                'permission_callback' => '__return_true',
×
NEW
55
                        ]
×
NEW
56
                );
×
57
        }
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc