Skip to content

feat(extension): bound native messaging host authority - #82

Open
seonghobae wants to merge 5 commits into
mainfrom
feat/native-messaging-host-authority
Open

feat(extension): bound native messaging host authority#82
seonghobae wants to merge 5 commits into
mainfrom
feat/native-messaging-host-authority

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Partial implementation of #27.

Buyer/security gap

Issue #27 requires native messaging only behind an explicit host-managed allow-list and process boundary. Protected main already separates Chromium extension permission from OriginWeave Agent capability, but it has no typed native-messaging host authority. A future adapter must not be able to treat the manifest nativeMessaging permission or an arbitrary host-name string as OriginWeave authority.

Test-first implementation

This branch is based directly on protected main 67af7c87589edc2039545af335c95064d9b8391c. Exact test-only head afea70bee5f479fc0b925be154fe79279fc34ae4 established the missing production boundary before the narrow implementation was added.

The contract requires:

  • Chromium-compatible native-messaging host-name syntax: lowercase ASCII alphanumeric, underscore and dot only, with no leading/trailing/consecutive dot;
  • an explicit exact extension-ID + host-name grant;
  • typed denial when the grant is absent, the extension differs, or the host differs; and
  • native-messaging permission remaining separate from OriginWeave Agent capability.

The intended production boundary is deliberately narrow and deterministic. It does not launch a process, parse a host manifest, read the registry/filesystem, communicate over stdio, parse messages, expose secrets, grant Agent actions, or treat extension content as trusted instruction.

Primary platform contract

The design follows Chrome's native-messaging contract: registered host names are restricted to lowercase alphanumeric characters, underscores and dots; allowed_origins is an explicit extension allow-list without wildcards; and Chrome launches each native messaging host in a separate process. The process/stdio integration remains a later separately tested boundary; this PR first establishes the Rust-side exact authority primitive.

Exact-head verification

Head 28593cf991cc552968da54b722a887252a3695e7 is directly ahead of protected main 67af7c87589edc2039545af335c95064d9b8391c with no intervening base movement. The exact-head CI run 31484721598, Manifest V3 Compatibility run 31484721575, Security Scan run 31484721547, and SAST Semgrep run 31484721542 all completed successfully. The final coverage-only repair exercised the already-supported numeric native-host-name branch and restored exact production branch coverage without widening production authority.

Governance

The PR is ready for review because the intended RED was observed and the smallest implementation is exact-head GREEN. No predecessor-head evidence is transferred. This scheduled actor does not merge, self-approve, weaken checks, or alter workflows.

Summary by CodeRabbit

  • 새로운 기능

    • Chrome 네이티브 메시징 호스트 이름의 형식 검증 및 정규화를 지원합니다.
    • 확장 프로그램과 호스트 간 명시적 접근 권한을 추가했습니다.
    • 확장 ID와 호스트 이름이 모두 일치할 때만 접근을 허용합니다.
    • 권한 누락 또는 정보 불일치 시 접근을 명확히 거부합니다.
  • 테스트

    • 허용 및 거부 조건과 별도 권한 없이 에이전트 접근이 제한되는 동작을 검증했습니다.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Native-messaging 호스트 이름 검증 타입과 명시적 접근 grant 평가 API를 추가했습니다. 확장 ID와 호스트 이름이 모두 일치할 때만 접근을 허용합니다. 관련 거부 조건과 확장 에이전트 capability 분리를 테스트합니다.

Changes

Native messaging 권한 경계

Layer / File(s) Summary
호스트 이름 및 접근 계약
crates/originweave-core/src/lib.rs
Chromium 문법에 맞는 NativeMessagingHostName 검증을 추가했습니다. 확장 ID와 호스트 이름을 포함하는 grant 및 접근 요청 타입을 추가했습니다. grant 누락, 확장 ID 불일치, 호스트 이름 불일치, 허용 결과를 구분합니다.
권한 평가 검증
crates/originweave-core/tests/native_messaging_authority.rs
유효하지 않은 호스트 이름을 거부하는 동작을 테스트합니다. grant가 정확히 일치할 때만 접근을 허용하고, 각 불일치 조건을 구분해 거부하는 동작을 검증합니다. 확장 에이전트 capability가 별도 grant 없이 허용되지 않는지 확인합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 네이티브 메시징 호스트 권한을 확장 ID와 호스트 이름으로 제한하는 주요 변경 사항을 간결하고 정확하게 설명합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/native-messaging-host-authority

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant