(dottedKey: string, line: number, valueText: string)
| 356 | const now = Date.now(); |
| 357 | |
| 358 | const emitLeaf = (dottedKey: string, line: number, valueText: string) => { |
| 359 | if (!dottedKey) return; |
| 360 | nodes.push({ |
| 361 | id: `spring-config:${filePath}:${line}:${dottedKey}`, |
| 362 | kind: 'constant', |
| 363 | name: dottedKey.split('.').pop() ?? dottedKey, |
| 364 | qualifiedName: dottedKey, |
| 365 | filePath, |
| 366 | startLine: line, |
| 367 | endLine: line, |
| 368 | startColumn: 0, |
| 369 | endColumn: valueText.length, |
| 370 | language: lang, |
| 371 | signature: dottedKey, |
| 372 | // SECURITY (#383): store the KEY only, never the value. Config files |
| 373 | // routinely hold secrets (DB passwords, API keys, JDBC URLs with embedded |
| 374 | // credentials), and surfacing the value here pushes it into agent context |
| 375 | // unbidden (it lands in codegraph_node/explore output via the docstring). |
| 376 | // The key is all `@Value`/`@ConfigurationProperties` resolution needs; an |
| 377 | // agent that genuinely needs a value can read the file directly. |
| 378 | updatedAt: now, |
| 379 | }); |
| 380 | }; |
| 381 | |
| 382 | if (isProperties) { |
| 383 | // Properties format: `k1.k2.k3 = value` (or `:` separator, or no value). |
no test coverage detected