Skip to content

Add IPC deep dive #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add IPC deep dive #616

wants to merge 4 commits into from

Conversation

coroiu
Copy link
Contributor

@coroiu coroiu commented Jun 17, 2025

🎟️ Tracking

📔 Objective

Add high level documentation of the IPC framework

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation
    team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@coroiu coroiu requested a review from a team as a code owner June 17, 2025 10:27
Copy link

Deploying contributing-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 98626d2
Status: ✅  Deploy successful!
Preview URL: https://2b73b519.contributing-docs.pages.dev
Branch Preview URL: https://coroiu-ipc-documentation.contributing-docs.pages.dev

View logs

Copy link

Logo
Checkmarx One – Scan Summary & Detailse3f17da9-6bd0-460c-a4aa-c3a8827a6770

New Issues (1)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CVE-2025-30360 Npm-webpack-dev-server-4.15.2
detailsRecommended version: 5.2.1
Description: Webpack-dev-server allows users to use webpack with a development server that provides live reloading. Webpack-dev-server users' source code may b...
Attack Vector: NETWORK
Attack Complexity: LOW

ID: E0yJSCnvOx12sCJTgcvGVKiiUHzpcqDglasZYaQoiKc%3D
Vulnerable Package

Copy link
Contributor

@withinfocus withinfocus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent writeup -- one of the best I have reviewed here. Love the use of diagrams. Just a few ⛏️.


The IPC framework is split into two main parts:

### Platform agnostic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Platform agnostic
### Platform-agnostic

Debatable in English grammar, but I prefer it hyphenated.


### Platform agnostic

The platform agnostic parts of the IPC framework are written in Rust and are responsible for the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The platform agnostic parts of the IPC framework are written in Rust and are responsible for the
The platform-agnostic parts of the IPC framework are written in Rust and are responsible for the

@enduml
```

### Platform specific
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Platform specific
### Platform-specific

You also use a hyphen for this in a paragraph above.


### Platform specific

The platform specific parts of the IPC framework are written in different languages and are
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The platform specific parts of the IPC framework are written in different languages and are
The platform-specific parts of the IPC framework are written in different languages and are

and receiving of messages, persisting cryptographic sessions, as well as any other platform-specific
details of the IPC communication. Below is an illustration of the platform-specific implementation
for the WebAssembly (WASM) platform, which uses JavaScript to implement how messages are sent and
received.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
received.
received:

You use a colon above, and I also personally prefer this as a lead-in to the image.


### Publish/Subscribe

This pattern allows consumers to subscribe to specific topics and receive messages published to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This pattern allows consumers to subscribe to specific topics and receive messages published to
Allows consumers to subscribe to specific topics and receive messages published to

Implied.


### Request/Response

This pattern allows a consumer to send a request to a producer and receive a response. It is useful
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This pattern allows a consumer to send a request to a producer and receive a response. It is useful
Allows a consumer to send a request to a producer and receive a response. It is useful

message, and the framework will handle the serialization and deserialization of the messages, as
long as the type supports conversion to and from a `Vec<u8>` representation.

### Request/Response
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Request/Response
### Request / Response

@enduml
```

### Request/Response
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Request/Response
### Request / Response


### Request/Response

The request/response functionality is built on top of the publish/subscribe message format by using
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The request/response functionality is built on top of the publish/subscribe message format by using
The request / response functionality is built on top of the publish / subscribe message format by using

Copy link
Member

@trmartin4 trmartin4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an excellent summary, thank you for writing it up. I am excited to see teams start to use it!

I had a couple of small suggestions.

# Inter-Process Communication (IPC)

Bitwarden uses IPC to allow communication between and within certain parts of our clients. The
oldest use-case is the communication between the Bitwarden browser extension and the Bitwarden
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
oldest use-case is the communication between the Bitwarden browser extension and the Bitwarden
original use-case is the communication between the Bitwarden browser extension and the Bitwarden

oldest use-case is the communication between the Bitwarden browser extension and the Bitwarden
desktop application to allow the extension to be unlocked using biometric authentication.

Bitwarden now has a generic framework for IPC provided in the SDK. This framework is used to provide
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Bitwarden now has a generic framework for IPC provided in the SDK. This framework is used to provide
Bitwarden now has a generic framework for IPC provided in our [SDK](https://github.com/bitwarden/sdk-internal). This framework is used to provide

Suggesting adding a link to disambiguate from our .NET SDK or SM SDK.

contains additional metadata about the request, such as the request identifier, type, and payload.
The type is used to determine which handler to call for the request, and the payload is the actual
data being sent in the request. The framework will then serialize the response as an
`RpcResponseMessage` and send it back to the consumer using the same topic. The response message
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`RpcResponseMessage` and send it back to the consumer using the same topic. The response message
`RpcResponseMessage` and send it back to the consumer using a topic reserved for responses. The response message

Comment on lines +3 to +4
Bitwarden uses IPC to allow communication between and within certain parts of our clients. The
oldest use-case is the communication between the Bitwarden browser extension and the Bitwarden
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oldest from the perspective of external IPC right? Client internal IPC backdates to the origin of desktop and browser extensions.

@Hinton
Copy link
Member

Hinton commented Jun 19, 2025

Should there be any notes about when to use this framework? intra-client communication such as browser extension content scripts and/or popup/background might not need it.

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.

4 participants