-
Notifications
You must be signed in to change notification settings - Fork 800
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
SSO: rely on Connection methods instead of relying on Jetpack. Part 2 #36989
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
* | ||
* @todo Update default value for redirect since the called function expects a string. | ||
* | ||
* @return mixed|void | ||
*/ | ||
public function build_authorize_url( $redirect = false ) { | ||
public function build_authorize_url( $redirect = false, $from = false, $raw = false ) { |
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.
At this point I'm wondering if build_authorize_url
shouldn't be merged into get_authorization_url
, but I'm not familiar enough with this to be confident that change can be done.
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.
Those filters have been there for a while, and I do wonder if we actually need them. And if we do, why we use them in some use cases, but not in others.
So I guess we could mark this as tech debt and return to this later.
When that method is called elsewhere, it is escaped there.
* | ||
* @todo Update default value for redirect since the called function expects a string. | ||
* | ||
* @return mixed|void | ||
*/ | ||
public function build_authorize_url( $redirect = false ) { | ||
public function build_authorize_url( $redirect = false, $from = false, $raw = false ) { |
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.
Those filters have been there for a while, and I do wonder if we actually need them. And if we do, why we use them in some use cases, but not in others.
So I guess we could mark this as tech debt and return to this later.
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.
Tests great.
I'm adding a couple more things I noticed, but they aren't blockers.
@@ -1194,7 +1193,9 @@ public function maybe_authorize_user_after_sso() { | |||
*/ | |||
remove_all_filters( 'jetpack_use_iframe_authorization_flow' ); |
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.
It's been a while since we removed the iframe flow, and looks like the filter is no longer there.
We probably could remove these hook calls as well.
Proposed changes:
This PR makes changes to the Jetpack Connection flow:
Jetpack
class to matching methods that were copied over to the Connection package back in My Jetpack: Handle authorize_redirect from connection package #22990.Jetpack
are now marked as deprecated, and the places that were using them have been switched to using the Connection methods.Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Patch