mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-10 05:34:25 +00:00
Serialize sensitive details in /Api/Structure
This commit is contained in:
@@ -138,9 +138,11 @@ namespace ArchiSteamFarm {
|
||||
[JsonProperty]
|
||||
internal string SteamPassword { get; set; }
|
||||
|
||||
public bool ShouldSerializeSteamLogin() => false;
|
||||
public bool ShouldSerializeSteamParentalPIN() => false;
|
||||
public bool ShouldSerializeSteamPassword() => false;
|
||||
private bool ShouldSerializeSensitiveDetails = true;
|
||||
|
||||
public bool ShouldSerializeSteamLogin() => ShouldSerializeSensitiveDetails;
|
||||
public bool ShouldSerializeSteamParentalPIN() => ShouldSerializeSensitiveDetails;
|
||||
public bool ShouldSerializeSteamPassword() => ShouldSerializeSensitiveDetails;
|
||||
|
||||
internal static BotConfig Load(string filePath) {
|
||||
if (string.IsNullOrEmpty(filePath)) {
|
||||
@@ -166,6 +168,8 @@ namespace ArchiSteamFarm {
|
||||
return null;
|
||||
}
|
||||
|
||||
botConfig.ShouldSerializeSensitiveDetails = false;
|
||||
|
||||
// Support encrypted passwords
|
||||
if ((botConfig.PasswordFormat != CryptoHelper.ECryptoMethod.PlainText) && !string.IsNullOrEmpty(botConfig.SteamPassword)) {
|
||||
// In worst case password will result in null, which will have to be corrected by user during runtime
|
||||
|
||||
Reference in New Issue
Block a user