fix: feed_api_key field doesn't show its "stored" state after masking - #9
Draft
rjonesbsink wants to merge 1 commit into
Draft
fix: feed_api_key field doesn't show its "stored" state after masking#9rjonesbsink wants to merge 1 commit into
rjonesbsink wants to merge 1 commit into
Conversation
Follow-up to openises#7. 07b9d1d already added data-secret="1" to feed_api_key in settings.php (fixing the actual data loss), but didn't touch config.js — the generic applySettingsToForm() has no idea about the <name>_set sentinel the server sends for masked fields, so the field still LOOKS empty and the "external feed is disabled" banner still shows even when a key is in fact configured. Cosmetic next to the data loss, but still wrong, and called out explicitly in the openises#7 thread as a gap being left for a separate fix. loadApiKeys() now reads feed_api_key_set and shows the same "stored — leave blank to keep, type to replace" placeholder loadSlackConfig() already uses for its secret fields, and tracks a data-configured flag so updateFeedKeyBanner() reflects the real state instead of just checking whether the box happens to be non-empty. (Dropped the settings.php data-secret="1" hunk this branch used to carry — main already has it via 07b9d1d, identical text, so keeping it here was pure duplication.)
rjonesbsink
force-pushed
the
fix/feed-api-key-secret-masking
branch
from
July 28, 2026 16:49
79e9b47 to
3c6f774
Compare
Member
|
Reviewed this one too — it's good to go from my side. No security surface, no server-side change, ES5-clean, and it mirrors I particularly like that the banner logic keeps the blank-and-configured case hidden, which is what "blank means keep the stored value" should look like to a user. That was the confusing part of #7 and this makes the state visible instead of implied. It's still marked draft — flip it to ready and I'll merge it. Thanks for splitting this out from the larger fix rather than bundling it. Reviewing a focused 22-line diff is a very different experience from reviewing it buried in a nine-file change, and I noticed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the config.js half of #7.
07b9d1dalready fixed the actual data-loss bug (data-secret="1"onfeed_api_keyinsettings.php) and covered the 9-field audit + boolean-masking issue — this PR doesn't touch any of that.What's left is the piece explicitly called out as a separate gap in that thread:
applySettingsToForm()has no concept of the<name>_setsentinel the server sends for masked fields, so a correctly-configuredfeed_api_keystill renders as an empty box, and the "external feed is disabled" banner still shows even though a key is in fact set.Change
loadApiKeys()now readsfeed_api_key_setand shows the same "stored — leave blank to keep, type to replace" placeholderloadSlackConfig()already uses for its own secret fields, tracking adata-configuredflag soupdateFeedKeyBanner()reflects the real state instead of just checking whether the box happens to be non-empty.This branch previously also carried the
data-secret="1"addition tosettings.php, but that's now identical to what's already onmainvia07b9d1d— dropped it to keep this PR to just the one remaining gap, rather than duplicating your own fix.Testing
Verified end-to-end on a live install: with a key configured, the field now shows the "stored" placeholder and the banner stays hidden; saving an unrelated field on the same form no longer touches the key (confirmed via direct DB check) and the display now correctly reflects that.