@aexol/spectral 0.9.269 → 0.9.270

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.
@@ -17,7 +17,7 @@ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
17
17
  import { dirname } from "node:path";
18
18
  import { loadJsonl, sampleChars } from "./analyzer.js";
19
19
  import { scrub } from "./scrubber.js";
20
- const REDACTION_KINDS = ["api_key", "jwt", "bearer", "home_path", "secret_value"];
20
+ const REDACTION_KINDS = ["api_key", "jwt", "bearer", "home_path", "user_path", "secret_value"];
21
21
  /**
22
22
  * Walk a JSON tree and scrub every string leaf. Objects/arrays are rebuilt
23
23
  * (structure and key order preserved); non-string leaves pass through.
@@ -6,6 +6,8 @@
6
6
  * - jwt — bare JWTs (eyJ... payload ... signature)
7
7
  * - bearer — "Bearer <token>" and Authorization header values
8
8
  * - home_path — /Users/<name>/ → /home/
9
+ * - user_path — Wine/Windows user segments (drive_c/users/<name>,
10
+ * <drive>:\Users\<name>) → <name> replaced with "user"
9
11
  * - secret_value — opaque values passed in by the caller (secret-store
10
12
  * values, .env values). The scrubber NEVER reads any
11
13
  * store itself; callers decide what to pass.
@@ -1 +1 @@
1
- {"version":3,"file":"scrubber.d.ts","sourceRoot":"","sources":["../../../src/extensions/dataset-uploader/scrubber.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B;AA6CD;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,CAiDvE"}
1
+ {"version":3,"file":"scrubber.d.ts","sourceRoot":"","sources":["../../../src/extensions/dataset-uploader/scrubber.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B;AAiED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,CAyDvE"}
@@ -6,6 +6,8 @@
6
6
  * - jwt — bare JWTs (eyJ... payload ... signature)
7
7
  * - bearer — "Bearer <token>" and Authorization header values
8
8
  * - home_path — /Users/<name>/ → /home/
9
+ * - user_path — Wine/Windows user segments (drive_c/users/<name>,
10
+ * <drive>:\Users\<name>) → <name> replaced with "user"
9
11
  * - secret_value — opaque values passed in by the caller (secret-store
10
12
  * values, .env values). The scrubber NEVER reads any
11
13
  * store itself; callers decide what to pass.
@@ -44,8 +46,27 @@ const JWT_PARTIAL_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}(?:\.[A-Za-z0-9_-]+){0,2}\b/
44
46
  * Normalized to /home (the marker would break the surrounding path).
45
47
  */
46
48
  const HOME_PATH_PATTERN = /\/Users\/[A-Za-z0-9._-]+(?=\/|$)/g;
49
+ /**
50
+ * Wine / Windows user segment inside a path:
51
+ * - drive_c/users/<name> (Wine prefix, e.g. /home/.wine/drive_c/users/<name>)
52
+ * - <drive>:\Users\<name> (native Windows path, backslashes)
53
+ * Only the user segment is replaced with "user" — the surrounding path is
54
+ * kept intact (a full-path marker would break the surrounding text).
55
+ * The normalized "user" value itself never re-matches (lookahead), so
56
+ * scrubbing is idempotent: re-scrubbing redacted text produces no new
57
+ * redactions, not even no-op ones.
58
+ */
59
+ const WINE_USER_PATH_PATTERN = /drive_c\/users\/(?!user(?=[/\\.\s-]|$))[A-Za-z0-9._-]+/g;
60
+ const WINDOWS_USER_PATH_PATTERN = /([A-Za-z]:\\Users\\)(?!user(?=[/\\.\s-]|$))[A-Za-z0-9._-]+/g;
47
61
  /** Stable ordering of kinds in the returned redactions array. */
48
- const REDACTION_KINDS = ["api_key", "jwt", "bearer", "home_path", "secret_value"];
62
+ const REDACTION_KINDS = [
63
+ "api_key",
64
+ "jwt",
65
+ "bearer",
66
+ "home_path",
67
+ "user_path",
68
+ "secret_value",
69
+ ];
49
70
  /**
50
71
  * Scrub `text` for secrets.
51
72
  *
@@ -96,6 +117,14 @@ export function scrub(text, extraValues) {
96
117
  counts.home_path = (counts.home_path ?? 0) + 1;
97
118
  return "/home";
98
119
  });
120
+ out = out.replace(WINE_USER_PATH_PATTERN, () => {
121
+ counts.user_path = (counts.user_path ?? 0) + 1;
122
+ return "drive_c/users/user";
123
+ });
124
+ out = out.replace(WINDOWS_USER_PATH_PATTERN, (match, prefix) => {
125
+ counts.user_path = (counts.user_path ?? 0) + 1;
126
+ return `${prefix}user`;
127
+ });
99
128
  const redactions = [];
100
129
  for (const kind of REDACTION_KINDS) {
101
130
  const count = counts[kind];
@@ -2836,7 +2836,6 @@ export type ValueTypes = {
2836
2836
  ["AdminCustomLyceumModelInput"]: {
2837
2837
  model: string | Variable<any, string>;
2838
2838
  image?: string | undefined | null | Variable<any, string>;
2839
- dockerfile?: string | undefined | null | Variable<any, string>;
2840
2839
  env?: Array<ValueTypes["AdminLyceumEnvOverrideInput"]> | undefined | null | Variable<any, string>;
2841
2840
  extraArgs?: Array<string> | undefined | null | Variable<any, string>;
2842
2841
  startCommand?: string | undefined | null | Variable<any, string>;
@@ -5957,7 +5956,6 @@ export type ResolverInputTypes = {
5957
5956
  ["AdminCustomLyceumModelInput"]: {
5958
5957
  model: string;
5959
5958
  image?: string | undefined | null;
5960
- dockerfile?: string | undefined | null;
5961
5959
  env?: Array<ResolverInputTypes["AdminLyceumEnvOverrideInput"]> | undefined | null;
5962
5960
  extraArgs?: Array<string> | undefined | null;
5963
5961
  startCommand?: string | undefined | null;
@@ -8255,7 +8253,6 @@ export type ModelTypes = {
8255
8253
  ["AdminCustomLyceumModelInput"]: {
8256
8254
  model: string;
8257
8255
  image?: string | undefined | null;
8258
- dockerfile?: string | undefined | null;
8259
8256
  env?: Array<ModelTypes["AdminLyceumEnvOverrideInput"]> | undefined | null;
8260
8257
  extraArgs?: Array<string> | undefined | null;
8261
8258
  startCommand?: string | undefined | null;
@@ -10717,7 +10714,6 @@ export type GraphQLTypes = {
10717
10714
  ["AdminCustomLyceumModelInput"]: {
10718
10715
  model: string;
10719
10716
  image?: string | undefined | null;
10720
- dockerfile?: string | undefined | null;
10721
10717
  env?: Array<GraphQLTypes["AdminLyceumEnvOverrideInput"]> | undefined | null;
10722
10718
  extraArgs?: Array<string> | undefined | null;
10723
10719
  startCommand?: string | undefined | null;