cal-itp / benefits

Transit benefits enrollment, minus the paperwork.
https://docs.calitp.org/benefits
GNU Affero General Public License v3.0
27 stars 9 forks source link

Plan refactor of secret and non-secret configuration data #1764

Closed thekaveman closed 9 months ago

thekaveman commented 1 year ago

The existing Django models capture both secret configuration items and non-secret configuration items. The vast majority of fields are non-secret and do not require additional controls.

For the secret configuration, values are currently maintained in Azure Key Vault and read into a new app service environment each time the app restarts (e.g. with a new deploy, or if an engineer restarts the app manually during debugging).

We want to continue to maintain the majority non-secret configuration data simply and directly via Django models and stored in the Django database.

We need a plan for how to incorporate the secret values in an environment where we do not re-create the database each time the app restarts, and thus would not (necessarily) read from Key Vault at app startup time.

Acceptance Criteria

Additional context

Activities

Running list of activities related to this effort

Implementation plan

thekaveman commented 12 months ago

Maybe helpful here: https://learn.microsoft.com/en-us/python/api/overview/azure/keyvault-secrets-readme?view=azure-python&source=recommendations

thekaveman commented 10 months ago

Could follow this pattern / helper function get_secret_by_name: https://github.com/cal-itp/data-infra/blob/main/packages/calitp-data-infra/calitp_data_infra/auth.py

thekaveman commented 9 months ago

We talked through this plan at a recent Dev Workshop, and made some adjustments based on the conversation. Those are reflected in the steps above.