chore: add network extension manager#18
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
617a941 to
300889e
Compare
| @@ -4,16 +4,200 @@ import VPNLib | |||
|
|
|||
| actor Manager { | |||
There was a problem hiding this comment.
I don't think this is worth unit testing, at least right now. We'd need to mock the PTP, the TunnelHandle, the validator, and eventually the XPC speaker, all for a relatively simple abstraction that's mostly error handling.
| // This can't be checked at compile-time, as both Tasks & Continuations can only ever throw | ||
| // a type-erased `Error` |
There was a problem hiding this comment.
This is a little frustrating - theTask type itself is generic on two type parameters, Success and Failure, but the only APIs you can await on a task are either value with an untyped throws or result which returns a type-erased any Error error variant. It's very similar for continuations, the type itself is generic but there's no way to return that typed error.
As an aside, I think I'm becoming more of a fan, for binaries at least, of just having a single opaque error type, propagating it with context, and then just displaying it, ala Go or Rust's anyhow - it's so rare that one or more of the error variants are recoverable, and that the caller needs to know which one.
4922fcf to
7e24349
Compare
|
@coadler Requesting your review here since Spike is OOO, and this is pretty relevant to you. This is the portion of the network extension that communicates over XPC. |
6d7d67a to
8964672
Compare
4d0b3da to
161e5c2
Compare
8964672 to
8b80132
Compare
8ca39b4 to
279f004
Compare

Relates to #2.
Adds the
Managerabstraction that:SignatureValidatoron a downloaded dylibNEPacketTunnelProviderTunnelHandleSpeakerEventually, it'll act as the middleman between the tunnel Speaker and the XPC speaker.