@sungen/driver-data-factory 3.2.23-beta.1 → 3.2.24-beta.1

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/lint.ts +20 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sungen/driver-data-factory",
3
- "version": "3.2.23-beta.1",
3
+ "version": "3.2.24-beta.1",
4
4
  "description": "Sungen Data Factory capability — standardized test-data generation from a field-type + security knowledge catalog (valid/boundary/invalid + traceability), the .overwrite merge layer, and (opt-in) @dataFactory runtime seeding. Design-time knowledge is runtime-free. Plugs into @sun-asterisk/sungen via the capability SPI.",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -14,7 +14,7 @@
14
14
  "author": "eqe team (engineer & quality) — Sun Asterisk",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@sun-asterisk/sungen": "3.2.23-beta.1",
17
+ "@sun-asterisk/sungen": "3.2.24-beta.1",
18
18
  "yaml": "^2.4.0"
19
19
  },
20
20
  "files": [
package/src/lint.ts CHANGED
@@ -19,6 +19,17 @@ export interface LintIssue {
19
19
 
20
20
  const BOUNDED = new Set(['email', 'string', 'password', 'phone', 'postcode', 'katakana', 'number-integer', 'number-float', 'currency']);
21
21
 
22
+ /**
23
+ * Third-party mailbox providers, whose addresses reach a REAL inbox. A registration or
24
+ * password-reset test that submits one dispatches mail to whoever owns that address — a
25
+ * stranger, or an employee's personal account. Reported so the domain is a deliberate choice
26
+ * (#592, raised from a field run that had generated `@gmail.com` sign-ups).
27
+ *
28
+ * Safe alternatives: the project's own domain (`@sun-asterisk.com`) or an IETF-reserved one
29
+ * (`@example.com`, RFC 2606 — guaranteed never to deliver).
30
+ */
31
+ const LIVE_MAILBOX_DOMAIN = /@(?:gmail|googlemail|yahoo|ymail|hotmail|outlook|live|msn|icloud|me|aol|proton(?:mail)?|gmx|mail|yandex|qq|163|126|naver|daum|zoho)\.[a-z.]{2,}$/i;
32
+
22
33
  export function lintFieldMap(map: FieldMap, catalog: Catalog, ctx: SelectionContext = {}): { issues: LintIssue[]; expanded: ExpandedField[] } {
23
34
  const expanded = expandFieldMap(map, catalog, ctx);
24
35
  const issues: LintIssue[] = [];
@@ -65,6 +76,15 @@ export function lintFieldMap(map: FieldMap, catalog: Catalog, ctx: SelectionCont
65
76
  if (def?.required && valid.length === 0) {
66
77
  issues.push({ field: path, severity: 'error', code: 'REQUIRED_NO_VALID', message: 'required field with no valid value' });
67
78
  }
79
+ // A valid email pointed at a real mailbox provider will actually be delivered to.
80
+ const live = [...new Set(f.points
81
+ .filter((p) => p.group !== 'invalid' && typeof p.value === 'string' && LIVE_MAILBOX_DOMAIN.test(p.value as string))
82
+ .map((p) => ((p.value as string).match(/@\S+$/) || [''])[0]))];
83
+ if (live.length) {
84
+ issues.push({ field: path, severity: 'warn', code: 'LIVE_MAILBOX',
85
+ message: `${live.join(', ')} is a real mailbox provider — a registration or reset test using it sends mail to whoever owns that address. Use the project domain (@sun-asterisk.com) or the reserved @example.com.` });
86
+ }
87
+
68
88
  // Applicability (M2b): cases NOT materialized for this field/context — surfaced, never silent.
69
89
  if (f.excluded?.length) {
70
90
  issues.push({ field: path, severity: 'info', code: 'NOT_APPLICABLE',