@babamba2/abap-mcp-adt-powerup 4.13.0 → 4.14.0

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 (83) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/handlers/adobeform/high/handleCreateAdobeFormFromSmartForm.d.ts +11 -1
  3. package/dist/handlers/adobeform/high/handleCreateAdobeFormFromSmartForm.d.ts.map +1 -1
  4. package/dist/handlers/adobeform/high/handleCreateAdobeFormFromSmartForm.js +25 -2
  5. package/dist/handlers/adobeform/high/handleCreateAdobeFormFromSmartForm.js.map +1 -1
  6. package/dist/handlers/include/high/handleUpdateInclude.d.ts +9 -0
  7. package/dist/handlers/include/high/handleUpdateInclude.d.ts.map +1 -1
  8. package/dist/handlers/include/high/handleUpdateInclude.js +23 -2
  9. package/dist/handlers/include/high/handleUpdateInclude.js.map +1 -1
  10. package/dist/handlers/system/readonly/handleGetSqlQuery.d.ts +18 -0
  11. package/dist/handlers/system/readonly/handleGetSqlQuery.d.ts.map +1 -1
  12. package/dist/handlers/system/readonly/handleGetSqlQuery.js +28 -4
  13. package/dist/handlers/system/readonly/handleGetSqlQuery.js.map +1 -1
  14. package/dist/handlers/system/readonly/handleGetStandardText.d.ts +46 -0
  15. package/dist/handlers/system/readonly/handleGetStandardText.d.ts.map +1 -0
  16. package/dist/handlers/system/readonly/handleGetStandardText.js +55 -0
  17. package/dist/handlers/system/readonly/handleGetStandardText.js.map +1 -0
  18. package/dist/handlers/system/readonly/handleRenderAdobeXdp.d.ts +54 -0
  19. package/dist/handlers/system/readonly/handleRenderAdobeXdp.d.ts.map +1 -0
  20. package/dist/handlers/system/readonly/handleRenderAdobeXdp.js +64 -0
  21. package/dist/handlers/system/readonly/handleRenderAdobeXdp.js.map +1 -0
  22. package/dist/handlers/table/readonly/handleGetRemoteTableContents.d.ts +4 -0
  23. package/dist/handlers/table/readonly/handleGetRemoteTableContents.d.ts.map +1 -1
  24. package/dist/handlers/table/readonly/handleGetRemoteTableContents.js +43 -0
  25. package/dist/handlers/table/readonly/handleGetRemoteTableContents.js.map +1 -1
  26. package/dist/handlers/table/readonly/handleGetTableContents.d.ts +4 -0
  27. package/dist/handlers/table/readonly/handleGetTableContents.d.ts.map +1 -1
  28. package/dist/handlers/table/readonly/handleGetTableContents.js +21 -3
  29. package/dist/handlers/table/readonly/handleGetTableContents.js.map +1 -1
  30. package/dist/handlers/table_type/high/handleCreateTableType.d.ts +1 -1
  31. package/dist/handlers/unit_test/high/handleGetUnitTestResult.d.ts.map +1 -1
  32. package/dist/handlers/unit_test/high/handleGetUnitTestResult.js +4 -0
  33. package/dist/handlers/unit_test/high/handleGetUnitTestResult.js.map +1 -1
  34. package/dist/handlers/unit_test/high/handleRunUnitTest.d.ts +24 -1
  35. package/dist/handlers/unit_test/high/handleRunUnitTest.d.ts.map +1 -1
  36. package/dist/handlers/unit_test/high/handleRunUnitTest.js +118 -3
  37. package/dist/handlers/unit_test/high/handleRunUnitTest.js.map +1 -1
  38. package/dist/lib/adobeForm.d.ts +61 -1
  39. package/dist/lib/adobeForm.d.ts.map +1 -1
  40. package/dist/lib/adobeForm.js +289 -2
  41. package/dist/lib/adobeForm.js.map +1 -1
  42. package/dist/lib/handlers/groups/ReadOnlyHandlersGroup.d.ts.map +1 -1
  43. package/dist/lib/handlers/groups/ReadOnlyHandlersGroup.js +10 -0
  44. package/dist/lib/handlers/groups/ReadOnlyHandlersGroup.js.map +1 -1
  45. package/dist/lib/legacyTableRead.d.ts +6 -0
  46. package/dist/lib/legacyTableRead.d.ts.map +1 -1
  47. package/dist/lib/legacyTableRead.js +35 -0
  48. package/dist/lib/legacyTableRead.js.map +1 -1
  49. package/dist/lib/policy/maskSecret.d.ts +27 -0
  50. package/dist/lib/policy/maskSecret.d.ts.map +1 -0
  51. package/dist/lib/policy/maskSecret.js +142 -0
  52. package/dist/lib/policy/maskSecret.js.map +1 -0
  53. package/dist/lib/policy/maskedRead.d.ts +48 -0
  54. package/dist/lib/policy/maskedRead.d.ts.map +1 -0
  55. package/dist/lib/policy/maskedRead.js +156 -0
  56. package/dist/lib/policy/maskedRead.js.map +1 -0
  57. package/dist/lib/policy/personalMask.d.ts +82 -0
  58. package/dist/lib/policy/personalMask.d.ts.map +1 -0
  59. package/dist/lib/policy/personalMask.js +938 -0
  60. package/dist/lib/policy/personalMask.js.map +1 -0
  61. package/dist/lib/policy/tableBlocklist.d.ts +15 -5
  62. package/dist/lib/policy/tableBlocklist.d.ts.map +1 -1
  63. package/dist/lib/policy/tableBlocklist.js +105 -12
  64. package/dist/lib/policy/tableBlocklist.js.map +1 -1
  65. package/dist/lib/readonlyGuard.d.ts +1 -0
  66. package/dist/lib/readonlyGuard.d.ts.map +1 -1
  67. package/dist/lib/readonlyGuard.js +9 -0
  68. package/dist/lib/readonlyGuard.js.map +1 -1
  69. package/dist/lib/smartFormContent.d.ts +27 -0
  70. package/dist/lib/smartFormContent.d.ts.map +1 -1
  71. package/dist/lib/smartFormContent.js +147 -21
  72. package/dist/lib/smartFormContent.js.map +1 -1
  73. package/dist/lib/valuesFile.d.ts +8 -0
  74. package/dist/lib/valuesFile.d.ts.map +1 -1
  75. package/dist/lib/valuesFile.js +41 -1
  76. package/dist/lib/valuesFile.js.map +1 -1
  77. package/package.json +1 -1
  78. package/dist/handlers/system/high/handleRuntimeCallDispatch.d.ts +0 -46
  79. package/dist/handlers/system/high/handleRuntimeCallDispatch.d.ts.map +0 -1
  80. package/dist/lib/policy/blocklist.d.ts +0 -73
  81. package/dist/lib/policy/blocklist.d.ts.map +0 -1
  82. package/dist/lib/smartForm.d.ts +0 -114
  83. package/dist/lib/smartForm.d.ts.map +0 -1
