Skip to content
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

Merged

Conversation

mgeisler
Copy link
Contributor

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, 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.

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.

@mgeisler mgeisler requested a review from a team as a code owner January 12, 2025 22:54
@mgeisler mgeisler force-pushed the x509-identity-provider-less-public-methods branch from 4854a94 to 7f7cd2c Compare January 13, 2025 09:06
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.
@mgeisler mgeisler force-pushed the x509-identity-provider-less-public-methods branch from 7f7cd2c to 825ca0e Compare January 13, 2025 09:22
@mgeisler mgeisler changed the title Remove unnecessary public methods from X509IdentityProvider Remove overloaded public methods from X509IdentityProvider Jan 13, 2025
@mgeisler
Copy link
Contributor Author

The "Native / LintAndFormatting (pull_request)" failure seems unrelated — it's about an unexpected lint, which became a warning recently.

@mulmarta
Copy link
Contributor

I fixed the warnings in #237 - we only fixed them on 1.x-main and forgot main

@mgeisler
Copy link
Contributor Author

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 😄

@tomleavy tomleavy merged commit 527675b into awslabs:main Jan 14, 2025
17 checks passed
@mgeisler
Copy link
Contributor Author

By the way, do you plan on merging the 1.x-main branch into main later? I'm asking because I wonder how you will ensure changes like this make it to the 1.x release?

@tomleavy
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants