mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Don't expose SteamLogin in weak password warning
While not strictly a sensitive property, there is no good reason why we should print it in the log instead of a bot name, which is far less sensitive in nature.
This commit is contained in:
@@ -1397,7 +1397,7 @@ public sealed class Bot : IAsyncDisposable {
|
||||
return;
|
||||
}
|
||||
|
||||
(BotConfig? botConfig, _) = await BotConfig.Load(configFile).ConfigureAwait(false);
|
||||
(BotConfig? botConfig, _) = await BotConfig.Load(configFile, BotName).ConfigureAwait(false);
|
||||
|
||||
if (botConfig == null) {
|
||||
await Destroy().ConfigureAwait(false);
|
||||
@@ -1499,7 +1499,7 @@ public sealed class Bot : IAsyncDisposable {
|
||||
return;
|
||||
}
|
||||
|
||||
(BotConfig? botConfig, string? latestJson) = await BotConfig.Load(configFilePath).ConfigureAwait(false);
|
||||
(BotConfig? botConfig, string? latestJson) = await BotConfig.Load(configFilePath, botName).ConfigureAwait(false);
|
||||
|
||||
if (botConfig == null) {
|
||||
ASF.ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, Strings.ErrorBotConfigInvalid, configFilePath));
|
||||
|
||||
@@ -540,7 +540,7 @@ public sealed class BotConfig {
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static async Task<(BotConfig? BotConfig, string? LatestJson)> Load(string filePath) {
|
||||
internal static async Task<(BotConfig? BotConfig, string? LatestJson)> Load(string filePath, string? botName = null) {
|
||||
if (string.IsNullOrEmpty(filePath)) {
|
||||
throw new ArgumentNullException(nameof(filePath));
|
||||
}
|
||||
@@ -600,7 +600,11 @@ public sealed class BotConfig {
|
||||
(bool isWeak, string? reason) = Utilities.TestPasswordStrength(decryptedSteamPassword!, disallowedValues);
|
||||
|
||||
if (isWeak) {
|
||||
ASF.ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.WarningWeakSteamPassword, !string.IsNullOrEmpty(botConfig.SteamLogin) ? botConfig.SteamLogin! : filePath, reason));
|
||||
if (string.IsNullOrEmpty(botName)) {
|
||||
botName = Path.GetFileNameWithoutExtension(filePath);
|
||||
}
|
||||
|
||||
ASF.ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.WarningWeakSteamPassword, botName, reason));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user