@sberpay-cli/cli-diagnostic 0.0.0-stage → 0.4.0-dev.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ // @sberpay-cli/cli-diagnostic: проверка версии Node, затем бандл. Собирает scripts/release/build.ts.
3
+ const MIN_MINOR = {"22":19,"24":5};
4
+ const [major = 0, minor = 0] = process.versions.node.split(".").map(Number);
5
+ const refuse = (code, message, hint) => {
6
+ if (process.argv.includes("--json")) process.stdout.write(`${JSON.stringify({ error: { code, message, hint } })}\n`);
7
+ else process.stderr.write(`✗ ${message}\n → ${hint}\n`);
8
+ process.exit(4);
9
+ };
10
+ if (!(major > 24 || (MIN_MINOR[major] !== undefined && minor >= MIN_MINOR[major]))) {
11
+ refuse("NODE_TOO_OLD", `Node ${process.versions.node} — нужен Node 22.19+ или 24.5+`, "Обновите Node до 22.19+ или 24.5+ (лучше 24 LTS) и повторите");
12
+ }
13
+ // Без проверки сертификатов Шлюз ЭК может подменить кто угодно в сети: вшитый корень Минцифры тогда ничего не даёт.
14
+ if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === "0") {
15
+ refuse("INSECURE_TLS", "NODE_TLS_REJECT_UNAUTHORIZED=0 выключает проверку сертификатов", "Уберите NODE_TLS_REJECT_UNAUTHORIZED из окружения");
16
+ }
17
+ await import("../dist/cli.mjs");
@@ -0,0 +1,53 @@
1
+ # Маскирование логов CLI и заглушек (конвенция ~/.claude/rules/common/logging.md).
2
+ # agentToken ходит шифротекстом, но тоже redact; sessionId знает только КГС и утилита (OQ-133, п. 5) — partial;
3
+ # deviceId — отпечаток открытого ключа, секрета в нём нет, но это идентификатор устройства — partial
4
+ # (в заголовке X-Hardware-Id — redact).
5
+ logging:
6
+ level: INFO # DEBUG включает тела и заголовки (замаскированные)
7
+ format: logfmt
8
+ masking:
9
+ defaultStrategy: redact
10
+ headers:
11
+ - { name: authorization, strategy: redact }
12
+ - { name: cookie, strategy: redact }
13
+ - { name: set-cookie, strategy: redact }
14
+ - { name: x-agent-token, strategy: redact }
15
+ - { name: x-hardware-id, strategy: redact }
16
+ - { name: location, strategy: redact }
17
+ - { name: x-device-signature, strategy: redact }
18
+ - { name: x-device-challenge, strategy: redact }
19
+ body:
20
+ - { path: "$..request", strategy: redact }
21
+ - { path: "$..response", strategy: redact }
22
+ - { path: "$..deviceInfo", strategy: redact }
23
+ - { path: "$..deliveryAddress", strategy: redact }
24
+ - { path: "$..deliveryAddresses", strategy: redact }
25
+ - { path: "$..purchaseContext", strategy: redact }
26
+ - { path: "$..intercomCode", strategy: redact }
27
+ - { path: "$..comment", strategy: redact }
28
+ - { path: "$..latitude", strategy: redact }
29
+ - { path: "$..longitude", strategy: redact }
30
+ - { path: "$..address", strategy: redact }
31
+ - { path: "$..tag", strategy: redact }
32
+ - { path: "$..message", strategy: redact }
33
+ - { path: "$..details", strategy: redact }
34
+ - { path: "$..errorMessage", strategy: redact }
35
+ - { path: "$..subId", strategy: redact } # по модели угроз subId — учётные данные (OQ-112)
36
+ - { path: "$..agentToken", strategy: redact }
37
+ - { path: "$..code", strategy: redact }
38
+ - { path: "$..client_secret", strategy: redact }
39
+ - { path: "$..access_token", strategy: redact }
40
+ - { path: "$..refresh_token", strategy: redact }
41
+ - { path: "$..id_token", strategy: redact }
42
+ - { path: "$..nonce", strategy: redact }
43
+ - { path: "$..password", strategy: redact }
44
+ - { path: "$..sessionId", strategy: partial, keepStart: 4, keepEnd: 0 }
45
+ - { path: "$..cabinetUrl", strategy: redact } # внутри sessionId
46
+ - { path: "$..sessionSecret", strategy: redact }
47
+ - { path: "$..secretHash", strategy: redact }
48
+ - { path: "$..secret", strategy: redact }
49
+ - { path: "$..challenge", strategy: redact }
50
+ - { path: "$..code_verifier", strategy: redact }
51
+ - { path: "$..deviceId", strategy: partial, keepStart: 6, keepEnd: 0 }
52
+ quietPaths:
53
+ - { path: "/favicon.ico", policy: drop }