add maskText to mask password
This commit is contained in:
parent
b3692705ab
commit
d738971435
|
@ -468,11 +468,11 @@ void FSUDAQ::LoadProgramSettings(){
|
||||||
LogMsg(" Raw Data Path : " + rawDataPath);
|
LogMsg(" Raw Data Path : " + rawDataPath);
|
||||||
LogMsg(" Influx IP : " + influxIP);
|
LogMsg(" Influx IP : " + influxIP);
|
||||||
LogMsg(" Database Name : " + dataBaseName);
|
LogMsg(" Database Name : " + dataBaseName);
|
||||||
LogMsg("Database Token : " + influxToken);
|
LogMsg("Database Token : " + maskText(influxToken));
|
||||||
LogMsg(" Elog IP : " + elogIP);
|
LogMsg(" Elog IP : " + elogIP);
|
||||||
LogMsg(" Elog Name : " + elogName);
|
LogMsg(" Elog Name : " + elogName);
|
||||||
LogMsg(" Elog User : " + elogUser);
|
LogMsg(" Elog User : " + maskText(elogUser));
|
||||||
LogMsg(" Elog PWD : " + elogPWD);
|
LogMsg(" Elog PWD : " + maskText(elogPWD));
|
||||||
logMsgHTMLMode = true;
|
logMsgHTMLMode = true;
|
||||||
|
|
||||||
//check is rawDataPath exist, if not, create one
|
//check is rawDataPath exist, if not, create one
|
||||||
|
|
12
FSUDAQ.h
12
FSUDAQ.h
|
@ -209,6 +209,18 @@ private:
|
||||||
//@----- Analyzer
|
//@----- Analyzer
|
||||||
Analyzer * onlineAnalyzer;
|
Analyzer * onlineAnalyzer;
|
||||||
|
|
||||||
|
QString maskText(const QString &password) {
|
||||||
|
if (password.length() <= 3) {
|
||||||
|
return password; // No masking needed for short passwords
|
||||||
|
} else if (password.length() <= 10) {
|
||||||
|
QString maskedPassword = password.left(3);
|
||||||
|
maskedPassword += QString("*").repeated(password.length() - 3);
|
||||||
|
return maskedPassword;
|
||||||
|
} else {
|
||||||
|
return password.left(3) + QString("*").repeated(7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user