troyhunt / password-purgatory-api

This is the Cloudflare Worker public API for deliberately making password creation hell
Apache License 2.0
143 stars 41 forks source link

Rate ridiculousness of checks and use lowest ratings first #29

Closed FizzBuzz791 closed 2 years ago

FizzBuzz791 commented 2 years ago

Here's a crack at infuriation levels. The low ones are quite obvious, the rest are just a thumb-suck. It's not pretty, but I'm fairly sure it gets the job done.

FizzBuzz791 commented 2 years ago

This is a follow-up to #19

BobForCat commented 2 years ago

Nice, if accepted should me merged fast so we can all update our PR to match that new code :)

troyhunt commented 2 years ago

Hey @FizzBuzz791, I love this! Presently not compiling though as "Beelzebub.getChecks is not a function". If you could take a look at that then I'd love to take the PR and roll it into main.

troyhunt commented 2 years ago

One remaining conflict since I took another PR 🙂 Sort that then I'll merge.

FizzBuzz791 commented 2 years ago

Oops! I think it's good now @troyhunt

troyhunt commented 2 years ago

Uh, I took that too hastily:

"Beelzebub.getValidChecks is not a function"

Just running out for lunch, if you have Wrangler you should see the problem and can push a fix, otherwise I'll sort it later.

FizzBuzz791 commented 2 years ago

Sorry, I'm not great with pure-JS. I think I'm missing the static prefix in each of the functions (checks, getValidChecks and infuriate).

I tried testing with the wrangler cli and the preview service and the error changed when I added static, but now it's telling me password is not defined, I think that's just because I'm passing the wrong request; localhost:8787?password=1234

troyhunt commented 2 years ago

Looks like you're missing a forward slash, here's what works for me: http://127.0.0.1:8787/?password=foo

I've just reverted the merge for now so no rush.