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

Deprecate add_hash and check_pass functions #151

Open
riverrun opened this issue Jul 7, 2020 · 7 comments
Open

Deprecate add_hash and check_pass functions #151

riverrun opened this issue Jul 7, 2020 · 7 comments
Assignees

Comments

@riverrun
Copy link
Owner

riverrun commented Jul 7, 2020

Problem

In version 4, the add_hash and check_pass functions were added. These functions were intended to be useful convenience functions that would reduce boilerplate code.

Unfortunately, it seems that several developers, especially new users of Comeonin, find these functions (and the resulting api) confusing. In addition, these functions do not seem to be widely used in authentication libraries, and, on reflection, they are probably not as useful as I had hoped.

Solution

I propose to deprecate these two functions in version 5.4, with the intention of removing them in version 6.0 (which will be in 2-3 months' time).

I hope that this will simplify the api and make comeonin, and the related password hashing libraries, easier to use.

Final note

This decision to remove these functions is not final. It also depends on the feedback I get in the next 2-3 months.

@riverrun riverrun self-assigned this Jul 7, 2020
@josevalim
Copy link
Contributor

I agree. :) We don't those in mix phx.gen.auth either!

@riverrun
Copy link
Owner Author

Deprecation notices (documentation) added to version 5.4.0

@JonRowe
Copy link

JonRowe commented Sep 11, 2023

👋 What is the intended replacement? The deprecations do not mention what you should swap them out for? (As an aside I found this rather confusing because the warning comes from Bcrypt but there is no mention of this in their changelog, so prehaps amending the message to at least reference it is a comeonin deprecation)

@josevalim
Copy link
Contributor

@JonRowe the easiest is to look at their current implementations. add_hash in particular is quite straight-forward: https://github.com/riverrun/comeonin/blob/master/lib/comeonin.ex#L32

@JonRowe
Copy link

JonRowe commented Sep 11, 2023

When I eventually found the source of the deprecation I did just vendor the logic from check_pass, but this was a convient one liner it would be nice if something replaced the deprecated functions :)

@datafoo
Copy link

datafoo commented Jan 11, 2024

Coming late to the party but for me check_pass is useful and I do not understand why it was deprecated.

If there was still confusion related to riverrun/argon2_elixir#38, then improving documentation would probably have been better than simply removing useful functions.

Also, why is this issue still open considering the deprecation is effective.

@josevalim
Copy link
Contributor

👍 for closing this issue.

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

No branches or pull requests

4 participants