@@ -63,13 +63,8 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
63
63
64
64
ctx , cancelFunc := context .WithCancel (ctx )
65
65
66
- if options .PrimaryExternalTokenEncryption != nil {
67
- cs := make ([]dbcrypt.Cipher , 0 )
68
- cs = append (cs , options .PrimaryExternalTokenEncryption )
69
- if options .SecondaryExternalTokenEncryption != nil {
70
- cs = append (cs , options .SecondaryExternalTokenEncryption )
71
- }
72
- cryptDB , err := dbcrypt .New (ctx , options .Database , dbcrypt .NewCiphers (cs ... ))
66
+ if options .ExternalTokenEncryption != nil {
67
+ cryptDB , err := dbcrypt .New (ctx , options .Database , options .ExternalTokenEncryption )
73
68
if err != nil {
74
69
cancelFunc ()
75
70
return nil , xerrors .Errorf ("init dbcrypt: %w" , err )
@@ -379,9 +374,7 @@ type Options struct {
379
374
BrowserOnly bool
380
375
SCIMAPIKey []byte
381
376
382
- // TODO: wire these up properly
383
- PrimaryExternalTokenEncryption dbcrypt.Cipher
384
- SecondaryExternalTokenEncryption dbcrypt.Cipher
377
+ ExternalTokenEncryption * dbcrypt.Ciphers
385
378
386
379
// Used for high availability.
387
380
ReplicaSyncUpdateInterval time.Duration
@@ -449,7 +442,7 @@ func (api *API) updateEntitlements(ctx context.Context) error {
449
442
codersdk .FeatureHighAvailability : api .DERPServerRelayAddress != "" ,
450
443
codersdk .FeatureMultipleGitAuth : len (api .GitAuthConfigs ) > 1 ,
451
444
codersdk .FeatureTemplateRBAC : api .RBAC ,
452
- codersdk .FeatureExternalTokenEncryption : api .PrimaryExternalTokenEncryption != nil ,
445
+ codersdk .FeatureExternalTokenEncryption : api .ExternalTokenEncryption != nil ,
453
446
codersdk .FeatureExternalProvisionerDaemons : true ,
454
447
codersdk .FeatureAdvancedTemplateScheduling : true ,
455
448
// FeatureTemplateRestartRequirement depends on
0 commit comments