summaryrefslogtreecommitdiff
path: root/internal/server/handlers/authkeycommand_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-08 09:32:13 +0200
committerPaul Buetow <paul@buetow.org>2026-03-08 09:32:13 +0200
commit91b83a9ffcabf7264888cf84b95f08b8cc88c832 (patch)
tree009b7bded9db99dcb02e3a55314c4b624304bdba /internal/server/handlers/authkeycommand_test.go
parent2007054d77b5bc40c943a9fd64874e850c750f2d (diff)
task: scope auth key dependencies to server instances (task 375)
Diffstat (limited to 'internal/server/handlers/authkeycommand_test.go')
-rw-r--r--internal/server/handlers/authkeycommand_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/server/handlers/authkeycommand_test.go b/internal/server/handlers/authkeycommand_test.go
index f510038..a454e94 100644
--- a/internal/server/handlers/authkeycommand_test.go
+++ b/internal/server/handlers/authkeycommand_test.go
@@ -33,11 +33,10 @@ func TestHandleAuthKeyCommandSuccess(t *testing.T) {
if message := readServerMessage(t, handler.serverMessages); message != "AUTHKEY OK\n" {
t.Fatalf("Unexpected response: %q", message)
}
- if !sshserver.AuthKeys().Has(handler.user.Name, key) {
+ if !handler.authKeyStore.Has(handler.user.Name, key) {
t.Fatalf("Expected key to be stored for user")
}
-
- sshserver.AuthKeys().Remove(handler.user.Name, key)
+ handler.authKeyStore.Remove(handler.user.Name, key)
}
func TestHandleAuthKeyCommandFeatureDisabled(t *testing.T) {
@@ -51,7 +50,7 @@ func TestHandleAuthKeyCommandFeatureDisabled(t *testing.T) {
if message := readServerMessage(t, handler.serverMessages); message != "AUTHKEY ERR feature disabled\n" {
t.Fatalf("Unexpected response: %q", message)
}
- if sshserver.AuthKeys().Has(handler.user.Name, key) {
+ if handler.authKeyStore.Has(handler.user.Name, key) {
t.Fatalf("Expected no key to be stored while feature is disabled")
}
}
@@ -84,6 +83,7 @@ func newAuthKeyTestHandler(userName string, authKeyEnabled bool) *ServerHandler
serverCfg: &config.ServerConfig{
AuthKeyEnabled: authKeyEnabled,
},
+ authKeyStore: sshserver.NewAuthKeyStore(time.Hour, 5),
}
}