summaryrefslogtreecommitdiff
path: root/test/ssh/ssh_auth_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/ssh/ssh_auth_test.exs')
-rw-r--r--test/ssh/ssh_auth_test.exs27
1 files changed, 7 insertions, 20 deletions
diff --git a/test/ssh/ssh_auth_test.exs b/test/ssh/ssh_auth_test.exs
index c3ced20..cb07259 100644
--- a/test/ssh/ssh_auth_test.exs
+++ b/test/ssh/ssh_auth_test.exs
@@ -29,26 +29,21 @@ defmodule Chessh.SSH.AuthTest do
:ok
end
- test "Fails to authenticate after configured max password attempt" do
+ test "Password attempts are rate limited" do
assert :disconnect ==
Enum.reduce(
- 1..Application.fetch_env!(:chessh, :max_password_attempts),
- %{attempts: 0},
- fn acc, _ ->
- case Chessh.SSH.Daemon.pwd_authenticate(
+ 1..Application.fetch_env!(:chessh, RateLimits, :jail_threshold),
+ fn _, _ ->
+ Chessh.SSH.Daemon.pwd_authenticate(
@valid_user.username,
'wrong_password',
- @localhost,
- acc
+ @localhost
) do
- {false, state} -> state
- x -> x
- end
end
)
end
- test "INTEGRATION TEST - Can ssh into daemon with password or public key" do
+ test "INTEGRATION - Can ssh into daemon with password or public key" do
{:ok, sup} = Task.Supervisor.start_link()
test_pid = self()
@@ -80,15 +75,7 @@ defmodule Chessh.SSH.AuthTest do
assert_receive(:connected_via_public_key, 500)
end
- test "Hosts are rate limited via password attempts" do
- :ok
- end
-
- test "Hosts are also rate limited with public keys" do
- :ok
- end
-
- test "User cannot have more than one current session" do
+ test "INTEGRATION - User cannot have more than specified concurrent sessions" do
:ok
end
end