[Developer] report NULLified KB columns in MCP results

This commit is contained in:
devmrko
2026-07-07 17:06:49 +09:00
parent 2ef04e6ab2
commit 6921682bcd

View File

@@ -634,17 +634,19 @@ public class OrdsProbeService {
List<String> masked = new ArrayList<>(); List<String> masked = new ArrayList<>();
for (ProtectedColumn column : sensitiveColumns) { for (ProtectedColumn column : sensitiveColumns) {
boolean present = false;
boolean allNull = true; boolean allNull = true;
for (Map<String, Object> row : rows) { for (Map<String, Object> row : rows) {
for (Map.Entry<String, Object> entry : row.entrySet()) { for (Map.Entry<String, Object> entry : row.entrySet()) {
if (entry.getKey().equalsIgnoreCase(column.columnName())) { if (entry.getKey().equalsIgnoreCase(column.columnName())) {
present = true;
allNull = allNull && entry.getValue() == null; allNull = allNull && entry.getValue() == null;
} }
} }
} }
if (present && allNull) { // APEX_JSON omits a ref-cursor column whose value is NULL. The KB
// object handlers always select every registered protected column, so
// a sensitive column missing from every JSON row is also a NULL result
// and must be reported as masked to the MCP/UI caller.
if (allNull) {
masked.add(column.columnName().toLowerCase(Locale.ROOT) + " [" + column.policyLabel() + "]"); masked.add(column.columnName().toLowerCase(Locale.ROOT) + " [" + column.policyLabel() + "]");
} }
} }