@@ -71,7 +71,7 @@ func TestBasicNotificationRoundtrip(t *testing.T) {
71
71
}
72
72
73
73
// nolint:gocritic // Unit test.
74
- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
74
+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
75
75
store , _ := dbtestutil .NewDB (t )
76
76
logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
77
77
method := database .NotificationMethodSmtp
@@ -135,7 +135,7 @@ func TestSMTPDispatch(t *testing.T) {
135
135
// SETUP
136
136
137
137
// nolint:gocritic // Unit test.
138
- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
138
+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
139
139
store , _ := dbtestutil .NewDB (t )
140
140
logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
141
141
@@ -197,7 +197,7 @@ func TestWebhookDispatch(t *testing.T) {
197
197
// SETUP
198
198
199
199
// nolint:gocritic // Unit test.
200
- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
200
+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
201
201
store , _ := dbtestutil .NewDB (t )
202
202
logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
203
203
@@ -281,7 +281,7 @@ func TestBackpressure(t *testing.T) {
281
281
store , _ := dbtestutil .NewDB (t )
282
282
logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
283
283
// nolint:gocritic // Unit test.
284
- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitShort ))
284
+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitShort ))
285
285
286
286
const method = database .NotificationMethodWebhook
287
287
cfg := defaultNotificationsConfig (method )
@@ -407,7 +407,7 @@ func TestRetries(t *testing.T) {
407
407
408
408
const maxAttempts = 3
409
409
// nolint:gocritic // Unit test.
410
- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
410
+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
411
411
store , _ := dbtestutil .NewDB (t )
412
412
logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
413
413
@@ -501,7 +501,7 @@ func TestExpiredLeaseIsRequeued(t *testing.T) {
501
501
}
502
502
503
503
// nolint:gocritic // Unit test.
504
- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
504
+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
505
505
store , _ := dbtestutil .NewDB (t )
506
506
logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
507
507
@@ -521,7 +521,7 @@ func TestExpiredLeaseIsRequeued(t *testing.T) {
521
521
noopInterceptor := newNoopStoreSyncer (store )
522
522
523
523
// nolint:gocritic // Unit test.
524
- mgrCtx , cancelManagerCtx := context .WithCancel (dbauthz .AsSystemRestricted (context .Background ()))
524
+ mgrCtx , cancelManagerCtx := context .WithCancel (dbauthz .AsNotifier (context .Background ()))
525
525
t .Cleanup (cancelManagerCtx )
526
526
527
527
mgr , err := notifications .NewManager (cfg , noopInterceptor , defaultHelpers (), createMetrics (), logger .Named ("manager" ))
@@ -626,7 +626,7 @@ func TestNotifierPaused(t *testing.T) {
626
626
// Setup.
627
627
628
628
// nolint:gocritic // Unit test.
629
- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
629
+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
630
630
store , _ := dbtestutil .NewDB (t )
631
631
logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
632
632
@@ -1081,7 +1081,7 @@ func TestNotificationTemplates_Golden(t *testing.T) {
1081
1081
}()
1082
1082
1083
1083
// nolint:gocritic // Unit test.
1084
- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
1084
+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
1085
1085
1086
1086
// smtp config shared between client and server
1087
1087
smtpConfig := codersdk.NotificationsEmailConfig {
@@ -1160,12 +1160,14 @@ func TestNotificationTemplates_Golden(t *testing.T) {
1160
1160
// as appearance changes are enterprise features and we do not want to mix those
1161
1161
// can't use the api
1162
1162
if tc .appName != "" {
1163
- err = (* db ).UpsertApplicationName (ctx , "Custom Application" )
1163
+ // nolint:gocritic // Unit test.
1164
+ err = (* db ).UpsertApplicationName (dbauthz .AsSystemRestricted (ctx ), "Custom Application" )
1164
1165
require .NoError (t , err )
1165
1166
}
1166
1167
1167
1168
if tc .logoURL != "" {
1168
- err = (* db ).UpsertLogoURL (ctx , "https://custom.application/logo.png" )
1169
+ // nolint:gocritic // Unit test.
1170
+ err = (* db ).UpsertLogoURL (dbauthz .AsSystemRestricted (ctx ), "https://custom.application/logo.png" )
1169
1171
require .NoError (t , err )
1170
1172
}
1171
1173
@@ -1248,7 +1250,7 @@ func TestNotificationTemplates_Golden(t *testing.T) {
1248
1250
}()
1249
1251
1250
1252
// nolint:gocritic // Unit test.
1251
- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
1253
+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
1252
1254
1253
1255
// Spin up the mock webhook server
1254
1256
var body []byte
@@ -1376,7 +1378,7 @@ func TestDisabledBeforeEnqueue(t *testing.T) {
1376
1378
}
1377
1379
1378
1380
// nolint:gocritic // Unit test.
1379
- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
1381
+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
1380
1382
store , _ := dbtestutil .NewDB (t )
1381
1383
logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
1382
1384
@@ -1412,7 +1414,7 @@ func TestDisabledAfterEnqueue(t *testing.T) {
1412
1414
}
1413
1415
1414
1416
// nolint:gocritic // Unit test.
1415
- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
1417
+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
1416
1418
store , _ := dbtestutil .NewDB (t )
1417
1419
logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
1418
1420
@@ -1469,7 +1471,7 @@ func TestCustomNotificationMethod(t *testing.T) {
1469
1471
}
1470
1472
1471
1473
// nolint:gocritic // Unit test.
1472
- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
1474
+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
1473
1475
store , _ := dbtestutil .NewDB (t )
1474
1476
logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
1475
1477
@@ -1573,7 +1575,7 @@ func TestNotificationsTemplates(t *testing.T) {
1573
1575
}
1574
1576
1575
1577
// nolint:gocritic // Unit test.
1576
- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
1578
+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
1577
1579
api := coderdtest .New (t , createOpts (t ))
1578
1580
1579
1581
// GIVEN: the first user (owner) and a regular member
@@ -1610,7 +1612,7 @@ func TestNotificationDuplicates(t *testing.T) {
1610
1612
}
1611
1613
1612
1614
// nolint:gocritic // Unit test.
1613
- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
1615
+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
1614
1616
store , _ := dbtestutil .NewDB (t )
1615
1617
logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
1616
1618
0 commit comments