Add /allowlist command (#399)
authormik2k2 <44849223+mik2k2@users.noreply.github.com>
Thu, 6 Jan 2022 14:09:51 +0000 (15:09 +0100)
committerGitHub <noreply@github.com>
Thu, 6 Jan 2022 14:09:51 +0000 (09:09 -0500)
commit621ae1b0d3df6297c97f05588f7fa5ca92131a95
tree996191bb2b7b8b0a8d74c9626fea3c9d45458eda
parent84bc5c76dda26d3bef256dc27bd35fee5d99df0b
Add /allowlist command (#399)

* move loading whitelist+ops from file to auth and save the loaded files fro reloading

* add /whitelist command with lots of open questions

* add test for /whitelist

* gofmt

* use the same auth (the tests don't seem to care, but htis is more right)

* mutex whitelistMode and remove some deferred TODOs

* s/whitelist/allowlist/ (user-facing); move helper functions outside the handler function

* check for ops in Auth.CheckPublicKey and move /allowlist handling to helper functions

* possibly fix the test timeout in HostNameCollision

* Revert "possibly fix the test timeout in HostNameCollision" (didn't work)

This reverts commit 664dbb0976f8f10ea7a673950a879591c2e7c320.

* managed to reproduce the timeout after updating, hopefully it's the same one

* remove some unimportant TODOs; add a message when reverify kicks people; add a reverify test

* add client connection with key; add test for /allowlist import AGE

* hopefully make test less racy

* s/whitelist/allowlist/

* fix crash on specifying exactly one more -v flag than the max level

* use a key loader function to move file reading out of auth

* add loader to allowlist test

* minor message changes

* add --whitelist with a warning; update tests for messages

* apparently, we have another prefix

* check names directly on the User objects in TestHostNameCollision

* not allowlisted -> not allowed

* small message change

* update test
auth.go
auth_test.go
cmd/ssh-chat/cmd.go
host.go
host_test.go
sshd/client.go
sshd/net_test.go