Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API #215

Open
wcandillon opened this issue Apr 22, 2018 · 2 comments
Open

REST API #215

wcandillon opened this issue Apr 22, 2018 · 2 comments

Comments

@wcandillon
Copy link

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!

@phaseOne
Copy link
Contributor

phaseOne commented Jul 2, 2018

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

@phaseOne
Copy link
Contributor

phaseOne commented Jul 2, 2018

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants