@@ -2,6 +2,7 @@ package ca
2
2
3
3
import (
4
4
"bytes"
5
+ "context"
5
6
"crypto"
6
7
"crypto/rand"
7
8
"crypto/sha1"
@@ -281,7 +282,8 @@ ZEp7knvU2psWRw==
281
282
assert .FatalError (t , err )
282
283
rr := httptest .NewRecorder ()
283
284
284
- tc .ca .srv .Handler .ServeHTTP (rr , rq )
285
+ ctx := authority .NewContext (context .Background (), tc .ca .auth )
286
+ tc .ca .srv .Handler .ServeHTTP (rr , rq .WithContext (ctx ))
285
287
286
288
if assert .Equals (t , rr .Code , tc .status ) {
287
289
body := & ClosingBuffer {rr .Body }
@@ -360,7 +362,8 @@ func TestCAProvisioners(t *testing.T) {
360
362
assert .FatalError (t , err )
361
363
rr := httptest .NewRecorder ()
362
364
363
- tc .ca .srv .Handler .ServeHTTP (rr , rq )
365
+ ctx := authority .NewContext (context .Background (), tc .ca .auth )
366
+ tc .ca .srv .Handler .ServeHTTP (rr , rq .WithContext (ctx ))
364
367
365
368
if assert .Equals (t , rr .Code , tc .status ) {
366
369
body := & ClosingBuffer {rr .Body }
@@ -426,7 +429,8 @@ func TestCAProvisionerEncryptedKey(t *testing.T) {
426
429
assert .FatalError (t , err )
427
430
rr := httptest .NewRecorder ()
428
431
429
- tc .ca .srv .Handler .ServeHTTP (rr , rq )
432
+ ctx := authority .NewContext (context .Background (), tc .ca .auth )
433
+ tc .ca .srv .Handler .ServeHTTP (rr , rq .WithContext (ctx ))
430
434
431
435
if assert .Equals (t , rr .Code , tc .status ) {
432
436
body := & ClosingBuffer {rr .Body }
@@ -487,7 +491,8 @@ func TestCARoot(t *testing.T) {
487
491
assert .FatalError (t , err )
488
492
rr := httptest .NewRecorder ()
489
493
490
- tc .ca .srv .Handler .ServeHTTP (rr , rq )
494
+ ctx := authority .NewContext (context .Background (), tc .ca .auth )
495
+ tc .ca .srv .Handler .ServeHTTP (rr , rq .WithContext (ctx ))
491
496
492
497
if assert .Equals (t , rr .Code , tc .status ) {
493
498
body := & ClosingBuffer {rr .Body }
@@ -534,7 +539,8 @@ func TestCAHealth(t *testing.T) {
534
539
assert .FatalError (t , err )
535
540
rr := httptest .NewRecorder ()
536
541
537
- tc .ca .srv .Handler .ServeHTTP (rr , rq )
542
+ ctx := authority .NewContext (context .Background (), tc .ca .auth )
543
+ tc .ca .srv .Handler .ServeHTTP (rr , rq .WithContext (ctx ))
538
544
539
545
if assert .Equals (t , rr .Code , tc .status ) {
540
546
body := & ClosingBuffer {rr .Body }
@@ -628,7 +634,8 @@ func TestCARenew(t *testing.T) {
628
634
rq .TLS = tc .tlsConnState
629
635
rr := httptest .NewRecorder ()
630
636
631
- tc .ca .srv .Handler .ServeHTTP (rr , rq )
637
+ ctx := authority .NewContext (context .Background (), tc .ca .auth )
638
+ tc .ca .srv .Handler .ServeHTTP (rr , rq .WithContext (ctx ))
632
639
633
640
if assert .Equals (t , rr .Code , tc .status ) {
634
641
body := & ClosingBuffer {rr .Body }
0 commit comments