@@ -312,8 +312,7 @@ func TestProxyRegisterDeregister(t *testing.T) {
312312})
313313require .NoError (t ,err )
314314
315- proxyClient := wsproxysdk .New (client .URL )
316- proxyClient .SetSessionToken (createRes .ProxyToken )
315+ proxyClient := wsproxysdk .New (client .URL ,createRes .ProxyToken )
317316
318317// Register
319318req := wsproxysdk.RegisterWorkspaceProxyRequest {
@@ -427,8 +426,7 @@ func TestProxyRegisterDeregister(t *testing.T) {
427426})
428427require .NoError (t ,err )
429428
430- proxyClient := wsproxysdk .New (client .URL )
431- proxyClient .SetSessionToken (createRes .ProxyToken )
429+ proxyClient := wsproxysdk .New (client .URL ,createRes .ProxyToken )
432430
433431req := wsproxysdk.RegisterWorkspaceProxyRequest {
434432AccessURL :"https://proxy.coder.test" ,
@@ -472,8 +470,7 @@ func TestProxyRegisterDeregister(t *testing.T) {
472470})
473471require .NoError (t ,err )
474472
475- proxyClient := wsproxysdk .New (client .URL )
476- proxyClient .SetSessionToken (createRes .ProxyToken )
473+ proxyClient := wsproxysdk .New (client .URL ,createRes .ProxyToken )
477474
478475err = proxyClient .DeregisterWorkspaceProxy (ctx , wsproxysdk.DeregisterWorkspaceProxyRequest {
479476ReplicaID :uuid .New (),
@@ -501,8 +498,7 @@ func TestProxyRegisterDeregister(t *testing.T) {
501498
502499// Register a replica on proxy 2. This shouldn't be returned by replicas
503500// for proxy 1.
504- proxyClient2 := wsproxysdk .New (client .URL )
505- proxyClient2 .SetSessionToken (createRes2 .ProxyToken )
501+ proxyClient2 := wsproxysdk .New (client .URL ,createRes2 .ProxyToken )
506502_ ,err = proxyClient2 .RegisterWorkspaceProxy (ctx , wsproxysdk.RegisterWorkspaceProxyRequest {
507503AccessURL :"https://other.proxy.coder.test" ,
508504WildcardHostname :"*.other.proxy.coder.test" ,
@@ -516,8 +512,7 @@ func TestProxyRegisterDeregister(t *testing.T) {
516512require .NoError (t ,err )
517513
518514// Register replica 1.
519- proxyClient1 := wsproxysdk .New (client .URL )
520- proxyClient1 .SetSessionToken (createRes1 .ProxyToken )
515+ proxyClient1 := wsproxysdk .New (client .URL ,createRes1 .ProxyToken )
521516req1 := wsproxysdk.RegisterWorkspaceProxyRequest {
522517AccessURL :"https://one.proxy.coder.test" ,
523518WildcardHostname :"*.one.proxy.coder.test" ,
@@ -574,8 +569,7 @@ func TestProxyRegisterDeregister(t *testing.T) {
574569})
575570require .NoError (t ,err )
576571
577- proxyClient := wsproxysdk .New (client .URL )
578- proxyClient .SetSessionToken (createRes .ProxyToken )
572+ proxyClient := wsproxysdk .New (client .URL ,createRes .ProxyToken )
579573
580574for i := 0 ;i < 100 ;i ++ {
581575ok := false
@@ -652,8 +646,7 @@ func TestIssueSignedAppToken(t *testing.T) {
652646
653647t .Run ("BadAppRequest" ,func (t * testing.T ) {
654648t .Parallel ()
655- proxyClient := wsproxysdk .New (client .URL )
656- proxyClient .SetSessionToken (proxyRes .ProxyToken )
649+ proxyClient := wsproxysdk .New (client .URL ,proxyRes .ProxyToken )
657650
658651ctx := testutil .Context (t ,testutil .WaitLong )
659652_ ,err := proxyClient .IssueSignedAppToken (ctx , workspaceapps.IssueTokenRequest {
@@ -674,8 +667,7 @@ func TestIssueSignedAppToken(t *testing.T) {
674667}
675668t .Run ("OK" ,func (t * testing.T ) {
676669t .Parallel ()
677- proxyClient := wsproxysdk .New (client .URL )
678- proxyClient .SetSessionToken (proxyRes .ProxyToken )
670+ proxyClient := wsproxysdk .New (client .URL ,proxyRes .ProxyToken )
679671
680672ctx := testutil .Context (t ,testutil .WaitLong )
681673_ ,err := proxyClient .IssueSignedAppToken (ctx ,goodRequest )
@@ -684,8 +676,7 @@ func TestIssueSignedAppToken(t *testing.T) {
684676
685677t .Run ("OKHTML" ,func (t * testing.T ) {
686678t .Parallel ()
687- proxyClient := wsproxysdk .New (client .URL )
688- proxyClient .SetSessionToken (proxyRes .ProxyToken )
679+ proxyClient := wsproxysdk .New (client .URL ,proxyRes .ProxyToken )
689680
690681rw := httptest .NewRecorder ()
691682ctx := testutil .Context (t ,testutil .WaitLong )
@@ -1032,8 +1023,7 @@ func TestGetCryptoKeys(t *testing.T) {
10321023Name :testutil .GetRandomName (t ),
10331024})
10341025
1035- client := wsproxysdk .New (cclient .URL )
1036- client .SetSessionToken (cclient .SessionToken ())
1026+ client := wsproxysdk .New (cclient .URL ,cclient .SessionToken ())
10371027
10381028_ ,err := client .CryptoKeys (ctx ,codersdk .CryptoKeyFeatureWorkspaceAppsAPIKey )
10391029require .Error (t ,err )