mirror of
https://github.com/aunefyren/wrapperr
synced 2024-12-12 12:22:32 +00:00
Improve obfuscasion
Ignore own name
This commit is contained in:
parent
e7cf883a57
commit
9ac8f04f6b
1 changed files with 14 additions and 6 deletions
|
@ -1154,7 +1154,14 @@ func WrapperrLoopData(user_id int, config *models.WrapperrConfig, wrapperr_data
|
|||
if currentUserID == 0 {
|
||||
newName = "Managed user"
|
||||
} else {
|
||||
newName = nameGenerator.Generate()
|
||||
// Generate random name
|
||||
newNameGen := nameGenerator.Generate()
|
||||
|
||||
// Try to improve random name
|
||||
newNameGenArray := strings.Split(newNameGen, "-")
|
||||
newNamePartOne := newNameGenArray[0]
|
||||
newNamePartTwo := newNameGenArray[1]
|
||||
newName = strings.Title(newNamePartOne) + " " + strings.Title(newNamePartTwo)
|
||||
}
|
||||
|
||||
// Create obfucasted struct type
|
||||
|
@ -1177,11 +1184,12 @@ func WrapperrLoopData(user_id int, config *models.WrapperrConfig, wrapperr_data
|
|||
obfuscateCatalog = append(obfuscateCatalog, obfuscatedUser)
|
||||
}
|
||||
|
||||
// Obfuscate user in dataset
|
||||
// Obfuscate user in dataset if it is not themself
|
||||
if currentUserID != user_id {
|
||||
wrapperr_year_user[d].FriendlyName = newName
|
||||
wrapperr_year_user[d].User = newName
|
||||
wrapperr_year_user[d].UserID = 0
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
wrapperr_year_user_summed = append(wrapperr_year_user_summed, wrapperr_year_user[d])
|
||||
|
|
Loading…
Reference in a new issue