MM-51768: Scrub username/password from SQL datasource (#22731)

https://mattermost.atlassian.net/browse/MM-51768
```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2023-04-03 23:41:51 +05:30
коммит произвёл GitHub
родитель 1762dfce22
Коммит dacac2e3ed
7 изменённых файлов: 80 добавлений и 81 удалений

Просмотреть файл

@@ -407,7 +407,10 @@ func (ds *DatabaseStore) RemoveFile(name string) error {
// String returns the path to the database backing the config, masking the password.
func (ds *DatabaseStore) String() string {
return stripPassword(ds.originalDsn, ds.driverName)
// This is called during the running of MM, so we expect the parsing of DSN
// to be successful.
sanitized, _ := sqlstore.SanitizeDataSource(ds.driverName, ds.originalDsn)
return sanitized
}
// Close cleans up resources associated with the store.