Document use of secret key to obscure Wagtail version

Whilst ideally we wouldn't use the secret key, it's the best way to ensure the value doesn't expose the wagtail version, whilst still being deployment-specific.
pull/11737/head^2
Jake Howard 2024-04-02 12:54:34 +01:00 zatwierdzone przez Matt Westcott
rodzic e8f4d56583
commit 6b0c97218a
2 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -29,6 +29,7 @@ except AttributeError:
if use_version_strings:
# SECRET_KEY is used to prevent exposing the Wagtail version
VERSION_HASH = hashlib.sha1(
(__version__ + settings.SECRET_KEY).encode("utf-8")
).hexdigest()[:8]

Wyświetl plik

@ -131,6 +131,7 @@ def get_sprite_hash():
global sprite_hash
if not sprite_hash:
content = str(home.sprite(None).content, "utf-8")
# SECRET_KEY is used to prevent exposing the Wagtail version
sprite_hash = hashlib.sha1(
(content + settings.SECRET_KEY).encode("utf-8")
).hexdigest()[:8]