refactor: complete conversion of log calls to slog (#787)

This commit is contained in:
Alessandro (Ale) Segala
2025-07-27 06:34:23 +02:00
committed by GitHub
parent 78266e3e4c
commit 42a861d206
22 changed files with 142 additions and 88 deletions

View File

@@ -30,7 +30,10 @@ func init() {
Use: "key-rotate",
Short: "Generates a new token signing key and replaces the current one",
RunE: func(cmd *cobra.Command, args []string) error {
db := bootstrap.NewDatabase()
db, err := bootstrap.NewDatabase()
if err != nil {
return err
}
return keyRotate(cmd.Context(), flags, db, &common.EnvConfig)
},
@@ -80,7 +83,10 @@ func keyRotate(ctx context.Context, flags keyRotateFlags, db *gorm.DB, envConfig
}
// Init the services we need
appConfigService := service.NewAppConfigService(ctx, db)
appConfigService, err := service.NewAppConfigService(ctx, db)
if err != nil {
return fmt.Errorf("failed to create app config service: %w", err)
}
// Get the key provider
keyProvider, err := jwkutils.GetKeyProvider(db, envConfig, appConfigService.GetDbConfig().InstanceID.Value)