Protects passwords from accidentally getting into logs
Project description
secure-string
Protects passwords from accidentally getting into logs
Installation
pip install secure-strings # not secure-string, but secure-strings
Examples
from secure_string import SecureString, SecureStringContextManager, SecureStringStrictContextManager
password = SecureString('my password')
print(password) # this will prints '***' to stdout
print(password.value) # this will prints 'my password', use the `value` property to get real value
# we can disable string protection
with SecureStringContextManager(False):
print(password) # 'my password'
# we can also enable strict mode when we need to find a place where the password can be displayed
with SecureStringStrictContextManager(True):
print(password) # SecureStringStrictError, Method "__str__" does not allowed in strict mode context
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
secure_strings-1.0.2.tar.gz
(7.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file secure_strings-1.0.2.tar.gz.
File metadata
- Download URL: secure_strings-1.0.2.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afc1a3287ff3b1705ff2d49029e8ab3ab585815204164277ac2ba50b7cb7224e
|
|
| MD5 |
c0efaef37d8b622d2989c62613f077c6
|
|
| BLAKE2b-256 |
c343f6852507cfbc86462ccd76d9fd4d894cb1a9d97f33f14666451ea0caa130
|
File details
Details for the file secure_strings-1.0.2-py3-none-any.whl.
File metadata
- Download URL: secure_strings-1.0.2-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4a8f68aba55a9eb723c59281e1f242434d40b5dae043267c093cd0a6ba2995e
|
|
| MD5 |
93afdad1e10fe7a0f6d51393ca5777cd
|
|
| BLAKE2b-256 |
a862fd8dd91aff781931cb190ca4c00e85f6750ed68e9e26fa886cb808e75b40
|