Mercurial > gemma
comparison pkg/controllers/importconfig.go @ 3540:b268cae2df39
merge with branch password
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Fri, 31 May 2019 09:34:31 +0200 |
parents | c64c47ff2ab1 |
children | 30f6647b8856 |
comparison
equal
deleted
inserted
replaced
3537:cbf883596e4e | 3540:b268cae2df39 |
---|---|
175 Message: fmt.Sprintf("No constructor for kind '%s' found", cfg.Kind), | 175 Message: fmt.Sprintf("No constructor for kind '%s' found", cfg.Kind), |
176 } | 176 } |
177 return | 177 return |
178 } | 178 } |
179 | 179 |
180 // Remove `password` from the attributes to be delivered to the client. | |
181 // Even a priviledged user shall not be able to see the password. | |
182 // (See config.ListAllPersistentConfigurationsContext() for the other | |
183 // place where this is done.) | |
184 filteredAttributes := make(common.Attributes) | |
185 for key, value := range cfg.Attributes { | |
186 if key != "password" { | |
187 filteredAttributes[key] = value | |
188 } | |
189 } | |
190 | |
180 what := ctor() | 191 what := ctor() |
181 | 192 if err = filteredAttributes.Unmarshal(what); err != nil { |
182 if err = cfg.Attributes.Unmarshal(what); err != nil { | |
183 return | 193 return |
184 } | 194 } |
185 | 195 |
186 jr = JSONResult{Result: &imports.ImportConfigOut{ | 196 jr = JSONResult{Result: &imports.ImportConfigOut{ |
187 ID: id, | 197 ID: id, |