ral-facilities / inventory-management-system-api

Apache License 2.0
0 stars 0 forks source link

Handling sensitive config values #284

Closed VKTB closed 4 months ago

VKTB commented 4 months ago

Description

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