rightscale/rest_connection — pull request #6 by daniel-trinh (2012-10-09 23:34:24+00:00)
Title: replacing api 0.1 basic auth to use /login cookie instead

@justingaylor @jonmarinellors @christopherdeutsch @magneland

0.1 API calls seem to be going through RightScale::Api::InternalConnection.connection -- this method creates a 'connection' object, which is used to perform HTTP requests. The connection object happens to have fields for http headers, cookies, etc.

I rewrote the method to first authenticate to API 1.0, and retrieve the cookie and set it in the connection object before each 0.1 request.

It's still kind of hacky, since it will do an authentication request first and then do the actual intended request for every 0.1 request