MCPcopy Index your code
hub / github.com/coder/coder / AppClient

Method AppClient

coderd/workspaceapps/apptest/setup.go:139–147  ·  view source on GitHub ↗

AppClient returns a *codersdk.Client that will route all requests to the app server. API requests will fail with this client. Any redirect responses are not followed by default. The client is authenticated as the first user by default.

(t *testing.T)

Source from the content-addressed store, hash-verified

137//
138// The client is authenticated as the first user by default.
139func (d *Details) AppClient(t *testing.T) *codersdk.Client {
140 client := codersdk.New(d.PathAppBaseURL, codersdk.WithSessionToken(d.SDKClient.SessionToken()))
141 forceURLTransport(t, client)
142 client.HTTPClient.CheckRedirect = func(_ *http.Request, _ []*http.Request) error {
143 return http.ErrUseLastResponse
144 }
145
146 return client
147}
148
149// PathAppURL returns the URL for the given path app.
150func (d *Details) PathAppURL(app App) *url.URL {

Callers 1

RunFunction · 0.80

Calls 4

NewFunction · 0.92
WithSessionTokenFunction · 0.92
forceURLTransportFunction · 0.85
SessionTokenMethod · 0.45

Tested by

no test coverage detected