feat(desktop): extract browser URL and redaction policy helpers - #64
Draft
John-Ryan21337 wants to merge 1 commit into
Draft
John-Ryan21337 wants to merge 1 commit into
John-Ryan21337 wants to merge 1 commit into
Conversation
This was referenced Sep 11, 2026
Merged
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.
What Changed
Extracts four pure browser policy helpers: address normalization, safe URL display, heuristic text redaction, and transport eligibility for operator-entered sensitive values. Includes boundary tests and a short integration note. No Electron import, endpoint, UI, dependency, or provider integration is added.
Unsupported schemes and URL credentials are rejected for navigation. Display URLs omit user information, query strings, and fragments. Recognized labelled secrets are removed in full before clipping, including one-character and long values. Sensitive-entry transport eligibility requires HTTPS or HTTP loopback and does not authorize entry.
Why
These policies are useful to review separately before adopting an embedded browser. This proposal is based directly on Cafe
devat99fbaec89da429924171c89d66a8f3455e42d9b0, with no prerequisite PR. It complements browser contracts #63 but does not depend on them.The working browser and adoption guide are in Club publication #66. A later native-browser integration can consume these helpers. Merging this PR alone does not provide browsing or permission enforcement. Redaction is best effort: arbitrary page text and URL paths can still contain sensitive data, so these helpers must not be treated as a logging or authorization guarantee.
Validation
yarn fmt,yarn lint, fullyarn typecheck, and fullyarn testpassed. Existing lint warnings remain.yarn build:desktop --forcepassed; emitted artifacts were checked separately from the exit code.Checklist
日本語:ブラウザーのURL正規化・表示用URL・簡易マスキング・機密入力の通信条件を扱う純粋関数です。
ブラウザーや権限は有効にせず、単独でレビューできます。マスキングは完全な機密保護を保証せず、
別途オリジン・所有者・対象・失効・利用者の承認を確認する必要があります。