brycx/checkpwn

Make checkpwn usable as a library

gsurrel opened this issue · 6 comments

Hi,

I'm building a password checker, and this seems to be the right piece of code I would ned, but it is a binary rather than a library. Are there any chances it can turn to a library, too?

brycx commented

Hi @gsurrel,

Yes, this is something that could be done. I've talked about it previously with @mdtro, who also requested this a while back. IIRC there are some crates on crates.io that also do what checkpwn does, but as a library. Have you seen them already?

If you have and still want checkpwn to become available as a library (would be a new checkpwn-lib crate), I'm totally fine with that. Though this is not my use case for checkpwn and therefor, not top priority for me to get arranged. Meaning, I won't be able to dedicate all my time to this. Is this change something you're interested in contributing to perhaps?

Hello,

I've actually copied-pasted the code I needed in my project KeePwn, as I did not find any other library for querying HIBP.

Even though that was just a one-off itch I scratched, it would be better to have a cleaner and proper integration by having checkpwn as a library crate. I've never done that, it would be a good excuse to level up a little :)

Let's see if I get the time and motivation to do it!

mdtro commented

I think you stumbled upon checkpwn for the same reasons I did. If you're up for it, I'd be interesting in collaborating to get a library built for this!

I just checked crates.io for what @brycx has remembered, and the "competition" is mostly abadonware, except for wisespace-io/pwned-rs , but hey the more options, the better

brycx commented

@gsurrel @mdtro @mardab

There is now an alpha release of a library version of this crate: https://crates.io/crates/checkpwn_lib

You all seemed interested in this, so perhaps you can take a look to see if the API fits your needs or if there's anything else you'd like changed?

checkpwn will start using checkpwn_lib once the first non-alpha version is released.

brycx commented

First release of the library is finalized and this utility has changed to use that.