add rate limiting and registration link expiry (#852)

* -add rate limiting to login and register endpoints
-change otp codes to be harder to guess

* allow user to view/change login and registration rate limiting value

* - add registration link expiry
- make it harder for attackers to discover usernames
- disallow empty usernames
- disallow short passwords
- move "generate registration link" button to the bottom to try and make it clearer that it wont update settings

* create "auth" config subsection

* dont show rate limit and registration timeout inputs unless user is admin

* blackify

* fix mistakes in expiration logic

* fix missed changes to use method field of the auth structure

* fix registration_link_timeout input not present when user is admin

Co-authored-by: benk10 <ben.kaufman10@gmail.com>
This commit is contained in:
djpnewton 2021-01-13 20:23:31 +13:00 committed by GitHub
parent ed50db3b8f
commit 18b2ad3f3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 199 additions and 69 deletions

View file

@ -254,7 +254,10 @@ Simply fill in https://blockstream.info/ to use that block explorer, but you wil
Check the .specter-folder in your Homefolder (or on your mynode/raspiblitz/...). There is a file called `config.json` in there which has a line like this:
```
"auth":"somethingInHere"
"auth": {
"method": "somethingInHere",
...
},
```
Depending on "what's written in `somethingInHere`:
* If it's `rpcpasswordaspin`, you can lookup the password in your `bitcoin.conf`-file in a line like `rpcpassword=YourPasswordHere`