Skip to content

Commit 0dda5b5

Browse files
removing-domain-from-username-if-exists
1 parent 0051eb6 commit 0dda5b5

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

internal/wrappers/client.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ func GetUniqueID() string {
10281028
if !ok {
10291029
continue
10301030
}
1031-
if strings.EqualFold(engineStr, "Checkmarx Developer Assist") {
1031+
if strings.EqualFold(engineStr, "Checkmarx One Assist") {
10321032
isAllowed = true
10331033
break
10341034
}
@@ -1048,7 +1048,14 @@ func GetUniqueID() string {
10481048
logger.PrintIfVerbose("Failed to get user: " + err.Error())
10491049
return ""
10501050
}
1051-
uniqueID = uuid.New().String() + "_" + currentUser.Username
1051+
username := currentUser.Username
1052+
username = strings.TrimSpace(username)
1053+
logger.PrintIfVerbose("Username to be used for unique id: " + username)
1054+
if strings.Contains(username, "\\") {
1055+
username = strings.Split(username, "\\")[1]
1056+
}
1057+
uniqueID = uuid.New().String() + "_" + username
1058+
10521059
logger.PrintIfVerbose("Unique id: " + uniqueID)
10531060
viper.Set(commonParams.UniqueIDConfigKey, uniqueID)
10541061
configFilePath, _ := configuration.GetConfigFilePath()

0 commit comments

Comments
 (0)