1

My custom search command required some credentials to work (third party lib auth) and I don't want to have it hardcoded. What is the best practice to pass the credentials inside this custom search command?

 I'm looking to do some similar to set-up page from add-on builder.

Any thought on this?

1 Answers1

0

Assuming there is a script running behind the custom search command, you can have your credentials stored in a file(eg: json format) and then encrypt the file using a key(GnuPG library). your hard coded credential file will not be required after this.

In the script, decrypt(use GnuPG library) the encrypted file using the key used for encryption and then use it for authentication.

TejaJag
  • 1
  • 2