-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Management API framework #537
Conversation
92983ab
to
be1b8da
Compare
@@ -508,6 +508,7 @@ private function autoloader( $class ) { | |||
$paths = array( | |||
$source_dir, | |||
$source_dir . 'admin/', | |||
$source_dir . 'api/', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add new directory to auto-load from.
), | ||
); | ||
return array( 'Auth0-Client' => base64_encode( wp_json_encode( $header_value ) ) ); | ||
return WP_Auth0_Api_Abstract::get_info_headers(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns an identical array.
* | ||
* @param WP_Auth0_Api_Jobs_Verification $api_jobs_resend - WP_Auth0_Api_Jobs_Verification instance. | ||
*/ | ||
public function __construct( WP_Auth0_Api_Jobs_Verification $api_jobs_resend ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add dependency injection.
ea1cc17
to
3d649e5
Compare
3d649e5
to
e253e5f
Compare
13c0f3b
to
41a16f1
Compare
@@ -120,6 +120,14 @@ public static function ro( $domain, $client_id, $username, $password, $connectio | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the changes in this file are doc blocks to add TODOs for deprecation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general, the abstraction is good and more tests is great.
|
||
/** | ||
* Class WP_Auth0_Email_Verification | ||
* Class WP_Auth0_Email_Verification. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general some of these comments seem a little superfluous.
41a16f1
to
fc5c23c
Compare
Create a more clear, complete, and easy-to-use access to the Management API, including better error logging when things go wrong.
WP_Auth0_Api_Abstract
abstract class to provide a wrapper around the WP HTTP class. This can be extended to add Management API endpoints more easily with built-in error handling.WP_Auth0_Api_Client_Credentials
to perform a Client Credentials grant for API callsWP_Auth0_Api_Jobs_Verification
to perform re-send email functionality (mainly to show how the framework is used).WP_Auth0_Email_Verification
to use the new API framework, provide better error responses.WP_Auth0_Api_Client
as TODO for deprecation.Note to reviewers
This is a large PR but almost 60% of code added is related to testing.