✨ feat(auth): JWT secret retention policy + automatic cleanup loop (ADR-0021) (#41)
Co-authored-by: Gabriel Radureau <arcodange@gmail.com> Co-committed-by: Gabriel Radureau <arcodange@gmail.com>
This commit was merged in pull request #41.
This commit is contained in:
@@ -218,6 +218,18 @@ func (s *userServiceImpl) ResetJWTSecrets() {
|
||||
s.secretManager.Reset(s.jwtConfig.Secret)
|
||||
}
|
||||
|
||||
// StartJWTSecretCleanupLoop delegates to the underlying secret manager to
|
||||
// start the periodic cleanup goroutine described in ADR-0021.
|
||||
func (s *userServiceImpl) StartJWTSecretCleanupLoop(ctx context.Context, interval time.Duration) {
|
||||
s.secretManager.StartCleanupLoop(ctx, interval)
|
||||
}
|
||||
|
||||
// RemoveExpiredJWTSecrets triggers an immediate cleanup pass via the
|
||||
// underlying secret manager. Returns the count of removed expired secrets.
|
||||
func (s *userServiceImpl) RemoveExpiredJWTSecrets() int {
|
||||
return s.secretManager.RemoveExpiredSecrets()
|
||||
}
|
||||
|
||||
// UserExists checks if a user exists by username
|
||||
func (s *userServiceImpl) UserExists(ctx context.Context, username string) (bool, error) {
|
||||
return s.repo.UserExists(ctx, username)
|
||||
|
||||
Reference in New Issue
Block a user