-
-
Notifications
You must be signed in to change notification settings - Fork 4
Add pre-built tasks #165
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
Add pre-built tasks #165
Conversation
Pull Request Test Coverage Report for Build 8936654537Details
💛 - Coveralls |
soywod
left a comment
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.
Here some comments to give more context. I have the following questions:
-
In this PR I missed
STARTTLSrelated stuff. I tried to set it up but I have hard time to do so because ofAnyStreamholding adyn Stream. Here a concrete example: I create aTcpStream, then wrap it into aAnyStream. From there I can create aClientFlowand aScheduler. After the greetings, ifSTARTTLSis supported by the server, I need to take back the initialTcpStreamin order to upgrade it to aTlsStream. Is the SansIO refactor will have an impact on this? -
Regarding SansIO, how is the state of the refactor? Should I wait for it, then re-open a PR?
-
Would you like me to split now the PR into small ones? One first with the core, then few others (one per task)?
|
|
||
| if let Some(event) = self.progress_receive().await? { | ||
| return Ok(event); | ||
| if self.is_waiting_for_idle_done_set() { |
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 the uggliest part of the PR. For the IDLE command to work with the current flow, I acted the same way the imap crate does: every time an IDLE event is received (or a timeout), we exit the IDLE mode. Lib consumers need to take care of the loop.
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.
Interesting. No strong opinions yet, but some thoughts:
- Not sure whether we should add this to
ClientFlowor burden the user ofClientFlowwith implementing this feature. I don't know the pros and cons yet. Or can we implement this as a task? - Regarding the SansIO refactoring, I would prefer to treat time as an input and somehow pass it into
ClientFlow. This would also make testing more feasible. - If we want to implement this as a feature of
ClientFlow, we should do this in a separate PR and add documentation andflow-testtest cases.
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.
Alright, then I will wait for the SansIO refactoring, and submit a dedicated PR.
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.
Okay! If you want then I can work on this, too.
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 see that the new implem with SansIO reads and writes in parallel, so I'm curious to give it a try and see how it behaves.
|
Hey Clement! Thanks for the PR! :-) I'm still not home but just a few thoughts to (hopefully) unblock you a bit. I think that we have roughly a few work packages here: Tasks that can already be added, tasks that need changes (IDLE), (START)TLS, and other improvements. To better focus on any part, we could try to split this PR accordingly and first try to get all things in that are unrelated to SansIO. Most tasks, I guess?
Sounds good! Feel free to PR multiple tasks at once when you feel there should not be much discussion needed. We should also treat STARTTLS as a connection "prefix", and only progress the IMAP protocol to the point where both parties start sending TLS data (doing (almost) no parsing). We don't even need to handle capabilities for STARTTLS:
This way, we have an isolated STARTTLS prefix and can proceed exactly as with implicit TLS. This would be secure by design. More in section 8 https://www.usenix.org/conference/usenixsecurity21/presentation/poddebniak. Jakob is currently working on TLS. I would suggest to wait a few more days before coming back to it. PS: I kinda like splitting and moving commits around :-) So, if you like, I could give it a try early next week. Still, feel free to already move this as much forward as you want! |
|
Awesome, then I will open small PRs until you come back.
We should also treat STARTTLS as a connection "prefix", and only
progress the IMAP protocol to the point where both parties start
sending TLS data (doing (almost) no parsing).
It is more clear now, thank you for the post as well, really
interesting.
Jakob is currently working on TLS. I would suggest to wait a few more
days before coming back to it.
I will wait for Jakob's work then.
Thanks for your feedback!
|
|
fyi: SansIO is ready for review, see #158 |
|
fyi: SansIO is ready for review
Awesome, I will try to integrate my core changes from your branch to
see. As soon as it is merged, I will open the first PR (and close this
one).
|
|
Thanks! :-) Lot's of progress happening, great :-) |
I open the PR so you can already have a look at it, but I plan to leave comments here and there to explain the changes.