Secure socks proxy: Allow overriding socks username (#74762)

This commit is contained in:
Stephanie Hingtgen 2023-09-12 14:07:41 -05:00 committed by GitHub
parent 3d50a6c87f
commit bb2f5fce07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -6,10 +6,14 @@ import (
)
func GetSQLProxyOptions(dsInfo sqleng.DataSourceInfo) *sdkproxy.Options {
return &sdkproxy.Options{
opts := &sdkproxy.Options{
Enabled: dsInfo.JsonData.SecureDSProxy,
Auth: &sdkproxy.AuthOptions{
Username: dsInfo.UID,
},
}
if dsInfo.JsonData.SecureDSProxyUsername != "" {
opts.Auth.Username = dsInfo.JsonData.SecureDSProxyUsername
}
return opts
}

View File

@ -73,6 +73,7 @@ type JsonData struct {
TimeInterval string `json:"timeInterval"`
Database string `json:"database"`
SecureDSProxy bool `json:"enableSecureSocksProxy"`
SecureDSProxyUsername string `json:"secureSocksProxyUsername"`
AllowCleartextPasswords bool `json:"allowCleartextPasswords"`
AuthenticationType string `json:"authenticationType"`
}