Merge lp://staging/~jtv/gwacl/dispatcher into lp://staging/gwacl

Proposed by Jeroen T. Vermeulen
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
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

To post a comment you must log in.
Revision history for this message
Raphaël Badin (rvb) wrote :

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

review: Approve
lp://staging/~jtv/gwacl/dispatcher updated
19. By Jeroen T. Vermeulen

Add missing files and TODO notices.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Thanks. Added. And x509dispatcher.go, which we pair-programmed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches