summaryrefslogtreecommitdiff
path: root/lib/chessh/ssh/server_key.ex
diff options
context:
space:
mode:
authorSimponic <loganhunt@simponic.xyz>2022-12-30 05:46:35 -0700
committerSimponic <loganhunt@simponic.xyz>2022-12-30 05:46:35 -0700
commit42425b02260d279cd9c12fb3e625282979b9e308 (patch)
tree0412bf9f39d44266cff94082c499e44e5f6e60f5 /lib/chessh/ssh/server_key.ex
parent60eea1b4ed65bc7cfce1e383dac6de9d004540eb (diff)
downloadchessh-42425b02260d279cd9c12fb3e625282979b9e308.tar.gz
chessh-42425b02260d279cd9c12fb3e625282979b9e308.zip
Add scalable session thresholds
Diffstat (limited to 'lib/chessh/ssh/server_key.ex')
-rw-r--r--lib/chessh/ssh/server_key.ex7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/chessh/ssh/server_key.ex b/lib/chessh/ssh/server_key.ex
index 72a4fbb..5252624 100644
--- a/lib/chessh/ssh/server_key.ex
+++ b/lib/chessh/ssh/server_key.ex
@@ -1,9 +1,14 @@
defmodule Chessh.SSH.ServerKey do
+ alias Chessh.PlayerSession
alias Chessh.Auth.KeyAuthenticator
+
@behaviour :ssh_server_key_api
def is_auth_key(key, username, _daemon_options) do
- KeyAuthenticator.authenticate(username, key)
+ PlayerSession.player_within_concurrent_sessions_and_satisfies(
+ username,
+ &KeyAuthenticator.authenticate(&1, key)
+ )
end
def host_key(algorithm, daemon_options) do