fix(installer): strip quotes + reject malformed OP_ITEM/OP_FIELD input#15
Open
busla wants to merge 1 commit into
Open
fix(installer): strip quotes + reject malformed OP_ITEM/OP_FIELD input#15busla wants to merge 1 commit into
busla wants to merge 1 commit into
Conversation
Followup from #14. The migration warning showed the correct split, but a Windows user typed the legacy 3-segment value back at the prompt (with quotes the first time), and the installer accepted it. Runtime defense in claudestart.ps1 silently fixed it at launch, but local.env on disk was still wrong. Three input-validation gaps in the prompts: 1. Read-Host / read returned literal quote chars from copy-pasted values (e.g. "op://...") so the first attempt failed with the misleading "must start with op://". Strip surrounding matched quotes inside prompt_default / Prompt-Default. 2. OP_ITEM prompt only checked the op:// prefix. A 3+ segment path passed through, undoing the migration that just happened. Now the prompt loops with a specific message that shows exactly how to split the input across the next two prompts. 3. OP_FIELD prompt accepted anything, including a full op:// URL. Reject inputs starting with op:// in both the field-list and no-fields paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Followup from #14. A Windows user reran the installer, saw the migration warning correctly identify their legacy
OP_ITEM, but then typed the legacy value back at the prompt (with quotes, then without) and the installer accepted it both times. Runtime defense inclaudestart.ps1silently corrected it at launch, butlocal.envon disk was still wrong.Three input-validation gaps surfaced:
Quote characters passed through literally. PowerShell's
Read-Hostand bash'sreadboth return literal"/'chars. Copy-pasted values from docs or secret managers often arrive quoted, and the validation only checked theop://prefix — so a quoted"op://..."failed with the misleading message "must start with op://" (it does — after the quote). Strip surrounding matched quotes inside the prompt helpers.OP_ITEM prompt accepted 3+ segment paths. Right after the migration explained that the field shouldn't be in OP_ITEM, the prompt happily accepted
op://Vault/Item/Fieldagain. Add segment-count validation with a specific message that shows the user exactly how to split their input across the next two prompts.OP_FIELD prompt accepted full
op://URLs. Reject inputs starting withop://in both the field-list and no-fields paths, with a hint that the field name is just a label.Walkthrough of the previously failing scenario
Before this PR (real user session):
After this PR:
Test plan
bash -n install.shirm .../install.ps1 | iexand types the legacy value — should get the specific 3-segment rejectioncurl .../install.sh | bash— should behave identically🤖 Generated with Claude Code