Changes to WordCamp and Meetup REST API endpoints
WordCamp Central REST API leaked some Meetup and WordCamp information.
This PR closes the /wordcamps endpoint from enumeration, which has been the way to see details for WordCamps with non-public statuses (like declined).
This PR also changes the way how /meetups endpoint works. Previously that endpoint returned an empty array, now it's similar to /wordcamps endpoint and returns all Meetups with public status. The /meetups endpoint also suffered from leakage by enumeration, which is prevented now.
Fixes #661 Fixes #610
How to test the changes in this Pull Request:
WordCamps
- Create new WordCamp application and decline that
- Copy the ID of that application
- Navigate to https://central.wordcamp.test/wp-json/wp/v2/wordcamps/{ID} and you should receive an error message
- Check some declined WordCamp applications on production, and you will see the details
Meetups
- Create new Meetup applications, one declined and one active in the chapter
- Navigate to https://central.wordcamp.test/wp-json/wp/v2/meetups, and you should see only the active one
- Copy the ID of the declined application and navigate to https://central.wordcamp.test/wp-json/wp/v2/meetups/{ID}, and you should receive an error message
- Check production https://central.wordcamp.org/wp-json/wp/v2/meetups and you get an empty array
- Check some declined Meetup applications on production, and you will see the details
It looks like the conflicts in public_html/wp-content/plugins/wcpt/wcpt-meetup/meetup-loader.php change some of the permissions, but not sure if it's solved completely (probably not), would you mind taking a look @timiwahalahti to confirm?