feat: Editor assets endpoint allows the VideoPress block#45255
feat: Editor assets endpoint allows the VideoPress block#45255
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. |
|
This PR has been marked as stale. This happened because:
If this PR is still useful, please do a [trunk merge or rebase](https://github.com/Automattic/jetpack/blob/trunk/docs/git-workflow.md#keeping-your-branch-up-to-date) and otherwise make sure it's up to date and has clear testing instructions. You may also want to ping possible reviewers in case they've forgotten about it. Please close this PR if you think it's not valid anymore — if you do, please add a brief explanation. If the PR is not updated (or at least commented on) in another month, it will be automatically closed. |
77dd37b to
bf835ce
Compare
7c65124 to
0eec284
Compare
bf835ce to
c3a846e
Compare
0eec284 to
2ebdfb2
Compare
c3a846e to
7615fb4
Compare
2ebdfb2 to
b5d50be
Compare
7615fb4 to
198018c
Compare
b5d50be to
d56e487
Compare
198018c to
6d335b5
Compare
d56e487 to
cf08962
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.
Utilize the `@wordpress/api-fetch` utility to align with WordPress core and enable usage of its functionality. Namely, leveraging middleware for configuring requests.
6d335b5 to
57be191
Compare
cf08962 to
ae35d6d
Compare
The `get-media-token` logic is utilized in a lot of contexts--WP Admin, site front end, etc. We cannot rely upon `apiFetch` universally, as it is unavailable in some of these contexts. This resulted in the error below. ``` [Error] TypeError: undefined is not an object (evaluating 'window.wp.apiFetch') ``` Adding `@wordpress/api-fetch` as a dependency is a non-starter as it would unnecessarily increase the bundle size. Instead, we scope the `apiFetch` usage to GutenbergKit, where it is available and needed for token authentication through middleware. This also reduces the overall reach of the changes.
ae35d6d to
8dd337f
Compare
57fdcbd to
8c890f9
Compare
Ref CMM-713.
Proposed changes:
Allow the
videopress/videoblock type for the GutenbergKit mobile app editor.Other information:
Jetpack product discussion
pbArwn-7AD-p2
Does this pull request change what data or activity we track or use?
No
Testing instructions:
/wpcom/v2/sites/<site_id>/editor-assetsendpoint for the WPCOM site—via API Console,curl, etc.videopress/videoblock type within theallow_block_types.