I'm working on setting up a connection to an SFTP server using a private key file and a username for authentication in my Mule application. Currently, I've managed to make it work by storing the key file directly within the code, specifically in the src/java/resources folder.
However, as I move forward with deploying the application to the runtime manager and consider promoting it to different or higher environments, or if there's a need to update the key file, I'm facing a bit of uncertainty. I'm not sure about the best practice for storing the key file in these situations and how to dynamically manage it.
Ideally, I'm looking for a solution that allows me to easily change the key file without having to redeploy the entire application. Is there a way to store the key file as a string within the application, or is there a better approach to handle this scenario?
I'd appreciate any advice or guidance on how to tackle this issue effectively. If there's a recommended best practice or any alternative methods that I should consider, I'm open to exploring those options.
I attempted to connect to the SFTP server using the provided identity file and username. Initially, I stored the key file in the src/java/resources folder within the code itself, which allowed the connection to work correctly. However, upon deploying the application to the runtime manager and attempting to promote it to different or higher environments, or when the key file needed to be updated, I encountered challenges.