@@ -312,8 +312,7 @@ func TestProxyRegisterDeregister(t *testing.T) {
312
312
})
313
313
require .NoError (t , err )
314
314
315
- proxyClient := wsproxysdk .New (client .URL )
316
- proxyClient .SetSessionToken (createRes .ProxyToken )
315
+ proxyClient := wsproxysdk .New (client .URL , createRes .ProxyToken )
317
316
318
317
// Register
319
318
req := wsproxysdk.RegisterWorkspaceProxyRequest {
@@ -427,8 +426,7 @@ func TestProxyRegisterDeregister(t *testing.T) {
427
426
})
428
427
require .NoError (t , err )
429
428
430
- proxyClient := wsproxysdk .New (client .URL )
431
- proxyClient .SetSessionToken (createRes .ProxyToken )
429
+ proxyClient := wsproxysdk .New (client .URL , createRes .ProxyToken )
432
430
433
431
req := wsproxysdk.RegisterWorkspaceProxyRequest {
434
432
AccessURL : "https://proxy.coder.test" ,
@@ -472,8 +470,7 @@ func TestProxyRegisterDeregister(t *testing.T) {
472
470
})
473
471
require .NoError (t , err )
474
472
475
- proxyClient := wsproxysdk .New (client .URL )
476
- proxyClient .SetSessionToken (createRes .ProxyToken )
473
+ proxyClient := wsproxysdk .New (client .URL , createRes .ProxyToken )
477
474
478
475
err = proxyClient .DeregisterWorkspaceProxy (ctx , wsproxysdk.DeregisterWorkspaceProxyRequest {
479
476
ReplicaID : uuid .New (),
@@ -501,8 +498,7 @@ func TestProxyRegisterDeregister(t *testing.T) {
501
498
502
499
// Register a replica on proxy 2. This shouldn't be returned by replicas
503
500
// for proxy 1.
504
- proxyClient2 := wsproxysdk .New (client .URL )
505
- proxyClient2 .SetSessionToken (createRes2 .ProxyToken )
501
+ proxyClient2 := wsproxysdk .New (client .URL , createRes2 .ProxyToken )
506
502
_ , err = proxyClient2 .RegisterWorkspaceProxy (ctx , wsproxysdk.RegisterWorkspaceProxyRequest {
507
503
AccessURL : "https://other.proxy.coder.test" ,
508
504
WildcardHostname : "*.other.proxy.coder.test" ,
@@ -516,8 +512,7 @@ func TestProxyRegisterDeregister(t *testing.T) {
516
512
require .NoError (t , err )
517
513
518
514
// Register replica 1.
519
- proxyClient1 := wsproxysdk .New (client .URL )
520
- proxyClient1 .SetSessionToken (createRes1 .ProxyToken )
515
+ proxyClient1 := wsproxysdk .New (client .URL , createRes1 .ProxyToken )
521
516
req1 := wsproxysdk.RegisterWorkspaceProxyRequest {
522
517
AccessURL : "https://one.proxy.coder.test" ,
523
518
WildcardHostname : "*.one.proxy.coder.test" ,
@@ -574,8 +569,7 @@ func TestProxyRegisterDeregister(t *testing.T) {
574
569
})
575
570
require .NoError (t , err )
576
571
577
- proxyClient := wsproxysdk .New (client .URL )
578
- proxyClient .SetSessionToken (createRes .ProxyToken )
572
+ proxyClient := wsproxysdk .New (client .URL , createRes .ProxyToken )
579
573
580
574
for i := 0 ; i < 100 ; i ++ {
581
575
ok := false
@@ -652,8 +646,7 @@ func TestIssueSignedAppToken(t *testing.T) {
652
646
653
647
t .Run ("BadAppRequest" , func (t * testing.T ) {
654
648
t .Parallel ()
655
- proxyClient := wsproxysdk .New (client .URL )
656
- proxyClient .SetSessionToken (proxyRes .ProxyToken )
649
+ proxyClient := wsproxysdk .New (client .URL , proxyRes .ProxyToken )
657
650
658
651
ctx := testutil .Context (t , testutil .WaitLong )
659
652
_ , err := proxyClient .IssueSignedAppToken (ctx , workspaceapps.IssueTokenRequest {
@@ -674,8 +667,7 @@ func TestIssueSignedAppToken(t *testing.T) {
674
667
}
675
668
t .Run ("OK" , func (t * testing.T ) {
676
669
t .Parallel ()
677
- proxyClient := wsproxysdk .New (client .URL )
678
- proxyClient .SetSessionToken (proxyRes .ProxyToken )
670
+ proxyClient := wsproxysdk .New (client .URL , proxyRes .ProxyToken )
679
671
680
672
ctx := testutil .Context (t , testutil .WaitLong )
681
673
_ , err := proxyClient .IssueSignedAppToken (ctx , goodRequest )
@@ -684,8 +676,7 @@ func TestIssueSignedAppToken(t *testing.T) {
684
676
685
677
t .Run ("OKHTML" , func (t * testing.T ) {
686
678
t .Parallel ()
687
- proxyClient := wsproxysdk .New (client .URL )
688
- proxyClient .SetSessionToken (proxyRes .ProxyToken )
679
+ proxyClient := wsproxysdk .New (client .URL , proxyRes .ProxyToken )
689
680
690
681
rw := httptest .NewRecorder ()
691
682
ctx := testutil .Context (t , testutil .WaitLong )
@@ -1032,8 +1023,7 @@ func TestGetCryptoKeys(t *testing.T) {
1032
1023
Name : testutil .GetRandomName (t ),
1033
1024
})
1034
1025
1035
- client := wsproxysdk .New (cclient .URL )
1036
- client .SetSessionToken (cclient .SessionToken ())
1026
+ client := wsproxysdk .New (cclient .URL , cclient .SessionToken ())
1037
1027
1038
1028
_ , err := client .CryptoKeys (ctx , codersdk .CryptoKeyFeatureWorkspaceAppsAPIKey )
1039
1029
require .Error (t , err )
0 commit comments