fix(db-*,epf-build): маскировать учётные данные в строке Running

Навыки печатали полную командную строку платформы, включая /P<пароль> (1cv8)
и --password= (ibcmd), в диагностику. Добавлен per-token маскер (/N, /P,
--user=, --password= → ***); привязка к началу токена не трогает пути.
Оба порта, обе ветки движка, все 9 навыков с параметрами подключения.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-07-19 19:10:04 +03:00
co-authored by Claude Opus 4.8
parent b8e141e7ce
commit d3fe8eb010
18 changed files with 202 additions and 58 deletions
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# db-dump-cf v1.7 — Dump 1C configuration to CF file
# db-dump-cf v1.8 — Dump 1C configuration to CF file
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
@@ -105,6 +105,16 @@ def output_nonempty(path):
return os.path.isfile(path) and os.path.getsize(path) > 0
def _mask(args):
"""Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display."""
out = []
for a in args:
a = re.sub(r"^(/[NP]).+", r"\1***", a)
a = re.sub(r"^(--(?:user|password)=).+", r"\1***", a)
out.append(a)
return out
def main():
sys.stdout.reconfigure(encoding="utf-8")
sys.stderr.reconfigure(encoding="utf-8")
@@ -156,7 +166,7 @@ def main():
if args.Password:
arguments.append(f"--password={args.Password}")
arguments.append(f"--data={ib_data}")
print(f"Running: ibcmd {' '.join(arguments)}")
print(f"Running: ibcmd {' '.join(_mask(arguments))}")
result = run_ibcmd([v8path] + arguments, bool(args.UserName))
exit_code = result.returncode
out_missing = exit_code == 0 and not output_nonempty(args.OutputFile)
@@ -206,7 +216,7 @@ def main():
arguments.append("/DisableStartupDialogs")
# --- Execute ---
print(f"Running: 1cv8.exe {' '.join(arguments)}")
print(f"Running: 1cv8.exe {' '.join(_mask(arguments))}")
result = subprocess.run(
[v8path] + arguments,
capture_output=True,