Devportal: Store environment configurations

Not applicable

Hi there,

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.

Solved Solved
1 6 229
1 ACCEPTED SOLUTION

Great Question @Pradeep Ande ,

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.

See an example here. Hope it helps.

View solution in original post

6 REPLIES 6

Great Question @Pradeep Ande ,

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.

See an example here. Hope it helps.

Yep, and here is a working example of a Drupal module that presents an admin form; it works with the Apigee dev portal.

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.

Thank you @Dino created form and was able to use Pantheon environments to configure differently in each environment.


Thank you @Anil Sagar It helped. I am able to implement it.

On a different note, I have $certified_app

$certified_app = $app instanceOf ApigeeCompanyAppEntity ? new \Apigee\ManagementAPI\CompanyApp($config, $app->companyName): new \Apigee\ManagementAPI\DeveloperApp($config, $app->developer);

and would like to get developer email address and company name. How is the relationship between developer and the app.

AbstractApp class has function to get getConsumerSecret(), getConsumerKey but couldnt find a function to get email address of developer.

Any help is appreciated.


@Pradeep Ande , Please post it as a new question.

click here click here click here

4422-ask-a-question-click-here.png