Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: refactor cli and coderd to use ClientOptions#19763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
spikecurtis merged 1 commit intomainfromspike/refactor-more-client-builder
Sep 22, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletionscli/exp_scaletest.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1004,9 +1004,10 @@ func (r *RootCmd) scaletestWorkspaceTraffic() *serpent.Command {
return xerrors.Errorf("parse workspace proxy URL: %w", err)
}

webClient = codersdk.New(u)
webClient.HTTPClient = client.HTTPClient
webClient.SetSessionToken(client.SessionToken())
webClient = codersdk.New(u,
codersdk.WithHTTPClient(client.HTTPClient),
codersdk.WithSessionToken(client.SessionToken()),
)

appConfig, err = createWorkspaceAppConfig(webClient, appHost.Host, app, ws, agent)
if err != nil {
Expand DownExpand Up@@ -1240,8 +1241,9 @@ func (r *RootCmd) scaletestDashboard() *serpent.Command {
return xerrors.Errorf("create token for user: %w", err)
}

userClient := codersdk.New(client.URL)
userClient.SetSessionToken(userTokResp.Key)
userClient := codersdk.New(client.URL,
codersdk.WithSessionToken(userTokResp.Key),
)

config := dashboard.Config{
Interval: interval,
Expand Down
3 changes: 1 addition & 2 deletionscoderd/coderdtest/coderdtest.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -845,8 +845,7 @@ func createAnotherUserRetry(t testing.TB, client *codersdk.Client, organizationI
require.NoError(t, err)
}

other := codersdk.New(client.URL)
other.SetSessionToken(sessionToken)
other := codersdk.New(client.URL, codersdk.WithSessionToken(sessionToken))
t.Cleanup(func() {
other.HTTPClient.CloseIdleConnections()
})
Expand Down
3 changes: 1 addition & 2 deletionscoderd/insights_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1467,8 +1467,7 @@ func TestUserActivityInsights_Golden(t *testing.T) {
TokenName: "no-password-user-token",
})
require.NoError(t, err)
userClient := codersdk.New(client.URL)
userClient.SetSessionToken(token.Key)
userClient := codersdk.New(client.URL, codersdk.WithSessionToken(token.Key))

coderUser, err := userClient.User(context.Background(), user.id.String())
require.NoError(t, err)
Expand Down
5 changes: 2 additions & 3 deletionscoderd/mcp_http.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,10 +32,9 @@ func (api *API) mcpHTTPHandler() http.Handler {
})
return
}
authenticatedClient := codersdk.New(api.AccessURL)
// Extract the original session token from the request
authenticatedClient.SetSessionToken(httpmw.APITokenFromRequest(r))

authenticatedClient := codersdk.New(api.AccessURL,
codersdk.WithSessionToken(httpmw.APITokenFromRequest(r)))
toolset := MCPToolset(r.URL.Query().Get("toolset"))
// Default to standard toolset if no toolset is specified.
if toolset == "" {
Expand Down
3 changes: 1 addition & 2 deletionscoderd/workspaceapps/apptest/setup.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -137,8 +137,7 @@ type Details struct {
//
// The client is authenticated as the first user by default.
func (d *Details) AppClient(t *testing.T) *codersdk.Client {
client := codersdk.New(d.PathAppBaseURL)
client.SetSessionToken(d.SDKClient.SessionToken())
client := codersdk.New(d.PathAppBaseURL, codersdk.WithSessionToken(d.SDKClient.SessionToken()))
forceURLTransport(t, client)
client.HTTPClient.CheckRedirect = func(_ *http.Request, _ []*http.Request) error {
return http.ErrUseLastResponse
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp