Repository navigation
House cleaning. - #8
Conversation
rmccue
left a comment
There was a problem hiding this comment.
This is amazing. Thank you so much!
|
Sorry for missing your other questions here!
Yeah: half of this code comes from the original OAuth 1 project and follows that code style, half of it is new and follows the HM coding standards (essentially, modernised WP standards).
Same as WP generally; generally a blank line before a comment line.
Yes: all classes that aren't in the current namespace should be imported.
Kept this around for #13, will eventually go 💀
Not used yet, see #10. The code there is just the skeleton that I created in a rush to get my thoughts down.
Makes sense to me; will merge #14 in a moment. :)
Currently unused, but we need to validate a few things to be spec compliant, notably |
|
Sorry, too, because not all of the things in What's Left were real questions, or at least not questions to get answered (just thought about and eventually resolved). The coding style parts were just to enumerate what I encountered (inconsistent blank lines, inconsistent namespace imports, etc.). I just updated #14, although you still have to decide about the intended behavior when encountering an invalid type. Just to have said that: for me, this PR is done (merged anyway, and all questions answered). Thanks. 🙂 |
Hi there! 👋
I had some time, so I went through the current code base (i.e., the
auth-code-flowbranch, which this PR thus targets), with an army of house elves, and fixed, updated and improved a few things here and there.Sorry for not splitting up commits. I did this on purpose, though, because otherwise we would've ended up with 42 (!) commits, ... or so.
I did not do any real changes to functionality, though, but see for yourself...
What Does This Pull Request Include?
WP\OAuth2\Client::check_redirect_uri()returntrueorfalse.WP\OAuth2\Endpoints\Authorization::handle_request().int.WP\OAuth2\Tokens\Token::is_valid()abstract, and not static anymore.WP\OAuth2\Tokens\Token::get_meta_prefix()method.$clientin the login template.What's Left?
admin.php:lib/class-wp-rest-oauth1-admin.phpdoes not exist in this plugin.oauth1all over.inc/class-scopes.php:inc/endpoints/class-authorization.php:handle_request()method usesOAuth2\get_grant_types(), which returns the unvalidated result of a filter,oauth2.grant_types.OAuth2\get_grant_types()function should both validate the data (and remove invalid handlers) and stateWP\OAuth2\Types\Type[]instead ofarrayas return type.inc/tokens/class-authorization-code.php:$argsparameter inWP\OAuth2\Tokens\Authorization_Code::validate()is for inheritance...?Again, this PR targets the
auth-code-flowbranch. If you want me to make it targetmasterinstead, just tell me.Cheers,
Thorsten