I am writing a tool that connects to a server using a login and password. The tool's user has to provide at runtime the login and password for the tool to be able to connect to a server to fetch some information.
However, I am putting in place some integration tests for my tool, hence the tests should be able to connect to the server. I can use a generic server's account to do so.
But I would like to automate those integration tests, so I would need to have the generic credentials stored encrypted somewhere and the integration tests to decrypt them when they get executed (even though they are generic, they are still credentials so I'm not comfortable in storing them un-encrypted).
What would be the way to work this out? If the tool is able to decrypt the password, then it means that it would hold some master key, and I do suppose this is wrong.
Should I expose some external service to which I am sending the encrypted value to get it decrypted so the encryption/decryption would be processed outside the tool?
Thanks