fastlane/boarding

REST API

wcandillon opened this issue ยท 2 comments

First things first, thank you for this great package, it is literally a life saver ๐Ÿ™Œ๐Ÿป

I was wondering if it was possible to invoke boarding via a REST API? It seems to be protected via an authenticity token? I have no skills with Ruby on Rails so I'm not sure how it would need to be modified in order to support REST?
Also maybe there is a reason of why it doesn't support REST at the moment?

Again, thank you for this great tool!

I'd be interested in adding this as a PR if it's justified. How much value would it provide for the community to add to this project vs forking and creating a REST only version?

In addition Apple has announced support for this in the "near" future: https://twitter.com/KrauseFx/status/1004450869868298240
See the Keynote Video here: https://developer.apple.com/videos/play/wwdc2018/303/

This project may fill the gap before Apple's update: https://github.com/Crystalnix/testflight-boarding

@wcandillon Another potential workaround is submitting the form via a POST request as-is.

As evidenced in this commit, boarding does not use CSRF protection. Therefore, your calling method does not need to keep track of state/session.

Here's an example:

curl -X POST \
  https://boarding.example.com/submit \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'first_name=John&last_name=Appleseed&email=john.appleseed%40example.com&token=PassphraseIfYouUseIt'

You will obviously not get a nice JSON response, but you could parse the HTML response body for the string Successfully added you as a tester. In addition, most everything will come back with 200 OK, as boarding does not currently reflect failures in the HTTP error codes. Probably something I should add to #188 or make a bigger PR that tracks error handling in general.

Given the pending release of Apple's new API for App Store Connect, boarding might be due for a refactor since it's pretty standalone. I'll open an issue and see what the other contributors think.