From 2de007f9ef8ae2724b9fbe2808ee25cbfe4ca876 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 3 Mar 2026 10:45:50 +0200 Subject: feat(config): add auth-key CLI and server cache settings --- internal/ssh/server/authkeystore.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'internal/ssh/server/authkeystore.go') diff --git a/internal/ssh/server/authkeystore.go b/internal/ssh/server/authkeystore.go index 8e26127..c4b89fe 100644 --- a/internal/ssh/server/authkeystore.go +++ b/internal/ssh/server/authkeystore.go @@ -33,6 +33,11 @@ func ServerAuthKeyStore() *AuthKeyStore { return authKeyStore } +// ConfigureAuthKeyStore reinitializes the process-wide auth key cache using config values. +func ConfigureAuthKeyStore(authKeyTTLSeconds, authKeyMaxPerUser int) { + authKeyStore = NewAuthKeyStore(time.Duration(authKeyTTLSeconds)*time.Second, authKeyMaxPerUser) +} + // NewAuthKeyStore builds a thread-safe auth key store. func NewAuthKeyStore(ttl time.Duration, maxKeysPerUser int) *AuthKeyStore { return newAuthKeyStoreWithClock(ttl, maxKeysPerUser, time.Now) -- cgit v1.2.3