mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
fix(enterprise/dbcrypt): pass CustomHeadersUserKeys in update test
The migration adds custom_headers_user_keys with NOT NULL DEFAULT '{}'. The DEFAULT only applies on INSERT; UPDATE without the field sends NULL and is rejected.
This commit is contained in:
@@ -1032,22 +1032,23 @@ func TestMCPServerConfigs(t *testing.T) {
|
||||
newHeaders = `{"X-New":"new-value"}`
|
||||
)
|
||||
updated, err := crypt.UpdateMCPServerConfig(ctx, database.UpdateMCPServerConfigParams{
|
||||
ID: cfg.ID,
|
||||
DisplayName: cfg.DisplayName,
|
||||
Slug: cfg.Slug,
|
||||
Description: cfg.Description,
|
||||
Url: cfg.Url,
|
||||
Transport: cfg.Transport,
|
||||
AuthType: cfg.AuthType,
|
||||
OAuth2ClientID: cfg.OAuth2ClientID,
|
||||
OAuth2ClientSecret: newSecret,
|
||||
APIKeyValue: newAPIKey,
|
||||
CustomHeaders: newHeaders,
|
||||
ToolAllowList: cfg.ToolAllowList,
|
||||
ToolDenyList: cfg.ToolDenyList,
|
||||
Availability: cfg.Availability,
|
||||
Enabled: cfg.Enabled,
|
||||
UpdatedBy: cfg.CreatedBy.UUID,
|
||||
ID: cfg.ID,
|
||||
DisplayName: cfg.DisplayName,
|
||||
Slug: cfg.Slug,
|
||||
Description: cfg.Description,
|
||||
Url: cfg.Url,
|
||||
Transport: cfg.Transport,
|
||||
AuthType: cfg.AuthType,
|
||||
OAuth2ClientID: cfg.OAuth2ClientID,
|
||||
OAuth2ClientSecret: newSecret,
|
||||
APIKeyValue: newAPIKey,
|
||||
CustomHeaders: newHeaders,
|
||||
CustomHeadersUserKeys: cfg.CustomHeadersUserKeys,
|
||||
ToolAllowList: cfg.ToolAllowList,
|
||||
ToolDenyList: cfg.ToolDenyList,
|
||||
Availability: cfg.Availability,
|
||||
Enabled: cfg.Enabled,
|
||||
UpdatedBy: cfg.CreatedBy.UUID,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
requireMCPServerConfigDecrypted(t, updated, ciphers, newSecret, newAPIKey, newHeaders)
|
||||
|
||||
Reference in New Issue
Block a user