This PR changes the types of the DatabaseConfig Pydantic class fields from str to SecretStr. This means that they will be serialised to ********** when accessing their values, or using .model_dump(), .dict(), or .json() (more info here). get_secret_value() should be used to access the secret value.
It also sets hide_input_in_errors on the models to True so that the input values can be hidden when ValidationError is raised during the validation.
Testing instructions
Add a set up instructions describing how the reviewer should test the code
[x] Review code
[x] Check Actions build
[x] Ensure that input values are not part of the error messages and logs (A validation error can be triggered by supplying a wrong type of value for a config or not supplying a value for a mandatory config)
Description
This PR changes the types of the
DatabaseConfig
Pydantic class fields fromstr
toSecretStr
. This means that they will be serialised to**********
when accessing their values, or using.model_dump()
,.dict()
, or.json()
(more info here).get_secret_value()
should be used to access the secret value.It also sets
hide_input_in_errors
on the models toTrue
so that the input values can be hidden whenValidationError
is raised during the validation.Testing instructions
Add a set up instructions describing how the reviewer should test the code