norn-cli 2.4.0 → 2.5.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 (93) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +24 -1
  3. package/dist/cli.js +217 -77
  4. package/package.json +13 -4
  5. package/.claude/settings.local.json +0 -18
  6. package/.claude/skills/norn-social-campaign/SKILL.md +0 -70
  7. package/out/apiResponseIntellisenseCache.js +0 -394
  8. package/out/assertionRunner.js +0 -567
  9. package/out/cacheDir.js +0 -136
  10. package/out/chatParticipant.js +0 -763
  11. package/out/cli/colors.js +0 -127
  12. package/out/cli/formatters/assertion.js +0 -102
  13. package/out/cli/formatters/index.js +0 -23
  14. package/out/cli/formatters/response.js +0 -106
  15. package/out/cli/formatters/summary.js +0 -246
  16. package/out/cli/redaction.js +0 -237
  17. package/out/cli/reporters/html.js +0 -689
  18. package/out/cli/reporters/index.js +0 -22
  19. package/out/cli/reporters/junit.js +0 -226
  20. package/out/codeLensProvider.js +0 -351
  21. package/out/compareContentProvider.js +0 -85
  22. package/out/completionProvider.js +0 -3739
  23. package/out/contractAssertionSummary.js +0 -225
  24. package/out/contractDecorationProvider.js +0 -243
  25. package/out/coverageCalculator.js +0 -879
  26. package/out/coveragePanel.js +0 -597
  27. package/out/debug/breakpointResolver.js +0 -84
  28. package/out/debug/breakpoints.js +0 -52
  29. package/out/debug/nornDebugAdapter.js +0 -166
  30. package/out/debug/nornDebugSession.js +0 -613
  31. package/out/debug/sequenceLocationIndex.js +0 -77
  32. package/out/debug/types.js +0 -3
  33. package/out/deepClone.js +0 -21
  34. package/out/diagnosticProvider.js +0 -2554
  35. package/out/environmentParser.js +0 -736
  36. package/out/environmentProvider.js +0 -544
  37. package/out/environmentTemplates.js +0 -146
  38. package/out/errors/formatError.js +0 -113
  39. package/out/errors/nornError.js +0 -29
  40. package/out/formUrlEncoded.js +0 -89
  41. package/out/httpClient.js +0 -348
  42. package/out/httpRuntimeOptions.js +0 -16
  43. package/out/importErrors.js +0 -31
  44. package/out/inlayHintResolver.js +0 -70
  45. package/out/jsonFileReader.js +0 -323
  46. package/out/mcpClient.js +0 -193
  47. package/out/mcpConfig.js +0 -184
  48. package/out/mcpToolIntellisenseCache.js +0 -96
  49. package/out/mcpToolSchema.js +0 -50
  50. package/out/nornConfig.js +0 -132
  51. package/out/nornHoverProvider.js +0 -124
  52. package/out/nornInlayHintsProvider.js +0 -191
  53. package/out/nornPrompt.js +0 -755
  54. package/out/nornSqlParser.js +0 -286
  55. package/out/nornapiHoverProvider.js +0 -135
  56. package/out/nornapiInlayHintsProvider.js +0 -94
  57. package/out/nornapiParser.js +0 -324
  58. package/out/nornenvCodeActionProvider.js +0 -101
  59. package/out/nornenvDecorationProvider.js +0 -239
  60. package/out/nornenvFoldingProvider.js +0 -63
  61. package/out/nornenvHoverProvider.js +0 -114
  62. package/out/nornenvInlayHintsProvider.js +0 -99
  63. package/out/nornenvLanguageModel.js +0 -187
  64. package/out/nornenvRegionRefactor.js +0 -267
  65. package/out/nornsqlHoverProvider.js +0 -95
  66. package/out/nornsqlInlayHintsProvider.js +0 -114
  67. package/out/parser.js +0 -839
  68. package/out/pathAccess.js +0 -28
  69. package/out/postmanImportPanel.js +0 -732
  70. package/out/postmanImportPlanner.js +0 -1155
  71. package/out/postmanImportSidebarView.js +0 -532
  72. package/out/quotedString.js +0 -35
  73. package/out/requestPreparation.js +0 -179
  74. package/out/requestValidation.js +0 -146
  75. package/out/responsePanel.js +0 -7754
  76. package/out/schemaGenerator.js +0 -562
  77. package/out/scriptRunner.js +0 -419
  78. package/out/secrets/cliSecrets.js +0 -415
  79. package/out/secrets/crypto.js +0 -105
  80. package/out/secrets/envFileSecrets.js +0 -177
  81. package/out/secrets/keyStore.js +0 -259
  82. package/out/sequenceDeclaration.js +0 -15
  83. package/out/sequenceRunner.js +0 -3590
  84. package/out/sqlAdapterRunner.js +0 -122
  85. package/out/sqlBuiltInAdapters.js +0 -604
  86. package/out/sqlConfig.js +0 -184
  87. package/out/starterCatalog.js +0 -554
  88. package/out/stringUtils.js +0 -25
  89. package/out/swaggerBodyIntellisenseCache.js +0 -114
  90. package/out/swaggerParser.js +0 -464
  91. package/out/testProvider.js +0 -767
  92. package/out/theoryCaseLoader.js +0 -113
  93. package/out/validationCache.js +0 -211
