Timeline for Iterating over multiple sets of credentials
Current License: CC BY-SA 3.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 13, 2018 at 2:03 | comment | added | svidgen |
I'm actually on the fence as to whether this question is on topic ... So, let me try to give you some advice here: Don't put credentials in your code. Put that stuff in a config file as a list or dictionary of connection strings or something (with encrypted creds if possible). So, your code would look more like, var endpoints = Config["endpoints"]; endpoints.forEach(t => uploadStuffTo(t); ) ... or whatever.
|
|
Jan 12, 2018 at 17:05 | comment | added | Ewan | conceptually this question is no different from the 'how do i simplify this if..else code' which is so popular atm | |
Jan 12, 2018 at 16:51 | answer | added | Ewan | timeline score: 0 | |
Jan 12, 2018 at 13:40 | comment | added | David Arno | Questions asking for assistance in explaining, writing or debugging code are off-topic here. Voting to close. | |
Jan 12, 2018 at 13:38 | review | Suggested edits | |||
Jan 13, 2018 at 2:43 | |||||
Jan 12, 2018 at 13:37 | review | Close votes | |||
Feb 1, 2018 at 3:03 | |||||
Jan 12, 2018 at 13:30 | comment | added | Tauropi | Great idea. I'll move them into environment variables, unless a dictionary is much better? I read that environment variables are safer. | |
Jan 12, 2018 at 13:26 | comment | added | neilsimp1 | For starters, are you sure the username/passwords will never change? They should probably be moved out of the code and into a configuration file. That might help organize the code for you too. That way you can just pull out username/password/url from a configuration object like a Dictionary. | |
Jan 12, 2018 at 13:19 | comment | added | Tauropi | I don't agree - I'm not asking for efficiency in the switch statement, I'm asking about how to generally doing these things, ie alternate methods. | |
Jan 12, 2018 at 13:15 | comment | added | gnat | Possible duplicate of Most efficient method for large switch statements | |
Jan 12, 2018 at 13:12 | review | First posts | |||
Jan 12, 2018 at 14:43 | |||||
Jan 12, 2018 at 13:08 | history | asked | Tauropi | CC BY-SA 3.0 |