@@ -71,7 +71,7 @@ func TestBasicNotificationRoundtrip(t *testing.T) {
7171 }
7272
7373 // nolint:gocritic // Unit test.
74- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
74+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
7575 store , _ := dbtestutil .NewDB (t )
7676 logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
7777 method := database .NotificationMethodSmtp
@@ -135,7 +135,7 @@ func TestSMTPDispatch(t *testing.T) {
135135 // SETUP
136136
137137 // nolint:gocritic // Unit test.
138- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
138+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
139139 store , _ := dbtestutil .NewDB (t )
140140 logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
141141
@@ -197,7 +197,7 @@ func TestWebhookDispatch(t *testing.T) {
197197 // SETUP
198198
199199 // nolint:gocritic // Unit test.
200- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
200+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
201201 store , _ := dbtestutil .NewDB (t )
202202 logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
203203
@@ -281,7 +281,7 @@ func TestBackpressure(t *testing.T) {
281281 store , _ := dbtestutil .NewDB (t )
282282 logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
283283 // nolint:gocritic // Unit test.
284- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitShort ))
284+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitShort ))
285285
286286 const method = database .NotificationMethodWebhook
287287 cfg := defaultNotificationsConfig (method )
@@ -407,7 +407,7 @@ func TestRetries(t *testing.T) {
407407
408408 const maxAttempts = 3
409409 // nolint:gocritic // Unit test.
410- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
410+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
411411 store , _ := dbtestutil .NewDB (t )
412412 logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
413413
@@ -501,7 +501,7 @@ func TestExpiredLeaseIsRequeued(t *testing.T) {
501501 }
502502
503503 // nolint:gocritic // Unit test.
504- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
504+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
505505 store , _ := dbtestutil .NewDB (t )
506506 logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
507507
@@ -521,7 +521,7 @@ func TestExpiredLeaseIsRequeued(t *testing.T) {
521521 noopInterceptor := newNoopStoreSyncer (store )
522522
523523 // nolint:gocritic // Unit test.
524- mgrCtx , cancelManagerCtx := context .WithCancel (dbauthz .AsSystemRestricted (context .Background ()))
524+ mgrCtx , cancelManagerCtx := context .WithCancel (dbauthz .AsNotifier (context .Background ()))
525525 t .Cleanup (cancelManagerCtx )
526526
527527 mgr , err := notifications .NewManager (cfg , noopInterceptor , defaultHelpers (), createMetrics (), logger .Named ("manager" ))
@@ -626,7 +626,7 @@ func TestNotifierPaused(t *testing.T) {
626626 // Setup.
627627
628628 // nolint:gocritic // Unit test.
629- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
629+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
630630 store , _ := dbtestutil .NewDB (t )
631631 logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
632632
@@ -1081,7 +1081,7 @@ func TestNotificationTemplates_Golden(t *testing.T) {
10811081 }()
10821082
10831083 // nolint:gocritic // Unit test.
1084- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
1084+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
10851085
10861086 // smtp config shared between client and server
10871087 smtpConfig := codersdk.NotificationsEmailConfig {
@@ -1160,12 +1160,14 @@ func TestNotificationTemplates_Golden(t *testing.T) {
11601160 // as appearance changes are enterprise features and we do not want to mix those
11611161 // can't use the api
11621162 if tc .appName != "" {
1163- err = (* db ).UpsertApplicationName (ctx , "Custom Application" )
1163+ // nolint:gocritic // Unit test.
1164+ err = (* db ).UpsertApplicationName (dbauthz .AsSystemRestricted (ctx ), "Custom Application" )
11641165 require .NoError (t , err )
11651166 }
11661167
11671168 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" )
11691171 require .NoError (t , err )
11701172 }
11711173
@@ -1248,7 +1250,7 @@ func TestNotificationTemplates_Golden(t *testing.T) {
12481250 }()
12491251
12501252 // nolint:gocritic // Unit test.
1251- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
1253+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
12521254
12531255 // Spin up the mock webhook server
12541256 var body []byte
@@ -1376,7 +1378,7 @@ func TestDisabledBeforeEnqueue(t *testing.T) {
13761378 }
13771379
13781380 // nolint:gocritic // Unit test.
1379- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
1381+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
13801382 store , _ := dbtestutil .NewDB (t )
13811383 logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
13821384
@@ -1412,7 +1414,7 @@ func TestDisabledAfterEnqueue(t *testing.T) {
14121414 }
14131415
14141416 // nolint:gocritic // Unit test.
1415- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
1417+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
14161418 store , _ := dbtestutil .NewDB (t )
14171419 logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
14181420
@@ -1469,7 +1471,7 @@ func TestCustomNotificationMethod(t *testing.T) {
14691471 }
14701472
14711473 // nolint:gocritic // Unit test.
1472- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
1474+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
14731475 store , _ := dbtestutil .NewDB (t )
14741476 logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
14751477
@@ -1573,7 +1575,7 @@ func TestNotificationsTemplates(t *testing.T) {
15731575 }
15741576
15751577 // nolint:gocritic // Unit test.
1576- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
1578+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
15771579 api := coderdtest .New (t , createOpts (t ))
15781580
15791581 // GIVEN: the first user (owner) and a regular member
@@ -1610,7 +1612,7 @@ func TestNotificationDuplicates(t *testing.T) {
16101612 }
16111613
16121614 // nolint:gocritic // Unit test.
1613- ctx := dbauthz .AsSystemRestricted (testutil .Context (t , testutil .WaitSuperLong ))
1615+ ctx := dbauthz .AsNotifier (testutil .Context (t , testutil .WaitSuperLong ))
16141616 store , _ := dbtestutil .NewDB (t )
16151617 logger := slogtest .Make (t , nil ).Leveled (slog .LevelDebug )
16161618
0 commit comments