I have a module that has specific server settings which includes a password.
The current approach I'm taking is to create a UUID and store it in the module file, creating one if it does not already exist.
I then use the PasswordSafe class and store the password using this UUID as the key to store the password under.
So far it's working great except for one thing. If you try to access the panel with the password when bg tasks are running then the master password dialog doesn't come up. When this happens the password is lost and a blank one is somehow stored.
Is there a better approach to doing this? I'm assuming simply hashing the password into the module settings isn't really a secure way of storing the password, but it definitely would be easier to reason about.