Skip to main content

Protects passwords from accidentally getting into logs

Project description

secure-string

Tests codecov Mypy pypi downloads versions

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 print '***' to stdout
print(password.value)  # this will print '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.4.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

secure_strings-1.0.4-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file secure_strings-1.0.4.tar.gz.

File metadata

  • Download URL: secure_strings-1.0.4.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for secure_strings-1.0.4.tar.gz
Algorithm Hash digest
SHA256 d1c151e8caa04e28d02de06b394bd6f134446fd6849f01aa561268d6c8b62258
MD5 d7757d127a165248cf86d16c46895a3c
BLAKE2b-256 99acc9b179506ba4869853bccff933b526df33cf722e022d979d94867b3eb833

See more details on using hashes here.

File details

Details for the file secure_strings-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: secure_strings-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for secure_strings-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 efa7939a24ae934aa49acfcedb1279fbe746e2681f8d40e30c4a10a0e1a08bd3
MD5 09a692772dcf0233023121f816a676a2
BLAKE2b-256 aed63adf480914f4f49061e06b5f8dc1025b04a2ee5fa7d221e1c5b53da4f516

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page