@@ -16,9 +16,11 @@
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.DISPATCH_MAX_ROWS = exports.LEGACY_READABLE_TABLES = void 0;
19
+ exports.isDispatcherCredentialTable = isDispatcherCredentialTable;
19
20
  exports.isLegacyUnsupported = isLegacyUnsupported;
20
21
  exports.parseSimpleSelect = parseSimpleSelect;
21
22
  exports.legacyTableRead = legacyTableRead;
23
+ const tableBlocklist_1 = require("./policy/tableBlocklist");
22
24
  const rfcBackend_1 = require("./rfcBackend");
23
25
  /** Tables the dispatcher's TABLE_READ accepts (keep in sync with the ABAP allow list). */
24
26
  exports.LEGACY_READABLE_TABLES = [
@@ -43,6 +45,30 @@ exports.LEGACY_READABLE_TABLES = [
43
45
  ];
44
46
  /** Row cap of the ABAP TABLE_READ action (FORM table_read: max_rows > 5000 → 5000). */
45
47
  exports.DISPATCH_MAX_ROWS = 5000;
48
+ /** PFCG tables the dispatcher still reads (role design and role-user assignment). */
49
+ const READABLE_AGR = new Set([
50
+ 'AGR_DEFINE',
51
+ 'AGR_TEXTS',
52
+ 'AGR_FLAGS',
53
+ 'AGR_AGRS',
54
+ 'AGR_TCODES',
55
+ 'AGR_1251',
56
+ 'AGR_1252',
57
+ 'AGR_USERS',
58
+ ]);
59
+ /**
60
+ * True for the credential / user master tables TABLE_READ refuses on every
61
+ * profile, off included (same list as the ABAP guard in FORM table_read).
62
+ * @param table table name, any case
63
+ */
64
+ function isDispatcherCredentialTable(table) {
65
+ const t = table.toUpperCase();
66
+ if (['RFCDES', 'RSECTAB', 'RSECACTB'].includes(t))
67
+ return true;
68
+ if (t.startsWith('AGR_'))
69
+ return !READABLE_AGR.has(t);
70
+ return /^(USR|UST|SSF_PSE|STRUST|SNC|TRUSTED|RSAU)/.test(t);
71
+ }
46
72
  /** True for the client library's "not supported on this SAP system (legacy …)" refusal. */
47
73
  function isLegacyUnsupported(error) {
48
74
  return /not supported on this SAP system \(legacy|BASIS < 7\.50/i.test(String(error?.message ?? error));
@@ -91,6 +117,9 @@ async function legacyTableRead(connection, req) {
91
117
  // truncated when more rows really exist. The ABAP side caps at
92
118
  // DISPATCH_MAX_ROWS; at that cap a full page still counts as truncated.
93
119
  const fetchRows = Math.min(req.maxRows + 1, exports.DISPATCH_MAX_ROWS);
120
+ // Blocklist profile "off": ask the dispatcher to drop its delivery-class
121
+ // rule, so business tables are readable with the user's SE16 authority.
122
+ const allTables = (0, tableBlocklist_1.activeProfile)() === 'off';
94
123
  let result;
95
124
  try {
96
125
  ({ result } = await (0, rfcBackend_1.callDispatch)(connection, 'TABLE_READ', {
@@ -98,10 +127,16 @@ async function legacyTableRead(connection, req) {
98
127
  field_list: req.fields ?? [],
99
128
  condition: req.where ?? '',
100
129
  max_rows: fetchRows,
130
+ ...(allTables ? { all_tables: 'X' } : {}),
101
131
  }));
102
132
  }
103
133
  catch (e) {
104
134
  const msg = String(e?.message ?? e);
135
+ if (allTables && /is not allowed/i.test(msg)) {
136
+ throw new Error(isDispatcherCredentialTable(table)
137
+ ? `${msg} — credential / user master tables stay closed on every blocklist profile, off included.`
138
+ : `${msg} — MCP_BLOCKLIST_PROFILE=off, but the ZMCP_ADT_DISPATCH installed on this system predates the all_tables flag (2026-11-17). Reinstall the dispatcher (abap/zmcp_adt_dispatch_ecc.abap or _731.abap) to read business tables.`);
139
+ }
105
140
  if (/is not allowed/i.test(msg)) {
106
141
  throw new Error(`${msg} — table reads on this SAP release (BASIS < 7.50) go through ZMCP_ADT_DISPATCH TABLE_READ, which reads customizing / system tables only (delivery class C, G, E, S, W — W since the 2026-10-28 dispatcher; dispatchers installed before 2026-10 accept only ${exports.LEGACY_READABLE_TABLES.join(', ')}).`);
107
142
  }
@@ -1 +1 @@
1
- {"version":3,"file":"legacyTableRead.js","sourceRoot":"","sources":["../../src/lib/legacyTableRead.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAgCH,kDAIC;AAYD,8CA0BC;AAMD,0CA6DC;AAzID,6CAA4C;AAE5C,0FAA0F;AAC7E,QAAA,sBAAsB,GAAG;IACpC,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,MAAM;IACN,OAAO;IACP,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CAAC,MAAM;YACX,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACtB,CAAC,CAAC,EAAE,CAAC;IACT,OAAO;QACL,SAAS,EAAE,GAAG,CAAC,QAAQ,IAAI,iBAAiB,KAAK,EAAE;QACnD,UAAU,EAAE,GAAG,CAAC,OAAO;QACvB,UAAU,EAAE,IAAI,CAAC,MAAM;QACvB,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QACvE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACnB,MAAM,GAAG,GAAwB,EAAE,CAAC;YACpC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;gBAAE,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO,GAAG,CAAC;QACb,CAAC,CAAC;QACF,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The server-side key of the test-data masking (`mask` argument). Generated by this server
3
+ * on first use and kept next to the active profile, readable by the owner only:
4
+ * ${SC4SAP_HOME_DIR | ~/.sc4sap}/profiles/<alias>/mask.key (legacy, no alias: …/mask.key)
5
+ * POSIX: file mode 600. Windows: the mode bits are not applied, so the file's ACL is set to the
6
+ * owner alone (inheritance removed) with icacls — on creation and once per process for a key
7
+ * created earlier.
8
+ * It never appears in a tool argument, a response, a log line or the plugin: the model
9
+ * knows only the run salt, which is a namespace, not a key. So tokens cannot be recomputed
10
+ * from a guessed value (dictionary) without this file. The same OS user can still read it
11
+ * (residual risk accepted for local, single-user use).
12
+ */
13
+ import { execFileSync } from 'node:child_process';
14
+ export declare function maskSecretPath(): string;
15
+ /** The Windows account icacls should grant: DOMAIN\user when the domain is known. */
16
+ export declare function windowsAccount(env?: NodeJS.ProcessEnv, user?: string): string;
17
+ /**
18
+ * Owner-only access on Windows: `icacls <file> /inheritance:r /grant:r <user>:F` removes the
19
+ * inherited entries (SYSTEM, Administrators, …) and leaves the owner. No-op elsewhere (mode 600
20
+ * is set at creation). A failure throws: the key is not used unprotected.
21
+ */
22
+ export declare function hardenKeyFile(file: string, platform?: NodeJS.Platform, exec?: typeof execFileSync, account?: string): void;
23
+ /** The masking key; created (random, 256 bit, owner-only) when the profile has none yet. */
24
+ export declare function loadMaskSecret(): Buffer;
25
+ /** Tests only: forget which key files were restricted in this process. */
26
+ export declare function resetHardenedForTests(): void;
27
+ //# sourceMappingURL=maskSecret.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maskSecret.d.ts","sourceRoot":"","sources":["../../../src/lib/policy/maskSecret.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAUlD,wBAAgB,cAAc,IAAI,MAAM,CAOvC;AAED,qFAAqF;AACrF,wBAAgB,cAAc,CAC5B,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,IAAI,GAAE,MAA+B,GACpC,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,IAAI,GAAE,OAAO,YAA2B,EACxC,OAAO,GAAE,MAAqD,GAC7D,IAAI,CAgCN;AAmBD,4FAA4F;AAC5F,wBAAgB,cAAc,IAAI,MAAM,CAkBvC;AAED,0EAA0E;AAC1E,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.maskSecretPath = maskSecretPath;
37
+ exports.windowsAccount = windowsAccount;
38
+ exports.hardenKeyFile = hardenKeyFile;
39
+ exports.loadMaskSecret = loadMaskSecret;
40
+ exports.resetHardenedForTests = resetHardenedForTests;
41
+ /**
42
+ * The server-side key of the test-data masking (`mask` argument). Generated by this server
43
+ * on first use and kept next to the active profile, readable by the owner only:
44
+ * ${SC4SAP_HOME_DIR | ~/.sc4sap}/profiles/<alias>/mask.key (legacy, no alias: …/mask.key)
45
+ * POSIX: file mode 600. Windows: the mode bits are not applied, so the file's ACL is set to the
46
+ * owner alone (inheritance removed) with icacls — on creation and once per process for a key
47
+ * created earlier.
48
+ * It never appears in a tool argument, a response, a log line or the plugin: the model
49
+ * knows only the run salt, which is a namespace, not a key. So tokens cannot be recomputed
50
+ * from a guessed value (dictionary) without this file. The same OS user can still read it
51
+ * (residual risk accepted for local, single-user use).
52
+ */
53
+ const node_child_process_1 = require("node:child_process");
54
+ const node_crypto_1 = require("node:crypto");
55
+ const fs = __importStar(require("node:fs"));
56
+ const os = __importStar(require("node:os"));
57
+ const path = __importStar(require("node:path"));
58
+ const profile_1 = require("../profile");
59
+ const KEY_HEX = /^[0-9a-f]{64}$/;
60
+ const hardened = new Set();
61
+ function maskSecretPath() {
62
+ const home = process.env.SC4SAP_HOME_DIR || path.join(os.homedir(), '.sc4sap');
63
+ const alias = (0, profile_1.getActiveAlias)();
64
+ return alias
65
+ ? path.join(home, 'profiles', alias, 'mask.key')
66
+ : path.join(home, 'mask.key');
67
+ }
68
+ /** The Windows account icacls should grant: DOMAIN\user when the domain is known. */
69
+ function windowsAccount(env = process.env, user = os.userInfo().username) {
70
+ return env.USERDOMAIN ? `${env.USERDOMAIN}\\${user}` : user;
71
+ }
72
+ /**
73
+ * Owner-only access on Windows: `icacls <file> /inheritance:r /grant:r <user>:F` removes the
74
+ * inherited entries (SYSTEM, Administrators, …) and leaves the owner. No-op elsewhere (mode 600
75
+ * is set at creation). A failure throws: the key is not used unprotected.
76
+ */
77
+ function hardenKeyFile(file, platform = process.platform, exec = node_child_process_1.execFileSync, account = platform === 'win32' ? windowsAccount() : '') {
78
+ if (platform !== 'win32')
79
+ return;
80
+ const fail = (why) => new Error(`mask: the masking key could not be restricted to its owner (${why}); rows are not returned`);
81
+ let acl = '';
82
+ try {
83
+ // A new file can carry explicit entries (SYSTEM, Administrators): /reset turns them into
84
+ // inherited ones, then /inheritance:r drops all inherited entries and /grant:r leaves the owner.
85
+ exec('icacls', [file, '/reset'], { stdio: 'ignore', windowsHide: true });
86
+ exec('icacls', [file, '/inheritance:r', '/grant:r', `${account}:F`], {
87
+ stdio: 'ignore',
88
+ windowsHide: true,
89
+ });
90
+ acl = String(exec('icacls', [file], { encoding: 'utf8', windowsHide: true }) ?? '');
91
+ }
92
+ catch {
93
+ throw fail('icacls did not run');
94
+ }
95
+ // Verify: exactly one entry left, the owner's.
96
+ const entries = acl
97
+ .split(/\r?\n/)
98
+ .map((l) => l.replace(file, '').trim())
99
+ .filter((l) => /:\(/.test(l));
100
+ if (entries.length !== 1)
101
+ throw fail(`${entries.length} access entries remain instead of 1`);
102
+ if (!entries[0].toLowerCase().startsWith(`${account.toLowerCase()}:`))
103
+ throw fail(`the remaining entry is not ${account} — on an Azure AD or Microsoft-account sign-in the owner name can differ from USERDOMAIN\\user`);
104
+ }
105
+ function readKey(file) {
106
+ const hex = fs.readFileSync(file, 'utf8').trim();
107
+ if (!KEY_HEX.test(hex))
108
+ throw new Error('mask: the masking key file is not a 64-hex key; rows are not returned');
109
+ return Buffer.from(hex, 'hex');
110
+ }
111
+ function useKey(file) {
112
+ if (!hardened.has(file)) {
113
+ hardenKeyFile(file);
114
+ hardened.add(file);
115
+ }
116
+ return readKey(file);
117
+ }
118
+ /** The masking key; created (random, 256 bit, owner-only) when the profile has none yet. */
119
+ function loadMaskSecret() {
120
+ const file = maskSecretPath();
121
+ if (fs.existsSync(file))
122
+ return useKey(file);
123
+ fs.mkdirSync(path.dirname(file), { recursive: true });
124
+ try {
125
+ fs.writeFileSync(file, `${(0, node_crypto_1.randomBytes)(32).toString('hex')}\n`, {
126
+ encoding: 'utf8',
127
+ mode: 0o600,
128
+ flag: 'wx',
129
+ });
130
+ }
131
+ catch (e) {
132
+ // Another process created it first: use that one.
133
+ if (e?.code !== 'EEXIST')
134
+ throw new Error('mask: the masking key could not be created; rows are not returned');
135
+ }
136
+ return useKey(file);
137
+ }
138
+ /** Tests only: forget which key files were restricted in this process. */
139
+ function resetHardenedForTests() {
140
+ hardened.clear();
141
+ }
142
+ //# sourceMappingURL=maskSecret.js.map
@@ -0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IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,kDAAkD;QAClD,IAAI,CAAC,EAAE,IAAI,KAAK,QAAQ;YACtB,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;IACN,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC;AAED,0EAA0E;AAC1E,SAAgB,qBAAqB;IACnC,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * `mask` on the row-reading tools: resolve the table's DDIC on the connected system and
3
+ * return the rows already masked (see personalMask.ts). Any failure returns no rows.
4
+ */
5
+ import type { IAbapConnection } from '@babamba2/mcp-abap-adt-interfaces';
6
+ import * as z from 'zod';
7
+ import { type MaskSpec, type StrictSelect, type TableDdic } from './personalMask';
8
+ export declare const MASK_DESCRIPTION: string;
9
+ /** `mask` for zod-typed tool schemas. */
10
+ export declare const maskZod: z.ZodOptional<z.ZodObject<{
11
+ salt: z.ZodString;
12
+ extra_fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
13
+ }, z.core.$strip>>;
14
+ /** `mask` for JSON-schema tool definitions. */
15
+ export declare const MASK_JSON_SCHEMA: {
16
+ readonly type: "object";
17
+ readonly description: string;
18
+ readonly properties: {
19
+ readonly salt: {
20
+ readonly type: "string";
21
+ readonly description: "16–64 hex characters, the run salt.";
22
+ };
23
+ readonly extra_fields: {
24
+ readonly type: "array";
25
+ readonly items: {
26
+ readonly type: "string";
27
+ };
28
+ readonly description: "More field names to mask as personal.";
29
+ };
30
+ };
31
+ readonly required: readonly ["salt"];
32
+ };
33
+ /**
34
+ * Field → data element / domain of `table` on the connected system (the DEV system also
35
+ * for a remote read: the same table is defined the same way; a field it does not know is
36
+ * masked anyway).
37
+ */
38
+ export declare function resolveTableDdic(connection: IAbapConnection, table: string, logger?: {
39
+ info?: (m: string) => void;
40
+ }): Promise<TableDdic>;
41
+ /** Refuses a masked read of a personal / credential table (any of `tables`). */
42
+ export declare function refuseMaskedTables(tables: readonly string[]): void;
43
+ /**
44
+ * The read result with its rows masked and a `masking` block. Rows must be objects
45
+ * keyed by column name; anything else (array rows, no rows key) fails.
46
+ */
47
+ export declare function maskPayload(payload: Record<string, any>, spec: MaskSpec, ddic: TableDdic, select: StrictSelect | null, table: string, secret: Buffer): Record<string, any>;
48
+ //# sourceMappingURL=maskedRead.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maskedRead.d.ts","sourceRoot":"","sources":["../../../src/lib/policy/maskedRead.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAIL,KAAK,QAAQ,EAEb,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,gBAAgB,QAKgJ,CAAC;AAE9K,yCAAyC;AACzC,eAAO,MAAM,OAAO;;;kBASS,CAAC;AAE9B,+CAA+C;AAC/C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;CAenB,CAAC;AAEX;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,eAAe,EAC3B,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GACtC,OAAO,CAAC,SAAS,CAAC,CAsBpB;AAED,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAMlE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC5B,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,YAAY,GAAG,IAAI,EAC3B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CA6BrB"}
@@ -0,0 +1,156 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.MASK_JSON_SCHEMA = exports.maskZod = exports.MASK_DESCRIPTION = void 0;
37
+ exports.resolveTableDdic = resolveTableDdic;
38
+ exports.refuseMaskedTables = refuseMaskedTables;
39
+ exports.maskPayload = maskPayload;
40
+ const z = __importStar(require("zod"));
41
+ const clients_1 = require("../clients");
42
+ const rfcBackend_1 = require("../rfcBackend");
43
+ const personalMask_1 = require("./personalMask");
44
+ exports.MASK_DESCRIPTION = 'Test-data mode: return the rows with personal values already masked (deterministic tokens from salt; ' +
45
+ 'default-deny — a column keeps its value only when it is a non-personal field of the table by name, data element ' +
46
+ 'or domain). The table DDIC is read first; personal / credential tables are refused; GetSqlQuery then accepts only ' +
47
+ 'a single-table SELECT with plain fields, optional AS, a simple WHERE. No rows at all when any step fails. ' +
48
+ 'Tokens are keyed by a server-side secret the caller never sees; the result carries only the masked rows, column metadata and a "masking" block (version, masked columns).';
49
+ /** `mask` for zod-typed tool schemas. */
50
+ exports.maskZod = z
51
+ .object({
52
+ salt: z.string().describe('16–64 hex characters, the run salt.'),
53
+ extra_fields: z
54
+ .array(z.string())
55
+ .optional()
56
+ .describe('More field names to mask as personal.'),
57
+ })
58
+ .optional()
59
+ .describe(exports.MASK_DESCRIPTION);
60
+ /** `mask` for JSON-schema tool definitions. */
61
+ exports.MASK_JSON_SCHEMA = {
62
+ type: 'object',
63
+ description: exports.MASK_DESCRIPTION,
64
+ properties: {
65
+ salt: {
66
+ type: 'string',
67
+ description: '16–64 hex characters, the run salt.',
68
+ },
69
+ extra_fields: {
70
+ type: 'array',
71
+ items: { type: 'string' },
72
+ description: 'More field names to mask as personal.',
73
+ },
74
+ },
75
+ required: ['salt'],
76
+ };
77
+ /**
78
+ * Field → data element / domain of `table` on the connected system (the DEV system also
79
+ * for a remote read: the same table is defined the same way; a field it does not know is
80
+ * masked anyway).
81
+ */
82
+ async function resolveTableDdic(connection, table, logger) {
83
+ let body;
84
+ if (process.env.SAP_VERSION?.toUpperCase() === 'ECC') {
85
+ const bridge = await (0, rfcBackend_1.callDdicTablRead)(connection, { name: table });
86
+ if (bridge.subrc !== 0)
87
+ throw new Error(`DDIC of ${table} not readable (ZMCP_ADT_DDIC_TABL_READ subrc=${bridge.subrc}): ${bridge.message}`);
88
+ body = JSON.stringify(bridge.result);
89
+ }
90
+ else {
91
+ const read = await (0, clients_1.createAdtClient)(connection, logger)
92
+ .getTable()
93
+ .read({ tableName: table }, 'active');
94
+ const data = read?.readResult?.data;
95
+ body = typeof data === 'string' ? data : JSON.stringify(data ?? '');
96
+ }
97
+ const ddic = (0, personalMask_1.ddicFromTableData)(body);
98
+ if (!ddic)
99
+ throw new Error(`DDIC of ${table} has no fields this server can read; rows are not returned`);
100
+ return ddic;
101
+ }
102
+ /** Refuses a masked read of a personal / credential table (any of `tables`). */
103
+ function refuseMaskedTables(tables) {
104
+ const refused = tables.filter(personalMask_1.isRefusedTable);
105
+ if (refused.length)
106
+ throw new Error(`mask: personal / credential table ${refused.join(', ')} — not read for test data`);
107
+ }
108
+ /**
109
+ * The read result with its rows masked and a `masking` block. Rows must be objects
110
+ * keyed by column name; anything else (array rows, no rows key) fails.
111
+ */
112
+ function maskPayload(payload, spec, ddic, select, table, secret) {
113
+ const rows = payload?.rows;
114
+ if (!Array.isArray(rows))
115
+ throw new Error('mask: the result has no row list; rows are not returned');
116
+ if (rows.some((r) => !r || typeof r !== 'object' || Array.isArray(r)))
117
+ throw new Error('mask: rows without column names cannot be masked; rows are not returned');
118
+ const sel = select && select.ok ? select : null;
119
+ const result = (0, personalMask_1.maskRows)(rows, spec.salt, spec.extraFields, {
120
+ ddic,
121
+ columns: sel ? sel.columns : null,
122
+ star: sel ? sel.star : false,
123
+ table,
124
+ secret,
125
+ });
126
+ // Only listed metadata keys go back: no other copy of the rows can ride along.
127
+ const kept = {};
128
+ for (const key of SAFE_KEYS)
129
+ if (key in payload)
130
+ kept[key] = payload[key];
131
+ return {
132
+ ...kept,
133
+ rows: result.rows,
134
+ masking: {
135
+ version: personalMask_1.MASK_VERSION,
136
+ default_deny: true,
137
+ masked_columns: result.masked,
138
+ ddic_fields: Object.keys(ddic).length,
139
+ },
140
+ };
141
+ }
142
+ /** Result keys a masked answer may keep besides `rows` (metadata only). */
143
+ const SAFE_KEYS = [
144
+ 'table',
145
+ 'table_name',
146
+ 'destination',
147
+ 'columns',
148
+ 'fields',
149
+ 'count',
150
+ 'rows_returned',
151
+ 'total_rows',
152
+ 'truncated',
153
+ 'note',
154
+ 'path',
155
+ ];
156
+ //# sourceMappingURL=maskedRead.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maskedRead.js","sourceRoot":"","sources":["../../../src/lib/policy/maskedRead.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,4CA0BC;AAGD,gDAMC;AAMD,kCAoCC;AApID,uCAAyB;AACzB,wCAA6C;AAC7C,8CAAiD;AACjD,iDAQwB;AAEX,QAAA,gBAAgB,GAC3B,uGAAuG;IACvG,kHAAkH;IAClH,oHAAoH;IACpH,4GAA4G;IAC5G,2KAA2K,CAAC;AAE9K,yCAAyC;AAC5B,QAAA,OAAO,GAAG,CAAC;KACrB,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAChE,YAAY,EAAE,CAAC;SACZ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,uCAAuC,CAAC;CACrD,CAAC;KACD,QAAQ,EAAE;KACV,QAAQ,CAAC,wBAAgB,CAAC,CAAC;AAE9B,+CAA+C;AAClC,QAAA,gBAAgB,GAAG;IAC9B,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,wBAAgB;IAC7B,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,qCAAqC;SACnD;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,WAAW,EAAE,uCAAuC;SACrD;KACF;IACD,QAAQ,EAAE,CAAC,MAAM,CAAC;CACV,CAAC;AAEX;;;;GAIG;AACI,KAAK,UAAU,gBAAgB,CACpC,UAA2B,EAC3B,KAAa,EACb,MAAuC;IAEvC,IAAI,IAAY,CAAC;IACjB,IAAI,OAAO,CAAC,GAA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AC,MAAM;YAC7B,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM;SACtC;KACF,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,SAAS,GAAG;IAChB,OAAO;IACP,YAAY;IACZ,aAAa;IACb,SAAS;IACT,QAAQ;IACR,OAAO;IACP,eAAe;IACf,YAAY;IACZ,WAAW;IACX,MAAM;IACN,MAAM;CACE,CAAC"}
@@ -0,0 +1,82 @@
1
+ /** Field names holding personal data: names, address, contact, bank, tax / ID numbers, birth data, user IDs. */
2
+ export declare const PERSONAL_EXACT: ReadonlySet<string>;
3
+ /** Data elements of personal data. */
4
+ export declare const PERSONAL_DTEL: ReadonlySet<string>;
5
+ /** Domains of personal data. */
6
+ export declare const PERSONAL_DOMAIN: ReadonlySet<string>;
7
+ export type FieldDdic = {
8
+ rollname: string;
9
+ domname: string;
10
+ /** DDIC data type (CURR, QUAN, CUKY, UNIT, …) when the source gives it. */
11
+ datatype?: string;
12
+ };
13
+ export type TableDdic = Record<string, FieldDdic>;
14
+ /** Field-name shapes of personal data (names, phone / fax / mobile, e-mail, birth, street lines, bank and tax numbers). */
15
+ export declare const PERSONAL_NAME_PATTERNS: readonly RegExp[];
16
+ /** Data element / domain shapes of personal data — checked on the source field's DDIC. */
17
+ export declare const PERSONAL_DDIC_PATTERNS: readonly RegExp[];
18
+ export declare function isPersonalField(name: string, extra?: readonly string[], ddic?: FieldDdic | null): boolean;
19
+ /**
20
+ * Data elements / domains that are clearly non-personal: client, organisational keys,
21
+ * country / region / language, business-partner and document numbers, type / status /
22
+ * flag codes, plain document dates, amounts, quantities, currency and unit keys.
23
+ * Anything not on this list is masked on a masked read.
24
+ */
25
+ export declare const CLEAR_DDIC: ReadonlySet<string>;
26
+ /** DDIC data types that are never personal on their own: amounts, quantities, currency and unit keys. */
27
+ export declare const CLEAR_DATATYPES: ReadonlySet<string>;
28
+ /**
29
+ * Keep this field in clear on a masked read? Only with its DDIC, only when the data
30
+ * element, domain or data type is on the clear list, and only when no personal shape
31
+ * (name, data element, domain, extra field) matches.
32
+ */
33
+ export declare function isClearField(name: string, extra?: readonly string[], ddic?: FieldDdic | null): boolean;
34
+ export declare function isRefusedTable(name: string): boolean;
35
+ /** Version of the token scheme and rule set, returned in `masking.version`. v2 = allow-list classifier (only clearly non-personal DDIC stays clear); v1 servers kept unlisted fields clear and are not accepted by the plugin. */
36
+ export declare const MASK_VERSION = "hmac-v2";
37
+ /**
38
+ * Deterministic stand-in: HMAC-SHA256 under the server-side key (maskSecret.ts) of
39
+ * run salt | table | field | value — same input in one run → same token, unrecoverable
40
+ * without the key. Length ≤ original, digits stay digits, birth dates become 19000101.
41
+ */
42
+ export declare function maskToken(value: unknown, table: string, field: string, salt: string, secret: Buffer): string;
43
+ /** Field → data element / domain from a GetTable answer: ECC bridge JSON (DD03L rows) or the S/4 table source. */
44
+ export declare function ddicFromTableData(body: string): TableDdic | null;
45
+ /** Every table name after FROM / JOIN (also in sub-queries) — for the refusal check. */
46
+ export declare function tablesInSql(sql: string): string[];
47
+ export type StrictSelect = {
48
+ ok: true;
49
+ table: string;
50
+ columns: Map<string, string>;
51
+ star: boolean;
52
+ } | {
53
+ ok: false;
54
+ why: string;
55
+ };
56
+ /**
57
+ * Strict SELECT grammar (allow-list): one SELECT, one table, plain fields with optional
58
+ * AS, unique output names, simple WHERE, UP TO n ROWS, ORDER BY. Anything else fails.
59
+ */
60
+ export declare function parseStrictSelect(sql: string): StrictSelect;
61
+ export type MaskOptions = {
62
+ ddic: TableDdic;
63
+ /** SELECT list: output column → source field; null = not a SELECT (columns are field names). */
64
+ columns?: Map<string, string> | null;
65
+ star?: boolean;
66
+ /** Table the rows come from (part of the token input). */
67
+ table: string;
68
+ /** Server-side key (maskSecret.ts); never leaves the server. */
69
+ secret: Buffer;
70
+ };
71
+ /** Mask rows default-deny. */
72
+ export declare function maskRows(rows: Record<string, unknown>[], salt: string, extra: readonly string[], opts: MaskOptions): {
73
+ rows: Record<string, unknown>[];
74
+ masked: string[];
75
+ };
76
+ export type MaskSpec = {
77
+ salt: string;
78
+ extraFields: string[];
79
+ };
80
+ /** The `mask` argument, checked; a string says what is wrong; null when absent. */
81
+ export declare function maskSpecFrom(raw: unknown): MaskSpec | string | null;
82
+ //# sourceMappingURL=personalMask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personalMask.d.ts","sourceRoot":"","sources":["../../../src/lib/policy/personalMask.ts"],"names":[],"mappings":"AAwBA,gHAAgH;AAChH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAqK7C,CAAC;AAIH,sCAAsC;AACtC,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,MAAM,CA2J5C,CAAC;AACH,gCAAgC;AAChC,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAkC9C,CAAC;AAyBH,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AACF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAElD,2HAA2H;AAC3H,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAgBnD,CAAC;AACF,0FAA0F;AAC1F,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAmBnD,CAAC;AAEF,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,SAAS,MAAM,EAAO,EAC7B,IAAI,GAAE,SAAS,GAAG,IAAW,GAC5B,OAAO,CAYT;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,MAAM,CA0KzC,CAAC;AACH,yGAAyG;AACzG,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAK9C,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,YAAY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