Flesh out the email implementation
This commit is contained in:
parent
c1a61730d5
commit
cee708f4d8
4 changed files with 29 additions and 10 deletions
0
src/utils/__init__.py
Normal file
0
src/utils/__init__.py
Normal file
14
src/utils/secret.py
Normal file
14
src/utils/secret.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
class SecretBox[T]:
|
||||
"""A helper abstraction for making sure secrets aren't leaked accidentally"""
|
||||
|
||||
def __init__(self, item: T):
|
||||
self._item = item
|
||||
|
||||
def expose_secret(self) -> T:
|
||||
return self._item
|
||||
|
||||
def __str__(self):
|
||||
return '<SECRET>'
|
||||
|
||||
def __repr__(self):
|
||||
return f'SecretBox<{type(self._item)}>'
|
||||
Loading…
Add table
Add a link
Reference in a new issue