feat: Allow Android WebView admin-ajax.php CORS requests#45292
feat: Allow Android WebView admin-ajax.php CORS requests#45292
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 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! 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. |
7c65124 to
0eec284
Compare
1e87e88 to
947871d
Compare
0eec284 to
2ebdfb2
Compare
947871d to
5c0702b
Compare
2ebdfb2 to
b5d50be
Compare
5c0702b to
0cc2139
Compare
b5d50be to
d56e487
Compare
46ba2ef to
5d316d9
Compare
d56e487 to
cf08962
Compare
5d316d9 to
67fa677
Compare
cf08962 to
ae35d6d
Compare
67fa677 to
a374c90
Compare
ae35d6d to
8dd337f
Compare
a374c90 to
a599d22
Compare
Allow authenticating for `admin-ajax` and post preview requests with application passwords. This enables cookie-less clients--e.g, the iOS and Android mobile apps--to successfully authenticate these requests.
Return early if the provided value is already truthy.
The logic now requires the `preview` parameter.
Mitigate potential security risk by limiting application password capabilities to VideoPress-related AJAX actions.
Align the `get_abilities()` key with the REST route name and expected API response documented in the PR.
…d extras Focus this branch solely on VideoPress AJAX authentication. Post preview functionality will be handled separately.
The Jetpack mobile app block editor relies upon Android WebViews for serving local Gutenberg files. Editor requests then originate from the platform-default `https://appassets.androidplatform.net` origin. To enable `admin-ajax.php` requests from the Android app, we must allow CORS requests from this origin.
Use a domain owned by the Jetpack project.
The domain was updated in a previous commit.
a599d22 to
54ef71f
Compare
Re-run CI tasks after changing GitHub PR base branch.
Ref CMM-713. Ref CMM-766. Ref CMM-767.
Proposed changes:
The Jetpack mobile app block editor relies upon Android WebViews for serving local Gutenberg files. Editor requests then originate from the
https://android-app-assets.jetpack.comorigin. To enableadmin-ajax.phprequests from the Android app, we must allow CORS requests from this origin.Other information:
Jetpack product discussion
pbArwn-7AD-p2
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
See the testing instructions in the sibling PR: wordpress-mobile/GutenbergKit#181