Merge lp:~jameinel/goose/no-ssl-public into lp:goose
Proposed by
John A Meinel
Status: | Merged |
---|---|
Approved by: | John A Meinel |
Approved revision: | 106 |
Merged at revision: | 107 |
Proposed branch: | lp:~jameinel/goose/no-ssl-public |
Merge into: | lp:goose |
Diff against target: |
55 lines (+37/-0) 2 files modified
client/client.go (+8/-0) client/local_test.go (+29/-0) |
To merge this branch: | bzr merge lp:~jameinel/goose/no-ssl-public |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+184517@code.launchpad.net |
Commit message
client.
While working on the juju-core side of the code, I discovered another path
where we try to connect to the HTTPS server (reading public buckets). So we
need a way to disable ssl validation there as well.
Description of the change
client.
While working on the juju-core side of the code, I discovered another path
where we try to connect to the HTTPS server (reading public buckets). So we
need a way to disable ssl validation there as well.
To post a comment you must log in.
Reviewers: mp+184517_ code.launchpad. net,
Message:
Please take a look.
Description: NewNonValidatin gPublicClient: new API
client.
While working on the juju-core side of the code, I discovered another
path
where we try to connect to the HTTPS server (reading public buckets). So
we
need a way to disable ssl validation there as well.
https:/ /code.launchpad .net/~jameinel/ goose/no- ssl-public/ +merge/ 184517
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/13396048/
Affected files (+39, -0 lines): local_test. go
A [revision details]
M client/client.go
M client/
Index: [revision details] 20130906034601- 83yd6irnaucxwul 4
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: client/client.go
=== modified file 'client/client.go'
--- client/client.go 2013-09-04 10:35:49 +0000
+++ client/client.go 2013-09-09 08:24:27 +0000
@@ -89,6 +89,14 @@
return &client
}
+func NewNonValidatin gPublicClient( baseURL string, logger *log.Logger) NewNonSSLValida ting(), ServiceTypes = []string{"compute", "object-store"}
Client {
+ return &client{
+ baseURL: baseURL,
+ logger: logger,
+ httpClient: goosehttp.
+ }
+}
+
var defaultRequired
func newClient(creds *identity. Credentials, auth_method identity.AuthMode, lient {
httpClient *goosehttp.Client, logger *log.Logger) AuthenticatingC
Index: client/ local_test. go local_test. go' local_test. go 2013-09-04 10:35:49 +0000 local_test. go 2013-09-09 08:24:27 +0000 contents, DeepEquals, []swift. ContainerConten ts{}) ainer(c *C) string { NewNonValidatin gClient( s.cred, AuthUserPass, nil) authClient) CreateContainer ("test_ container" , swift.PublicRead) MakeServiceURL( "object- store", nil) baseURL[ :8], Equals, "https://") icClientRefuses SelfSigned( c *C) { ntainer( c) client. NewPublicClient (baseURL, nil)) List("test_ container" , "", "", "", 0) ContainerConten ts(nil) ) ngPublicClientA cceptsSelfSigne d(c ntainer( c) client. NewNonValidatin gPublicClient( baseURL, List("test_ container" , "", "", "", 0) ContainerConten ts{})
=== modified file 'client/
--- client/
+++ client/
@@ -396,3 +396,32 @@
c.Assert(err, IsNil)
c.Check(
}
+
+func (s *localHTTPSSuite) setupPublicCont
+ // First set up a container that can be read publically
+ authClient := client.
identity.
+ authSwift := swift.New(
+ err := authSwift.
+ c.Assert(err, IsNil)
+
+ baseURL, err := authClient.
+ c.Assert(err, IsNil)
+ c.Assert(
+ return baseURL
+}
+
+func (s *localHTTPSSuite) TestDefaultPubl
+ baseURL := s.setupPublicCo
+ swiftClient := swift.New(
+ contents, err := swiftClient.
+ c.Assert(err, ErrorMatches, "(.|\n)*x509: certificate signed by unknown
authority")
+ c.Assert(contents, DeepEquals, []swift.
+}
+
+func (s *localHTTPSSuite) TestNonValidati
*C) {
+ baseURL := s.setupPublicCo
+ swiftClient := swift.New(
nil))
+ contents, err := swiftClient.
+ c.Assert(err, IsNil)
+ c.Assert(contents, DeepEquals, []swift.
+}