miniflux: Mark secret strings in privileged actions

Fixes: #2435

Tests:

- Run affected privileged actions through UI and notice that secret strings are
not logged.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2024-08-11 12:57:33 -04:00
1 parent 7dda5455d8
commit bec5e593b3
1 file changed
+3 -3
+3 -3
View File
@@ -10,7 +10,7 @@ from urllib.parse import urlparse
import pexpect import pexpect
from plinth import action_utils, db from plinth import action_utils, db
from plinth.actions import privileged from plinth.actions import privileged, secret_str
from plinth.utils import is_non_empty_file from plinth.utils import is_non_empty_file
STATIC_SETTINGS = { STATIC_SETTINGS = {
@@ -83,7 +83,7 @@ def _run_miniflux_interactively(command: str, username: str,
@privileged @privileged
def create_admin_user(username: str, password: str): def create_admin_user(username: str, password: secret_str):
"""Create a new admin user for Miniflux CLI. """Create a new admin user for Miniflux CLI.
Raise exception if a user with the name already exists or otherwise fails. Raise exception if a user with the name already exists or otherwise fails.
@@ -96,7 +96,7 @@ def create_admin_user(username: str, password: str):
@privileged @privileged
def reset_user_password(username: str, password: str): def reset_user_password(username: str, password: secret_str):
"""Reset a user password using Miniflux CLI. """Reset a user password using Miniflux CLI.
Raise exception if the user does not exist or otherwise fails. Raise exception if the user does not exist or otherwise fails.