Let's say an application I'm writing requires a password for something but I don't want that password to be saved in version control (so no hard-coding the password). What I've been doing is creating a file called PASSWORD
which is read in once by the application and ignored by version control. Is there a more preferential method to handle this situation?
|
|||||
|
This is a perennial problem. At some point, when software needs to access something protected by a password, the software needs that password. And for the software to get that password, and not require a user to enter it manually, it has to be stored in persistent storage of some sort. I see several options:
|
|||
|
For Windows applications, there is the registry or various config files,e.g. app.config or web.config, that could be used to store this kind of data. AppSettings is the collection used within Windows code to access the config file in .Net for example. I'd suspect there are similar files and locations on systems using other operating systems for where this information would be stored. While you may disagree about storing a web.config in version control, I have had more than a few times where a developer got upset that I committed the "web.config" and thus at times it is worth considering what is the code and what is configuration that administrators can handle. If you have a better solution, why aren't you posting it? |
|||||||||
|