Merge lp://staging/~jtv/gwacl/dispatcher into lp://staging/gwacl
Status: | Merged |
---|---|
Approved by: | Jeroen T. Vermeulen |
Approved revision: | 19 |
Merged at revision: | 18 |
Proposed branch: | lp://staging/~jtv/gwacl/dispatcher |
Merge into: | lp://staging/gwacl |
Diff against target: |
245 lines (+147/-57) 4 files modified
example/live_example.go (+50/-0) x509dispatcher.go (+70/-0) x509session.go (+25/-31) x509session_test.go (+2/-26) |
To merge this branch: | bzr merge lp://staging/~jtv/gwacl/dispatcher |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raphaël Badin (community) | Approve | ||
Review via email: mp+153975@code.staging.launchpad.net |
Commit message
Refactor the x509 code, based on working prototype of a management-API call.
Description of the change
You see here the basics for communicating with the Azure management interface, using SSL and client-side certificates.
We had to use libcurl to talk to Azure. The Azure management API forces a TLS renegotiation, and Go's standard http package does not support those (as we eventually found out from reading the standard-library source). It just breaks with a "no renegotiation" error. We're trying to hide libcurl from the gwacl API so that we could switch it out later if needed, as & when the standard library supports Azure.
We have a request to the actual Azure API working. This refactoring prepares us for (1) dependency injection so we can get proper tests going (we'll make doX509Request something the tests can switch out for a fake), and (2) implementation of other methods that use the API.
No, this is nowhere near complete. We're sprinting and this is initial setup. It's not going to break anything that worked!
Jeroen
[0]
78 +// NewSession creates and returns a new X509Session based on credentials
79 // and X509 certificate files.
s/NewSession/ NewX509Session
[1]
110 +func GetURL(URI, subscriptionId string) (string) {
114 +func (session *X509Session) Get(url string) (string, error) {
Add TODO: Test this.