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
Currently each agency's
SwitchioConfigdeclares several pieces of information that are common across agencies:It would be ideal to centralize this information.
Perhaps in a new model calledsee discussion belowSwitchioEnvConfigassociated with eachEnvironmentrather than agencies themselves?If that makes sense, we might also consider surfacing the two props below in the very same model.
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 belowAcceptance Criteria
SwitchioConfigmodel no longer has these fields that must be entered into each instance in the Admin:enrollment_api_authorization_headerclient_certificateca_certificateprivate_keyclient_certificate_data,ca_certificate_data, andprivate_key_dataproperties are updated to get the env var directly, rather than looking for the removed fieldsenrollment_api_authorization_headerproperty is added to access that env var_datafields and the oldenrollment_api_authorization_headerfield name for the new property name, no code changes outside of the model are required.