cuonztech-privacy-chaos-gate 0.3.4 → 0.3.6
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.
- package/LICENSE +41 -24
- package/README.md +36 -1
- package/action.yml +1 -1
- package/dist/{chunk-NGGZYNRX.js → chunk-PDBLZE7N.js} +1420 -1135
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +53 -1
- package/dist/index.js +3 -1
- package/package.json +3 -6
package/dist/cli.js
CHANGED
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
resolveEntitlement,
|
|
12
12
|
resolveGateConfig,
|
|
13
13
|
resolveJurisdictions
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-PDBLZE7N.js";
|
|
15
15
|
|
|
16
16
|
// src/cli.ts
|
|
17
17
|
import { Command, CommanderError } from "commander";
|
|
18
18
|
import pc from "picocolors";
|
|
19
|
-
var VERSION = true ? "0.3.
|
|
19
|
+
var VERSION = true ? "0.3.6" : "dev";
|
|
20
20
|
for (const stream of [process.stdout, process.stderr]) {
|
|
21
21
|
stream.on("error", (err) => {
|
|
22
22
|
if (err.code !== "EPIPE") throw err;
|
package/dist/index.d.ts
CHANGED
|
@@ -810,6 +810,8 @@ declare const LeakReportSchema: z.ZodObject<{
|
|
|
810
810
|
bannerObserved: z.ZodOptional<z.ZodBoolean>;
|
|
811
811
|
/** Scanner: Version des Browsers, mit dem gescannt wurde (für die Herkunftsangabe). */
|
|
812
812
|
browserVersion: z.ZodOptional<z.ZodString>;
|
|
813
|
+
/** User-Agent, mit dem sich die Scan-Kontexte gemeldet haben (Chrome-Kennzeichen ohne «Headless»). */
|
|
814
|
+
browserUserAgent: z.ZodOptional<z.ZodString>;
|
|
813
815
|
/** `--har`: in diesem Lauf geschriebene HAR-Dateien, relativ zum Report-Ordner (eigener Unterordner je Lauf). */
|
|
814
816
|
harFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
815
817
|
/** Herkunft des Laufs: Version, Scan-Konfiguration ohne Geheimnisse und deren SHA-256 (`provenance.ts`). */
|
|
@@ -1199,6 +1201,7 @@ declare const LeakReportSchema: z.ZodObject<{
|
|
|
1199
1201
|
}[] | undefined;
|
|
1200
1202
|
bannerObserved?: boolean | undefined;
|
|
1201
1203
|
browserVersion?: string | undefined;
|
|
1204
|
+
browserUserAgent?: string | undefined;
|
|
1202
1205
|
harFiles?: string[] | undefined;
|
|
1203
1206
|
provenance?: {
|
|
1204
1207
|
tool: "cpcg";
|
|
@@ -1370,6 +1373,7 @@ declare const LeakReportSchema: z.ZodObject<{
|
|
|
1370
1373
|
}[] | undefined;
|
|
1371
1374
|
bannerObserved?: boolean | undefined;
|
|
1372
1375
|
browserVersion?: string | undefined;
|
|
1376
|
+
browserUserAgent?: string | undefined;
|
|
1373
1377
|
harFiles?: string[] | undefined;
|
|
1374
1378
|
provenance?: {
|
|
1375
1379
|
tool: "cpcg";
|
|
@@ -2307,6 +2311,15 @@ interface ChaosScannerOptions extends ScannerOverrides {
|
|
|
2307
2311
|
cnameResolver?: CnameResolver;
|
|
2308
2312
|
/** Abruf der Sitemap-Dateien im Tiefenlauf (Default: HTTP, nur Zielbereich); Tests geben einen eigenen mit. */
|
|
2309
2313
|
sitemapFetcher?: SitemapFetcher;
|
|
2314
|
+
/** Fortschritt: wird beim Start jedes Szenarios (und der Schlussprüfung) gerufen; die CLI zeigt daraus eine Zeile. */
|
|
2315
|
+
onProgress?: (event: ScanProgress) => void;
|
|
2316
|
+
}
|
|
2317
|
+
/** Fortschritt des Scans: gestartetes Szenario, laufende Nummer, Gesamtzahl, Zeit seit Scanbeginn. */
|
|
2318
|
+
interface ScanProgress {
|
|
2319
|
+
step: ChaosScenario | "late-banner-check";
|
|
2320
|
+
index: number;
|
|
2321
|
+
total: number;
|
|
2322
|
+
elapsedMs: number;
|
|
2310
2323
|
}
|
|
2311
2324
|
declare class ChaosScanner implements ChaosScannerInterface {
|
|
2312
2325
|
private evidenceDir?;
|
|
@@ -2315,6 +2328,18 @@ declare class ChaosScanner implements ChaosScannerInterface {
|
|
|
2315
2328
|
private harCount;
|
|
2316
2329
|
/** HAR-Dateien dieses Laufs (absolut) */
|
|
2317
2330
|
private harFiles;
|
|
2331
|
+
/** Offene Browser-Kontexte (für die Obergrenzen: nach Ablauf werden sie geschlossen). */
|
|
2332
|
+
private liveContexts;
|
|
2333
|
+
/** Frame-Abfragen ohne Antwort in diesem Lauf (siehe `boundedFrameQuery`): dann ist «kein Banner» nicht belegt. */
|
|
2334
|
+
private frameQueryTimeouts;
|
|
2335
|
+
/** User-Agent der Scan-Kontexte (für den Report). */
|
|
2336
|
+
private userAgent?;
|
|
2337
|
+
/**
|
|
2338
|
+
* Abgebrochene Schritte, die auch nach dem Schliessen ihrer Kontexte nicht endeten. `scan()` kehrt erst zurück, wenn
|
|
2339
|
+
* sie nach dem Schliessen des Browsers ausgelaufen sind: sonst könnten sie in einen späteren Lauf derselben Instanz
|
|
2340
|
+
* (Re-Scan) hineinschreiben.
|
|
2341
|
+
*/
|
|
2342
|
+
private abandoned;
|
|
2318
2343
|
/** Zielbereich des laufenden Scans und Freigabe-Header */
|
|
2319
2344
|
private scope?;
|
|
2320
2345
|
private targetHeaders?;
|
|
@@ -2358,6 +2383,7 @@ declare class ChaosScanner implements ChaosScannerInterface {
|
|
|
2358
2383
|
private evidenceBytes;
|
|
2359
2384
|
private evidenceCapNoted;
|
|
2360
2385
|
private readonly evidenceMaxBytes;
|
|
2386
|
+
private readonly onProgress?;
|
|
2361
2387
|
constructor(options?: ChaosScannerOptions);
|
|
2362
2388
|
/** Die Schlusspruefung lief das Wartefenster vollstaendig ohne Banner-Hinweis durch (Seite stabil). */
|
|
2363
2389
|
private probeCompleted;
|
|
@@ -2387,6 +2413,30 @@ declare class ChaosScanner implements ChaosScannerInterface {
|
|
|
2387
2413
|
* -Cookies (keine Befunde, nur Referenz). `null`, wenn die Seite dabei nicht ladbar war.
|
|
2388
2414
|
*/
|
|
2389
2415
|
private countMarketingWithoutGpc;
|
|
2416
|
+
/**
|
|
2417
|
+
* Führt einen Schritt mit Obergrenze aus. Läuft sie ab, wird `signal` abgebrochen und es werden alle offenen
|
|
2418
|
+
* Browser-Kontexte geschlossen: hängende Browser-Operationen scheitern dann, und der Schritt beendet sich über seinen
|
|
2419
|
+
* eigenen Fehlerpfad. Er bekommt danach noch `STEP_SETTLE_MS` zum Aufräumen; was er später noch tut, darf keinen
|
|
2420
|
+
* gemeinsamen Zustand mehr ändern (Szenarien schreiben in einen eigenen Puffer, Prüfungen fragen `signal` ab).
|
|
2421
|
+
*/
|
|
2422
|
+
private withDeadline;
|
|
2423
|
+
/** Nach dem Schliessen des Browsers: auf abgebrochene, noch laufende Schritte warten (höchstens die Nachlaufzeit). */
|
|
2424
|
+
private drainAbandoned;
|
|
2425
|
+
/** Vor- oder Schlussprüfung mit Obergrenze: nach Ablauf eine Warnung, der Scan läuft weiter; Fehler wie bisher. */
|
|
2426
|
+
private boundedStep;
|
|
2427
|
+
/** Obergrenze der Schlussprüfung: ihr Wartefenster plus zwei Navigationsfristen und Reserve. */
|
|
2428
|
+
private lateProbeDeadlineMs;
|
|
2429
|
+
/**
|
|
2430
|
+
* Führt ein Szenario mit Obergrenze aus (`scenarioDeadlineMs`). Das Szenario schreibt in einen eigenen Puffer, der
|
|
2431
|
+
* genau einmal übernommen wird; was ein abgebrochenes Szenario danach noch schreibt, landet nirgends. Nach Ablauf
|
|
2432
|
+
* steht sein Beleg in jedem Fall auf «nicht prüfbar» mit dem Grund «Zeitlimit» (nie grün).
|
|
2433
|
+
* Andere Fehler laufen unverändert weiter (wie ohne Obergrenze).
|
|
2434
|
+
*/
|
|
2435
|
+
private bounded;
|
|
2436
|
+
/** Beleg eines abgebrochenen Szenarios: «nicht prüfbar (Zeitlimit)», nie bestanden; bis dahin Gemessenes bleibt. */
|
|
2437
|
+
private markTimeLimit;
|
|
2438
|
+
/** Frame-Abfragen ohne Antwort: Warnung; ohne gesehenen Banner ist «kein Banner» damit nicht belegt. */
|
|
2439
|
+
private noteFrameQueryTimeouts;
|
|
2390
2440
|
private newContext;
|
|
2391
2441
|
/**
|
|
2392
2442
|
* Steht ein Banner-Bedienelement schon im Dokument, wenn kein Skript der Seite läuft? Dann ist das Banner eingebettet
|
|
@@ -2701,6 +2751,8 @@ declare function assessReport(report: LeakReport, scenarios?: ChaosScenario[], o
|
|
|
2701
2751
|
jurisdictions?: JurisdictionProfile[];
|
|
2702
2752
|
}): GateAssessment;
|
|
2703
2753
|
|
|
2754
|
+
/** Eine Zeile je gestartetem Szenario, damit ein langer oder hängender Lauf in Konsole und CI-Log sichtbar ist. */
|
|
2755
|
+
declare function printScanProgress(e: ScanProgress): void;
|
|
2704
2756
|
/** Prüft, ob die Zielseite antwortet und nicht mit 4xx/5xx; wirft sonst einen neutralen Fehler. */
|
|
2705
2757
|
declare function checkTargetReachable(url: string, timeoutMs: number, fetchImpl?: typeof fetch, headers?: Record<string, string>): Promise<number>;
|
|
2706
2758
|
type Preflight = (config: GateConfig) => Promise<unknown>;
|
|
@@ -2974,4 +3026,4 @@ declare function isLoopbackTarget(url: string): boolean;
|
|
|
2974
3026
|
*/
|
|
2975
3027
|
declare function runGate(optionsOrConfig: CliRawOptions | GateConfigInput): Promise<GateExecutionResult>;
|
|
2976
3028
|
|
|
2977
|
-
export { type BannerIssue, type BannerKind, BannerKindSchema, type BotProtection, CORE_SCENARIOS, ChaosScanner, type ChaosScannerInterface, type ChaosScenario, ChaosScenarioSchema, type CliRawOptions, type CodeSolution, type CoverOptions, ENV_FILE_KEYS_HELP, EXIT, type Entitlement, type EntitlementInput, type EvidenceHtmlOptions, type EvidenceMarkdownOptions, type EvidenceRecord, EvidenceRecordSchema, type EvidenceStatus, EvidenceStatusSchema, type FilePatch, FilePatchSchema, type GateAssessment, type GateConfig, type GateConfigInput, GateConfigSchema, type GateExecutionResult, type GateState, type IgnoredFinding, JurisdictionCodeSchema, LICENSE_CONTACT, type LeakReport, LeakReportSchema, PrivacyChaosGate, type PullRequestResult, PullRequestResultSchema, RemediationEngine, type RemediationEngineInterface, type RemediationResult, RemediationResultSchema, type ReportFacts, type ReportGate, type RequestEvent, RequestEventSchema, type ReviewVerdict, ReviewVerdictSchema, type SamplingInfo, type StorageSnapshot, StorageSnapshotSchema, type TrackerCategory, TrackerCategorySchema, type TrackerViolation, TrackerViolationSchema, type UncheckableReason, type Verification, assessReport, buildCoverHtml, buildEvidenceHtml, buildEvidenceMarkdown, checkTargetReachable, codeSolutionsFor, comparisonIntro, consentSignalTable, coverLede, deriveReportFacts, evidenceLabelOf, findingsCountText, gateNotesOf, groupFindings, isEnvKeyAllowedFromFile, isLoopbackTarget, judgeRescan, leakSubpagePaths, licenseSkipText, loadProjectEnv, parseGateConfig, placeholderLegend, problemsTextOf, provenanceText, renderDeluxeCombined, renderDeluxePdf, reproductionText, requestedLicensedFeatures, resolveEntitlement, resolveGateConfig, resolveReportGate, runGate, statusLabelOf, uncheckableReasons, uncheckableReasonsForReport, waitForVerifyUrl };
|
|
3029
|
+
export { type BannerIssue, type BannerKind, BannerKindSchema, type BotProtection, CORE_SCENARIOS, ChaosScanner, type ChaosScannerInterface, type ChaosScenario, ChaosScenarioSchema, type CliRawOptions, type CodeSolution, type CoverOptions, ENV_FILE_KEYS_HELP, EXIT, type Entitlement, type EntitlementInput, type EvidenceHtmlOptions, type EvidenceMarkdownOptions, type EvidenceRecord, EvidenceRecordSchema, type EvidenceStatus, EvidenceStatusSchema, type FilePatch, FilePatchSchema, type GateAssessment, type GateConfig, type GateConfigInput, GateConfigSchema, type GateExecutionResult, type GateState, type IgnoredFinding, JurisdictionCodeSchema, LICENSE_CONTACT, type LeakReport, LeakReportSchema, PrivacyChaosGate, type PullRequestResult, PullRequestResultSchema, RemediationEngine, type RemediationEngineInterface, type RemediationResult, RemediationResultSchema, type ReportFacts, type ReportGate, type RequestEvent, RequestEventSchema, type ReviewVerdict, ReviewVerdictSchema, type SamplingInfo, type StorageSnapshot, StorageSnapshotSchema, type TrackerCategory, TrackerCategorySchema, type TrackerViolation, TrackerViolationSchema, type UncheckableReason, type Verification, assessReport, buildCoverHtml, buildEvidenceHtml, buildEvidenceMarkdown, checkTargetReachable, codeSolutionsFor, comparisonIntro, consentSignalTable, coverLede, deriveReportFacts, evidenceLabelOf, findingsCountText, gateNotesOf, groupFindings, isEnvKeyAllowedFromFile, isLoopbackTarget, judgeRescan, leakSubpagePaths, licenseSkipText, loadProjectEnv, parseGateConfig, placeholderLegend, printScanProgress, problemsTextOf, provenanceText, renderDeluxeCombined, renderDeluxePdf, reproductionText, requestedLicensedFeatures, resolveEntitlement, resolveGateConfig, resolveReportGate, runGate, statusLabelOf, uncheckableReasons, uncheckableReasonsForReport, waitForVerifyUrl };
|
package/dist/index.js
CHANGED
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
loadProjectEnv,
|
|
44
44
|
parseGateConfig,
|
|
45
45
|
placeholderLegend,
|
|
46
|
+
printScanProgress,
|
|
46
47
|
problemsTextOf,
|
|
47
48
|
provenanceText,
|
|
48
49
|
renderDeluxeCombined,
|
|
@@ -56,7 +57,7 @@ import {
|
|
|
56
57
|
uncheckableReasons,
|
|
57
58
|
uncheckableReasonsForReport,
|
|
58
59
|
waitForVerifyUrl
|
|
59
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-PDBLZE7N.js";
|
|
60
61
|
|
|
61
62
|
// src/index.ts
|
|
62
63
|
async function runGate(optionsOrConfig) {
|
|
@@ -109,6 +110,7 @@ export {
|
|
|
109
110
|
loadProjectEnv,
|
|
110
111
|
parseGateConfig,
|
|
111
112
|
placeholderLegend,
|
|
113
|
+
printScanProgress,
|
|
112
114
|
problemsTextOf,
|
|
113
115
|
provenanceText,
|
|
114
116
|
renderDeluxeCombined,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cuonztech-privacy-chaos-gate",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "CuonzTech Privacy Chaos Gate — CI/CD Consent-Scanner, Chaos-Szenarien und Auto-Fix-PR",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,13 +21,10 @@
|
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=20"
|
|
23
23
|
},
|
|
24
|
-
"repository": {
|
|
25
|
-
"type": "git",
|
|
26
|
-
"url": "git+https://github.com/cuonztech/privacy-chaos-gate.git"
|
|
27
|
-
},
|
|
28
24
|
"homepage": "https://cuonztech.ch/privacy-chaos-gate.html",
|
|
29
25
|
"bugs": {
|
|
30
|
-
"url": "https://
|
|
26
|
+
"url": "https://cuonztech.ch/privacy-chaos-gate.html",
|
|
27
|
+
"email": "support@cuonztech.ch"
|
|
31
28
|
},
|
|
32
29
|
"publishConfig": {},
|
|
33
30
|
"scripts": {
|