@@ -1,237 +0,0 @@
1
- "use strict";
2
- /**
3
- * Redaction module for sensitive data in CLI output
4
- *
5
- * Automatically redacts:
6
- * - Authorization headers (Bearer tokens, Basic auth, API keys)
7
- * - Common sensitive field names (password, secret, token, api_key, etc.)
8
- * - User-defined secrets from .nornenv `secret` declarations
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.createRedactionOptions = createRedactionOptions;
12
- exports.redactHeaders = redactHeaders;
13
- exports.redactString = redactString;
14
- exports.redactBody = redactBody;
15
- exports.redactUrl = redactUrl;
16
- exports.getRedactedMarker = getRedactedMarker;
17
- const REDACTED = '***REDACTED***';
18
- /**
19
- * Common header names that should always be redacted
20
- */
21
- const SENSITIVE_HEADERS = new Set([
22
- 'authorization',
23
- 'x-api-key',
24
- 'x-auth-token',
25
- 'x-access-token',
26
- 'api-key',
27
- 'apikey',
28
- 'cookie',
29
- 'set-cookie',
30
- 'x-csrf-token',
31
- 'x-xsrf-token',
32
- ]);
33
- /**
34
- * Patterns for sensitive values in headers/bodies
35
- * These patterns match common token/key formats
36
- */
37
- const SENSITIVE_PATTERNS = [
38
- // Bearer tokens
39
- /Bearer\s+[A-Za-z0-9\-_=]+\.?[A-Za-z0-9\-_=]*\.?[A-Za-z0-9\-_=]*/gi,
40
- // Basic auth
41
- /Basic\s+[A-Za-z0-9+/=]+/gi,
42
- // API keys (common formats)
43
- /api[_-]?key[=:]\s*["']?[A-Za-z0-9\-_]+["']?/gi,
44
- ];
45
- /**
46
- * Field names in JSON that should have their values redacted
47
- */
48
- const SENSITIVE_FIELD_NAMES = new Set([
49
- 'password',
50
- 'passwd',
51
- 'secret',
52
- 'token',
53
- 'access_token',
54
- 'accesstoken',
55
- 'refresh_token',
56
- 'refreshtoken',
57
- 'api_key',
58
- 'apikey',
59
- 'api-key',
60
- 'private_key',
61
- 'privatekey',
62
- 'client_secret',
63
- 'clientsecret',
64
- 'auth',
65
- 'authorization',
66
- 'credential',
67
- 'credentials',
68
- ]);
69
- /**
70
- * Create default redaction options
71
- */
72
- function createRedactionOptions(secretNames = new Set(), secretValues = new Map(), enabled = true) {
73
- return { secretNames, secretValues, enabled };
74
- }
75
- /**
76
- * Redact sensitive headers
77
- */
78
- function redactHeaders(headers, options) {
79
- if (!options.enabled) {
80
- return headers;
81
- }
82
- const redacted = {};
83
- for (const [key, value] of Object.entries(headers)) {
84
- const lowerKey = key.toLowerCase();
85
- // Check if header name is sensitive
86
- if (SENSITIVE_HEADERS.has(lowerKey)) {
87
- redacted[key] = REDACTED;
88
- continue;
89
- }
90
- // Check for Bearer/Basic patterns in value
91
- let redactedValue = value;
92
- for (const pattern of SENSITIVE_PATTERNS) {
93
- redactedValue = redactedValue.replace(pattern, REDACTED);
94
- }
95
- // Check if value matches any secret values
96
- redactedValue = redactSecretValues(redactedValue, options);
97
- redacted[key] = redactedValue;
98
- }
99
- return redacted;
100
- }
101
- /**
102
- * Redact sensitive values in a string
103
- */
104
- function redactString(text, options) {
105
- if (!options.enabled || !text) {
106
- return text;
107
- }
108
- let result = text;
109
- // Apply pattern-based redaction
110
- for (const pattern of SENSITIVE_PATTERNS) {
111
- result = result.replace(pattern, REDACTED);
112
- }
113
- // Redact user-defined secret values
114
- result = redactSecretValues(result, options);
115
- return result;
116
- }
117
- /**
118
- * Redact secret values from .nornenv
119
- */
120
- function redactSecretValues(text, options) {
121
- if (!text || options.secretValues.size === 0) {
122
- return text;
123
- }
124
- let result = text;
125
- // Replace each secret value with redacted marker
126
- for (const [, value] of options.secretValues) {
127
- if (value && value.length > 0) {
128
- // Escape special regex characters in the value
129
- const escaped = value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
130
- result = result.replace(new RegExp(escaped, 'g'), REDACTED);
131
- }
132
- }
133
- return result;
134
- }
135
- /**
136
- * Redact sensitive fields in JSON body
137
- */
138
- function redactBody(body, options) {
139
- if (!options.enabled) {
140
- return body;
141
- }
142
- if (typeof body === 'string') {
143
- // Try to parse as JSON first
144
- try {
145
- const parsed = JSON.parse(body);
146
- return JSON.stringify(redactObject(parsed, options), null, 2);
147
- }
148
- catch {
149
- // Not JSON, apply string redaction
150
- return redactString(body, options);
151
- }
152
- }
153
- if (typeof body === 'object' && body !== null) {
154
- return redactObject(body, options);
155
- }
156
- return body;
157
- }
158
- /**
159
- * Recursively redact sensitive fields in an object
160
- */
161
- function redactObject(obj, options) {
162
- if (Array.isArray(obj)) {
163
- return obj.map(item => redactObject(item, options));
164
- }
165
- if (typeof obj !== 'object' || obj === null) {
166
- if (typeof obj === 'string') {
167
- return redactSecretValues(obj, options);
168
- }
169
- return obj;
170
- }
171
- const result = {};
172
- for (const [key, value] of Object.entries(obj)) {
173
- const lowerKey = key.toLowerCase();
174
- // Check if field name indicates sensitive data
175
- if (SENSITIVE_FIELD_NAMES.has(lowerKey)) {
176
- result[key] = REDACTED;
177
- continue;
178
- }
179
- // Check if this is a user-defined secret variable name
180
- if (options.secretNames.has(key)) {
181
- result[key] = REDACTED;
182
- continue;
183
- }
184
- // Recursively process nested objects
185
- if (typeof value === 'object' && value !== null) {
186
- result[key] = redactObject(value, options);
187
- }
188
- else if (typeof value === 'string') {
189
- result[key] = redactSecretValues(value, options);
190
- }
191
- else {
192
- result[key] = value;
193
- }
194
- }
195
- return result;
196
- }
197
- /**
198
- * Redact a URL (query parameters with sensitive names)
199
- */
200
- function redactUrl(url, options) {
201
- if (!options.enabled) {
202
- return url;
203
- }
204
- try {
205
- const urlObj = new URL(url);
206
- const params = new URLSearchParams(urlObj.search);
207
- let modified = false;
208
- for (const [key] of params.entries()) {
209
- const lowerKey = key.toLowerCase();
210
- if (SENSITIVE_FIELD_NAMES.has(lowerKey) ||
211
- lowerKey.includes('token') ||
212
- lowerKey.includes('key') ||
213
- lowerKey.includes('secret') ||
214
- lowerKey.includes('password')) {
215
- params.set(key, REDACTED);
216
- modified = true;
217
- }
218
- }
219
- if (modified) {
220
- urlObj.search = params.toString();
221
- return urlObj.toString();
222
- }
223
- // Also redact secret values that appear in the URL
224
- return redactSecretValues(url, options);
225
- }
226
- catch {
227
- // If URL parsing fails, just do string-based redaction
228
- return redactSecretValues(url, options);
229
- }
230
- }
231
- /**
232
- * Get the redaction marker (for display purposes)
233
- */
234
- function getRedactedMarker() {
235
- return REDACTED;
236
- }
237
- //# sourceMappingURL=redaction.js.map