Skip to content

Commit

Permalink
Add warning to secret_key parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
Varbin committed Aug 13, 2021
1 parent 71f6c5d commit 8d37c7e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cachelib/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ class BaseCache:
no timeout is specified on :meth:`set`. A timeout
of 0 indicates that the cache never expires.
:param secret_key: Key to sign cache entries with.
:param secret_key: Key to sign cache entries with.
.. versionadded:: 0.3.0
"""

def __init__(
Expand Down
7 changes: 7 additions & 0 deletions src/cachelib/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ class FileSystemCache(BaseCache):
:param mode: the file mode wanted for the cache files, default 0600
:param secret_key: Key to sign cache entries with.
.. warning::
Without a secret key or in case the secret key is not secret anymore,
anyone with write access to the cache directory can trick your program
into executing arbitrary code.
.. versionadded:: 0.3.0
"""

#: used for temporary files by the FileSystemCache
Expand Down
7 changes: 7 additions & 0 deletions src/cachelib/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ class RedisCache(BaseCache):
:param key_prefix: A prefix that should be added to all keys.
:param secret_key: Key to sign cache entries with.
.. warning::
Without a secret key or in case the secret key is not secret anymore,
anyone with write access to the redis instance can trick your program
into executing arbitrary code.
.. versionadded:: 0.3.0
Any additional keyword arguments will be passed to ``redis.Redis``.
"""

Expand Down
7 changes: 7 additions & 0 deletions src/cachelib/uwsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ class UWSGICache(BaseCache):
same instance as the werkzeug app, you only have to provide the name of
the cache.
:param secret_key: Key to sign cache entries with.
.. warning::
Without a secret key or in case the secret key is not secret anymore,
anyone with write access to the uWSGI cache can trick your program
into executing arbitrary code.
.. versionadded:: 0.3.0
"""

def __init__(
Expand Down

0 comments on commit 8d37c7e

Please sign in to comment.