# HG changeset patch # User Thomas Junk # Date 1559288071 -7200 # Node ID b268cae2df39bafcf9203fba078fbb1edb4386af # Parent cbf883596e4eff0ddf9cbf947c58f999a9650b0b# Parent 60f48bc1498addade397e0a4d61ff85a5354bf00 merge with branch password diff -r cbf883596e4e -r b268cae2df39 client/src/components/importconfiguration/ScheduledImports.vue --- a/client/src/components/importconfiguration/ScheduledImports.vue Thu May 30 10:45:20 2019 +0200 +++ b/client/src/components/importconfiguration/ScheduledImports.vue Fri May 31 09:34:31 2019 +0200 @@ -393,6 +393,7 @@
-
+
Please enter a Password */ + +import { mapState } from "vuex"; export default { name: "distancemarksvirtual", props: ["url", "username", "password"], @@ -94,6 +99,10 @@ }; }, computed: { + ...mapState("importschedule", [ + "importScheduleDetailVisible", + "currentSchedule" + ]), showPassword() { if (this.passwordVisible) return "text"; return "password"; diff -r cbf883596e4e -r b268cae2df39 client/src/components/importconfiguration/types/Waterwaygauges.vue --- a/client/src/components/importconfiguration/types/Waterwaygauges.vue Thu May 30 10:45:20 2019 +0200 +++ b/client/src/components/importconfiguration/types/Waterwaygauges.vue Fri May 31 09:34:31 2019 +0200 @@ -59,7 +59,10 @@
-
+
Please enter a Password */ + +import { mapState } from "vuex"; + export default { name: "waterwaygauges", props: ["username", "password", "url"], @@ -94,6 +100,10 @@ }; }, computed: { + ...mapState("importschedule", [ + "importScheduleDetailVisible", + "currentSchedule" + ]), showPassword() { if (this.passwordVisible) return "text"; return "password"; diff -r cbf883596e4e -r b268cae2df39 pkg/controllers/importconfig.go --- a/pkg/controllers/importconfig.go Thu May 30 10:45:20 2019 +0200 +++ b/pkg/controllers/importconfig.go Fri May 31 09:34:31 2019 +0200 @@ -177,9 +177,19 @@ return } - what := ctor() + // Remove `password` from the attributes to be delivered to the client. + // Even a priviledged user shall not be able to see the password. + // (See config.ListAllPersistentConfigurationsContext() for the other + // place where this is done.) + filteredAttributes := make(common.Attributes) + for key, value := range cfg.Attributes { + if key != "password" { + filteredAttributes[key] = value + } + } - if err = cfg.Attributes.Unmarshal(what); err != nil { + what := ctor() + if err = filteredAttributes.Unmarshal(what); err != nil { return } diff -r cbf883596e4e -r b268cae2df39 pkg/imports/config.go --- a/pkg/imports/config.go Thu May 30 10:45:20 2019 +0200 +++ b/pkg/imports/config.go Fri May 31 09:34:31 2019 +0200 @@ -269,7 +269,12 @@ if pc.Attributes == nil { pc.Attributes = common.Attributes{} } - pc.Attributes.Set(k.String, v.String) + // Prevent sending the `password` back to the client. + // (See importconfig.infoImportConfig() for the other place + // where this is done.) + if k.String != "password" { + pc.Attributes.Set(k.String, v.String) + } } }