Skip to content

feat(desktop): extract browser URL and redaction policy helpers - #64

Draft
John-Ryan21337 wants to merge 1 commit into
cafeai:devfrom
John-Ryan21337:adoption/cafe-dev-browser-security-helpers-20260911
Draft

John-Ryan21337 wants to merge 1 commit into
cafeai:devfrom
John-Ryan21337:adoption/cafe-dev-browser-security-helpers-20260911

Conversation

@John-Ryan21337

@John-Ryan21337 John-Ryan21337 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

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 dev at 99fbaec89da429924171c89d66a8f3455e42d9b0, 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

  • Independent audit repaired labelled-secret suffix leakage; 55 focused tests passed.
  • yarn fmt, yarn lint, full yarn typecheck, and full yarn test passed. Existing lint warnings remain.
  • yarn build:desktop --force passed; emitted artifacts were checked separately from the exit code.
  • No UI/runtime activation; native browsing requires separate integration tests.
  • Upstream CI passed at this head: Ubuntu, Windows, macOS, all three native desktop packages, and Linux AppImage.

Checklist

  • This PR is small and focused: one helper module, one test file, one integration note.
  • I explained what changed and why.
  • No UI changes; screenshots and video are not applicable.

日本語:ブラウザーのURL正規化・表示用URL・簡易マスキング・機密入力の通信条件を扱う純粋関数です。
ブラウザーや権限は有効にせず、単独でレビューできます。マスキングは完全な機密保護を保証せず、
別途オリジン・所有者・対象・失効・利用者の承認を確認する必要があります。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant