trilemma-dev/SecureXPC

Add real XPC integration tests

Closed this issue · 8 comments

I would like to contribute an integration test suite, which exercises the real client/server messaging functions. I would like to build this prior to making pretty big changes as part of #17 and #20.

As it turns out, this can be done without the need to spin up XPC or Mach services, using an anonymous XPC connection, whose ends both run within the same process. Quinn "The Eskimo!" documents how to do this with the NSXPCConnection APIs in Testing and Debugging XPC Code With an Anonymous Listener.

I found some more information about anonymous XPC connections in the C XPC APIs in WWDC 2013 - Session 702 - Efficient design with XPC (slides), at around 18:33 to 21:50, slides 47-56.

I've split the work into multiple PRs, each one building upon the previous

@jakaplan Hey Josh,

As you can see, this work involves quite a few different parts. It looks like GitHub doesn't have a very good way to handle dependant work like this, so this is a bit rough.

I've split them into their own PRs. For each one, please:

  1. Review in the order they're listed above
  2. Put comments on the PR that first introduces the effected line(s).
  3. Don't ship the PRs until their dependency has merged, and I've re-based them

I'll do my best to start reviewing these tomorrow night (my time), it'll likely take me a few days to get through them. Things right now are quite busy both personally and professionally.

No worries! I'm just working off a local copy, so you're not blocking anything.

I only wished I could make the review experience a little better. The best I could do was add a "diff" link in the latter 3 PRs, which will filter down the "files" view to only show changes from the novel commits in the PR.

Things right now are quite busy both personally and professionally.

Good luck!

Same situation here, hence my sporadic bursts of contributions followed by silence haha.

Sorry for going off-topic, but I just wanted to thank you both for your work on this. I'm hoping to migrate my XPC code to use SecureXPC and really appreciate the effort going into this. I think a lot of people will benefit from this work over time — it's really needed.

Sorry for going off-topic, but I just wanted to thank you both for your work on this.

Thanks for the kind words! If you have any feedback or questions, don't hesitate to open discussion or topic issues.

I'm hoping to migrate my XPC code to use SecureXPC and really appreciate the effort going into this. I think a lot of people will benefit from this work over time — it's really needed.

If you don't mind me asking, what is your use case for XPC? Always good to understand the diverse ways it's being used to make sure we're considering that as SecureXPC evolves.

@amomchilov I've reviewed #21 and #23. Will prioritize responding to any responses and/or changes you make to those two PRs, while time permitting reviewing the other two.

Have now also reviewed #24 and #25. Thanks for all of you work on these!

@jakaplan Thanks Josh! I've gone through all your review comments. I definitely need to put some more polish into things here, but I think I has some direction with where to go next.

I'll be busy in the following weeks (work trip, moving to a new house, holidays, etc.), so my code contributions will be more sporadic. I'll still be responsive to messages though.

I'll try to flesh out and land #21 this Saturday, at least.