-
Notifications
You must be signed in to change notification settings - Fork 0
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Manager
abstraction that:SignatureValidator
on a downloaded dylibNEPacketTunnelProvider
TunnelHandle
Speaker
Eventually, it'll act as the middleman between the tunnel Speaker and the XPC speaker.