Merge lp:~pedronis/ubuntu-push/set-auth-helper into lp:ubuntu-push/automatic

Proposed by Samuele Pedroni
Status: Merged
Approved by: Samuele Pedroni
Approved revision: 163
Merged at revision: 163
Proposed branch: lp:~pedronis/ubuntu-push/set-auth-helper
Merge into: lp:ubuntu-push/automatic
Diff against target: 64 lines (+10/-5)
2 files modified
client/client.go (+5/-2)
client/client_test.go (+5/-3)
To merge this branch: bzr merge lp:~pedronis/ubuntu-push/set-auth-helper
Reviewer Review Type Date Requested Status
John Lenton (community) Approve
Review via email: mp+220202@code.launchpad.net

Commit message

let set the auth helper through the actual config

Description of the change

let set the auth helper through the actual config

To post a comment you must log in.
Revision history for this message
John Lenton (chipaca) wrote :

This'll break people with tweaked configs. Oh well.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'client/client.go'
2--- client/client.go 2014-05-16 12:49:30 +0000
3+++ client/client.go 2014-05-20 07:45:28 +0000
4@@ -61,6 +61,8 @@
5 ExpectAllRepairedTime config.ConfigTimeDuration `json:"expect_all_repaired"` // worth retrying all servers after
6 // The PEM-encoded server certificate
7 CertPEMFile string `json:"cert_pem_file"`
8+ // How to invoke the auth helper
9+ AuthHelper []string `json:"auth_helper"`
10 // The logging level (one of "debug", "info", "error")
11 LogLevel logger.ConfigLogLevel `json:"log_level"`
12 }
13@@ -151,8 +153,9 @@
14 ExchangeTimeout: client.config.ExchangeTimeout.TimeDuration(),
15 HostsCachingExpiryTime: client.config.HostsCachingExpiryTime.TimeDuration(),
16 ExpectAllRepairedTime: client.config.ExpectAllRepairedTime.TimeDuration(),
17- PEM: client.pem,
18- Info: info,
19+ PEM: client.pem,
20+ Info: info,
21+ AuthHelper: client.config.AuthHelper,
22 }
23 }
24
25
26=== modified file 'client/client_test.go'
27--- client/client_test.go 2014-05-16 12:49:30 +0000
28+++ client/client_test.go 2014-05-20 07:45:28 +0000
29@@ -106,6 +106,7 @@
30 "addr": ":0",
31 "cert_pem_file": pem_file,
32 "recheck_timeout": "3h",
33+ "auth_helper": []string{},
34 "log_level": "debug",
35 }
36 for k, v := range overrides {
37@@ -255,6 +256,9 @@
38 ******************************************************************/
39
40 func (cs *clientSuite) TestDeriveSessionConfig(c *C) {
41+ cs.writeTestConfig(map[string]interface{}{
42+ "auth_helper": []string{"auth", "helper"},
43+ })
44 info := map[string]interface{}{
45 "foo": 1,
46 }
47@@ -268,7 +272,7 @@
48 ExpectAllRepairedTime: 30 * time.Minute,
49 PEM: cli.pem,
50 Info: info,
51- AuthHelper: []string{},
52+ AuthHelper: []string{"auth", "helper"},
53 }
54 // sanity check that we are looking at all fields
55 vExpected := reflect.ValueOf(expected)
56@@ -278,8 +282,6 @@
57 // field isn't empty/zero
58 c.Assert(fv.Interface(), Not(DeepEquals), reflect.Zero(fv.Type()).Interface(), Commentf("forgot about: %s", vExpected.Type().Field(i).Name))
59 }
60- // but AuthHelper really should be nil for now
61- expected.AuthHelper = nil
62 // finally compare
63 conf := cli.deriveSessionConfig(info)
64 c.Check(conf, DeepEquals, expected)

Subscribers

People subscribed via source and target branches