-
Notifications
You must be signed in to change notification settings - Fork 24
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
Remove overloaded public methods from X509IdentityProvider #236
Remove overloaded public methods from X509IdentityProvider #236
Conversation
4854a94
to
7f7cd2c
Compare
While using a `X509IdentityProvider` in a generic context, I discovered that it has a few methods which I found confusing: - X509IdentityProvider::identity takes 1 argument, but IdentityProvider::identity takes 2 arguments! - X509IdentityProvider::valid_successor takes 2 arguments, but IdentityProvider::valid_successor takes 3 arguments! I ended up solving this with the fully-qualified `<Type as Trait>::method` syntax, but I think the situation can be avoided all together by just implementing the trait directly.
The previous commit removed a few public methods, implying that we need a SemVer breaking change. Since the types are re-exported in mls-rs, I also bumped the version of that crate.
7f7cd2c
to
825ca0e
Compare
The "Native / LintAndFormatting (pull_request)" failure seems unrelated — it's about an unexpected lint, which became a warning recently. |
I fixed the warnings in #237 - we only fixed them on 1.x-main and forgot main |
Thanks for merging the fix back! I should have done that, but got distracted today 😄 |
By the way, do you plan on merging the |
Yeah that's the idea. Once we have enough for alpha 1 we will merge and create a branch off right before that for bug fixes on 0.x |
Description of changes:
While using a
X509IdentityProvider
in a generic context, I discovered that it has a few methods which I found confusing:X509IdentityProvider::identity
takes 1 argument, butIdentityProvider::identity
takes 2 arguments!X509IdentityProvider::valid_successor
takes 2 arguments, butIdentityProvider::valid_successor
takes 3 arguments!I ended up solving this with the fully-qualified
<Type as Trait>::method
syntax, but I think the situation can be avoided all together by just implementing the trait directly.Please let me know what you think of this — I think it's simpler without the "double" implementations, but perhaps I'm missing something.
Call-outs:
This is a SemVer breaking change, so I've bumped the version number of mls-rs-identity-x509. Since the type is re-exported by mls-rs, I bumped its version number as well.
Testing:
Tests we updated to pass in the necessary parameters, even though we know they are not used in the tests.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT license.