orange-cloudfoundry/static-creds-broker

implement support for multiple plans with associated credentials

Closed this issue · 3 comments

Given env variables definining multiple plans in format SERVICES_SID_PLAN_PID_NAME

SERVICES_API_DIRECTORY_NAME: MyService
SERVICES_API_DIRECTORY_PLAN_1_NAME: dev
SERVICES_API_DIRECTORY_PLAN_1_CREDENTIALS_URI: http://mydev-api.org
SERVICES_API_DIRECTORY_PLAN_1_CREDENTIALS_ACCESS_KEY: AZERT23456664DFDSFSDFDSF
SERVICES_API_DIRECTORY_PLAN_2_NAME: preprod
SERVICES_API_DIRECTORY_PLAN_2_CREDENTIALS_URI: http://mypreprod-api.org
SERVICES_API_DIRECTORY_PLAN_2_CREDENTIALS_ACCESS_KEY: AZERT23456664DFDSFSDFDSF
SERVICES_API_DIRECTORY_PLAN_3_NAME: prod
SERVICES_API_DIRECTORY_PLAN_3_CREDENTIALS_URI: http://myprod-api.org
SERVICES_API_DIRECTORY_PLAN_3_CREDENTIALS_ACCESS_KEY: AZERT23456664DFDSFSDFDSF

Then the marketplace will be registered with a service with 3 plans: dev, preprod, prod
Specific credentials for each plans are returned

fixed in commits:
bf32511
49acd36
6467703

Note: both credentials definitions per service (ex. SERVICES_API_DIRECTORY_CREDENTIALS_URI) and per plan (ex. SERVICES_API_DIRECTORY_PLAN_1_CREDENTIALS_URI) is supported.

If there are conflicts keys defined both in service credentials and plan credentials, the value of plan credential will be taken.

Question: whether the support of updateable plan is necessary ?

@tao-xinxiu No I don't see use-cases that would require the ability for a static-creds service instance to be updated to switch between plans ( cf update-service -p NEW_PLAN). Let's defer this if that gets required by users.