File tree 2 files changed +23
-2
lines changed
2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,17 @@ import (
21
21
22
22
// State represents a desired system state
23
23
type State struct {
24
- Targets task.Targets `json:"targets"`
25
- Env map [string ]string `json:"env"`
24
+ Targets task.Targets `json:"targets"`
25
+ AuthMethods []AuthMethod `json:"auths"`
26
+ Env map [string ]string `json:"env"`
27
+ }
28
+
29
+ // AuthMethod represents a method of authentication for a target
30
+ type AuthMethod struct {
31
+ Name string `json:"name"` // name of the auth method
32
+ Path string `json:"path"` // path within the secret store
33
+ UserKey string `json:"user_key"` // key for username
34
+ PassKey string `json:"pass_key"` // key for password
26
35
}
27
36
28
37
// ConfigFromDirectory searches a directory for configuration files and
@@ -90,6 +99,15 @@ function T(t) {
90
99
function E(k, v) {
91
100
STATE.env[k] = v
92
101
}
102
+
103
+ function A(a) {
104
+ if(a.name === undefined) { throw "auth name undefined"; }
105
+ if(a.path === undefined) { throw "auth path undefined"; }
106
+ if(a.user_key === undefined) { throw "auth user_key undefined"; }
107
+ if(a.pass_key === undefined) { throw "auth pass_key undefined"; }
108
+
109
+ STATE.auths.push(a);
110
+ }
93
111
` )
94
112
95
113
cb .vm .Set ("HOSTNAME" , hostname ) //nolint:errcheck
Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ type Target struct {
48
48
49
49
// Whether or not to run `Command` on first run, useful if the command is `docker-compose up`
50
50
InitialRun bool `json:"initial_run"`
51
+
52
+ // Auth method to use from the auth store
53
+ Auth string `json:"auth"`
51
54
}
52
55
53
56
// Execute runs the target's command in the specified directory with the
You can’t perform that action at this time.
0 commit comments