fix(api): save literal asterisks in OTLP API keys #6281
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.43) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 355 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.351
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #6281"
general
weight: 0.35
Jackmeson1
Fixes #6280
Saving
abas the OTLP API key now writes it to the settings file and returns******. A client can also submit a mask from before a key rotation while changing another setting. The store keeps the rotated key.ObservabilitySettingsStore.save_publicpreviously treated any asterisk as a placeholder. It now recognizes the two forms the API emits after trimming the input: eight asterisks alone, or eight asterisks between a four-character prefix and suffix. It resolves either form under the existing write lock.The public-route regression starts with an ordinary replacement, then saves
abor a 16-character literal whose eight asterisks are off center. It checks the key on disk, masked PUT and GET responses, resubmission of the current mask, a sampling-rate edit with a stale mask, and an empty clear. The two cases exercise both directions across the short-key masking boundary.A desired literal identical to either mask remains ambiguous. Supporting that literal requires a protocol decision. #6239 handles integer validation separately.
On Ubuntu 24.04 at
d2bf02ce,test_observability_settings_api.pypassed on Python 3.12 with Transformers 5.24.1 and 4.57.6 and on Python 3.10 (11 each); with the store from94688263the two new cases fail at the saved-key assertion. Pre-commit on the changed files and mypy over the repository passed; the consumer suite had only failures that also occur on the base. On Windows Python 3.10.20 and 3.14.6 the file passed as well (11 each).Web UI
System Settings now shows the saved OTLP key mask as a placeholder. Backspace in the empty field keeps the current key. Typing
absends that replacement, and a successful save empties the field and displays the mask returned by the server. Select Clear saved key on save to remove the key.API clients can resubmit either reserved mask form to keep the current key, including after rotation. After trimming, the store recognizes eight asterisks alone or eight asterisks between a four-character prefix and suffix. A client that sends
plai******5678sets that literal key.The follow-up commit
7c7ad0cbchanges only the frontend. On Windows with Node 24, the 18 system-settings tests pass (npm run test:system-settings), and the seven new UI assertions fail with the frontend fromd2bf02ce; eslint, Prettier andtsc --noEmitpass. The regressions use jsdom with a mocked API; I did not run a live browser. The UI regressions cover Backspace, literal replacement, refreshed mask display, explicit clear, and unrelated saves after erasing a draft, leaving only whitespace, or adding the first key in another tab.AI disclosure: this was prepared with AI assistance (Claude Code with Claude Opus 5.5, and OpenAI Codex with GPT-6.2).
🤖 Generated with Claude Code