File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,9 @@ type Config struct {
3030
3131// Service is the URL and its Env pair
3232type Service struct {
33- URL string `json:"url"`
34- Env Env `json:"env"`
33+ URL string `json:"url"`
34+ Env Env `json:"env"`
35+ Args []string `json:"args"`
3536}
3637
3738// Env represents the environment variables needed to request to IAP-protected app
@@ -86,6 +87,7 @@ func (cfg *Config) Create() error {
8687 ClientID : "foobar.apps.googleusercontent.com" ,
8788 Binary : "curl" ,
8889 },
90+ Args : []string {},
8991 }}
9092 }
9193
@@ -212,3 +214,13 @@ func (cfg *Config) Register(s Service) error {
212214 w .Write (out .Bytes ())
213215 return w .Flush ()
214216}
217+
218+ // GetServiceArgs returns ...
219+ func (cfg * Config ) GetServiceArgs (url string ) []string {
220+ for _ , service := range cfg .Services {
221+ if service .URL == url {
222+ return service .Args
223+ }
224+ }
225+ return []string {}
226+ }
Original file line number Diff line number Diff line change @@ -154,8 +154,9 @@ func (c CLI) run() int {
154154 authHeader := fmt .Sprintf ("Authorization: Bearer %s" , token )
155155 args := append (
156156 []string {"-H" , authHeader }, // For IAP
157- c .args ... ,
157+ c .cfg . GetServiceArgs ( url ) ... ,
158158 )
159+ args = append (args , c .args ... )
159160 args = append (args , url )
160161
161162 s := newShell (env .Binary , args )
You can’t perform that action at this time.
0 commit comments