(ctx context.Context, params database.UpdateMCPServerConfigParams)
| 828 | } |
| 829 | |
| 830 | func (db *dbCrypt) UpdateMCPServerConfig(ctx context.Context, params database.UpdateMCPServerConfigParams) (database.MCPServerConfig, error) { |
| 831 | if strings.TrimSpace(params.OAuth2ClientSecret) == "" { |
| 832 | params.OAuth2ClientSecretKeyID = sql.NullString{} |
| 833 | } else if err := db.encryptField(¶ms.OAuth2ClientSecret, ¶ms.OAuth2ClientSecretKeyID); err != nil { |
| 834 | return database.MCPServerConfig{}, err |
| 835 | } |
| 836 | if strings.TrimSpace(params.APIKeyValue) == "" { |
| 837 | params.APIKeyValueKeyID = sql.NullString{} |
| 838 | } else if err := db.encryptField(¶ms.APIKeyValue, ¶ms.APIKeyValueKeyID); err != nil { |
| 839 | return database.MCPServerConfig{}, err |
| 840 | } |
| 841 | if strings.TrimSpace(params.CustomHeaders) == "" { |
| 842 | params.CustomHeadersKeyID = sql.NullString{} |
| 843 | } else if err := db.encryptField(¶ms.CustomHeaders, ¶ms.CustomHeadersKeyID); err != nil { |
| 844 | return database.MCPServerConfig{}, err |
| 845 | } |
| 846 | |
| 847 | cfg, err := db.Store.UpdateMCPServerConfig(ctx, params) |
| 848 | if err != nil { |
| 849 | return database.MCPServerConfig{}, err |
| 850 | } |
| 851 | if err := db.decryptMCPServerConfig(&cfg); err != nil { |
| 852 | return database.MCPServerConfig{}, err |
| 853 | } |
| 854 | return cfg, nil |
| 855 | } |
| 856 | |
| 857 | func (db *dbCrypt) UpsertMCPServerUserToken(ctx context.Context, params database.UpsertMCPServerUserTokenParams) (database.MCPServerUserToken, error) { |
| 858 | if strings.TrimSpace(params.AccessToken) == "" { |
nothing calls this directly
no test coverage detected