GithubHelp home page GithubHelp logo

mattevans / pwned-passwords Goto Github PK

View Code? Open in Web Editor NEW
86.0 4.0 7.0 35 KB

๐Ÿ”Go client library for checking values against compromised HIBP Pwned Passwords

License: MIT License

Go 100.00%
golang pwned-passwords hibp passwords password-safety

pwned-passwords's People

Contributors

hartzell avatar mattevans avatar williamnharvey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pwned-passwords's Issues

use a custom httpclient instead of http.DefaultClient to add a timeout

I just read, Troy Hunt blog post about Pwned Passwords, wanted to use it and saw your lib : great job you will save me time.
However I did some code review and saw you are using http.DefaultClient as http client : be careful that DefaultClient has no timeout by default so it make your lib dependant on https://api.pwnedpasswords.com server response. Although pwnedpassword is a well backed API and it will not hang request every day I think it's preferable to avoid the risk and use a custom http.client just to set a timeout.
See this and cloudflare guide to timeout.

I suggest a 3 minutes timeout, because this is the value that may be added to the http.DefaultClient in future Go release
... or maybe add the possibility to pass the wanted timeout value to hibp.NewClient()

Provide the number of times a particular password was pwned

It would be nice to have the number of times a password was pwned returned rather than just a true/false value as to whether it was actually pwned.

Then we could add an IsPwned method to the PwnedStore struct to allow a user to use the old behaviour if this was desired.

I'm happy to make this change if it's something you would accept?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.