-
Notifications
You must be signed in to change notification settings - Fork 18
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
base: main
Are you sure you want to change the base?
Add IPC deep dive #616
Conversation
Deploying contributing-docs with
|
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 |
New Issues (1)Checkmarx found the following issues in this Pull Request
|
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Request/Response | |
### Request / Response |
@enduml | ||
``` | ||
|
||
### Request/Response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Request/Response | |
### Request / Response |
|
||
### Request/Response | ||
|
||
The request/response functionality is built on top of the publish/subscribe message format by using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`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 |
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 |
There was a problem hiding this comment.
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.
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. |
🎟️ Tracking
📔 Objective
Add high level documentation of the IPC framework
⏰ Reminders before review
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 confirmedissue 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