diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-03 10:45:50 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-03 10:45:50 +0200 |
| commit | 2de007f9ef8ae2724b9fbe2808ee25cbfe4ca876 (patch) | |
| tree | f91a742d682928ef12eb5a011411c3bb0ef16a02 /internal/ssh/server/authkeystore.go | |
| parent | 6d50a475114699911f2ebe1376915cd8317f1881 (diff) | |
feat(config): add auth-key CLI and server cache settings
Diffstat (limited to 'internal/ssh/server/authkeystore.go')
| -rw-r--r-- | internal/ssh/server/authkeystore.go | 5 |
1 files changed, 5 insertions, 0 deletions
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) |
