Skip to content

consider centralizing redundant SwitchioConfig properties #3560

@jgravois

Description

@jgravois

Currently each agency's SwitchioConfig declares several pieces of information that are common across agencies:

  • Enrollment api authorization header
  • Client certificate
  • Ca certificate
  • Private key

It would be ideal to centralize this information. Perhaps in a new model called SwitchioEnvConfig associated with each Environment rather than agencies themselves? see discussion below

If that makes sense, we might also consider surfacing the two props below in the very same model.

  • switchio-{env}-enrollment-api-base-url
  • switchio-{env}-tokenization-api-base-url

based on my cursory reading of the code, it looks more like they ended up secrets in the interest of making it convenient to switch between environments, not because they actually store something sensitive. see discussion below

Acceptance Criteria

  • The SwitchioConfig model no longer has these fields that must be entered into each instance in the Admin:
    • enrollment_api_authorization_header
    • client_certificate
    • ca_certificate
    • private_key
  • Values that were used in the above fields are stored in environment variables (secrets in Azure Key Vault for the cloud environments)
  • The existing client_certificate_data, ca_certificate_data, and private_key_data properties are updated to get the env var directly, rather than looking for the removed fields
  • A new enrollment_api_authorization_header property is added to access that env var
  • By reusing those PEM data _data fields and the old enrollment_api_authorization_header field name for the new property name, no code changes outside of the model are required.

Metadata

Metadata

Assignees

Labels

back-endDjango views, sessions, middleware, models, migrations etc.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions