From 382b931cd47c0e5e0177f3ddf43d475834df6fe2 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 4 Aug 2024 11:05:30 -0700 Subject: [PATCH] ikiwiki: Mark secret strings in privileged actions Tests: - Run affected privileged actions through UI and notice that secret strings are not logged. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/ikiwiki/privileged.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plinth/modules/ikiwiki/privileged.py b/plinth/modules/ikiwiki/privileged.py index 5f6c6357f..fda1eca9b 100644 --- a/plinth/modules/ikiwiki/privileged.py +++ b/plinth/modules/ikiwiki/privileged.py @@ -7,7 +7,7 @@ import re import shutil import subprocess -from plinth.actions import privileged +from plinth.actions import privileged, secret_str SETUP_WIKI = '/etc/ikiwiki/plinth-wiki.setup' SETUP_BLOG = '/etc/ikiwiki/plinth-blog.setup' @@ -57,7 +57,7 @@ def get_sites() -> list[tuple[str, str]]: @privileged -def create_wiki(wiki_name: str, admin_name: str, admin_password: str): +def create_wiki(wiki_name: str, admin_name: str, admin_password: secret_str): """Create a wiki.""" pw_bytes = admin_password.encode() input_ = pw_bytes + b'\n' + pw_bytes @@ -68,7 +68,7 @@ def create_wiki(wiki_name: str, admin_name: str, admin_password: str): @privileged -def create_blog(blog_name: str, admin_name: str, admin_password: str): +def create_blog(blog_name: str, admin_name: str, admin_password: secret_str): """Create a blog.""" pw_bytes = admin_password.encode() input_ = pw_bytes + b'\n' + pw_bytes