Use a more general (and faster) method to sanitize URLs with credentials (#19239)
Use a more general method to sanitize URLs with credentials: Simple and intuitive / Faster / Remove all credentials in all URLs
This commit is contained in:
parent
84038f33f4
commit
c83168104b
12 changed files with 114 additions and 205 deletions
|
@ -112,7 +112,7 @@ func removeCredentials(payload string) (string, error) {
|
|||
|
||||
opts.AuthPassword = ""
|
||||
opts.AuthToken = ""
|
||||
opts.CloneAddr = util.NewStringURLSanitizer(opts.CloneAddr, true).Replace(opts.CloneAddr)
|
||||
opts.CloneAddr = util.SanitizeCredentialURLs(opts.CloneAddr)
|
||||
|
||||
confBytes, err := json.Marshal(opts)
|
||||
if err != nil {
|
||||
|
|
|
@ -245,7 +245,7 @@ func FinishMigrateTask(task *Task) error {
|
|||
}
|
||||
conf.AuthPassword = ""
|
||||
conf.AuthToken = ""
|
||||
conf.CloneAddr = util.NewStringURLSanitizer(conf.CloneAddr, true).Replace(conf.CloneAddr)
|
||||
conf.CloneAddr = util.SanitizeCredentialURLs(conf.CloneAddr)
|
||||
conf.AuthPasswordEncrypted = ""
|
||||
conf.AuthTokenEncrypted = ""
|
||||
conf.CloneAddrEncrypted = ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue