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

Closed
riverrun opened this issue Jul 7, 2020 · 9 comments
Closed

Deprecate add_hash and check_pass functions #151

riverrun opened this issue Jul 7, 2020 · 9 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.

@riverrun riverrun closed this as completed Oct 4, 2024
@egeersoz
Copy link

Hi there. I started getting these messages after running mix deps.get and found myself here. I agree with datafoo and I do not understand why this issue was closed, considering:

  1. That some users find these functions confusing should not be sufficient reason to remove them, since other users might (and in fact do) find them useful. For a widely used library like this, there needs to be a much higher bar for deprecations.
  2. No proper replacement is recommended, either in the deprecation message or in the docs. In fact, the wiki still suggests using add_hash (and the linked example is a 404). If new users find these functions confusing, imagine how much more confused they will be when they follow the outdated wiki and get the deprecation errors. Vendoring the code from the library is not a solution IMHO.

@josevalim
Copy link
Contributor

I submitted a PR to include the deprecation messages: #162 - I have also updated the wiki.

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

5 participants