✨ 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:
@@ -701,6 +701,13 @@ func (s *Server) Run() error {
|
||||
ongoingCtx, stopOngoingGracefully := context.WithCancel(context.Background())
|
||||
defer stopOngoingGracefully()
|
||||
|
||||
// Start the JWT secret cleanup loop (ADR-0021). The loop runs until rootCtx
|
||||
// is cancelled (graceful shutdown), removing non-primary secrets whose
|
||||
// ExpiresAt is in the past.
|
||||
if s.userService != nil {
|
||||
s.userService.StartJWTSecretCleanupLoop(rootCtx, s.config.GetJWTSecretCleanupInterval())
|
||||
}
|
||||
|
||||
// Create HTTP server
|
||||
log.Trace().Str("address", s.config.GetServerAddress()).Msg("Server running")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user