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

refactor: Rework module and feature flag for better v4/v4.2 split #13

Merged
merged 9 commits into from
Apr 18, 2024

Conversation

Bluefinger
Copy link
Owner

@Bluefinger Bluefinger commented Apr 17, 2024

In order to avoid feature flag resolution issues, I've gone and reworked the structure of the project to split the two implementations into separate modules. By default for v0.2 of this crate, going forward the chosen implementation will be Final v4.2, which is meant to be more robust. The legacy final v4 will be behind a feature flag legacy_v4, but enabling that will only expose the module, no longer overriding the implementation output.

To prevent misuse of certain features such as secret generation, I reworked the methods to output structs instead of plain arrays, allowing me to type into the methods that the hashers can only be seeded with the correct secrets type, so you can't use the legacy version to seed the secret of the default hasher.

I'm sure there can be some further deduplication done, but I cba for this part, and probably could be done as a follow-up should there be the need for it.

Closes #10

@Bluefinger Bluefinger added the enhancement New feature or request label Apr 17, 2024
@Lymia
Copy link
Contributor

Lymia commented Apr 18, 2024

I don't see anything obviously wrong with this.

@Bluefinger
Copy link
Owner Author

I don't see anything obviously wrong with this.

That's as good enough vote of confidence as I'll take 😄 I'll probably merge this as is after I've done a few more pass-throughs to ensure I haven't missed anything

@Bluefinger Bluefinger merged commit 336b380 into main Apr 18, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v4_2 is a misuse of Cargo features.
2 participants