-
Notifications
You must be signed in to change notification settings - Fork 41
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
Implement and compare all 3 connection cookie designs. #77
Conversation
b691d73
to
b6e60c4
Compare
Cool @da2ce7! I like having real speed metrics. Do you want to include all the options in the final version or just record why we choose one of them? |
354774c
to
839c2f1
Compare
@josecelano rebased upon your latest version. :) |
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.
hi @da2ce7
I think we should not include the code we are not going to use and keep only the fastest implementation. We could keep this implementation in a different repo or branch to track why we use the encrypted version.
In general, I like the simplicity of the solution at the higher level. Still, having less abstraction forces us to see more Rust scaffolding code (for type casting) that leads to less readability, in my honest opinion. And also to less testability.
I would be happy with a similar approach but removing test code from production code and making it easier to mock global values when needed, with different values, instead of hardcoded fixed values.
Hello @josecelano
I completely agree, I plan to remove all the other implementations. The reason that I have included all three implementations was:
Yes I removed almost all the abstractions that you provided, as I'm still learning rust, I wish to use the standard library as much as possible. I do not want to re-invent the wheel.
This too I agree with. I'm not sure what sort of abstractions make the best sense yet. I plan to look into the facade design pattern as you recommended. |
Yes, I think that's something I'm still miserably failing. Specially with "A value-to-value conversion that consumes the input value". I need time to get used to those self-killing objects. I have been discussing with @WarmBeer here. |
5e224c4
to
005daa3
Compare
Very nice to see a comparison of all 3 implementations! |
662b941
to
5ef9ec5
Compare
@josecelano I have reimplemented the clock, now it takes the form a Duration, and has Into and From traits implemented for both a local clock, and a fixed clock. |
I will take a look. I've also been thinking about how to keep the global variables in your functions without having two different implementations for tests and production code. I mean things like this: if cfg!(test) { &TEST_BLOWFISH_KEY } else { &BLOWFISH_KEY }; I found this solution. Which is actually an old solution. Solution 2 in this article. The "facade" solution I mentioned is probably the more complex one. |
43f0ab0
to
bd5e9c0
Compare
@josecelano and @WarmBeer I'm now felling that my version of the Clock Module is quite rusty: What do you think? |
@da2ce7 yes, it's much rustier. I've created a PR with my feedback. |
2279f51
to
3973de6
Compare
cbb03d2
to
8d3e2ea
Compare
Requires rebase upon: #85 |
8d3e2ea
to
53e44b7
Compare
53e44b7
to
e8ae013
Compare
hi @da2ce7 are you planning to merge this PR? In general, I'm not fun of adding code that is not used in production but:
|
Closing, current implementation is good for the first release. |
Implemented all three connection cookie formats and compared them in the benchmark: