|
Push environment secrets after connecting API
This change introduces a new client API,
PushEnvironmentSecrets. The api.Open function
is modified to call it directly after a
successful Login if given a non-empty set of
secrets to pass to the server. The
juju/NewAPI* functions have been modified to
pass secrets to api.Open. Non-client callers
of api.Open (i.e. machine agents) will not
invoke PushEnvironmentSecrets.
A follow-up CL will modify Login to return
a flag indicating that secrets have not
previously been sent, and should now be.
The api.Open function will then be modified
to check this flag, and conditionally make
the PushEnvironmentSecrets call.
Also, fix a bug in state.State.SetEnvironmentConfig,
so deleted attributes are removed from Mongo.
Also, modify the dummy provider to not set defaults
in config when calling SecretAttrs. These changes
were necessary for testing PushEnvironmentSecrets
properly.
Fixes lp:1248809
https://code.launchpad.net/~axwalk/juju-core/api-push-env-secrets/+merge/194083
(do not edit description out of merge proposal)
Total comments: 8
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+196 lines, -71 lines) |
Patch |
|
A |
[revision details]
|
View
|
1
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
agent/agent.go
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
juju/api.go
|
View
|
1
|
7 chunks |
+61 lines, -33 lines |
0 comments
|
Download
|
|
M |
juju/apiconn_test.go
|
View
|
|
6 chunks |
+14 lines, -14 lines |
0 comments
|
Download
|
|
M |
juju/testing/conn.go
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
provider/dummy/config_test.go
|
View
|
1
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
provider/dummy/environs.go
|
View
|
1
|
1 chunk |
+2 lines, -5 lines |
0 comments
|
Download
|
|
M |
state/api/apiclient.go
|
View
|
|
3 chunks |
+28 lines, -7 lines |
0 comments
|
Download
|
|
M |
state/api/client.go
|
View
|
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
state/api/params/params.go
|
View
|
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
|
M |
state/apiserver/client/api_test.go
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
state/apiserver/client/client.go
|
View
|
1
|
2 chunks |
+23 lines, -0 lines |
0 comments
|
Download
|
|
M |
state/apiserver/client/client_test.go
|
View
|
1
|
2 chunks |
+35 lines, -0 lines |
0 comments
|
Download
|
|
M |
state/apiserver/login_test.go
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
state/apiserver/server_test.go
|
View
|
|
3 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
|
M |
state/settings.go
|
View
|
1
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
state/state.go
|
View
|
1
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
Total messages: 5
|