4 ms·
Step 1) document the endpoints enough that outside developers can write their own clients. It took quite a bit of work for me to get a native Clojure client wo
by arohner 10y ago
Step 1) document the endpoints enough that outside developers can write their own clients.
It took quite a bit of work for me to get a native Clojure client working to connect to the google cloud SDK. That was after wrestling with jar-hell around gRPC and calling the Java client from clojure, which is decidedly not pretty.
- chatmasta 10y agoIn these situations the best thing you can do is man-in-the-middle the HTTP requests from an existing client. That said, I've only ever had to do this when reversing private mobile API's. I can't believe a REST API from Google would be missing documentation of the raw HTTP endpoints?! That should be the first documentation of an API, before that of any specific client implementations.
- kbenson 10y agoOr get a pre-existing client for a non-compiled language. Chances are there's a Python/PHP/Ruby/Perl implementation, and those shouldn't be hard to pick apart.
- euyyn 10y agoFor future reference, here's the HTTP/REST documentation for the Cloud APIs: https://cloud.google.com/apis/docs/overview https://cloud.google.com/apis/docs/overview E.g. for the GKE API: https://cloud.google.com/container-engine/reference/rest/ https://cloud.google.com/container-engine/reference/rest/ (For people that rather use an existing library, this lets you pick one of 7 languages and start from there: https://cloud.google.com/docs/ https://cloud.google.com/docs/ )
- arohner 10y agoYes, but that doesn't deal with authentication. My problem was getting the JWT stuff working. The solution ended up being: https://gist.github.com/arohner/8d94ee5704b1c0c1b206186525d9f7a7 https://gist.github.com/arohner/8d94ee5704b1c0c1b206186525d9...
- euyyn 10y agoAh, yeah, coding the OAuth2 flow in a new language (vs using an existing library) is tricky, at the very least because OAuth2 itself is complex. The best docs I know for that are here https://developers.google.com/identity/protocols/OAuth2ServiceAccount https://developers.google.com/identity/protocols/OAuth2Servi... (we should link to it from the docs of the Cloud APIs). From a glimpse, what's said there matches what your code is doing, so thanks a lot for sharing it!