Automattic / Automattic/jetpack

Jetpack REST API: Site based authentication migration

Open
#17,379 0 comments 0 reactions 1 assignee Claimed by @fgiannar View on GitHub
[Feature] WP REST API Enhancement
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

This is a master issue in order to keep track of our efforts to migrate REST API and XMLRPC endpoints to use blog token.

## Make REST API endpoints accept blog tokens on the plugin side:

- [x] [Base PR](https://github.com/Automattic/jetpack/pull/17331) that will allow us to accept a blog token in endpoints with `$needed_capabilities` defined. Those capabilities will be only checked if a user token is used.

### Technical Debt:
https://github.com/Automattic/jetpack/pull/17460

- [ ] Sync: Revert `$needed_capabilities` to `manage_options` and add `allow_jetpack_site_auth` in endpoint definition

- [ ] Options: Revert `$needed_capabilities` to `manage_options` and add `allow_jetpack_site_auth` in endpoint definition (`WPCOM_JSON_API_Get_Option_Endpoint`)

## Make XMLRPC methods accept blog tokens on the plugin side:
https://github.com/Automattic/jetpack/pull/17291

- [x] jetpack.idcUrlValidation
- [x] jetpack.unlinkUser
- [x] jetpack.testConnection
- [x] jetpack.featuresAvailable
- [x] jetpack.featuresEnabled
- [x] jetpack.syncObject
- [x] jetpack.getHeartbeatData
- [x] jetpack.getBlog (stats)
- [x] jetpack.updatePublicizeConnections

### Evaluate whether we want to migrate

- [x] createMediaItem (VideoPress)
- [x] updateVideoPressMediaItem
- [x] updateVideoPressPosterImage
- [x] jetpack.testAPIUserCode (Should not be migrated)
- [ ] disconnectBlog

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.