@@ -467,7 +467,7 @@ func New(options *Options) *API {
467
467
codersdk .CryptoKeyFeatureOIDCConvert ,
468
468
)
469
469
if err != nil {
470
- options .Logger .Critical (ctx , "failed to properly instantiate oidc convert signing cache" , slog .Error (err ))
470
+ options .Logger .Fatal (ctx , "failed to properly instantiate oidc convert signing cache" , slog .Error (err ))
471
471
}
472
472
}
473
473
@@ -478,7 +478,7 @@ func New(options *Options) *API {
478
478
codersdk .CryptoKeyFeatureWorkspaceAppsToken ,
479
479
)
480
480
if err != nil {
481
- options .Logger .Critical (ctx , "failed to properly instantiate app signing key cache" , slog .Error (err ))
481
+ options .Logger .Fatal (ctx , "failed to properly instantiate app signing key cache" , slog .Error (err ))
482
482
}
483
483
}
484
484
@@ -489,10 +489,30 @@ func New(options *Options) *API {
489
489
codersdk .CryptoKeyFeatureWorkspaceAppsAPIKey ,
490
490
)
491
491
if err != nil {
492
- options .Logger .Critical (ctx , "failed to properly instantiate app encryption key cache" , slog .Error (err ))
492
+ options .Logger .Fatal (ctx , "failed to properly instantiate app encryption key cache" , slog .Error (err ))
493
493
}
494
494
}
495
495
496
+ if options .CoordinatorResumeTokenProvider == nil {
497
+ fetcher := & cryptokeys.DBFetcher {
498
+ DB : options .Database ,
499
+ }
500
+
501
+ resumeKeycache , err := cryptokeys .NewSigningCache (ctx ,
502
+ options .Logger ,
503
+ fetcher ,
504
+ codersdk .CryptoKeyFeatureTailnetResume ,
505
+ )
506
+ if err != nil {
507
+ options .Logger .Fatal (ctx , "failed to properly instantiate tailnet resume signing cache" , slog .Error (err ))
508
+ }
509
+ options .CoordinatorResumeTokenProvider = tailnet .NewResumeTokenKeyProvider (
510
+ resumeKeycache ,
511
+ options .Clock ,
512
+ tailnet .DefaultResumeTokenExpiry ,
513
+ )
514
+ }
515
+
496
516
// Start a background process that rotates keys. We intentionally start this after the caches
497
517
// are created to force initial requests for a key to populate the caches. This helps catch
498
518
// bugs that may only occur when a key isn't precached in tests and the latency cost is minimal.
0 commit comments