I am in process of integrating Devportal with third party API.
When an action is performed in DevPortal, Data needs to be posted to third party API.
I am able to do that without any problem. Now the question is where can I store the environment specific credentials.
I have different credentials for Dev, test and Live. I do not want to hard code them in the code.
I would like credentials configurable from Devpostal, in case I have to change these values in future, I do not want to update the code to change the credentials.
You can create an Admin form & Store these credentials in Drupal Variables table using system settings form API. Make sure you secure this admin form using drupal permissions feature.
This isn’t exactly what you need but it might provide a useful starting point. You could start with this module (it’s licensed via the Apache source license v2.0) and modify it to suit your needs. This one has a table that lists the environments in the Edge organization, and a different string setting for each of those.
You could modify it to list the Pantheon stages (dev,test,live) and allow the admin to specify a different set of credentials for each of those environments.