Validate configuration map entries before saving #552
All Vouch review confidence checks passed
Residual risk 0.29 = Change Risk (0.69) × (1 − Review Confidence (0.58)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.69 · 449 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.366
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.069
Real PR Conversation Timeline
1 comments
"Review active on #552"
general
weight: 0.35
NicoPiel
Summary
Fixes #520.
Neither configuration map PUT endpoint checks the body before saving it. The XML and JSON readers ignore the map's generic types, so a request can deserialize to a null map, or a map with a null or non-string key, or a null or non-
ConfigurationPropertyentry.DefaultConfigurationController.setConfigurationPropertiessaved the map before building the in-memory copy, so in database mode the bad map was written to the database and then the in-memory update threw. On the next startup the map failed to load and then read as empty. A null key didn't throw at all. It was persisted and broke the Administrator's Configuration Map tab.PUT /configurationMap/{key}from #515 goes through the same method, so a<null/>body there does the same damage. @NicoPiel and @gibson9583 both reported that in their reviews of #515.setConfigurationPropertiesnow rejects a null map, and checks every raw entry's key and value type. If any check fails, it throws aControllerExceptionbefore saving anything. Both endpoints go through that method, so one check covers both.Notes for reviewers
ControllerException. What #520 asked for is that nothing gets saved and the map is unaffected. Returning 400 instead would mean checking the body in the servlets, or adding a new exception type mapped to 400. I've left that for a separate change. Let me know if you'd rather have it here.Testing
DefaultConfigurationControllerTesthas new database-mode cases for a null map, a null entry, a null key, a non-string key, a non-ConfigurationPropertyentry, and a null property sent to the single-entry endpoint. Each one checks that the stored database row and the in-memory map are both unchanged after the rejection.Claude checked:
./gradlew clean build -PdisableSigning=truepasses.Release Note
Invalid configuration map updates through the REST API no longer empty the map after a restart
With
configurationmap.location = database, an invalid body sent toPUT /api/server/configurationMapwas saved to the database before the request failed. Examples are a<null/>body, an entry with no value, or a key that isn't a string. The server kept using the old map until the next restart, so nothing looked wrong. After the restart the map couldn't be loaded and read as empty, so$cfglookups returned nothing. If someone saved the Configuration Map panel in that state, the original entries were lost for good. A null key was also accepted and kept, and it stopped the Administrator's Configuration Map panel from loading. The server now checks every key and entry and rejects an invalid update before anything is saved. The same check applies to the new single-entryPUT /api/server/configurationMap/{key}endpoint. (#520, #552)Rejected updates still return a 500, as they did before, but the stored map is no longer changed. File mode wasn't affected, because those bodies already failed before the file was written.
If your configuration map came up empty after a restart, and the first request for it after the restart failed with a
NullPointerExceptionorClassCastException, theconfiguration.propertiesrow for categorycorein theCONFIGURATIONtable probably holds a bad map. Fix or delete that row by hand and restart.---
🤖 Drafted with Claude Code