Automattic / vip-support

Manages the VIP Support Users on your site
GNU General Public License v2.0
12 stars 4 forks source link

Add rest api endpoints #51

Closed joshbetz closed 7 years ago

joshbetz commented 7 years ago

See #50

ethitter commented 7 years ago

In addition to the wpcom_vip_go_rest_api_request_allowed() call, we'll need some protection for the REST endpoints being blocked via the rest_authentication_errors filter. Cron Control handles it here: https://github.com/Automattic/vip-go-mu-plugins/blob/6d9c22a536fc62537dea797f621cd17888ffae10/001-cron.php#L45. We do the same for the sites endpoint here: https://github.com/Automattic/vip-go-mu-plugins/blob/d34e2e93e11135dbccbac573add05e354b988276/rest-api/vip-endpoints.php#L63.

mjangda commented 7 years ago

we'll need some protection for the REST endpoints being blocked via the rest_authentication_errors filter.

Can we do this in a somewhat generic way so we don't have to repeat the same code everywhere?

ethitter commented 7 years ago

Can we do this in a somewhat generic way so we don't have to repeat the same code everywhere?

Good call. The protection in https://github.com/Automattic/vip-go-mu-plugins/blob/d34e2e93e11135dbccbac573add05e354b988276/rest-api/vip-endpoints.php#L63 can be generalized to cover the entire vip namespace.

ethitter commented 7 years ago

Good call. The protection in https://github.com/Automattic/vip-go-mu-plugins/blob/d34e2e93e11135dbccbac573add05e354b988276/rest-api/vip-endpoints.php#L63 can be generalized to cover the entire vip namespace.

Done in https://github.com/Automattic/vip-go-mu-plugins/pull/749, along with adding support for query-string permalinks (because I was there ¯_(ツ)_/¯).

mjangda commented 7 years ago

Oh, I guess tests are failing here too. We should definitely fix before merging.

ethitter commented 7 years ago

Yeah, the tests have been broken for...a while. Travis wasn't even enabled until yesterday. :)

ethitter commented 7 years ago

Tests are fixed in #54, which is meant to be merged into this.