-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
-
Python Drivers
-
Not Needed
-
Context
To avoid logging tokens or passwords accidentally pydantic provides a nice SecretStr model as a way to reduce these issues.
Can change instances like:
class Token(BaseModel):
access_token: str
refresh_token: Optional[str] = None
token_type: str
to
from pydantic import SecretStr class Token(BaseModel): access_token: SecretStr refresh_token: Optional[SecretStr] = None token_type: str
Definition of done
What must be done to consider the task complete?
str is replaced with SecretStr throughout the code.
Pitfalls
What should the implementer watch out for? What are the risks?